diff --git a/DN.Character.pas b/DN.Character.pas new file mode 100644 index 0000000..8440ec3 --- /dev/null +++ b/DN.Character.pas @@ -0,0 +1,14 @@ +unit DN.Character; + +interface + +uses + Character; + +{$Warnings off} +type + TCharacter = Character.TCharacter; + +implementation + +end. diff --git a/DN.Package.Gitlab.pas b/DN.Package.Gitlab.pas new file mode 100644 index 0000000..377f7e9 --- /dev/null +++ b/DN.Package.Gitlab.pas @@ -0,0 +1,61 @@ +{ +######################################################### +# Copyright by Alexander Benikowski # +# This unit is part of the Delphinus project hosted on # +# https://github.com/Memnarch/Delphinus # +######################################################### +} +unit DN.Package.Gitlab; + +interface + +uses + Classes, + Types, + DN.Types, + DN.Package; + +type + TDNGitLabPackage = class; + + TGetLicenseCallback = function(const APackage: TDNGitLabPackage; const ALicense: TDNLicense): string of object; + + TDNGitLabPackage = class(TDNPackage) + private + FRepoID: string; + FRepoReleases: string; + FDefaultBranch: string; + FRepositoryName: string; + FOnGetLicense: TGetLicenseCallback; + FRepositoryType: string; + FRepository: string; + FRepositoryUser: string; + protected + function GetLicenseText(const AValue: TDNLicense): string; override; + public + property RepoID: string read FRepoID write FRepoID; + property RepoReleases: string read FRepoReleases write FRepoReleases; + property DefaultBranch: string read FDefaultBranch write FDefaultBranch; + property RepositoryName: string read FRepositoryName write FRepositoryName; + property RepositoryType: string read FRepositoryType write FRepositoryType; + property RepositoryUser: string read FRepositoryUser write FRepositoryUser; + property Repository: string read FRepository write FRepository; + property OnGetLicense: TGetLicenseCallback read FOnGetLicense write FOnGetLicense; + end; + +implementation + +{ TDNGitLabPackage } + +function TDNGitLabPackage.GetLicenseText(const AValue: TDNLicense): string; +begin + Result := inherited; + if (Result = '') and not FLicenseTexts.ContainsKey(AValue.LicenseFile) and Assigned(FOnGetLicense) then + begin + Result := FOnGetLicense(Self, AValue); + LicenseText[AValue] := Result; + end; +end; + +end. + diff --git a/DN.PackageProvider.Folder.pas b/DN.PackageProvider.Folder.pas new file mode 100644 index 0000000..aeaeb80 --- /dev/null +++ b/DN.PackageProvider.Folder.pas @@ -0,0 +1,156 @@ +unit DN.PackageProvider.Folder; + +interface + +uses + DN.Package.Intf, + DN.PackageProvider; + +type + TDNFolderPackageProvider = class(TDNPackageProvider) + private + FPath: string; + procedure ProcessPackagesOfAuthor(const APath, AAuthor: string); + procedure ProcessPackage(const APath, AAuthor, APackage: string); + public + constructor Create(const APath: string); + function Reload: Boolean; override; + function Download(const APackage: IDNPackage; const AVersion: string; const AFolder: string; out AContentFolder: string): Boolean; override; + end; + +implementation + +uses + IOUtils, + SysUtils, + Classes, + DN.Types, + DN.Version, + DN.Package, + DN.Package.Version, + DN.Package.Dependency, + DN.JsonFile.Info; + +const + CNoVersionDir = 'HEAD'; + +{ TDNFolderPackageProvider } + +constructor TDNFolderPackageProvider.Create(const APath: string); +begin + inherited Create(); + FPath := APath; +end; + +function TDNFolderPackageProvider.Download(const APackage: IDNPackage; + const AVersion, AFolder: string; out AContentFolder: string): Boolean; +var + LPath: string; +begin + LPath := TPath.Combine(TPath.Combine(FPath, APackage.Author), APackage.Name); + if AVersion <> '' then + LPath := TPath.Combine(LPath, AVersion) + else + LPath := TPath.Combine(LPath, CNoVersionDir); + + Result := TDirectory.Exists(LPath); + if Result then + begin + TDirectory.Copy(LPath, AFolder); + AContentFolder := AFolder; + end; +end; + +procedure TDNFolderPackageProvider.ProcessPackage(const APath, AAuthor, + APackage: string); +var + LVersionPath, LVersionText, LInfoPath: string; + LPackage: TDNPackage; + LPackageVersion: TDNPackageVersion; + LVersion, LHighestVersion: TDNVersion; + LInfo: TInfoFile; + LDependency: TInfoDependency; + LPictureFile: string; + LLicense, LLicenseCopy: TDNLicense; +begin + LHighestVersion := TDNVersion.Create(); + LPackage := TDNPackage.Create(); + try + LPackage.Author := AAuthor; + LPackage.Name := APackage; + for LVersionPath in TDirectory.GetDirectories(APath) do + begin + LVersionText := ExtractFileName(LVersionPath); + LInfoPath := TPath.Combine(LVersionPath, CInfoFile); + if TDNVersion.TryParse(LVersionText, LVersion) and TFile.Exists(LInfoPath) then + begin + LInfo := TInfoFile.Create(); + try + LInfo.LoadFromFile(LInfoPath); + LPackageVersion := TDNPackageVersion.Create(); + try + LPackageVersion.Name := LVersion.ToString; + LPackageVersion.Value := LVersion; + LPackageVersion.CompilerMin := LInfo.CompilerMin; + LPackageVersion.CompilerMax := LInfo.CompilerMax; + for LDependency in LInfo.Dependencies do + LPackageVersion.Dependencies.Add(TDNPackageDependency.Create(LDependency.ID, LDependency.Version)); + if LHighestVersion.IsEmpty or (LVersion > LHighestVersion) then + begin + LHighestVersion := LVersion; + LPackage.ID := LInfo.ID; + LPackage.CompilerMin := LInfo.CompilerMin; + LPackage.CompilerMax := LInfo.CompilerMax; + LPackage.Platforms := LInfo.Platforms; + for LLicense in LInfo.Licenses do + begin + LLicenseCopy := LLicense; + LLicenseCopy.LicenseFile := TPath.Combine(LVersionPath, LLicense.LicenseFile); + LPackage.Licenses.Add(LLicenseCopy); + if TFile.Exists(LLicenseCopy.LicenseFile) then + LPackage.LicenseText[LLicenseCopy] := TFile.ReadAllText(LLicenseCopy.LicenseFile); + end; + LPictureFile := TPath.Combine(LVersionPath, LInfo.Picture); + end; + finally + LPackage.Versions.Add(LPackageVersion); + end; + finally + LInfo.Free; + end; + end; + end; + if TFile.Exists(LPictureFile) then + LPackage.Picture.LoadFromFile(LPictureFile); + finally + if LPackage.ID <> TGuid.Empty then + Packages.Add(LPackage) + else + LPackage.Free; + end; +end; + +procedure TDNFolderPackageProvider.ProcessPackagesOfAuthor(const APath, + AAuthor: string); +var + LDir: string; +begin + for LDir in TDirectory.GetDirectories(APath) do + ProcessPackage(LDir, AAuthor, ExtractFileName(LDir)); +end; + +function TDNFolderPackageProvider.Reload: Boolean; +var + LDir: string; +begin + Result := False; + Packages.Clear; + if TDirectory.Exists(FPath) then + begin + for LDir in TDirectory.GetDirectories(FPath) do + ProcessPackagesOfAuthor(LDir, ExtractFileName(LDir)); + Result := True; + end; +end; + +end. diff --git a/DN.PackageProvider.GitLab.State.pas b/DN.PackageProvider.GitLab.State.pas new file mode 100644 index 0000000..fa831af --- /dev/null +++ b/DN.PackageProvider.GitLab.State.pas @@ -0,0 +1,68 @@ +{ +######################################################### +# Copyright by Alexander Benikowski # +# This unit is part of the Delphinus project hosted on # +# https://github.com/Memnarch/Delphinus # +######################################################### +} +unit DN.PackageProvider.GitLab.State; + +interface + +uses + DN.PackageProvider.State, + DN.PackageProvider.State.Intf, + DN.HttpClient.Intf; + +type + TDNGitlabPackageProviderState = class(TDNPackageProviderState) + private + FClient: IDNHttpClient; + protected + function GetStatisticCount: Integer; override; + function GetStatisticName(const AIndex: Integer): string; override; + function GetStatisticValue(const AIndex: Integer): string; override; + public + constructor Create(const AClient: IDNHttpClient); + end; + +implementation + +{ TDNGitlabPackageProviderState } + +constructor TDNGitlabPackageProviderState.Create(const AClient: IDNHttpClient); +begin + inherited Create; + FClient := AClient; +end; + +function TDNGitlabPackageProviderState.GetStatisticCount: Integer; +begin + Result := 3; +end; + +function TDNGitlabPackageProviderState.GetStatisticName( + const AIndex: Integer): string; +begin + case AIndex of + 0: Result := 'Ratelimit'; + 1: Result := 'RateLimit-Remaining'; + 2: Result := 'RateLimit-Reset'; + else + Result := ''; + end; +end; + +function TDNGitlabPackageProviderState.GetStatisticValue( + const AIndex: Integer): string; +begin + case AIndex of + 0: Result := FClient.ResponseHeader['X-RateLimit-Limit']; + 1: Result := FClient.ResponseHeader['X-RateLimit-Remaining']; + 2: Result := FClient.ResponseHeader['X-RateLimit-Reset']; + else + Result := ''; + end; +end; + +end. diff --git a/DN.PackageProvider.GitLab.pas b/DN.PackageProvider.GitLab.pas new file mode 100644 index 0000000..5a92880 --- /dev/null +++ b/DN.PackageProvider.GitLab.pas @@ -0,0 +1,631 @@ +{ +######################################################### +# Copyright by Alexander Benikowski # +# This unit is part of the Delphinus project hosted on # +# https://github.com/Memnarch/Delphinus # +######################################################### +} +unit DN.PackageProvider.GitLab; + +interface + +uses + Classes, + Types, + Graphics, + SysUtils, + SyncObjs, + Generics.Collections, + DN.Types, + DN.Package.Gitlab, + DN.Package.Intf, + DN.PackageProvider, + DN.JSonFile.CacheInfo, + DN.Progress.Intf, + DN.HttpClient.Intf, + DN.JSon, + DN.JSOnFile.Info, + DN.PackageProvider.State.Intf, + DN.Package.Version.Intf; + +type + TDNGitLabPackageProvider = class(TDNPackageProvider, IDNProgress, IDNPackageProviderState) + private + FBaseURL: String; + FProgress: IDNProgress; + FPushDates: TDictionary; + FExistingIDs: TDictionary; + FDateMutex: TMutex; + FState: IDNPackageProviderState; + FLoadPictures: Boolean; + + function GetFileStream(const aURL: string; AFile: TStream): Boolean; + function GetGitlabFileText(const aRepoID, aFilePath, aRef : string; out AText: string): Boolean; + function GetLicense(const APackage: TDNGitLabPackage; const ALicense: TDNLicense): string; + function GetInfoFile(const aRepoID, aRef: string; AInfo: TInfoFile): Boolean; + function GetReleaseText(const ARepositoryID: string; out AReleases: string): Boolean; + procedure RegisterReleases(const APackage: IDNPackage; const aRepoID, aReleases : string); + function getRelease(aReleases, aRelease: string) : TJSonObject; + function getReleaseAssetDownload(aRelease : TJSonObject) : string; + procedure LoadPicture(APicture: TPicture; aURL : String); + procedure AddDependencies(const AVersion: IDNPackageVersion; AInf: TInfoFile); + procedure AddPackageFromJSon(AJSon: TJSONObject); + function CreatePackageWithMetaInfo(AItem: TJSONObject; out APackage: IDNPackage): Boolean; + procedure HandleDownloadProgress(AProgress, AMax: Int64); + procedure CheckRateLimit; + procedure setBaseURL(aValue : String); + protected + FClient: IDNHttpClient; + function GetPushDateFile: string; + function GetRepoList(out ARepos: TJSONArray): Boolean; virtual; + procedure SavePushDates; + procedure LoadPushDates; + //properties for interfaceredirection + property Progress: IDNProgress read FProgress implements IDNProgress; + property State: IDNPackageProviderState read FState implements IDNPackageProviderState; + public + constructor Create(const AClient: IDNHttpClient; ALoadPictures: Boolean = True); + destructor Destroy(); override; + function Reload(): Boolean; override; + function Download(const APackage: IDNPackage; const AVersion: string; const AFolder: string; out AContentFolder: string): Boolean; override; + + property BaseURL : String read FBaseURL write setBaseURL; + end; + +const + + CGitlabOAuthAuthentication = 'Bearer %s'; + +implementation + +uses + IOUtils, + DateUtils, + DN.IOUtils, + StrUtils, + jpeg, + pngimage, + DN.Version, + DN.Package, + DN.Zip, + DN.Package.Version, + DN.Package.Dependency, + DN.Package.Dependency.Intf, + DN.Progress, + DN.Environment, + DN.Graphics.Loader, + DN.PackageProvider.GitLab.State; + +const + + CGitlab = 'Gitlab'; + CGitRepoSearch = '%0:sapi/v4/projects?scope=projects&search=delphinus-support'; + CGitRepoSearchTK = '%0:sapi/v4/projects?scope=projects&search=delphinus-support&private_token=%1:s'; + CGitRepoGetFile = '%0:sapi/v4/projects/%1:s/repository/files/%2:s/raw?ref=%3:s'; + CGitRepoDownload = '%0:sapi/v4/projects/%1:s/repository/archive.zip'; + CGitRepoReleases = '%0:sapi/v4/projects/%1:s/releases'; + CMediaTypeRaw = ''; + CPushDates = 'PushDates.ini'; + +type + EGitlabProviderException = EAbort; + ERateLimitException = EGitlabProviderException; + EInvalidProviderSetup = EGitlabProviderException; + +{ TDCPMPackageProvider } + +procedure TDNGitLabPackageProvider.AddDependencies( + const AVersion: IDNPackageVersion; AInf: TInfoFile); +var + LInfDependency: TInfoDependency; + LDependency: IDNPackageDependency; +begin + for LInfDependency in AInf.Dependencies do + begin + LDependency := TDNPackageDependency.Create(LInfDependency.ID, LInfDependency.Version); + AVersion.Dependencies.Add(LDependency); + end; +end; + +procedure TDNGitLabPackageProvider.AddPackageFromJSon(AJSon: TJSONObject); +var + LPackage: IDNPackage; +begin + if CreatePackageWithMetaInfo(AJSon, LPackage) then + begin + Packages.Add(LPackage); + end; +end; + +procedure TDNGitLabPackageProvider.CheckRateLimit; +var + LUnixTime: Int64; + LResetTime: TDateTime; +begin + if FClient.ResponseHeader['X-RateLimit-Remaining'] = '0' then + begin + LUnixTime := StrToInt64Def(FClient.ResponseHeader['X-RateLimit-Reset'], 0); + LResetTime := TTimeZone.Local.ToLocalTime(UnixToDateTime(LUnixTime)); + raise ERateLimitException.Create('Ratelimit exceeded. Wait for reset. Reset is at ' + DateTimeToStr(LResetTime)); + end; +end; + +procedure TDNGitLabPackageProvider.setBaseURL(aValue : String); +begin + if aValue <> FBaseURL then + begin + FBaseURL := aValue; + if length(FBaseURL) > 0 then + begin + if FBaseURL.Chars[length(FBaseURL)-1] <> '/' then + begin + FBaseURL := FBaseURL + '/'; + end; + end; + end; +end; + +constructor TDNGitLabPackageProvider.Create; +var + LKey: string; +begin + inherited Create(); + FClient := AClient; + FProgress := TDNProgress.Create(); + FPushDates := TDictionary.Create(); + FExistingIDs := TDictionary.Create(); + LKey := StringReplace(GetPushDateFile(), '\', '/', [rfReplaceAll]); + FDateMutex := TMutex.Create(nil, False, LKey); + FState := TDNGitlabPackageProviderState.Create(FClient); + FLoadPictures := ALoadPictures; +end; + +function TDNGitLabPackageProvider.CreatePackageWithMetaInfo(AItem: TJSONObject; + out APackage: IDNPackage): Boolean; +var + LPackage: TDNGitLabPackage; + LName, LAuthor, LDefaultBranch, LReleases, LWebURL: string; + LFullName, LRepoID, LPushDate, LOldPushDate, LAvatatURL: string; + LHeadInfo: TInfoFile; + LHomePage: TJSONValue; + LHeadVersion: TDNPackageVersion; +begin + Result := False; + + LRepoID := AItem.GetValue('id').Value; + LName := AItem.GetValue('name').Value; + LFullName := AItem.GetValue('path_with_namespace').Value; + LPushDate := AItem.GetValue('last_activity_at').Value; + LAuthor := TJSonObject(AItem.GetValue('namespace')).GetValue('name').Value; + LDefaultBranch := AItem.GetValue('default_branch').Value; + LWebURL := AItem.GetValue('web_url').Value; + LAvatatURL := AItem.GetValue('avatar_url').Value; + + GetReleaseText(LRepoID, LReleases); + + //if nothing was pushed or released since last refresh, we can go fullcache and not contact the server + FClient.IgnoreCacheExpiration := (LPushDate = LOldPushDate) and (FClient.LastResponseSource = rsCache); + LHeadInfo := TInfoFile.Create(); + try + if GetInfoFile(LRepoID, LDefaultBranch, LHeadInfo) and not FExistingIDs.ContainsKey(LHeadInfo.ID) then + begin + FExistingIDs.Add(LHeadInfo.ID, 0); + LPackage := TDNGitLabPackage.Create(); + LPackage.RepoID := LRepoID; + LPackage.RepoReleases := LReleases; + LPackage.OnGetLicense := GetLicense; + if not AItem.GetValue('description').Null then + LPackage.Description := AItem.GetValue('description').Value; + LPackage.DownloadLoaction := Format(CGitRepoDownload, [FBaseURL, LRepoID]); + LPackage.Author := LAuthor; + LPackage.RepositoryName := LName; + LPackage.DefaultBranch := LDefaultBranch; + + LPackage.ProjectUrl := LWebURL; + LHomePage := AItem.GetValue('web_url'); + if LHomePage is TJSONString then + LPackage.HomepageUrl := LHomePage.Value; + + if LHeadInfo.RepositoryRedirectIssues then + LPackage.ReportUrl := LWebURL; + if LHeadInfo.ReportUrl <> '' then + LPackage.ReportUrl := LHeadInfo.ReportUrl; + + if LHeadInfo.Name <> '' then + LPackage.Name := LHeadInfo.Name + else + LPackage.Name := LName; + LPackage.ID := LHeadInfo.ID; + LPackage.CompilerMin := LHeadInfo.PackageCompilerMin; + LPackage.CompilerMax := LHeadInfo.PackageCompilerMax; + LPackage.Licenses.AddRange(LHeadInfo.Licenses); + LPackage.Platforms := LHeadInfo.Platforms; + LPackage.RepositoryType := LHeadInfo.RepositoryType; + LPackage.RepositoryUser := LHeadInfo.RepositoryUser; + LPackage.Repository := LHeadInfo.Repository; + APackage := LPackage; + if FLoadPictures then + begin + try + LoadPicture(APackage.Picture, LAvatatURL); + except + end; + end; + RegisterReleases(APackage, LRepoID, LReleases); + LHeadVersion := TDNPackageVersion.Create(); + LHeadVersion.Name := 'HEAD'; + LHeadVersion.Value := TDNVersion.Create(); + LHeadVersion.CompilerMin := LHeadInfo.CompilerMin; + LHeadVersion.CompilerMax := LHeadInfo.CompilerMax; + AddDependencies(LHeadVersion, LHeadInfo); + APackage.Versions.Add(LHeadVersion); + FPushDates.AddOrSetValue(LFullName, LPushDate); + Result := True; + end; + finally + LHeadInfo.Free; + FClient.IgnoreCacheExpiration := False; + end; +end; + +destructor TDNGitLabPackageProvider.Destroy; +begin + FDateMutex.Free(); + FPushDates.Free(); + FExistingIDs.Free(); + FClient := nil; + FProgress := nil; + inherited; +end; + +function ExtractAndDeleteArchive(const AArchive: string; ARootDir: string): string; +var + LFolder: string; + LDirs: TStringDynArray; +begin + Result := ''; + LFolder := TPath.Combine(ARootDir, TGuid.NewGuid.ToString); + if ForceDirectories(LFolder) and ShellUnzip(AArchive, LFolder) then + begin + LDirs := TDirectory.GetDirectories(LFolder); + if Length(LDirs) = 1 then + Result := LDirs[0]; + end; + TFile.Delete(AArchive); +end; + +function TDNGitLabPackageProvider.GetFileStream(const aURL: string; AFile: TStream): Boolean; +begin + FClient.Accept := CMediaTypeRaw; + try + Result := FClient.Get(aURL, AFile) = HTTPErrorOk; + if not Result then + CheckRateLimit(); + finally + FClient.Accept := ''; + end; +end; + +function TDNGitLabPackageProvider.GetGitlabFileText(const aRepoID, aFilePath, aRef : string; out AText: string): Boolean; +var url : string; +begin + FClient.Accept := CMediaTypeRaw; + try + url := Format(CGitRepoGetFile, [FBaseURL, aRepoID, aFilePath, aRef]); + Result := FClient.GetText(url, AText) = HTTPErrorOk; + if not Result then + CheckRateLimit(); + finally + FClient.Accept := ''; + end; +end; + +function TDNGitLabPackageProvider.GetLicense(const APackage: TDNGitLabPackage; const ALicense: TDNLicense): string; +var crepoid, cref : string; +begin + Result := 'No Licensefile has been provided.' + sLineBreak + 'Contact the Packageauthor to fix this issue by using the report-button.'; + if (ALicense.LicenseFile <> '') then + begin + crepoid := (APackage as TDNGitLabPackage).RepoID; + cref := (APackage as TDNGitLabPackage).DefaultBranch; + if GetGitlabFileText(crepoid, ALicense.LicenseFile, cref, result) then + begin + //if we do not detect a single Windows-Linebreak, we assume Posix-LineBreaks and convert + if not ContainsStr(Result, sLineBreak) then + Result := StringReplace(Result, #10, sLineBreak, [rfReplaceAll]); + end + else + begin + Result := 'An error occured while downloading the license information.' + sLineBreak + 'The file might be missing.'; + end; + end; +end; + +function TDNGitLabPackageProvider.GetInfoFile(const aRepoID, aRef: string; AInfo: TInfoFile): Boolean; +var + LResponse: string; +begin + FClient.Accept := CMediaTypeRaw; + try + Result := GetGitlabFileText(aRepoID, CInfoFile, aRef, LResponse) + and AInfo.LoadFromString(LResponse); + if not Result then + CheckRateLimit(); + finally + FClient.Accept := ''; + end; +end; + +function TDNGitLabPackageProvider.GetReleaseText(const ARepositoryID: string; out AReleases: string): Boolean; +begin + Result := FClient.GetText(Format(CGitRepoReleases, [FBaseURL, ARepositoryID]), AReleases) = HTTPErrorOk; + if not Result then + CheckRateLimit(); +end; + +function TDNGitLabPackageProvider.Download(const APackage: IDNPackage; + const AVersion: string; const AFolder: string; out AContentFolder: string): Boolean; +var + LArchiveFile, LProviderFolder, LProviderUrl: string; + LGitlabPackage: TDNGitLabPackage; + LRelease : TJSONObject; +const + CNamePrefix = 'filename='; +begin + FProgress.SetTasks(['Downloading']); + LArchiveFile := TPath.Combine(AFolder, 'Package.zip'); + FClient.OnProgress := HandleDownloadProgress; + if AVersion = 'HEAD' then + begin + LProviderUrl := APackage.DownloadLoaction; + end else + begin + LRelease := getRelease((APackage as TDNGitLabPackage).RepoReleases, AVersion); + if LRelease <> nil then + begin + try + LProviderUrl := getReleaseAssetDownload(LRelease); + finally + FreeAndNil(LRelease); + end; + end; + end; + Result := FClient.Download(APackage.DownloadLoaction, LArchiveFile) = HTTPErrorOk; + if Result then + begin + AContentFolder := ExtractAndDeleteArchive(LArchiveFile, AFolder); + if APackage is TDNGitLabPackage then + begin + LGitlabPackage := APackage as TDNGitLabPackage; + if LGitlabPackage.RepositoryType <> '' then + begin + Result := FClient.Download(LProviderUrl, LArchiveFile) = HTTPErrorOk; + if Result then + begin + LProviderFolder := ExtractAndDeleteArchive(LArchiveFile, AFolder); + TDirectory.Copy(AContentFolder, LProviderFolder); + AContentFolder := LProviderFolder; + end; + end; + end; + end; + FClient.OnProgress := nil; +end; + +procedure TDNGitLabPackageProvider.LoadPicture(APicture: TPicture; aURL : String); +var + LPicStream: TMemoryStream; +begin + LPicStream := TMemoryStream.Create(); + try + if GetFileStream(aURL, LPicStream) then + begin + LPicStream.Position := 0; + TGraphicLoader.TryLoadPictureFromStream(LPicStream, '.png', APicture); + end; + finally + LPicStream.Free; + end; +end; + +procedure TDNGitLabPackageProvider.RegisterReleases(const APackage: IDNPackage; const aRepoID, aReleases : string); +var + LArray: TJSONArray; + LObject: TJSonObject; + i: Integer; + LVersionName: string; + LInfo: TInfoFile; + LVersion: IDNPackageVersion; +begin + LInfo := TInfoFile.Create(); + try + LArray := TJSOnObject.ParseJSONValue(AReleases) as TJSONArray; + try + for i := 0 to LArray.Count - 1 do + begin + LObject := LArray.Items[i] as TJSonObject; + LVersionName := LObject.GetValue('tag_name').Value; + if GetInfoFile(aRepoID, LVersionName, LInfo) then + begin + LVersion := TDNPackageVersion.Create(); + LVersion.Name := LVersionName; + LVersion.CompilerMin := LInfo.CompilerMin; + LVersion.CompilerMax := LInfo.CompilerMax; + AddDependencies(LVersion, LInfo); + APackage.Versions.Add(LVersion); + end; + end; + finally + LArray.Free; + end; + finally + LInfo.Free; + end; +end; + +function TDNGitLabPackageProvider.getRelease(aReleases, aRelease: string) : TJSonObject; +var + LArray: TJSONArray; + LObject: TJSonObject; + i: Integer; + LVersionName: string; +begin + result := nil; + LArray := TJSOnObject.ParseJSONValue(AReleases) as TJSONArray; + try + for i := 0 to LArray.Count - 1 do + begin + LObject := LArray.Items[i] as TJSonObject; + LVersionName := LObject.GetValue('tag_name').Value; + if LVersionName = aRelease then + begin + result := TJSOnObject.ParseJSONValue(LObject.ToString) as TJSOnObject; + break; + end; + end; + finally + LArray.Free; + end; +end; + +function TDNGitLabPackageProvider.getReleaseAssetDownload(aRelease : TJSonObject) : string; +var cvassets : TJSONValue; + coassets, + cosource : TJSONObject; + casources : TJSONArray; + i : Integer; +begin + result := ''; + if aRelease <> nil then + begin + cvassets := aRelease.GetValue('assets'); + if cvassets is TJSONObject then + begin + coassets := TJSONObject(cvassets); + casources := coassets.GetValue('sources') as TJSONArray; + for i := 0 to casources.Count - 1 do + begin + cosource := casources.Items[i] as TJSONObject; + if cosource.GetValue('format').Value = 'zip' then + begin + result := cosource.GetValue('url').Value; + break; + end; + end; + end; + end; +end; + +function TDNGitLabPackageProvider.GetPushDateFile: string; +begin + Result := TPath.Combine(GetDelphinusTempFolder(), CPushDates); +end; + +function TDNGitLabPackageProvider.GetRepoList(out ARepos: TJSONArray): Boolean; +var + LRoot: TJSONArray; + LSearchResponse: string; + BSearchResponse: TArray; +begin + Result := FClient.GetText(Format(CGitRepoSearch, [FBaseURL]), LSearchResponse) = HTTPErrorOk; + if Result then + begin + BSearchResponse := TEncoding.UTF8.GetBytes(LSearchResponse); + LRoot := TJSONObject.ParseJSONValue(BSearchResponse, 0, Length(BSearchResponse), + [ TJSONObject.TJSONParseOption.IsUTF8, + TJSONObject.TJSONParseOption.UseBool]) as TJSONArray; + ARepos := LRoot; + ARepos.Owned := False; + end; +end; + +procedure TDNGitLabPackageProvider.HandleDownloadProgress(AProgress, + AMax: Int64); +begin + FProgress.SetTaskProgress('Archive', AProgress, AMax); +end; + +procedure TDNGitLabPackageProvider.LoadPushDates; +var + LDates: TStringList; + i: Integer; +begin + FDateMutex.Acquire(); + FPushDates.Clear; + + if not TFile.Exists(GetPushDateFile()) then + Exit; + + LDates := TStringList.Create(); + try + LDates.LoadFromFile(GetPushDateFile()); + for i := 0 to LDates.Count - 1 do + FPushDates.Add(LDates.Names[i], LDates.ValueFromIndex[i]); + finally + LDates.Free; + end; +end; + +function TDNGitLabPackageProvider.Reload: Boolean; +var + LRepo: TJSONObject; + LRepos: TJSONArray; + i: Integer; +begin + Result := False; + try + (FState as TDNGitlabPackageProviderState).Reset(); + FProgress.SetTasks(['Reolading']); + try + LoadPushDates(); + FClient.BeginWork(); + try + if GetRepoList(LRepos) then + begin + try + Packages.Clear(); + FExistingIDs.Clear(); + for i := 0 to LRepos.Count - 1 do + begin + LRepo := LRepos.Items[i] as TJSONObject; + FProgress.SetTaskProgress(LRepo.GetValue('name').Value, i, LRepos.Count); + AddPackageFromJSon(LRepo); + end; + FProgress.Completed(); + Result := True; + finally + LRepos.Free; + end; + end; + finally + FClient.EndWork(); + end; + finally + SavePushDates(); + end; + except + on E: ERateLimitException do + (FState as TDNGitlabPackageProviderState).SetError(E.Message) + end; +end; + +procedure TDNGitLabPackageProvider.SavePushDates; +var + LDates: TStringList; + LKeys, LValues: TArray; + i: Integer; +begin + LDates := TStringList.Create(); + try + LKeys := FPushDates.Keys.ToArray(); + LValues := FPushDates.Values.ToArray(); + for i := 0 to FPushDates.Count - 1 do + LDates.Add(LKeys[i] + '=' + LValues[i]); + LDates.SaveToFile(GetPushDateFile()); + finally + LDates.Free; + FDateMutex.Release(); + end; +end; + +end. diff --git a/DN.PackageProvider.MultiSource.pas b/DN.PackageProvider.MultiSource.pas new file mode 100644 index 0000000..3620cfe --- /dev/null +++ b/DN.PackageProvider.MultiSource.pas @@ -0,0 +1,105 @@ +unit DN.PackageProvider.MultiSource; + +interface + +uses + DN.Package.Intf, + DN.PackageProvider, + DN.PackageProvider.Intf, + DN.Progress.Intf; + +type + TDNMultiSourceProvider = class(TDNPackageProvider, IDNProgress) + private + FSources: TArray; + FProgress: IDNProgress; + procedure HandleProgress(const Task, Item: string; Progress, Max: Int64); + function TryGetSourceForPackage(const APackage: IDNPackage; out ASource: IDNPackageProvider): Boolean; + property Progress: IDNProgress read FProgress implements IDNProgress; + public + constructor Create(const ASources: TArray); + function Reload: Boolean; override; + function Download(const APackage: IDNPackage; const AVersion: string; const AFolder: string; out AContentFolder: string): Boolean; override; + end; + +implementation + +uses + SysUtils, + Generics.Collections, + DN.Progress; + +{ TDNMultiSourceProvider } + +constructor TDNMultiSourceProvider.Create( + const ASources: TArray); +var + LSource: IDNPackageProvider; + LProgress: IDNProgress; +begin + inherited Create(); + FSources := ASources; + FProgress := TDNProgress.Create(); + for LSource in FSources do + if Supports(LSource, IDNProgress, LProgress) then + LProgress.OnProgress := HandleProgress; +end; + +function TDNMultiSourceProvider.Download(const APackage: IDNPackage; + const AVersion, AFolder: string; out AContentFolder: string): Boolean; +var + LSource: IDNPackageProvider; +begin + Result := TryGetSourceForPackage(APackage, LSource); + if Result then + Result := LSource.Download(APackage, AVersion, AFolder, AContentFolder); +end; + +procedure TDNMultiSourceProvider.HandleProgress(const Task, Item: string; + Progress, Max: Int64); +begin + FProgress.SetTaskProgress(Item, Progress, Max); +end; + +function TDNMultiSourceProvider.Reload: Boolean; +var + LSource: IDNPackageProvider; + LExisting: TDictionary; + LPackage: IDNPackage; +begin + Result := False; + LExisting := TDictionary.Create(); + try + Packages.Clear; + FProgress.SetTasks(['Reloading']); + for LSource in FSources do + begin + Result := LSource.Reload or Result; + for LPackage in LSource.Packages do + if not LExisting.ContainsKey(LPackage.ID.ToString) then + begin + LExisting.Add(LPackage.ID.ToString, ''); + Packages.Add(LPackage); + end; + end; + FProgress.Completed; + finally + LExisting.Free; + end; +end; + +function TDNMultiSourceProvider.TryGetSourceForPackage( + const APackage: IDNPackage; out ASource: IDNPackageProvider): Boolean; +var + LSource: IDNPackageProvider; +begin + for LSource in FSources do + if LSource.Packages.IndexOf(APackage) > -1 then + begin + ASource := LSource; + Exit(True); + end; + Result := False; +end; + +end. diff --git a/DN.PackageSource.ConfigPage.Folder.dfm b/DN.PackageSource.ConfigPage.Folder.dfm new file mode 100644 index 0000000..9498fc5 --- /dev/null +++ b/DN.PackageSource.ConfigPage.Folder.dfm @@ -0,0 +1,25 @@ +object DNFolderConfigPage: TDNFolderConfigPage + Left = 0 + Top = 0 + Width = 320 + Height = 240 + TabOrder = 0 + DesignSize = ( + 320 + 240) + object Label1: TLabel + Left = 0 + Top = 0 + Width = 26 + Height = 13 + Caption = 'Path:' + end + object edPath: TEdit + Left = 0 + Top = 16 + Width = 320 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + end +end diff --git a/DN.PackageSource.ConfigPage.Folder.pas b/DN.PackageSource.ConfigPage.Folder.pas new file mode 100644 index 0000000..757f4bb --- /dev/null +++ b/DN.PackageSource.ConfigPage.Folder.pas @@ -0,0 +1,52 @@ +unit DN.PackageSource.ConfigPage.Folder; + +interface + +uses + Windows, + Messages, + SysUtils, + Variants, + Classes, + Graphics, + Controls, + Forms, + Dialogs, + DN.PackageSource.ConfigPage, + DN.PackageSource.Settings.Intf, + StdCtrls; + +type + TDNFolderConfigPage = class(TFrame) + Label1: TLabel; + edPath: TEdit; + private + { Private declarations } + public + { Public declarations } + procedure Load(const ASettings: IDNPackageSourceSettings); override; + procedure Save(const ASettings: IDNPackageSourceSettings); override; + end; + +implementation + +uses + DN.PackageSource.Settings.Folder; + +{$R *.dfm} + +{ TDNFolderConfigPage } + +procedure TDNFolderConfigPage.Load(const ASettings: IDNPackageSourceSettings); +begin + inherited; + edPath.Text := ASettings[TDNFolderSourceSettings.Path].Value.ToString; +end; + +procedure TDNFolderConfigPage.Save(const ASettings: IDNPackageSourceSettings); +begin + inherited; + ASettings[TDNFolderSourceSettings.Path].Value := edPath.Text; +end; + +end. diff --git a/DN.PackageSource.ConfigPage.Github.dfm b/DN.PackageSource.ConfigPage.Github.dfm new file mode 100644 index 0000000..09b3147 --- /dev/null +++ b/DN.PackageSource.ConfigPage.Github.dfm @@ -0,0 +1,50 @@ +object DNGithubSourceConfigPage: TDNGithubSourceConfigPage + Left = 0 + Top = 0 + Width = 320 + Height = 240 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + TabOrder = 0 + DesignSize = ( + 320 + 240) + object Label1: TLabel + Left = 3 + Top = 3 + Width = 75 + Height = 16 + Caption = 'OAuthToken:' + end + object lbResponse: TLabel + Left = 3 + Top = 54 + Width = 314 + Height = 16 + Anchors = [akLeft, akTop, akRight] + AutoSize = False + end + object edOAuthToken: TEdit + Left = 3 + Top = 24 + Width = 233 + Height = 24 + Anchors = [akLeft, akTop, akRight] + PasswordChar = '*' + TabOrder = 0 + end + object btnTest: TButton + Left = 242 + Top = 24 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'Test' + TabOrder = 1 + OnClick = btnTestClick + end +end diff --git a/DN.PackageSource.ConfigPage.Github.pas b/DN.PackageSource.ConfigPage.Github.pas new file mode 100644 index 0000000..bc71945 --- /dev/null +++ b/DN.PackageSource.ConfigPage.Github.pas @@ -0,0 +1,86 @@ +unit DN.PackageSource.ConfigPage.Github; + +interface + +uses + Windows, + Messages, + SysUtils, + Variants, + Classes, + Graphics, + Controls, + Forms, + Dialogs, + DN.PackageSource.ConfigPage, + DN.PackageSource.Settings.Intf, + StdCtrls; + +type + TDNGithubSourceConfigPage = class(TFrame) + edOAuthToken: TEdit; + Label1: TLabel; + btnTest: TButton; + lbResponse: TLabel; + procedure btnTestClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + procedure Load(const ASettings: IDNPackageSourceSettings); override; + procedure Save(const ASettings: IDNPackageSourceSettings); override; + end; + +implementation + +uses + DN.PackageProvider.GitHub, + DN.JSon, + DN.HttpClient.Intf, + DN.HttpClient.WinHttp, + DN.PackageSource.Settings.GitHub; + +{$R *.dfm} + +{ TGithubSourceConfigPage } + +procedure TDNGithubSourceConfigPage.btnTestClick(Sender: TObject); +var + LClient: IDNHttpClient; + LResult: Integer; + LResponse: string; + LJSon: TJSONObject; +begin + LClient := TDNWinHttpClient.Create(); + LClient.Authentication := Format(CGithubOAuthAuthentication, [Trim(edOAuthToken.Text)]); + LResult := LClient.GetText('https://api.github.com/user', LResponse); + if LResult = HTTPErrorOk then + begin + LJSon := TJSonObject.ParseJSONValue(LResponse) as TJSonObject; + try + lbResponse.Caption := 'Authenticated as ' + LJSon.GetValue('login').Value; + finally + LJSon.Free; + end; + end + else + begin + lbResponse.Caption := 'Failed with ResponseCode ' + IntToStr(LResult); + end; +end; + +procedure TDNGithubSourceConfigPage.Load( + const ASettings: IDNPackageSourceSettings); +begin + inherited; + edOAuthToken.Text := ASettings.Field[TDNGithubPackageSourceSettings.OAuthToken].Value.AsString; +end; + +procedure TDNGithubSourceConfigPage.Save( + const ASettings: IDNPackageSourceSettings); +begin + inherited; + ASettings.Field[TDNGithubPackageSourceSettings.OAuthToken].Value := edOAuthToken.Text; +end; + +end. diff --git a/DN.PackageSource.ConfigPage.Gitlab.dfm b/DN.PackageSource.ConfigPage.Gitlab.dfm new file mode 100644 index 0000000..3b8471d --- /dev/null +++ b/DN.PackageSource.ConfigPage.Gitlab.dfm @@ -0,0 +1,87 @@ +object DNGitlabSourceConfigPage: TDNGitlabSourceConfigPage + Left = 0 + Top = 0 + Width = 320 + Height = 214 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + TabOrder = 0 + DesignSize = ( + 320 + 214) + object lblInfoToken: TLabel + Left = 3 + Top = 95 + Width = 75 + Height = 16 + Caption = 'OAuthToken:' + end + object lbResponse: TLabel + Left = 3 + Top = 147 + Width = 314 + Height = 58 + Anchors = [akLeft, akTop, akRight] + AutoSize = False + WordWrap = True + end + object lblInfoBaseURL: TLabel + Left = 3 + Top = 10 + Width = 58 + Height = 16 + Caption = 'Base URL:' + end + object imgAvatar: TImage + Left = 242 + Top = 63 + Width = 75 + Height = 78 + Anchors = [akTop, akRight] + Stretch = True + end + object edtOAuthToken: TEdit + Left = 3 + Top = 117 + Width = 233 + Height = 24 + Anchors = [akLeft, akTop, akRight] + PasswordChar = '*' + TabOrder = 0 + end + object edtBaseURL: TEdit + Left = 3 + Top = 32 + Width = 233 + Height = 24 + Anchors = [akLeft, akTop, akRight] + ParentShowHint = False + ShowHint = True + TabOrder = 1 + TextHint = 'https://gitlab.com' + OnChange = edtBaseURLChange + end + object btnTestURL: TButton + Left = 242 + Top = 32 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'Test' + TabOrder = 2 + OnClick = btnTestTokenClick + end + object btnSetURLGitLabCom: TButton + Left = 2 + Top = 56 + Width = 103 + Height = 25 + Caption = 'GitLab.com' + TabOrder = 3 + OnClick = btnSetURLGitLabComClick + end +end diff --git a/DN.PackageSource.ConfigPage.Gitlab.pas b/DN.PackageSource.ConfigPage.Gitlab.pas new file mode 100644 index 0000000..b0a3b01 --- /dev/null +++ b/DN.PackageSource.ConfigPage.Gitlab.pas @@ -0,0 +1,191 @@ +{ +######################################################### +# Copyright by Alexander Benikowski # +# This unit is part of the Delphinus project hosted on # +# https://github.com/Memnarch/Delphinus # +######################################################### +} +unit DN.PackageSource.ConfigPage.Gitlab; + +interface + +uses + Windows, + Messages, + SysUtils, + Variants, + Classes, + Graphics, + Controls, + Forms, + Dialogs, + DN.PackageSource.ConfigPage, + DN.PackageSource.Settings.Intf, + StdCtrls, Vcl.ExtCtrls; + +type + TDNGitlabSourceConfigPage = class(TFrame) + edtOAuthToken: TEdit; + lblInfoToken: TLabel; + lbResponse: TLabel; + edtBaseURL: TEdit; + lblInfoBaseURL: TLabel; + btnTestURL: TButton; + btnSetURLGitLabCom: TButton; + imgAvatar: TImage; + procedure btnSetURLGitLabComClick(Sender: TObject); + procedure btnTestTokenClick(Sender: TObject); + procedure edtBaseURLChange(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + procedure Load(const ASettings: IDNPackageSourceSettings); override; + procedure Save(const ASettings: IDNPackageSourceSettings); override; + end; + +implementation + +uses + DN.PackageProvider.GitLab, + DN.JSon, + DN.HttpClient.Intf, + DN.HttpClient.WinHttp, + DN.PackageSource.Settings.GitLab + {$IF RTLVersion < 32.0} + , PngImage, Jpeg + {$ENDIF} + ; + +{$R *.dfm} + +{ TGitlabSourceConfigPage } + +procedure TDNGitlabSourceConfigPage.btnSetURLGitLabComClick(Sender: TObject); +begin + edtBaseURL.Text := 'https://gitlab.com'; +end; + +procedure TDNGitlabSourceConfigPage.btnTestTokenClick(Sender: TObject); +var + LClient: IDNHttpClient; + LResult: Integer; + LResponse: string; + LJSon: TJSONObject; + zs : string; + avatarstream : TMemoryStream; + {$IF RTLVersion < 32.0} + cgfx : TGraphic; + {$ENDIF} +begin + lbResponse.Caption := Format('Checking (%0:s)...', [DateTimeToStr(Now)]); + Application.ProcessMessages; + LClient := TDNWinHttpClient.Create(); + LClient.Authentication := Format(CGitlabOAuthAuthentication, [Trim(edtOAuthToken.Text)]); + zs := Format('%0:s/api/v4/user?private_token=%1:s', [edtBaseURL.Text, Trim(edtOAuthToken.Text)]); + try + LResult := LClient.GetText(zs, LResponse); + except + on e : exception do + begin + lbResponse.Caption := Format('No connection "%0:s"', [e.Message]); + exit; + end; + end; + if LResult = HTTPErrorOk then + begin + LJSon := TJSonObject.ParseJSONValue(LResponse) as TJSonObject; + try + if LJSon <> nil then + begin + lbResponse.Caption := Format('You are: %0:s (%1:s)', [LJSon.GetValue('username').Value, LJSon.GetValue('name').Value]); + try + avatarstream := TMemoryStream.Create; + try + LResult := LClient.Get(LJSon.GetValue('avatar_url').Value, avatarstream); + if LResult = HTTPErrorOk then + begin + avatarstream.Position := 0; + {$IF RTLVersion >= 32.0} + imgAvatar.Picture.LoadFromStream(avatarstream); + {$ELSE} + cgfx := nil; + // try PNG... + if cgfx = nil then + begin + cgfx := TPngImage.Create; + try + cgfx.LoadFromStream(avatarstream); + imgAvatar.Picture.Graphic := cgfx; + except + FreeAndNil(cgfx); + end; + end; + // try JPG... + if cgfx = nil then + begin + cgfx := TJpegImage.Create; + try + cgfx.LoadFromStream(avatarstream); + imgAvatar.Picture.Graphic := cgfx; + except + FreeAndNil(cgfx); + end; + end; + // try BMP... + if cgfx = nil then + begin + cgfx := TBitmap.Create; + try + cgfx.LoadFromStream(avatarstream); + imgAvatar.Picture.Graphic := cgfx; + except + FreeAndNil(cgfx); + end; + end; + {$ENDIF} + end; + finally + FreeAndNil(avatarstream); + end; + except + on e : exception do + begin + // only a missing picture + end; + end; + end else + begin + lbResponse.Caption := 'Unexpected result, there is no API answer'; + end; + finally + LJSon.Free; + end; + end else + begin + lbResponse.Caption := 'Authentication failed with ResponseCode ' + IntToStr(LResult); + end; +end; + +procedure TDNGitlabSourceConfigPage.edtBaseURLChange(Sender: TObject); +begin + edtBaseURL.Hint := edtBaseURL.Text; +end; + +procedure TDNGitlabSourceConfigPage.Load( + const ASettings: IDNPackageSourceSettings); +begin + inherited; + edtOAuthToken.Text := ASettings.Field[TDNGitlabPackageSourceSettings.OAuthToken].Value.AsString; + edtBaseURL.Text := ASettings.Field[TDNGitlabPackageSourceSettings.BaseURL].Value.AsString; +end; + +procedure TDNGitlabSourceConfigPage.Save( + const ASettings: IDNPackageSourceSettings); +begin + inherited; + ASettings.Field[TDNGitlabPackageSourceSettings.OAuthToken].Value := edtOAuthToken.Text; + ASettings.Field[TDNGitlabPackageSourceSettings.BaseURL].Value := edtBaseURL.Text; +end; + +end. diff --git a/DN.PackageSource.ConfigPage.Intf.pas b/DN.PackageSource.ConfigPage.Intf.pas new file mode 100644 index 0000000..8c55b9d --- /dev/null +++ b/DN.PackageSource.ConfigPage.Intf.pas @@ -0,0 +1,21 @@ +unit DN.PackageSource.ConfigPage.Intf; + +interface + +uses + Controls, + DN.PackageSource.Settings.Intf; + +type + IDNPackageSourceConfigPage = interface + ['{56F8FA24-FEA1-4FF5-91FF-06EF005161A5}'] + function GetParent: TWinControl; + procedure SetParent(const AValue: TWinControl); + procedure Load(const ASettings: IDNPackageSourceSettings); + procedure Save(const ASettings: IDNPackageSourceSettings); + property Parent: TWinControl read GetParent write SetParent; + end; + +implementation + +end. diff --git a/DN.PackageSource.ConfigPage.pas b/DN.PackageSource.ConfigPage.pas new file mode 100644 index 0000000..212b6cd --- /dev/null +++ b/DN.PackageSource.ConfigPage.pas @@ -0,0 +1,58 @@ +unit DN.PackageSource.ConfigPage; + +interface + +uses + Controls, + Forms, + DN.PackageSource.Settings.Intf, + DN.PackageSource.ConfigPage.Intf; + +type + TDNSourceConfigPage = class(TFrame, IInterface, IDNPackageSourceConfigPage) + private + FRefCount: Integer; + protected + function _AddRef: Integer; stdcall; + function _Release: Integer; stdcall; + function GetParent: TWinControl; + procedure SetParent(const AValue: TWinControl); reintroduce; + public + procedure Load(const ASettings: IDNPackageSourceSettings); virtual; abstract; + procedure Save(const ASettings: IDNPackageSourceSettings); virtual; abstract; + end; + + //Make designer happy + TFrame = TDNSourceConfigPage; + +implementation + +uses + SyncObjs; + +{ TDNSourceConfigPage } + +function TDNSourceConfigPage.GetParent: TWinControl; +begin + Result := Parent; +end; + +procedure TDNSourceConfigPage.SetParent(const AValue: TWinControl); +begin + Align := alClient; + Parent := AValue; +end; + +function TDNSourceConfigPage._AddRef: Integer; +begin + Result := TInterlocked.Increment(FRefCount); +end; + +function TDNSourceConfigPage._Release: Integer; +begin + Result := TInterlocked.Decrement(FRefCount); + if Result = 0 then + Self.Free; +end; + +end. diff --git a/DN.PackageSource.Folder.pas b/DN.PackageSource.Folder.pas new file mode 100644 index 0000000..bc03e94 --- /dev/null +++ b/DN.PackageSource.Folder.pas @@ -0,0 +1,50 @@ +unit DN.PackageSource.Folder; + +interface + +uses + DN.PackageSource, + DN.PackageSource.ConfigPage.Intf, + DN.PackageSource.Settings.Intf, + DN.PackageProvider.Intf; + +type + TDNFolderPackageSource = class(TDNPackageSource) + public + function GetName: string; override; + function NewConfigPage: IDNPackageSourceConfigPage; override; + function NewProvider(const ASettings: IDNPackageSourceSettings): IDNPackageProvider; override; + function NewSettings: IDNPackageSourceSettings; override; + end; + +implementation + +uses + DN.PackageProvider.Folder, + DN.PackageSource.Settings.Folder, + DN.PackageSource.ConfigPage.Folder; + +{ TDNFolderPackageSource } + +function TDNFolderPackageSource.GetName: string; +begin + Result := 'Folder'; +end; + +function TDNFolderPackageSource.NewConfigPage: IDNPackageSourceConfigPage; +begin + Result := TDNFolderConfigPage.Create(nil); +end; + +function TDNFolderPackageSource.NewProvider( + const ASettings: IDNPackageSourceSettings): IDNPackageProvider; +begin + Result := TDNFolderPackageProvider.Create(ASettings[TDNFolderSourceSettings.Path].Value.ToString); +end; + +function TDNFolderPackageSource.NewSettings: IDNPackageSourceSettings; +begin + Result := TDNFolderSourceSettings.Create(GetName()); +end; + +end. diff --git a/DN.PackageSource.Github.pas b/DN.PackageSource.Github.pas new file mode 100644 index 0000000..12c2bb0 --- /dev/null +++ b/DN.PackageSource.Github.pas @@ -0,0 +1,60 @@ +unit DN.PackageSource.Github; + +interface + +uses + DN.PackageSource, + DN.PackageProvider.Intf, + DN.PackageSource.Settings.Intf, + DN.PackageSource.ConfigPage.Intf; + +type + TDNGithubPackageSource = class(TDNPackageSource) + public + function GetName: string; override; + function NewProvider(const ASettings: IDNPackageSourceSettings): IDNPackageProvider; override; + function NewSettings: IDNPackageSourceSettings; override; + function NewConfigPage: IDNPackageSourceConfigPage; override; + end; + +implementation + +uses + SysUtils, + DN.PackageSource.Settings.GitHub, + DN.PackageSource.ConfigPage.Github, + DN.PackageProvider.Github, + DN.HttpClient.Intf, + DN.HttpClient.WinHttp; + +{ TGithubPackageSource } + +function TDNGithubPackageSource.GetName: string; +begin + Result := 'GitHub'; +end; + +function TDNGithubPackageSource.NewConfigPage: IDNPackageSourceConfigPage; +begin + Result := TDNGithubSourceConfigPage.Create(nil); +end; + +function TDNGithubPackageSource.NewProvider( + const ASettings: IDNPackageSourceSettings): IDNPackageProvider; +var + LClient: IDNHttpClient; + LOAuthToken: string; +begin + LClient := TDNWinHttpClient.Create(); + LOAuthToken := ASettings.Field[TDNGithubPackageSourceSettings.OAuthToken].Value.ToString; + if LOAuthToken <> '' then + LClient.Authentication := Format(CGithubOAuthAuthentication, [LOAuthToken]); + Result := TDNGitHubPackageProvider.Create(LClient); +end; + +function TDNGithubPackageSource.NewSettings: IDNPackageSourceSettings; +begin + Result := TDNGithubPackageSourceSettings.Create(GetName); +end; + +end. diff --git a/DN.PackageSource.Gitlab.pas b/DN.PackageSource.Gitlab.pas new file mode 100644 index 0000000..280fb79 --- /dev/null +++ b/DN.PackageSource.Gitlab.pas @@ -0,0 +1,61 @@ +unit DN.PackageSource.Gitlab; + +interface + +uses + DN.PackageSource, + DN.PackageProvider.Intf, + DN.PackageSource.Settings.Intf, + DN.PackageSource.ConfigPage.Intf; + +type + TDNGitlabPackageSource = class(TDNPackageSource) + public + function GetName: string; override; + function NewProvider(const ASettings: IDNPackageSourceSettings): IDNPackageProvider; override; + function NewSettings: IDNPackageSourceSettings; override; + function NewConfigPage: IDNPackageSourceConfigPage; override; + end; + +implementation + +uses + SysUtils, + DN.PackageSource.Settings.GitLab, + DN.PackageSource.ConfigPage.Gitlab, + DN.PackageProvider.Gitlab, + DN.HttpClient.Intf, + DN.HttpClient.WinHttp; + +{ TGitlabPackageSource } + +function TDNGitlabPackageSource.GetName: string; +begin + Result := 'GitLab'; +end; + +function TDNGitlabPackageSource.NewConfigPage: IDNPackageSourceConfigPage; +begin + Result := TDNGitlabSourceConfigPage.Create(nil); +end; + +function TDNGitlabPackageSource.NewProvider( + const ASettings: IDNPackageSourceSettings): IDNPackageProvider; +var + LClient: IDNHttpClient; + LOAuthToken: string; +begin + LClient := TDNWinHttpClient.Create(); + LOAuthToken := ASettings.Field[TDNGitlabPackageSourceSettings.OAuthToken].Value.ToString; + if LOAuthToken <> '' then + LClient.Authentication := Format(CGitlabOAuthAuthentication, [LOAuthToken]); + Result := TDNGitLabPackageProvider.Create(LClient); + TDNGitLabPackageProvider(Result).BaseURL := ASettings.Field[TDNGitlabPackageSourceSettings.BaseURL].Value.ToString; +end; + +function TDNGitlabPackageSource.NewSettings: IDNPackageSourceSettings; +begin + Result := TDNGitlabPackageSourceSettings.Create(GetName); +end; + +end. diff --git a/DN.PackageSource.Intf.pas b/DN.PackageSource.Intf.pas new file mode 100644 index 0000000..9fb988e --- /dev/null +++ b/DN.PackageSource.Intf.pas @@ -0,0 +1,22 @@ +unit DN.PackageSource.Intf; + +interface + +uses + DN.PackageProvider.Intf, + DN.PackageSource.Settings.Intf, + DN.PackageSource.ConfigPage.Intf; + +type + IDNPackageSource = interface + ['{DBC78301-EE5B-4CD3-98F8-A00413905077}'] + function GetName: string; + function NewSettings: IDNPackageSourceSettings; + function NewProvider(const ASettings: IDNPackageSourceSettings): IDNPackageProvider; + function NewConfigPage: IDNPackageSourceConfigPage; + property Name: string read GetName; + end; + +implementation + +end. diff --git a/DN.PackageSource.Registry.Intf.pas b/DN.PackageSource.Registry.Intf.pas new file mode 100644 index 0000000..4da251e --- /dev/null +++ b/DN.PackageSource.Registry.Intf.pas @@ -0,0 +1,20 @@ +unit DN.PackageSource.Registry.Intf; + +interface + +uses + DN.PackageSource.Intf; + +type + IDNPackageSourceRegistry = interface + ['{A8F4ACA8-09FE-40E9-8951-512C375C85C3}'] + function GetSources: TArray; + procedure RegisterSource(const ASource: IDNPackageSource); + procedure UnregisterSource(const ASource: IDNPackageSource); + function TryGetSource(const AName: string; out ASource: IDNPackageSource): Boolean; + property Sources: TArray read GetSources; + end; + +implementation + +end. diff --git a/DN.PackageSource.Registry.pas b/DN.PackageSource.Registry.pas new file mode 100644 index 0000000..876053d --- /dev/null +++ b/DN.PackageSource.Registry.pas @@ -0,0 +1,67 @@ +unit DN.PackageSource.Registry; + +interface + +uses + Generics.Collections, + DN.PackageSource.Intf, + DN.PackageSource.Registry.Intf; + +type + TDNPackageSourceRegistry = class(TInterfacedObject, IDNPackageSourceRegistry) + private + FSources: TDictionary; + function GetSources: TArray; + procedure RegisterSource(const ASource: IDNPackageSource); + function TryGetSource(const AName: string; + out ASource: IDNPackageSource): Boolean; + procedure UnregisterSource(const ASource: IDNPackageSource); + public + constructor Create; + destructor Destroy; override; + end; + + +implementation + +uses + DN.Character; + +{ TDNPackageSourceRegistry } + +constructor TDNPackageSourceRegistry.Create; +begin + inherited; + FSources := TDictionary.Create(); +end; + +destructor TDNPackageSourceRegistry.Destroy; +begin + FSources.Free; + inherited; +end; + +function TDNPackageSourceRegistry.GetSources: TArray; +begin + Result := FSources.Values.ToArray; +end; + +procedure TDNPackageSourceRegistry.RegisterSource( + const ASource: IDNPackageSource); +begin + FSources.Add(TCharacter.ToLower(ASource.Name), ASource); +end; + +function TDNPackageSourceRegistry.TryGetSource(const AName: string; + out ASource: IDNPackageSource): Boolean; +begin + Result := FSources.TryGetValue(TCharacter.ToLower(AName), ASource); +end; + +procedure TDNPackageSourceRegistry.UnregisterSource( + const ASource: IDNPackageSource); +begin + FSources.Remove(TCharacter.ToLower(ASource.Name)); +end; + +end. diff --git a/DN.PackageSource.Settings.Field.Intf.pas b/DN.PackageSource.Settings.Field.Intf.pas new file mode 100644 index 0000000..87db2eb --- /dev/null +++ b/DN.PackageSource.Settings.Field.Intf.pas @@ -0,0 +1,24 @@ +unit DN.PackageSource.Settings.Field.Intf; + +interface + +uses + RTTI; + +type + TFieldValueType = (ftString, ftInteger); + + IDNPackageSourceSettingsField = interface + ['{DC0FBD64-173E-4569-B1B3-C76D824AD7B8}'] + function GetValue: TValue; + procedure SetValue(const Value: TValue); + function GetValueType: TFieldValueType; + function GetName: string; + property Name: string read GetName; + property Value: TValue read GetValue write SetValue; + property ValueType: TFieldValueType read GetValueType; + end; + +implementation + +end. diff --git a/DN.PackageSource.Settings.Field.pas b/DN.PackageSource.Settings.Field.pas new file mode 100644 index 0000000..45986b2 --- /dev/null +++ b/DN.PackageSource.Settings.Field.pas @@ -0,0 +1,57 @@ +unit DN.PackageSource.Settings.Field; + +interface + +uses + DN.PackageSource.Settings.Field.Intf, + RTTI; + +type + TDNPackageSourceSettingsField = class(TInterfacedObject, IDNPackageSourceSettingsField) + private + FName: string; + FValue: TValue; + FValueType: TFieldValueType; + function GetValue: TValue; + procedure SetValue(const Value: TValue); + function GetValueType: TFieldValueType; + function GetName: string; + public + constructor Create(const AName: string; AType: TFieldValueType); + property Name: string read GetName; + property Value: TValue read GetValue write SetValue; + property ValueType: TFieldValueType read GetValueType; + end; + +implementation + +{ TDNPackageSourceSettingsField } + +constructor TDNPackageSourceSettingsField.Create(const AName: string; AType: TFieldValueType); +begin + inherited Create(); + FName := AName; + FValueType := AType; +end; + +function TDNPackageSourceSettingsField.GetName: string; +begin + Result := FName; +end; + +function TDNPackageSourceSettingsField.GetValue: TValue; +begin + Result := FValue; +end; + +function TDNPackageSourceSettingsField.GetValueType: TFieldValueType; +begin + Result := FValueType; +end; + +procedure TDNPackageSourceSettingsField.SetValue(const Value: TValue); +begin + FValue := Value; +end; + +end. diff --git a/DN.PackageSource.Settings.Folder.pas b/DN.PackageSource.Settings.Folder.pas new file mode 100644 index 0000000..a97209e --- /dev/null +++ b/DN.PackageSource.Settings.Folder.pas @@ -0,0 +1,29 @@ +unit DN.PackageSource.Settings.Folder; + +interface + +uses + DN.PackageSource.Settings; + +type + TDNFolderSourceSettings = class(TDNPackageSourceSettings) + protected + procedure InitFields; override; + public + const Path = 'Path'; + end; + +implementation + +uses + DN.PackageSource.Settings.Field.Intf; + +{ TDNFolderSourceSettings } + +procedure TDNFolderSourceSettings.InitFields; +begin + inherited; + DeclareField(Path, ftString); +end; + +end. diff --git a/DN.PackageSource.Settings.Github.pas b/DN.PackageSource.Settings.Github.pas new file mode 100644 index 0000000..355a20f --- /dev/null +++ b/DN.PackageSource.Settings.Github.pas @@ -0,0 +1,29 @@ +unit DN.PackageSource.Settings.Github; + +interface + +uses + DN.PackageSource.Settings; + +type + TDNGithubPackageSourceSettings = class(TDNPackageSourceSettings) + protected + procedure InitFields; override; + public + const OAuthToken = 'OAuthToken'; + end; + +implementation + +uses + DN.PackageSource.Settings.Field.Intf; + +{ TDNGithubPackageSourceSettings } + +procedure TDNGithubPackageSourceSettings.InitFields; +begin + inherited; + DeclareField(OAuthToken, ftString); +end; + +end. diff --git a/DN.PackageSource.Settings.Gitlab.pas b/DN.PackageSource.Settings.Gitlab.pas new file mode 100644 index 0000000..e5ac99a --- /dev/null +++ b/DN.PackageSource.Settings.Gitlab.pas @@ -0,0 +1,38 @@ +{ +######################################################### +# Copyright by Alexander Benikowski # +# This unit is part of the Delphinus project hosted on # +# https://github.com/Memnarch/Delphinus # +######################################################### +} +unit DN.PackageSource.Settings.Gitlab; + +interface + +uses + DN.PackageSource.Settings; + +type + TDNGitlabPackageSourceSettings = class(TDNPackageSourceSettings) + protected + procedure InitFields; override; + public + const OAuthToken = 'OAuthToken'; + const BaseURL = 'BaseURL'; + end; + +implementation + +uses + DN.PackageSource.Settings.Field.Intf; + +{ TDNGitlabPackageSourceSettings } + +procedure TDNGitlabPackageSourceSettings.InitFields; +begin + inherited; + DeclareField(OAuthToken, ftString); + DeclareField(BaseURL, ftString); +end; + +end. diff --git a/DN.PackageSource.Settings.Intf.pas b/DN.PackageSource.Settings.Intf.pas new file mode 100644 index 0000000..d7a74a3 --- /dev/null +++ b/DN.PackageSource.Settings.Intf.pas @@ -0,0 +1,24 @@ +unit DN.PackageSource.Settings.Intf; + +interface + +uses + DN.PackageSource.Settings.Field.Intf; + +type + IDNPackageSourceSettings = interface + ['{F26601A3-7C4E-4E2B-981D-057C80F85D94}'] + function GetField(const AName: string): IDNPackageSourceSettingsField; + function GetFields: TArray; + function GetName: string; + function GetSourceName: string; + procedure SetName(const Value: string); + property Name: string read GetName write SetName; + property SourceName: string read GetSourceName; + property Field[const AName: string]: IDNPackageSourceSettingsField read GetField; default; + property Fields: TArray read GetFields; + end; + +implementation + +end. diff --git a/DN.PackageSource.Settings.pas b/DN.PackageSource.Settings.pas new file mode 100644 index 0000000..59a3157 --- /dev/null +++ b/DN.PackageSource.Settings.pas @@ -0,0 +1,93 @@ +unit DN.PackageSource.Settings; + +interface + +uses + Generics.Collections, + DN.PackageSource.Settings.Field.Intf, + DN.PackageSource.Settings.Intf; + +type + TDNPackageSourceSettings = class(TInterfacedObject, IDNPackageSourceSettings) + private + FName: string; + FSourceName: string; + FFields: TDictionary; + function GetField(const AName: string): IDNPackageSourceSettingsField; + function GetFields: TArray; + function GetName: string; + function GetSourceName: string; + procedure SetName(const Value: string); + protected + function DeclareField(const AName: string; AType: TFieldValueType): IDNPackageSourceSettingsField; + procedure InitFields; virtual; + public + constructor Create(const ASourceName: string); + destructor Destroy; override; + property Name: string read GetName write SetName; + property SourceName: string read GetSourceName; + property Field[const AName: string]: IDNPackageSourceSettingsField read GetField; + property Fields: TArray read GetFields; + end; + +implementation + +uses + DN.Character, + DN.PackageSource.Settings.Field; + +{ TDNPackageSourceSettings } + +constructor TDNPackageSourceSettings.Create(const ASourceName: string); +begin + inherited Create(); + FFields := TDictionary.Create(); + FSourceName := ASourceName; + InitFields(); +end; + +function TDNPackageSourceSettings.DeclareField( + const AName: string; AType: TFieldValueType): IDNPackageSourceSettingsField; +begin + Result := TDNPackageSourceSettingsField.Create(AName, AType); + FFields.Add(TCharacter.ToLower(AName), Result); +end; + +destructor TDNPackageSourceSettings.Destroy; +begin + FFields.Free; + inherited; +end; + +function TDNPackageSourceSettings.GetField( + const AName: string): IDNPackageSourceSettingsField; +begin + Result := FFields[TCharacter.ToLower(AName)]; +end; + +function TDNPackageSourceSettings.GetFields: TArray; +begin + Result := FFields.Values.ToArray; +end; + +function TDNPackageSourceSettings.GetName: string; +begin + Result := FName; +end; + +function TDNPackageSourceSettings.GetSourceName: string; +begin + Result := FSourceName; +end; + +procedure TDNPackageSourceSettings.InitFields; +begin + +end; + +procedure TDNPackageSourceSettings.SetName(const Value: string); +begin + FName := Value; +end; + +end. diff --git a/DN.PackageSource.pas b/DN.PackageSource.pas new file mode 100644 index 0000000..b09926b --- /dev/null +++ b/DN.PackageSource.pas @@ -0,0 +1,22 @@ +unit DN.PackageSource; + +interface + +uses + DN.PackageSource.Settings.Intf, + DN.PackageProvider.Intf, + DN.PackageSource.Intf, + DN.PackageSource.ConfigPage.Intf; + +type + TDNPackageSource = class(TInterfacedObject, IDNPackageSource) + public + function GetName: string; virtual; abstract; + function NewProvider(const ASettings: IDNPackageSourceSettings): IDNPackageProvider; virtual; abstract; + function NewSettings: IDNPackageSourceSettings; virtual; abstract; + function NewConfigPage: IDNPackageSourceConfigPage; virtual; abstract; + end; + +implementation + +end. diff --git a/DN.Settings.Intf.pas b/DN.Settings.Intf.pas index c92d5e3..5d72740 100644 --- a/DN.Settings.Intf.pas +++ b/DN.Settings.Intf.pas @@ -2,6 +2,9 @@ interface +uses + DN.PackageSource.Settings.Intf; + type IDNSettings = interface ['{AEF92172-BD4F-44BA-B3F2-479533B00285}'] @@ -9,11 +12,14 @@ interface function GetOAuthToken: string; function GetVersion: string; function GetInstallDate: TDateTime; + function GetSourceSettings: TArray; + procedure SetSourceSettings(const Value: TArray); procedure SetOAuthToken(const Value: string); property InstallationDirectory: string read GetInstallationDirectory; property OAuthToken: string read GetOAuthToken write SetOAuthToken; property Version: string read GetVersion; property InstallDate: TDateTime read GetInstallDate; + property SourceSettings: TArray read GetSourceSettings write SetSourceSettings; end; IDNElevatedSettings = interface(IDNSettings) diff --git a/DN.Settings.pas b/DN.Settings.pas index 641a6cb..ba09141 100644 --- a/DN.Settings.pas +++ b/DN.Settings.pas @@ -3,11 +3,17 @@ interface uses - DN.Settings.Intf; + Generics.Collections, + DN.Settings.Intf, + DN.PackageSource.Settings.Intf; type + TDNPackageSourceSettingsFactory = reference to function(const ASourceName: string; out ASettings: IDNPackageSourceSettings): Boolean; + TDNSettings = class(TInterfacedObject, IDNSettings, IDNElevatedSettings) private + FSourceSettings: TList; + FSettingsFactory: TDNPackageSourceSettingsFactory; function ReadString(const AValueName: string): string; procedure WriteString(const AValueName, AContent: string); function GetInstallationDirectory: string; @@ -18,22 +24,33 @@ TDNSettings = class(TInterfacedObject, IDNSettings, IDNElevatedSettings) procedure SetVersion(const Value: string); function GetInstallDate: TDateTime; procedure SetInstallDate(const Value: TDateTime); + function GetSourceSettings: TArray; + procedure CreateDefaultSource; + procedure LoadSources; + procedure SaveSources; + procedure SetSourceSettings(const Value: TArray); public + constructor Create(const ASettingsFactory: TDNPackageSourceSettingsFactory); + destructor Destroy; override; procedure Clear(); property InstallationDirectory: string read GetInstallationDirectory write SetInstallationDirectory; property OAuthToken: string read GetOAuthToken write SetOAuthToken; property Version: string read GetVersion write SetVersion; property InstallDate: TDateTime read GetInstallDate write SetInstallDate; + property SourceSettings: TArray read GetSourceSettings write SetSourceSettings; end; implementation uses + Classes, Windows, Registry, SysUtils, DateUtils, - StrUtils; + StrUtils, + IOUtils, + DN.PackageSource.Settings.Field.Intf; const CInstallationDirectory = 'InstallationDirectory'; @@ -41,12 +58,14 @@ implementation CVersion = 'Version'; CInstallDate = 'InstallDate'; CDelphinusKey = 'Software\Delphinus'; + CDelphinusSourcesKey = CDelphinusKey + '\Sources'; CRootKey = HKEY_CURRENT_USER; CDateFormat = 'yyyy-mm-dd'; CDateSeperator = '-'; CTimeFormat = 'hh:nn:ss:zzz'; CTimeSeperator = ':'; CDateTimeFormat = CDateFormat + ' ' + CTimeFormat; + CSourceType = 'SourceType'; { TDNSettings } @@ -63,6 +82,31 @@ procedure TDNSettings.Clear; end; end; +constructor TDNSettings.Create(const ASettingsFactory: TDNPackageSourceSettingsFactory); +begin + inherited Create(); + FSourceSettings := TList.Create(); + FSettingsFactory := ASettingsFactory; +end; + +procedure TDNSettings.CreateDefaultSource; +var + LSetting: IDNPackageSourceSettings; +begin + if FSettingsFactory('GitHub', LSetting) then + begin + LSetting.Name := 'GitHub'; + LSetting.Field['OAuthToken'].Value := OAuthToken; + FSourceSettings.Add(LSetting); + end; +end; + +destructor TDNSettings.Destroy; +begin + FSourceSettings.Free(); + inherited; +end; + function TDNSettings.GetInstallationDirectory: string; begin Result := ReadString(CInstallationDirectory) @@ -92,11 +136,70 @@ function TDNSettings.GetOAuthToken: string; Result := ReadString(COAuthToken); end; +function TDNSettings.GetSourceSettings: TArray; +begin + if FSourceSettings.Count = 0 then + LoadSources(); + if FSourceSettings.Count = 0 then + CreateDefaultSource(); + Result := FSourceSettings.ToArray; +end; + function TDNSettings.GetVersion: string; begin Result := ReadString(CVersion); end; +procedure TDNSettings.LoadSources; +var + LRegistry: TRegistry; + LKeys: TStringList; + LKey, LSourceType: string; + LSettings: IDNPackageSourceSettings; + LField: IDNPackageSourceSettingsField; +begin + FSourceSettings.Clear(); + LRegistry := TRegistry.Create(); + try + LRegistry.RootKey := CRootKey; + if LRegistry.OpenKeyReadOnly(CDelphinusSourcesKey) then + begin + LKeys := TStringList.Create(); + try + LRegistry.GetKeyNames(LKeys); + LRegistry.CloseKey; + for LKey in LKeys do + begin + if LRegistry.OpenKeyReadOnly(CDelphinusSourcesKey + '\' + LKey) and LRegistry.ValueExists(CSourceType) then + begin + LSourceType := LRegistry.ReadString(CSourceType); + if FSettingsFactory(LSourceType, LSettings) then + begin + LSettings.Name := LKey; + for LField in LSettings.Fields do + begin + if LRegistry.ValueExists(LField.Name) then + begin + case LField.ValueType of + ftString: LField.Value := LRegistry.ReadString(LField.Name); + ftInteger: LField.Value := LRegistry.ReadInteger(LField.Name); + end; + end; + end; + FSourceSettings.Add(LSettings); + end; + LRegistry.CloseKey; + end; + end; + finally + LKeys.Free(); + end; + end; + finally + LRegistry.Free; + end; +end; + function TDNSettings.ReadString(const AValueName: string): string; var LRegistry: TRegistry; @@ -115,6 +218,46 @@ function TDNSettings.ReadString(const AValueName: string): string; end; end; +procedure TDNSettings.SaveSources; +var + LRegistry: TRegistry; + LSetting: IDNPackageSourceSettings; + LField: IDNPackageSourceSettingsField; + LPath: string; +begin + LRegistry := TRegistry.Create(); + try + LRegistry.RootKey := CRootKey; + if (not LRegistry.KeyExists(CDelphinusSourcesKey) or LRegistry.DeleteKey(CDelphinusSourcesKey)) then + begin + for LSetting in FSourceSettings do + begin + LPath := TPath.Combine(CDelphinusSourcesKey, LSetting.Name); + if LRegistry.OpenKey(LPath, True) then + begin + try + LRegistry.WriteString(CSourceType, LSetting.SourceName); + for LField in LSetting.Fields do + begin + if not LField.Value.IsEmpty then + begin + case LField.ValueType of + ftString: LRegistry.WriteString(LField.Name, LField.Value.AsString); + ftInteger: LRegistry.WriteInteger(LField.Name, LField.Value.AsInteger); + end; + end; + end; + finally + LRegistry.CloseKey(); + end; + end; + end; + end; + finally + LRegistry.Free; + end; +end; + procedure TDNSettings.SetInstallationDirectory(const Value: string); begin WriteString(CInstallationDirectory, Value); @@ -130,6 +273,14 @@ procedure TDNSettings.SetOAuthToken(const Value: string); WriteString(COAuthToken, Value); end; +procedure TDNSettings.SetSourceSettings( + const Value: TArray); +begin + FSourceSettings.Clear(); + FSourceSettings.AddRange(Value); + SaveSources(); +end; + procedure TDNSettings.SetVersion(const Value: string); begin WriteString(CVersion, Value); diff --git a/Icons/Add.ico b/Icons/Add.ico new file mode 100644 index 0000000..9fdc240 Binary files /dev/null and b/Icons/Add.ico differ diff --git a/Packages/DelphiX-Berlin/Delphinus.Theming.pas b/Packages/DelphiX-Berlin/Delphinus.Theming.pas new file mode 100644 index 0000000..852c5a3 --- /dev/null +++ b/Packages/DelphiX-Berlin/Delphinus.Theming.pas @@ -0,0 +1,42 @@ +unit Delphinus.Theming; + +interface + +uses + SysUtils, + Graphics, + Windows; + +const + CBlendPrimary = 0.87; + CBlendSecondary = 0.54; + CBlendDisabled = 0.38; + CBlendDivider = 0.12; + + CPrimaryColor: TColor = $fe4f30; //$304ffe; + CAccentColor: TColor = $5b18c2;//$c2185b; + +function BlendColor(ABackground, AForeground: TColor; AForegroundAlpha: Single): TColor; + +implementation + +type + TColorRec = packed record + R, G, B, A: Byte; + end; + +function BlendColor(ABackground, AForeground: TColor; AForegroundAlpha: Single): TColor; +var + LBackgroundAlpha: Single; + LBackground, LForeground: TColorRec; +begin + LBackgroundAlpha := 1 - AForegroundAlpha; + LBackground := TColorRec(ColorToRGB(ABackground)); + LForeground := TColorRec(ColorToRGB(AForeground)); + TColorRec(Result).R := Round(LBackground.R * LBackgroundAlpha + LForeground.R * AForegroundAlpha); + TColorRec(Result).G := Round(LBackground.G * LBackgroundAlpha + LForeground.G * AForegroundAlpha); + TColorRec(Result).B := Round(LBackground.B * LBackgroundAlpha + LForeground.B * AForegroundAlpha); + TColorRec(Result).A := Round(LBackground.A * LBackgroundAlpha + LForeground.A * AForegroundAlpha); +end; + +end. diff --git a/Packages/DelphiX-Berlin/Delphinus.dpk b/Packages/DelphiX-Berlin/Delphinus.dpk new file mode 100644 index 0000000..e9b4adc --- /dev/null +++ b/Packages/DelphiX-Berlin/Delphinus.dpk @@ -0,0 +1,194 @@ +package Delphinus; + +{$R *.res} +{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES ON} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DEFINE DEBUG} +{$ENDIF IMPLICITBUILDING} +{$DESIGNONLY} +{$IMPLICITBUILD ON} + +requires + rtl, + DesignIDE, + vclimg, + vcl; + +contains + Delphinus.Theming in 'Delphinus.Theming.pas', + Delphinus.About in '..\Delphinus.About.pas' {AboutDialog}, + Delphinus.CategoryFilterView in '..\Delphinus.CategoryFilterView.pas' {CategoryFilterView: TFrame}, + Delphinus.Controller in '..\Delphinus.Controller.pas', + Delphinus.DelphiInstallation.View in '..\Delphinus.DelphiInstallation.View.pas' {DelphiInstallationView: TFrame}, + Delphinus.DependencyDialog in '..\Delphinus.DependencyDialog.pas' {DependencyDialog}, + Delphinus.Dialog in '..\Delphinus.Dialog.pas' {DelphinusDialog}, + Delphinus.Forms in '..\Delphinus.Forms.pas', + Delphinus.LicenseDialog in '..\Delphinus.LicenseDialog.pas' {LicenseDialog}, + Delphinus.Main in '..\Delphinus.Main.pas', + Delphinus.OptionsDialog in '..\Delphinus.OptionsDialog.pas' {DelphinusOptionsDialog}, + Delphinus.OptionsDialog.TypeSelection in '..\Delphinus.OptionsDialog.TypeSelection.pas' {TypeSelectionDialog}, + Delphinus.ProgressDialog in '..\Delphinus.ProgressDialog.pas' {ProgressDialog}, + Delphinus.Resources.Names in '..\Delphinus.Resources.Names.pas', + Delphinus.Resources in '..\Delphinus.Resources.pas', + Delphinus.SetupDialog in '..\Delphinus.SetupDialog.pas' {SetupDialog}, + Delphinus.UiTypes in '..\Delphinus.UiTypes.pas', + Delphinus.Version in '..\Delphinus.Version.pas', + DN.ActiveX in '..\..\DN.ActiveX.pas', + DN.BPLService.Intf in '..\..\DN.BPLService.Intf.pas', + DN.BPLService.Registry in '..\..\DN.BPLService.Registry.pas', + DN.BPLService.ToolsApi in '..\..\DN.BPLService.ToolsApi.pas', + DN.Character in '..\..\DN.Character.pas', + DN.ComCtrls.Helper in '..\..\DN.ComCtrls.Helper.pas', + DN.Compiler.IDE in '..\..\DN.Compiler.IDE.pas', + DN.Compiler.Intf in '..\..\DN.Compiler.Intf.pas', + DN.Compiler.MSBuild in '..\..\DN.Compiler.MSBuild.pas', + DN.Compiler in '..\..\DN.Compiler.pas', + DN.Compiler.ValueOverrides.Factory in '..\..\DN.Compiler.ValueOverrides.Factory.pas', + DN.Compiler.ValueOverrides.Intf in '..\..\DN.Compiler.ValueOverrides.Intf.pas', + DN.Compiler.ValueOverrides in '..\..\DN.Compiler.ValueOverrides.pas', + DN.Controls.Button in '..\..\DN.Controls.Button.pas', + DN.Controls in '..\..\DN.Controls.pas', + DN.DelphiInstallation.Editions in '..\..\DN.DelphiInstallation.Editions.pas', + DN.DelphiInstallation.Intf in '..\..\DN.DelphiInstallation.Intf.pas', + DN.DelphiInstallation in '..\..\DN.DelphiInstallation.pas', + DN.DelphiInstallation.Provider.Intf in '..\..\DN.DelphiInstallation.Provider.Intf.pas', + DN.DelphiInstallation.Provider in '..\..\DN.DelphiInstallation.Provider.pas', + DN.DPRProperties.Intf in '..\..\DN.DPRProperties.Intf.pas', + DN.DPRProperties in '..\..\DN.DPRProperties.pas', + DN.Environment in '..\..\DN.Environment.pas', + DN.EnvironmentOptions.IDE in '..\..\DN.EnvironmentOptions.IDE.pas', + DN.EnvironmentOptions.Intf in '..\..\DN.EnvironmentOptions.Intf.pas', + DN.EnvironmentOptions in '..\..\DN.EnvironmentOptions.pas', + DN.EnvironmentOptions.Registry in '..\..\DN.EnvironmentOptions.Registry.pas', + DN.ExpertService.Intf in '..\..\DN.ExpertService.Intf.pas', + DN.ExpertService in '..\..\DN.ExpertService.pas', + DN.FileService.Intf in '..\..\DN.FileService.Intf.pas', + DN.FileService in '..\..\DN.FileService.pas', + DN.Graphics.Loader in '..\..\DN.Graphics.Loader.pas', + DN.Graphics in '..\..\DN.Graphics.pas', + DN.HttpClient.Cache.Intf in '..\..\DN.HttpClient.Cache.Intf.pas', + DN.HttpClient.Cache in '..\..\DN.HttpClient.Cache.pas', + DN.HttpClient.Intf in '..\..\DN.HttpClient.Intf.pas', + DN.HttpClient in '..\..\DN.HttpClient.pas', + DN.HttpClient.WinHttp in '..\..\DN.HttpClient.WinHttp.pas', + DN.Import.WinHttp in '..\..\DN.Import.WinHttp.pas', + DN.Installer.Delphinus in '..\..\DN.Installer.Delphinus.pas', + DN.Installer.IDE in '..\..\DN.Installer.IDE.pas', + DN.Installer.Intf in '..\..\DN.Installer.Intf.pas', + DN.Installer in '..\..\DN.Installer.pas', + DN.IOUtils in '..\..\DN.IOUtils.pas', + DN.JSon in '..\..\DN.JSon.pas', + DN.JSonFile.CacheInfo in '..\..\DN.JSonFile.CacheInfo.pas', + DN.JSonFile.Info in '..\..\DN.JSonFile.Info.pas', + DN.JSonFile.Installation in '..\..\DN.JSonFile.Installation.pas', + DN.JSonFile.InstalledInfo in '..\..\DN.JSonFile.InstalledInfo.pas', + DN.JSonFile in '..\..\DN.JSonFile.pas', + DN.JSonFile.Uninstallation in '..\..\DN.JSonFile.Uninstallation.pas', + DN.Package.Dependency.Intf in '..\..\DN.Package.Dependency.Intf.pas', + DN.Package.Dependency in '..\..\DN.Package.Dependency.pas', + DN.Package.DirectoryLoader.Intf in '..\..\DN.Package.DirectoryLoader.Intf.pas', + DN.Package.DirectoryLoader in '..\..\DN.Package.DirectoryLoader.pas', + DN.Package.Finder.Intf in '..\..\DN.Package.Finder.Intf.pas', + DN.Package.Finder in '..\..\DN.Package.Finder.pas', + DN.Package.Github in '..\..\DN.Package.Github.pas', + DN.Package.Gitlab in '..\..\DN.Package.Gitlab.pas', + DN.Package.Intf in '..\..\DN.Package.Intf.pas', + DN.Package in '..\..\DN.Package.pas', + DN.Package.Version.Finder.Intf in '..\..\DN.Package.Version.Finder.Intf.pas', + DN.Package.Version.Finder in '..\..\DN.Package.Version.Finder.pas', + DN.Package.Version.Intf in '..\..\DN.Package.Version.Intf.pas', + DN.Package.Version in '..\..\DN.Package.Version.pas', + DN.PackageDetailView in '..\..\DN.PackageDetailView.pas' {PackageDetailView: TFrame}, + DN.PackageFilter in '..\..\DN.PackageFilter.pas', + DN.PackageOverview in '..\..\DN.PackageOverview.pas', + DN.PackageProvider.Folder in '..\..\DN.PackageProvider.Folder.pas', + DN.PackageProvider.GitHub in '..\..\DN.PackageProvider.GitHub.pas', + DN.PackageProvider.GitHub.State in '..\..\DN.PackageProvider.GitHub.State.pas', + DN.PackageProvider.GitHubRepo in '..\..\DN.PackageProvider.GitHubRepo.pas', + DN.PackageProvider.GitLab in '..\..\DN.PackageProvider.GitLab.pas', + DN.PackageProvider.GitLab.State in '..\..\DN.PackageProvider.GitLab.State.pas', + DN.PackageProvider.Installed in '..\..\DN.PackageProvider.Installed.pas', + DN.PackageProvider.Intf in '..\..\DN.PackageProvider.Intf.pas', + DN.PackageProvider.MultiSource in '..\..\DN.PackageProvider.MultiSource.pas', + DN.PackageProvider in '..\..\DN.PackageProvider.pas', + DN.PackageProvider.State.Intf in '..\..\DN.PackageProvider.State.Intf.pas', + DN.PackageProvider.State in '..\..\DN.PackageProvider.State.pas', + DN.PackageSource.ConfigPage.Folder in '..\..\DN.PackageSource.ConfigPage.Folder.pas' {DNFolderConfigPage: TFrame}, + DN.PackageSource.ConfigPage.Github in '..\..\DN.PackageSource.ConfigPage.Github.pas' {DNGithubSourceConfigPage: TFrame}, + DN.PackageSource.ConfigPage.Gitlab in '..\..\DN.PackageSource.ConfigPage.Gitlab.pas' {DNGitlabSourceConfigPage: TFrame}, + DN.PackageSource.ConfigPage.Intf in '..\..\DN.PackageSource.ConfigPage.Intf.pas', + DN.PackageSource.ConfigPage in '..\..\DN.PackageSource.ConfigPage.pas', + DN.PackageSource.Folder in '..\..\DN.PackageSource.Folder.pas', + DN.PackageSource.Github in '..\..\DN.PackageSource.Github.pas', + DN.PackageSource.Gitlab in '..\..\DN.PackageSource.Gitlab.pas', + DN.PackageSource.Intf in '..\..\DN.PackageSource.Intf.pas', + DN.PackageSource in '..\..\DN.PackageSource.pas', + DN.PackageSource.Registry.Intf in '..\..\DN.PackageSource.Registry.Intf.pas', + DN.PackageSource.Registry in '..\..\DN.PackageSource.Registry.pas', + DN.PackageSource.Settings.Field.Intf in '..\..\DN.PackageSource.Settings.Field.Intf.pas', + DN.PackageSource.Settings.Field in '..\..\DN.PackageSource.Settings.Field.pas', + DN.PackageSource.Settings.Folder in '..\..\DN.PackageSource.Settings.Folder.pas', + DN.PackageSource.Settings.Github in '..\..\DN.PackageSource.Settings.Github.pas', + DN.PackageSource.Settings.Gitlab in '..\..\DN.PackageSource.Settings.Gitlab.pas', + DN.PackageSource.Settings.Intf in '..\..\DN.PackageSource.Settings.Intf.pas', + DN.PackageSource.Settings in '..\..\DN.PackageSource.Settings.pas', + DN.Preview in '..\..\DN.Preview.pas', + DN.Progress.Intf in '..\..\DN.Progress.Intf.pas', + DN.Progress in '..\..\DN.Progress.pas', + DN.ProjectGroupInfo.Intf in '..\..\DN.ProjectGroupInfo.Intf.pas', + DN.ProjectGroupInfo in '..\..\DN.ProjectGroupInfo.pas', + DN.ProjectInfo.Intf in '..\..\DN.ProjectInfo.Intf.pas', + DN.ProjectInfo in '..\..\DN.ProjectInfo.pas', + DN.Settings.Intf in '..\..\DN.Settings.Intf.pas', + DN.Settings in '..\..\DN.Settings.pas', + DN.Setup.Core in '..\..\DN.Setup.Core.pas', + DN.Setup.Dependency.Intf in '..\..\DN.Setup.Dependency.Intf.pas', + DN.Setup.Dependency in '..\..\DN.Setup.Dependency.pas', + DN.Setup.Dependency.Processor.Intf in '..\..\DN.Setup.Dependency.Processor.Intf.pas', + DN.Setup.Dependency.Processor in '..\..\DN.Setup.Dependency.Processor.pas', + DN.Setup.Dependency.Resolver.Install in '..\..\DN.Setup.Dependency.Resolver.Install.pas', + DN.Setup.Dependency.Resolver.Intf in '..\..\DN.Setup.Dependency.Resolver.Intf.pas', + DN.Setup.Dependency.Resolver.UnInstall in '..\..\DN.Setup.Dependency.Resolver.UnInstall.pas', + DN.Setup.Intf in '..\..\DN.Setup.Intf.pas', + DN.Setup in '..\..\DN.Setup.pas', + DN.TextTable.Intf in '..\..\DN.TextTable.Intf.pas', + DN.TextTable in '..\..\DN.TextTable.pas', + DN.ToolsApi in '..\..\DN.ToolsApi.pas', + DN.Types in '..\..\DN.Types.pas', + DN.Uninstaller.Delphinus in '..\..\DN.Uninstaller.Delphinus.pas', + DN.Uninstaller.IDE in '..\..\DN.Uninstaller.IDE.pas', + DN.Uninstaller.Intf in '..\..\DN.Uninstaller.Intf.pas', + DN.Uninstaller in '..\..\DN.Uninstaller.pas', + DN.Utils in '..\..\DN.Utils.pas', + DN.VariableResolver.Compiler.Factory in '..\..\DN.VariableResolver.Compiler.Factory.pas', + DN.VariableResolver.Compiler in '..\..\DN.VariableResolver.Compiler.pas', + DN.VariableResolver.Intf in '..\..\DN.VariableResolver.Intf.pas', + DN.VariableResolver in '..\..\DN.VariableResolver.pas', + DN.Version in '..\..\DN.Version.pas', + DN.Zip in '..\..\DN.Zip.pas'; + +end. + + + + diff --git a/Packages/DelphiX-Berlin/Delphinus.dproj b/Packages/DelphiX-Berlin/Delphinus.dproj new file mode 100644 index 0000000..206d39f --- /dev/null +++ b/Packages/DelphiX-Berlin/Delphinus.dproj @@ -0,0 +1,704 @@ + + + {0990B172-C221-4312-816E-1E634AF7EE2C} + Delphinus.dpk + 18.2 + VCL + True + Debug + Win32 + 1 + Package + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + ..;$(DCC_UnitSearchPath) + System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) + true + Delphinus + true + true + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + false + false + false + false + false + + + rtl;dbrtl;DbxCommonDriver;IndyCore;IndySystem;IndyProtocols;$(DCC_UsePackage) + + + rtl;vclimg;dbrtl;DbxCommonDriver;IndyCore;IndySystem;IndyProtocols;vcl;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + + + rtl;vclimg;dbrtl;DbxCommonDriver;IndyCore;IndySystem;IndyProtocols;vcl;$(DCC_UsePackage) + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + $(BDS)\bin\bds.exe + false + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + + MainSource + + + + + + + +
AboutDialog
+ dfm +
+ +
CategoryFilterView
+ dfm + TFrame +
+ + +
DelphiInstallationView
+ dfm + TFrame +
+ +
DependencyDialog
+ dfm +
+ +
DelphinusDialog
+ dfm +
+ + +
LicenseDialog
+ dfm +
+ + +
DelphinusOptionsDialog
+ dfm +
+ +
TypeSelectionDialog
+ dfm +
+ +
ProgressDialog
+ dfm +
+ + + +
SetupDialog
+ dfm +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageDetailView
+ dfm + TFrame +
+ + + + + + + + + + + + + + + +
DNFolderConfigPage
+ dfm + TFrame +
+ +
DNGithubSourceConfigPage
+ dfm + TFrame +
+ +
DNGitlabSourceConfigPage
+ dfm + TFrame +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DelphinusImages.res
+
+ +
Delphinus.res
+
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + Delphi.Personality.12 + Package + + + + Delphinus.dpk + + + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + + + Delphinus.bpl + true + + + + + 0 + .dll;.bpl + + + 1 + .dylib + + + + + Contents\Resources + 1 + + + + + classes + 1 + + + + + Contents\MacOS + 0 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\drawable-xxhdpi + 1 + + + + + library\lib\mips + 1 + + + + + 1 + + + 1 + + + 0 + + + 1 + + + 1 + + + library\lib\armeabi-v7a + 1 + + + 1 + + + + + 0 + + + 1 + .framework + + + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + 1 + + + 1 + + + 1 + + + + + + library\lib\armeabi + 1 + + + + + 0 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\drawable-normal + 1 + + + + + res\drawable-xhdpi + 1 + + + + + res\drawable-large + 1 + + + + + 1 + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + res\drawable-hdpi + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + + + Assets + 1 + + + Assets + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\values + 1 + + + + + res\drawable-small + 1 + + + + + res\drawable + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + + + res\drawable + 1 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 0 + .bpl + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + + + res\drawable-mdpi + 1 + + + + + res\drawable-xlarge + 1 + + + + + res\drawable-ldpi + 1 + + + + + + + + + + + + + + False + True + False + + + 12 + + + + +
diff --git a/Packages/DelphiX-Berlin/Delphinus.res b/Packages/DelphiX-Berlin/Delphinus.res new file mode 100644 index 0000000..36f26e2 Binary files /dev/null and b/Packages/DelphiX-Berlin/Delphinus.res differ diff --git a/Packages/DelphiX-Berlin/DelphinusImages.res b/Packages/DelphiX-Berlin/DelphinusImages.res new file mode 100644 index 0000000..a121995 Binary files /dev/null and b/Packages/DelphiX-Berlin/DelphinusImages.res differ diff --git a/Packages/DelphiX-Rio/Delphinus.Theming.pas b/Packages/DelphiX-Rio/Delphinus.Theming.pas new file mode 100644 index 0000000..852c5a3 --- /dev/null +++ b/Packages/DelphiX-Rio/Delphinus.Theming.pas @@ -0,0 +1,42 @@ +unit Delphinus.Theming; + +interface + +uses + SysUtils, + Graphics, + Windows; + +const + CBlendPrimary = 0.87; + CBlendSecondary = 0.54; + CBlendDisabled = 0.38; + CBlendDivider = 0.12; + + CPrimaryColor: TColor = $fe4f30; //$304ffe; + CAccentColor: TColor = $5b18c2;//$c2185b; + +function BlendColor(ABackground, AForeground: TColor; AForegroundAlpha: Single): TColor; + +implementation + +type + TColorRec = packed record + R, G, B, A: Byte; + end; + +function BlendColor(ABackground, AForeground: TColor; AForegroundAlpha: Single): TColor; +var + LBackgroundAlpha: Single; + LBackground, LForeground: TColorRec; +begin + LBackgroundAlpha := 1 - AForegroundAlpha; + LBackground := TColorRec(ColorToRGB(ABackground)); + LForeground := TColorRec(ColorToRGB(AForeground)); + TColorRec(Result).R := Round(LBackground.R * LBackgroundAlpha + LForeground.R * AForegroundAlpha); + TColorRec(Result).G := Round(LBackground.G * LBackgroundAlpha + LForeground.G * AForegroundAlpha); + TColorRec(Result).B := Round(LBackground.B * LBackgroundAlpha + LForeground.B * AForegroundAlpha); + TColorRec(Result).A := Round(LBackground.A * LBackgroundAlpha + LForeground.A * AForegroundAlpha); +end; + +end. diff --git a/Packages/DelphiX-Rio/Delphinus.dpk b/Packages/DelphiX-Rio/Delphinus.dpk new file mode 100644 index 0000000..f62706a --- /dev/null +++ b/Packages/DelphiX-Rio/Delphinus.dpk @@ -0,0 +1,193 @@ +package Delphinus; + +{$R *.res} +{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES ON} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DEFINE DEBUG} +{$ENDIF IMPLICITBUILDING} +{$DESIGNONLY} +{$IMPLICITBUILD ON} + +requires + rtl, + DesignIDE, + vclimg, + vcl; + +contains + Delphinus.Main in '..\Delphinus.Main.pas', + Delphinus.Controller in '..\Delphinus.Controller.pas', + Delphinus.Dialog in '..\Delphinus.Dialog.pas' {DelphinusDialog}, + Delphinus.SetupDialog in '..\Delphinus.SetupDialog.pas' {SetupDialog}, + Delphinus.UiTypes in '..\Delphinus.UiTypes.pas', + Delphinus.Forms in '..\Delphinus.Forms.pas', + Delphinus.Resources.Names in '..\Delphinus.Resources.Names.pas', + Delphinus.OptionsDialog in '..\Delphinus.OptionsDialog.pas' {DelphinusOptionsDialog}, + Delphinus.Version in '..\Delphinus.Version.pas', + Delphinus.LicenseDialog in '..\Delphinus.LicenseDialog.pas' {LicenseDialog}, + Delphinus.CategoryFilterView in '..\Delphinus.CategoryFilterView.pas' {CategoryFilterView: TFrame}, + Delphinus.ProgressDialog in '..\Delphinus.ProgressDialog.pas' {ProgressDialog}, + Delphinus.Theming in 'Delphinus.Theming.pas', + Delphinus.Resources in '..\Delphinus.Resources.pas', + Delphinus.About in '..\Delphinus.About.pas' {AboutDialog}, + Delphinus.DependencyDialog in '..\Delphinus.DependencyDialog.pas' {DependencyDialog}, + Delphinus.OptionsDialog.TypeSelection in '..\Delphinus.OptionsDialog.TypeSelection.pas' {TypeSelectionDialog}, + DN.ActiveX in '..\..\DN.ActiveX.pas', + DN.BPLService.Intf in '..\..\DN.BPLService.Intf.pas', + DN.BPLService.Registry in '..\..\DN.BPLService.Registry.pas', + DN.BPLService.ToolsApi in '..\..\DN.BPLService.ToolsApi.pas', + DN.Character in '..\..\DN.Character.pas', + DN.ComCtrls.Helper in '..\..\DN.ComCtrls.Helper.pas', + DN.Compiler.IDE in '..\..\DN.Compiler.IDE.pas', + DN.Compiler.Intf in '..\..\DN.Compiler.Intf.pas', + DN.Compiler.MSBuild in '..\..\DN.Compiler.MSBuild.pas', + DN.Compiler in '..\..\DN.Compiler.pas', + DN.Compiler.ValueOverrides.Factory in '..\..\DN.Compiler.ValueOverrides.Factory.pas', + DN.Compiler.ValueOverrides.Intf in '..\..\DN.Compiler.ValueOverrides.Intf.pas', + DN.Compiler.ValueOverrides in '..\..\DN.Compiler.ValueOverrides.pas', + DN.Controls.Button in '..\..\DN.Controls.Button.pas', + DN.Controls in '..\..\DN.Controls.pas', + DN.DelphiInstallation.Editions in '..\..\DN.DelphiInstallation.Editions.pas', + DN.DelphiInstallation.Intf in '..\..\DN.DelphiInstallation.Intf.pas', + DN.DelphiInstallation in '..\..\DN.DelphiInstallation.pas', + DN.DelphiInstallation.Provider.Intf in '..\..\DN.DelphiInstallation.Provider.Intf.pas', + DN.DelphiInstallation.Provider in '..\..\DN.DelphiInstallation.Provider.pas', + DN.DPRProperties.Intf in '..\..\DN.DPRProperties.Intf.pas', + DN.DPRProperties in '..\..\DN.DPRProperties.pas', + DN.Environment in '..\..\DN.Environment.pas', + DN.EnvironmentOptions.IDE in '..\..\DN.EnvironmentOptions.IDE.pas', + DN.EnvironmentOptions.Intf in '..\..\DN.EnvironmentOptions.Intf.pas', + DN.EnvironmentOptions in '..\..\DN.EnvironmentOptions.pas', + DN.EnvironmentOptions.Registry in '..\..\DN.EnvironmentOptions.Registry.pas', + DN.ExpertService.Intf in '..\..\DN.ExpertService.Intf.pas', + DN.ExpertService in '..\..\DN.ExpertService.pas', + DN.FileService.Intf in '..\..\DN.FileService.Intf.pas', + DN.FileService in '..\..\DN.FileService.pas', + DN.Graphics.Loader in '..\..\DN.Graphics.Loader.pas', + DN.Graphics in '..\..\DN.Graphics.pas', + DN.HttpClient.Cache.Intf in '..\..\DN.HttpClient.Cache.Intf.pas', + DN.HttpClient.Cache in '..\..\DN.HttpClient.Cache.pas', + DN.HttpClient.Intf in '..\..\DN.HttpClient.Intf.pas', + DN.HttpClient in '..\..\DN.HttpClient.pas', + DN.HttpClient.WinHttp in '..\..\DN.HttpClient.WinHttp.pas', + DN.Import.WinHttp in '..\..\DN.Import.WinHttp.pas', + DN.Installer.Delphinus in '..\..\DN.Installer.Delphinus.pas', + DN.Installer.IDE in '..\..\DN.Installer.IDE.pas', + DN.Installer.Intf in '..\..\DN.Installer.Intf.pas', + DN.Installer in '..\..\DN.Installer.pas', + DN.IOUtils in '..\..\DN.IOUtils.pas', + DN.JSon in '..\..\DN.JSon.pas', + DN.JSonFile.CacheInfo in '..\..\DN.JSonFile.CacheInfo.pas', + DN.JSonFile.Info in '..\..\DN.JSonFile.Info.pas', + DN.JSonFile.Installation in '..\..\DN.JSonFile.Installation.pas', + DN.JSonFile.InstalledInfo in '..\..\DN.JSonFile.InstalledInfo.pas', + DN.JSonFile in '..\..\DN.JSonFile.pas', + DN.JSonFile.Uninstallation in '..\..\DN.JSonFile.Uninstallation.pas', + DN.Package.Dependency.Intf in '..\..\DN.Package.Dependency.Intf.pas', + DN.Package.Dependency in '..\..\DN.Package.Dependency.pas', + DN.Package.DirectoryLoader.Intf in '..\..\DN.Package.DirectoryLoader.Intf.pas', + DN.Package.DirectoryLoader in '..\..\DN.Package.DirectoryLoader.pas', + DN.Package.Finder.Intf in '..\..\DN.Package.Finder.Intf.pas', + DN.Package.Finder in '..\..\DN.Package.Finder.pas', + DN.Package.Github in '..\..\DN.Package.Github.pas', + DN.Package.Intf in '..\..\DN.Package.Intf.pas', + DN.Package in '..\..\DN.Package.pas', + DN.Package.Version.Finder.Intf in '..\..\DN.Package.Version.Finder.Intf.pas', + DN.Package.Version.Finder in '..\..\DN.Package.Version.Finder.pas', + DN.Package.Version.Intf in '..\..\DN.Package.Version.Intf.pas', + DN.Package.Version in '..\..\DN.Package.Version.pas', + DN.PackageDetailView in '..\..\DN.PackageDetailView.pas' {PackageDetailView: TFrame}, + DN.PackageFilter in '..\..\DN.PackageFilter.pas', + DN.PackageOverview in '..\..\DN.PackageOverview.pas', + DN.PackageProvider.Folder in '..\..\DN.PackageProvider.Folder.pas', + DN.PackageProvider.GitHub in '..\..\DN.PackageProvider.GitHub.pas', + DN.PackageProvider.GitHub.State in '..\..\DN.PackageProvider.GitHub.State.pas', + DN.PackageProvider.GitHubRepo in '..\..\DN.PackageProvider.GitHubRepo.pas', + DN.PackageProvider.GitLab in '..\..\DN.PackageProvider.GitLab.pas', + DN.PackageProvider.GitLab.State in '..\..\DN.PackageProvider.GitLab.State.pas', + DN.PackageProvider.Installed in '..\..\DN.PackageProvider.Installed.pas', + DN.PackageProvider.Intf in '..\..\DN.PackageProvider.Intf.pas', + DN.PackageProvider.MultiSource in '..\..\DN.PackageProvider.MultiSource.pas', + DN.PackageProvider in '..\..\DN.PackageProvider.pas', + DN.PackageProvider.State.Intf in '..\..\DN.PackageProvider.State.Intf.pas', + DN.PackageProvider.State in '..\..\DN.PackageProvider.State.pas', + DN.PackageSource.ConfigPage.Folder in '..\..\DN.PackageSource.ConfigPage.Folder.pas' {DNFolderConfigPage: TFrame}, + DN.PackageSource.ConfigPage.Github in '..\..\DN.PackageSource.ConfigPage.Github.pas' {DNGithubSourceConfigPage: TFrame}, + DN.PackageSource.ConfigPage.Gitlab in '..\..\DN.PackageSource.ConfigPage.Gitlab.pas' {DNGitlabSourceConfigPage: TFrame}, + DN.PackageSource.ConfigPage.Intf in '..\..\DN.PackageSource.ConfigPage.Intf.pas', + DN.PackageSource.ConfigPage in '..\..\DN.PackageSource.ConfigPage.pas', + DN.PackageSource.Folder in '..\..\DN.PackageSource.Folder.pas', + DN.PackageSource.Github in '..\..\DN.PackageSource.Github.pas', + DN.PackageSource.Intf in '..\..\DN.PackageSource.Intf.pas', + DN.PackageSource in '..\..\DN.PackageSource.pas', + DN.PackageSource.Registry.Intf in '..\..\DN.PackageSource.Registry.Intf.pas', + DN.PackageSource.Registry in '..\..\DN.PackageSource.Registry.pas', + DN.PackageSource.Settings.Field.Intf in '..\..\DN.PackageSource.Settings.Field.Intf.pas', + DN.PackageSource.Settings.Field in '..\..\DN.PackageSource.Settings.Field.pas', + DN.PackageSource.Settings.Folder in '..\..\DN.PackageSource.Settings.Folder.pas', + DN.PackageSource.Settings.Github in '..\..\DN.PackageSource.Settings.Github.pas', + DN.PackageSource.Settings.Gitlab in '..\..\DN.PackageSource.Settings.Gitlab.pas', + DN.PackageSource.Settings.Intf in '..\..\DN.PackageSource.Settings.Intf.pas', + DN.PackageSource.Settings in '..\..\DN.PackageSource.Settings.pas', + DN.Preview in '..\..\DN.Preview.pas', + DN.Progress.Intf in '..\..\DN.Progress.Intf.pas', + DN.Progress in '..\..\DN.Progress.pas', + DN.ProjectGroupInfo.Intf in '..\..\DN.ProjectGroupInfo.Intf.pas', + DN.ProjectGroupInfo in '..\..\DN.ProjectGroupInfo.pas', + DN.ProjectInfo.Intf in '..\..\DN.ProjectInfo.Intf.pas', + DN.ProjectInfo in '..\..\DN.ProjectInfo.pas', + DN.Settings.Intf in '..\..\DN.Settings.Intf.pas', + DN.Settings in '..\..\DN.Settings.pas', + DN.Setup.Core in '..\..\DN.Setup.Core.pas', + DN.Setup.Dependency.Intf in '..\..\DN.Setup.Dependency.Intf.pas', + DN.Setup.Dependency in '..\..\DN.Setup.Dependency.pas', + DN.Setup.Dependency.Processor.Intf in '..\..\DN.Setup.Dependency.Processor.Intf.pas', + DN.Setup.Dependency.Processor in '..\..\DN.Setup.Dependency.Processor.pas', + DN.Setup.Dependency.Resolver.Install in '..\..\DN.Setup.Dependency.Resolver.Install.pas', + DN.Setup.Dependency.Resolver.Intf in '..\..\DN.Setup.Dependency.Resolver.Intf.pas', + DN.Setup.Dependency.Resolver.UnInstall in '..\..\DN.Setup.Dependency.Resolver.UnInstall.pas', + DN.Setup.Intf in '..\..\DN.Setup.Intf.pas', + DN.Setup in '..\..\DN.Setup.pas', + DN.TextTable.Intf in '..\..\DN.TextTable.Intf.pas', + DN.TextTable in '..\..\DN.TextTable.pas', + DN.ToolsApi in '..\..\DN.ToolsApi.pas', + DN.Types in '..\..\DN.Types.pas', + DN.Uninstaller.Delphinus in '..\..\DN.Uninstaller.Delphinus.pas', + DN.Uninstaller.IDE in '..\..\DN.Uninstaller.IDE.pas', + DN.Uninstaller.Intf in '..\..\DN.Uninstaller.Intf.pas', + DN.Uninstaller in '..\..\DN.Uninstaller.pas', + DN.Utils in '..\..\DN.Utils.pas', + DN.VariableResolver.Compiler.Factory in '..\..\DN.VariableResolver.Compiler.Factory.pas', + DN.VariableResolver.Compiler in '..\..\DN.VariableResolver.Compiler.pas', + DN.VariableResolver.Intf in '..\..\DN.VariableResolver.Intf.pas', + DN.VariableResolver in '..\..\DN.VariableResolver.pas', + DN.Version in '..\..\DN.Version.pas', + DN.Zip in '..\..\DN.Zip.pas', + DN.Package.Gitlab in '..\..\DN.Package.Gitlab.pas', + DN.PackageSource.Gitlab in '..\..\DN.PackageSource.Gitlab.pas'; + +end. + + + + diff --git a/Packages/DelphiX-Rio/Delphinus.dproj b/Packages/DelphiX-Rio/Delphinus.dproj new file mode 100644 index 0000000..6941ad7 --- /dev/null +++ b/Packages/DelphiX-Rio/Delphinus.dproj @@ -0,0 +1,1120 @@ + + + {0990B172-C221-4312-816E-1E634AF7EE2C} + Delphinus.dpk + 18.8 + VCL + True + Debug + Win32 + 1 + Package + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + ..;$(DCC_UnitSearchPath) + System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) + true + Delphinus + true + true + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + false + false + false + false + false + + + rtl;vclimg;dbrtl;DbxCommonDriver;IndyCore;IndySystem;IndyProtocols;vcl;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + + + rtl;vclimg;dbrtl;DbxCommonDriver;IndyCore;IndySystem;IndyProtocols;vcl;$(DCC_UsePackage) + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + $(BDS)\bin\bds.exe + false + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + + MainSource + + + + + + + + +
DelphinusDialog
+
+ +
SetupDialog
+
+ + + + +
DelphinusOptionsDialog
+
+ + +
LicenseDialog
+
+ +
CategoryFilterView
+ TFrame +
+ +
ProgressDialog
+
+ + + +
AboutDialog
+
+ +
DependencyDialog
+ dfm +
+ +
TypeSelectionDialog
+ dfm +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageDetailView
+ dfm + TFrame +
+ + + + + + + + + + + + + + + +
DNFolderConfigPage
+ dfm + TFrame +
+ +
DNGithubSourceConfigPage
+ dfm + TFrame +
+ +
DNGitlabSourceConfigPage
+ dfm + TFrame +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DelphinusImages.res
+
+ +
Delphinus.res
+
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + Delphi.Personality.12 + Package + + + + Delphinus.dpk + + + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + + + Delphinus.bpl + true + + + + + 1 + + + 0 + + + + + classes + 1 + + + classes + 1 + + + + + res\xml + 1 + + + res\xml + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + library\lib\armeabi + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\mips + 1 + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\values-v21 + 1 + + + res\values-v21 + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-small + 1 + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + res\drawable-xlarge + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + 1 + + + 1 + + + 0 + + + + + 1 + .framework + + + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + + + + 1 + + + 1 + + + 1 + + + + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + + + True + False + + + 12 + + + + +
diff --git a/Packages/DelphiX-Rio/Delphinus.res b/Packages/DelphiX-Rio/Delphinus.res new file mode 100644 index 0000000..36f26e2 Binary files /dev/null and b/Packages/DelphiX-Rio/Delphinus.res differ diff --git a/Packages/DelphiX-Rio/DelphinusImages.res b/Packages/DelphiX-Rio/DelphinusImages.res new file mode 100644 index 0000000..a121995 Binary files /dev/null and b/Packages/DelphiX-Rio/DelphinusImages.res differ diff --git a/Packages/DelphiX-Sydney/Delphinus.Theming.pas b/Packages/DelphiX-Sydney/Delphinus.Theming.pas new file mode 100644 index 0000000..852c5a3 --- /dev/null +++ b/Packages/DelphiX-Sydney/Delphinus.Theming.pas @@ -0,0 +1,42 @@ +unit Delphinus.Theming; + +interface + +uses + SysUtils, + Graphics, + Windows; + +const + CBlendPrimary = 0.87; + CBlendSecondary = 0.54; + CBlendDisabled = 0.38; + CBlendDivider = 0.12; + + CPrimaryColor: TColor = $fe4f30; //$304ffe; + CAccentColor: TColor = $5b18c2;//$c2185b; + +function BlendColor(ABackground, AForeground: TColor; AForegroundAlpha: Single): TColor; + +implementation + +type + TColorRec = packed record + R, G, B, A: Byte; + end; + +function BlendColor(ABackground, AForeground: TColor; AForegroundAlpha: Single): TColor; +var + LBackgroundAlpha: Single; + LBackground, LForeground: TColorRec; +begin + LBackgroundAlpha := 1 - AForegroundAlpha; + LBackground := TColorRec(ColorToRGB(ABackground)); + LForeground := TColorRec(ColorToRGB(AForeground)); + TColorRec(Result).R := Round(LBackground.R * LBackgroundAlpha + LForeground.R * AForegroundAlpha); + TColorRec(Result).G := Round(LBackground.G * LBackgroundAlpha + LForeground.G * AForegroundAlpha); + TColorRec(Result).B := Round(LBackground.B * LBackgroundAlpha + LForeground.B * AForegroundAlpha); + TColorRec(Result).A := Round(LBackground.A * LBackgroundAlpha + LForeground.A * AForegroundAlpha); +end; + +end. diff --git a/Packages/DelphiX-Sydney/Delphinus.dpk b/Packages/DelphiX-Sydney/Delphinus.dpk new file mode 100644 index 0000000..e9b4adc --- /dev/null +++ b/Packages/DelphiX-Sydney/Delphinus.dpk @@ -0,0 +1,194 @@ +package Delphinus; + +{$R *.res} +{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES ON} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DEFINE DEBUG} +{$ENDIF IMPLICITBUILDING} +{$DESIGNONLY} +{$IMPLICITBUILD ON} + +requires + rtl, + DesignIDE, + vclimg, + vcl; + +contains + Delphinus.Theming in 'Delphinus.Theming.pas', + Delphinus.About in '..\Delphinus.About.pas' {AboutDialog}, + Delphinus.CategoryFilterView in '..\Delphinus.CategoryFilterView.pas' {CategoryFilterView: TFrame}, + Delphinus.Controller in '..\Delphinus.Controller.pas', + Delphinus.DelphiInstallation.View in '..\Delphinus.DelphiInstallation.View.pas' {DelphiInstallationView: TFrame}, + Delphinus.DependencyDialog in '..\Delphinus.DependencyDialog.pas' {DependencyDialog}, + Delphinus.Dialog in '..\Delphinus.Dialog.pas' {DelphinusDialog}, + Delphinus.Forms in '..\Delphinus.Forms.pas', + Delphinus.LicenseDialog in '..\Delphinus.LicenseDialog.pas' {LicenseDialog}, + Delphinus.Main in '..\Delphinus.Main.pas', + Delphinus.OptionsDialog in '..\Delphinus.OptionsDialog.pas' {DelphinusOptionsDialog}, + Delphinus.OptionsDialog.TypeSelection in '..\Delphinus.OptionsDialog.TypeSelection.pas' {TypeSelectionDialog}, + Delphinus.ProgressDialog in '..\Delphinus.ProgressDialog.pas' {ProgressDialog}, + Delphinus.Resources.Names in '..\Delphinus.Resources.Names.pas', + Delphinus.Resources in '..\Delphinus.Resources.pas', + Delphinus.SetupDialog in '..\Delphinus.SetupDialog.pas' {SetupDialog}, + Delphinus.UiTypes in '..\Delphinus.UiTypes.pas', + Delphinus.Version in '..\Delphinus.Version.pas', + DN.ActiveX in '..\..\DN.ActiveX.pas', + DN.BPLService.Intf in '..\..\DN.BPLService.Intf.pas', + DN.BPLService.Registry in '..\..\DN.BPLService.Registry.pas', + DN.BPLService.ToolsApi in '..\..\DN.BPLService.ToolsApi.pas', + DN.Character in '..\..\DN.Character.pas', + DN.ComCtrls.Helper in '..\..\DN.ComCtrls.Helper.pas', + DN.Compiler.IDE in '..\..\DN.Compiler.IDE.pas', + DN.Compiler.Intf in '..\..\DN.Compiler.Intf.pas', + DN.Compiler.MSBuild in '..\..\DN.Compiler.MSBuild.pas', + DN.Compiler in '..\..\DN.Compiler.pas', + DN.Compiler.ValueOverrides.Factory in '..\..\DN.Compiler.ValueOverrides.Factory.pas', + DN.Compiler.ValueOverrides.Intf in '..\..\DN.Compiler.ValueOverrides.Intf.pas', + DN.Compiler.ValueOverrides in '..\..\DN.Compiler.ValueOverrides.pas', + DN.Controls.Button in '..\..\DN.Controls.Button.pas', + DN.Controls in '..\..\DN.Controls.pas', + DN.DelphiInstallation.Editions in '..\..\DN.DelphiInstallation.Editions.pas', + DN.DelphiInstallation.Intf in '..\..\DN.DelphiInstallation.Intf.pas', + DN.DelphiInstallation in '..\..\DN.DelphiInstallation.pas', + DN.DelphiInstallation.Provider.Intf in '..\..\DN.DelphiInstallation.Provider.Intf.pas', + DN.DelphiInstallation.Provider in '..\..\DN.DelphiInstallation.Provider.pas', + DN.DPRProperties.Intf in '..\..\DN.DPRProperties.Intf.pas', + DN.DPRProperties in '..\..\DN.DPRProperties.pas', + DN.Environment in '..\..\DN.Environment.pas', + DN.EnvironmentOptions.IDE in '..\..\DN.EnvironmentOptions.IDE.pas', + DN.EnvironmentOptions.Intf in '..\..\DN.EnvironmentOptions.Intf.pas', + DN.EnvironmentOptions in '..\..\DN.EnvironmentOptions.pas', + DN.EnvironmentOptions.Registry in '..\..\DN.EnvironmentOptions.Registry.pas', + DN.ExpertService.Intf in '..\..\DN.ExpertService.Intf.pas', + DN.ExpertService in '..\..\DN.ExpertService.pas', + DN.FileService.Intf in '..\..\DN.FileService.Intf.pas', + DN.FileService in '..\..\DN.FileService.pas', + DN.Graphics.Loader in '..\..\DN.Graphics.Loader.pas', + DN.Graphics in '..\..\DN.Graphics.pas', + DN.HttpClient.Cache.Intf in '..\..\DN.HttpClient.Cache.Intf.pas', + DN.HttpClient.Cache in '..\..\DN.HttpClient.Cache.pas', + DN.HttpClient.Intf in '..\..\DN.HttpClient.Intf.pas', + DN.HttpClient in '..\..\DN.HttpClient.pas', + DN.HttpClient.WinHttp in '..\..\DN.HttpClient.WinHttp.pas', + DN.Import.WinHttp in '..\..\DN.Import.WinHttp.pas', + DN.Installer.Delphinus in '..\..\DN.Installer.Delphinus.pas', + DN.Installer.IDE in '..\..\DN.Installer.IDE.pas', + DN.Installer.Intf in '..\..\DN.Installer.Intf.pas', + DN.Installer in '..\..\DN.Installer.pas', + DN.IOUtils in '..\..\DN.IOUtils.pas', + DN.JSon in '..\..\DN.JSon.pas', + DN.JSonFile.CacheInfo in '..\..\DN.JSonFile.CacheInfo.pas', + DN.JSonFile.Info in '..\..\DN.JSonFile.Info.pas', + DN.JSonFile.Installation in '..\..\DN.JSonFile.Installation.pas', + DN.JSonFile.InstalledInfo in '..\..\DN.JSonFile.InstalledInfo.pas', + DN.JSonFile in '..\..\DN.JSonFile.pas', + DN.JSonFile.Uninstallation in '..\..\DN.JSonFile.Uninstallation.pas', + DN.Package.Dependency.Intf in '..\..\DN.Package.Dependency.Intf.pas', + DN.Package.Dependency in '..\..\DN.Package.Dependency.pas', + DN.Package.DirectoryLoader.Intf in '..\..\DN.Package.DirectoryLoader.Intf.pas', + DN.Package.DirectoryLoader in '..\..\DN.Package.DirectoryLoader.pas', + DN.Package.Finder.Intf in '..\..\DN.Package.Finder.Intf.pas', + DN.Package.Finder in '..\..\DN.Package.Finder.pas', + DN.Package.Github in '..\..\DN.Package.Github.pas', + DN.Package.Gitlab in '..\..\DN.Package.Gitlab.pas', + DN.Package.Intf in '..\..\DN.Package.Intf.pas', + DN.Package in '..\..\DN.Package.pas', + DN.Package.Version.Finder.Intf in '..\..\DN.Package.Version.Finder.Intf.pas', + DN.Package.Version.Finder in '..\..\DN.Package.Version.Finder.pas', + DN.Package.Version.Intf in '..\..\DN.Package.Version.Intf.pas', + DN.Package.Version in '..\..\DN.Package.Version.pas', + DN.PackageDetailView in '..\..\DN.PackageDetailView.pas' {PackageDetailView: TFrame}, + DN.PackageFilter in '..\..\DN.PackageFilter.pas', + DN.PackageOverview in '..\..\DN.PackageOverview.pas', + DN.PackageProvider.Folder in '..\..\DN.PackageProvider.Folder.pas', + DN.PackageProvider.GitHub in '..\..\DN.PackageProvider.GitHub.pas', + DN.PackageProvider.GitHub.State in '..\..\DN.PackageProvider.GitHub.State.pas', + DN.PackageProvider.GitHubRepo in '..\..\DN.PackageProvider.GitHubRepo.pas', + DN.PackageProvider.GitLab in '..\..\DN.PackageProvider.GitLab.pas', + DN.PackageProvider.GitLab.State in '..\..\DN.PackageProvider.GitLab.State.pas', + DN.PackageProvider.Installed in '..\..\DN.PackageProvider.Installed.pas', + DN.PackageProvider.Intf in '..\..\DN.PackageProvider.Intf.pas', + DN.PackageProvider.MultiSource in '..\..\DN.PackageProvider.MultiSource.pas', + DN.PackageProvider in '..\..\DN.PackageProvider.pas', + DN.PackageProvider.State.Intf in '..\..\DN.PackageProvider.State.Intf.pas', + DN.PackageProvider.State in '..\..\DN.PackageProvider.State.pas', + DN.PackageSource.ConfigPage.Folder in '..\..\DN.PackageSource.ConfigPage.Folder.pas' {DNFolderConfigPage: TFrame}, + DN.PackageSource.ConfigPage.Github in '..\..\DN.PackageSource.ConfigPage.Github.pas' {DNGithubSourceConfigPage: TFrame}, + DN.PackageSource.ConfigPage.Gitlab in '..\..\DN.PackageSource.ConfigPage.Gitlab.pas' {DNGitlabSourceConfigPage: TFrame}, + DN.PackageSource.ConfigPage.Intf in '..\..\DN.PackageSource.ConfigPage.Intf.pas', + DN.PackageSource.ConfigPage in '..\..\DN.PackageSource.ConfigPage.pas', + DN.PackageSource.Folder in '..\..\DN.PackageSource.Folder.pas', + DN.PackageSource.Github in '..\..\DN.PackageSource.Github.pas', + DN.PackageSource.Gitlab in '..\..\DN.PackageSource.Gitlab.pas', + DN.PackageSource.Intf in '..\..\DN.PackageSource.Intf.pas', + DN.PackageSource in '..\..\DN.PackageSource.pas', + DN.PackageSource.Registry.Intf in '..\..\DN.PackageSource.Registry.Intf.pas', + DN.PackageSource.Registry in '..\..\DN.PackageSource.Registry.pas', + DN.PackageSource.Settings.Field.Intf in '..\..\DN.PackageSource.Settings.Field.Intf.pas', + DN.PackageSource.Settings.Field in '..\..\DN.PackageSource.Settings.Field.pas', + DN.PackageSource.Settings.Folder in '..\..\DN.PackageSource.Settings.Folder.pas', + DN.PackageSource.Settings.Github in '..\..\DN.PackageSource.Settings.Github.pas', + DN.PackageSource.Settings.Gitlab in '..\..\DN.PackageSource.Settings.Gitlab.pas', + DN.PackageSource.Settings.Intf in '..\..\DN.PackageSource.Settings.Intf.pas', + DN.PackageSource.Settings in '..\..\DN.PackageSource.Settings.pas', + DN.Preview in '..\..\DN.Preview.pas', + DN.Progress.Intf in '..\..\DN.Progress.Intf.pas', + DN.Progress in '..\..\DN.Progress.pas', + DN.ProjectGroupInfo.Intf in '..\..\DN.ProjectGroupInfo.Intf.pas', + DN.ProjectGroupInfo in '..\..\DN.ProjectGroupInfo.pas', + DN.ProjectInfo.Intf in '..\..\DN.ProjectInfo.Intf.pas', + DN.ProjectInfo in '..\..\DN.ProjectInfo.pas', + DN.Settings.Intf in '..\..\DN.Settings.Intf.pas', + DN.Settings in '..\..\DN.Settings.pas', + DN.Setup.Core in '..\..\DN.Setup.Core.pas', + DN.Setup.Dependency.Intf in '..\..\DN.Setup.Dependency.Intf.pas', + DN.Setup.Dependency in '..\..\DN.Setup.Dependency.pas', + DN.Setup.Dependency.Processor.Intf in '..\..\DN.Setup.Dependency.Processor.Intf.pas', + DN.Setup.Dependency.Processor in '..\..\DN.Setup.Dependency.Processor.pas', + DN.Setup.Dependency.Resolver.Install in '..\..\DN.Setup.Dependency.Resolver.Install.pas', + DN.Setup.Dependency.Resolver.Intf in '..\..\DN.Setup.Dependency.Resolver.Intf.pas', + DN.Setup.Dependency.Resolver.UnInstall in '..\..\DN.Setup.Dependency.Resolver.UnInstall.pas', + DN.Setup.Intf in '..\..\DN.Setup.Intf.pas', + DN.Setup in '..\..\DN.Setup.pas', + DN.TextTable.Intf in '..\..\DN.TextTable.Intf.pas', + DN.TextTable in '..\..\DN.TextTable.pas', + DN.ToolsApi in '..\..\DN.ToolsApi.pas', + DN.Types in '..\..\DN.Types.pas', + DN.Uninstaller.Delphinus in '..\..\DN.Uninstaller.Delphinus.pas', + DN.Uninstaller.IDE in '..\..\DN.Uninstaller.IDE.pas', + DN.Uninstaller.Intf in '..\..\DN.Uninstaller.Intf.pas', + DN.Uninstaller in '..\..\DN.Uninstaller.pas', + DN.Utils in '..\..\DN.Utils.pas', + DN.VariableResolver.Compiler.Factory in '..\..\DN.VariableResolver.Compiler.Factory.pas', + DN.VariableResolver.Compiler in '..\..\DN.VariableResolver.Compiler.pas', + DN.VariableResolver.Intf in '..\..\DN.VariableResolver.Intf.pas', + DN.VariableResolver in '..\..\DN.VariableResolver.pas', + DN.Version in '..\..\DN.Version.pas', + DN.Zip in '..\..\DN.Zip.pas'; + +end. + + + + diff --git a/Packages/DelphiX-Sydney/Delphinus.dproj b/Packages/DelphiX-Sydney/Delphinus.dproj new file mode 100644 index 0000000..e4ac8da --- /dev/null +++ b/Packages/DelphiX-Sydney/Delphinus.dproj @@ -0,0 +1,899 @@ + + + {0990B172-C221-4312-816E-1E634AF7EE2C} + Delphinus.dpk + 19.0 + VCL + True + Debug + Win32 + 1 + Package + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + ..;$(DCC_UnitSearchPath) + System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) + true + Delphinus + true + true + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + false + false + false + false + false + + + CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSLocationUsageDescription=The reason for accessing the location information of the user;NSContactsUsageDescription=The reason for accessing the contacts;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSCameraUsageDescription=The reason for accessing the camera;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSMotionUsageDescription=The reason for accessing the accelerometer;NSDesktopFolderUsageDescription=The reason for accessing the Desktop folder;NSDocumentsFolderUsageDescription=The reason for accessing the Documents folder;NSDownloadsFolderUsageDescription=The reason for accessing the Downloads folder;NSNetworkVolumesUsageDescription=The reason for accessing files on a network volume;NSRemovableVolumesUsageDescription=The reason for accessing files on a removable volume;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers + Debug + true + Base + true + rtl;dbrtl;DbxCommonDriver;IndyCore;IndySystem;IndyProtocols;$(DCC_UsePackage);$(DCC_UsePackage) + + + rtl;vclimg;dbrtl;DbxCommonDriver;IndyCore;IndySystem;IndyProtocols;vcl;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + + + rtl;vclimg;dbrtl;DbxCommonDriver;IndyCore;IndySystem;IndyProtocols;vcl;$(DCC_UsePackage) + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + $(BDS)\bin\bds.exe + false + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + + MainSource + + + + + + + +
AboutDialog
+ dfm +
+ +
CategoryFilterView
+ dfm + TFrame +
+ + +
DelphiInstallationView
+ dfm + TFrame +
+ +
DependencyDialog
+ dfm +
+ +
DelphinusDialog
+ dfm +
+ + +
LicenseDialog
+ dfm +
+ + +
DelphinusOptionsDialog
+ dfm +
+ +
TypeSelectionDialog
+ dfm +
+ +
ProgressDialog
+ dfm +
+ + + +
SetupDialog
+ dfm +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageDetailView
+ dfm + TFrame +
+ + + + + + + + + + + + + + + +
DNFolderConfigPage
+ dfm + TFrame +
+ +
DNGithubSourceConfigPage
+ dfm + TFrame +
+ +
DNGitlabSourceConfigPage
+ dfm + TFrame +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DelphinusImages.res
+
+ +
Delphinus.res
+
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + Delphi.Personality.12 + Package + + + + Delphinus.dpk + + + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + + + Delphinus.bpl + true + + + + + 1 + + + 0 + + + + + classes + 1 + + + classes + 1 + + + + + res\xml + 1 + + + res\xml + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + library\lib\armeabi + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\mips + 1 + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\values-v21 + 1 + + + res\values-v21 + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-small + 1 + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + res\drawable-xlarge + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + 1 + + + 1 + + + 0 + + + + + 1 + .framework + + + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + + + + + 1 + + + 1 + + + 1 + + + + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + + + False + True + False + + + 12 + + + + +
diff --git a/Packages/DelphiX-Sydney/Delphinus.res b/Packages/DelphiX-Sydney/Delphinus.res new file mode 100644 index 0000000..36f26e2 Binary files /dev/null and b/Packages/DelphiX-Sydney/Delphinus.res differ diff --git a/Packages/DelphiX-Sydney/DelphinusImages.res b/Packages/DelphiX-Sydney/DelphinusImages.res new file mode 100644 index 0000000..a121995 Binary files /dev/null and b/Packages/DelphiX-Sydney/DelphinusImages.res differ diff --git a/Packages/DelphiX-Tokyo/Delphinus.Theming.pas b/Packages/DelphiX-Tokyo/Delphinus.Theming.pas new file mode 100644 index 0000000..852c5a3 --- /dev/null +++ b/Packages/DelphiX-Tokyo/Delphinus.Theming.pas @@ -0,0 +1,42 @@ +unit Delphinus.Theming; + +interface + +uses + SysUtils, + Graphics, + Windows; + +const + CBlendPrimary = 0.87; + CBlendSecondary = 0.54; + CBlendDisabled = 0.38; + CBlendDivider = 0.12; + + CPrimaryColor: TColor = $fe4f30; //$304ffe; + CAccentColor: TColor = $5b18c2;//$c2185b; + +function BlendColor(ABackground, AForeground: TColor; AForegroundAlpha: Single): TColor; + +implementation + +type + TColorRec = packed record + R, G, B, A: Byte; + end; + +function BlendColor(ABackground, AForeground: TColor; AForegroundAlpha: Single): TColor; +var + LBackgroundAlpha: Single; + LBackground, LForeground: TColorRec; +begin + LBackgroundAlpha := 1 - AForegroundAlpha; + LBackground := TColorRec(ColorToRGB(ABackground)); + LForeground := TColorRec(ColorToRGB(AForeground)); + TColorRec(Result).R := Round(LBackground.R * LBackgroundAlpha + LForeground.R * AForegroundAlpha); + TColorRec(Result).G := Round(LBackground.G * LBackgroundAlpha + LForeground.G * AForegroundAlpha); + TColorRec(Result).B := Round(LBackground.B * LBackgroundAlpha + LForeground.B * AForegroundAlpha); + TColorRec(Result).A := Round(LBackground.A * LBackgroundAlpha + LForeground.A * AForegroundAlpha); +end; + +end. diff --git a/Packages/DelphiX-Tokyo/Delphinus.dpk b/Packages/DelphiX-Tokyo/Delphinus.dpk new file mode 100644 index 0000000..e9b4adc --- /dev/null +++ b/Packages/DelphiX-Tokyo/Delphinus.dpk @@ -0,0 +1,194 @@ +package Delphinus; + +{$R *.res} +{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES ON} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DEFINE DEBUG} +{$ENDIF IMPLICITBUILDING} +{$DESIGNONLY} +{$IMPLICITBUILD ON} + +requires + rtl, + DesignIDE, + vclimg, + vcl; + +contains + Delphinus.Theming in 'Delphinus.Theming.pas', + Delphinus.About in '..\Delphinus.About.pas' {AboutDialog}, + Delphinus.CategoryFilterView in '..\Delphinus.CategoryFilterView.pas' {CategoryFilterView: TFrame}, + Delphinus.Controller in '..\Delphinus.Controller.pas', + Delphinus.DelphiInstallation.View in '..\Delphinus.DelphiInstallation.View.pas' {DelphiInstallationView: TFrame}, + Delphinus.DependencyDialog in '..\Delphinus.DependencyDialog.pas' {DependencyDialog}, + Delphinus.Dialog in '..\Delphinus.Dialog.pas' {DelphinusDialog}, + Delphinus.Forms in '..\Delphinus.Forms.pas', + Delphinus.LicenseDialog in '..\Delphinus.LicenseDialog.pas' {LicenseDialog}, + Delphinus.Main in '..\Delphinus.Main.pas', + Delphinus.OptionsDialog in '..\Delphinus.OptionsDialog.pas' {DelphinusOptionsDialog}, + Delphinus.OptionsDialog.TypeSelection in '..\Delphinus.OptionsDialog.TypeSelection.pas' {TypeSelectionDialog}, + Delphinus.ProgressDialog in '..\Delphinus.ProgressDialog.pas' {ProgressDialog}, + Delphinus.Resources.Names in '..\Delphinus.Resources.Names.pas', + Delphinus.Resources in '..\Delphinus.Resources.pas', + Delphinus.SetupDialog in '..\Delphinus.SetupDialog.pas' {SetupDialog}, + Delphinus.UiTypes in '..\Delphinus.UiTypes.pas', + Delphinus.Version in '..\Delphinus.Version.pas', + DN.ActiveX in '..\..\DN.ActiveX.pas', + DN.BPLService.Intf in '..\..\DN.BPLService.Intf.pas', + DN.BPLService.Registry in '..\..\DN.BPLService.Registry.pas', + DN.BPLService.ToolsApi in '..\..\DN.BPLService.ToolsApi.pas', + DN.Character in '..\..\DN.Character.pas', + DN.ComCtrls.Helper in '..\..\DN.ComCtrls.Helper.pas', + DN.Compiler.IDE in '..\..\DN.Compiler.IDE.pas', + DN.Compiler.Intf in '..\..\DN.Compiler.Intf.pas', + DN.Compiler.MSBuild in '..\..\DN.Compiler.MSBuild.pas', + DN.Compiler in '..\..\DN.Compiler.pas', + DN.Compiler.ValueOverrides.Factory in '..\..\DN.Compiler.ValueOverrides.Factory.pas', + DN.Compiler.ValueOverrides.Intf in '..\..\DN.Compiler.ValueOverrides.Intf.pas', + DN.Compiler.ValueOverrides in '..\..\DN.Compiler.ValueOverrides.pas', + DN.Controls.Button in '..\..\DN.Controls.Button.pas', + DN.Controls in '..\..\DN.Controls.pas', + DN.DelphiInstallation.Editions in '..\..\DN.DelphiInstallation.Editions.pas', + DN.DelphiInstallation.Intf in '..\..\DN.DelphiInstallation.Intf.pas', + DN.DelphiInstallation in '..\..\DN.DelphiInstallation.pas', + DN.DelphiInstallation.Provider.Intf in '..\..\DN.DelphiInstallation.Provider.Intf.pas', + DN.DelphiInstallation.Provider in '..\..\DN.DelphiInstallation.Provider.pas', + DN.DPRProperties.Intf in '..\..\DN.DPRProperties.Intf.pas', + DN.DPRProperties in '..\..\DN.DPRProperties.pas', + DN.Environment in '..\..\DN.Environment.pas', + DN.EnvironmentOptions.IDE in '..\..\DN.EnvironmentOptions.IDE.pas', + DN.EnvironmentOptions.Intf in '..\..\DN.EnvironmentOptions.Intf.pas', + DN.EnvironmentOptions in '..\..\DN.EnvironmentOptions.pas', + DN.EnvironmentOptions.Registry in '..\..\DN.EnvironmentOptions.Registry.pas', + DN.ExpertService.Intf in '..\..\DN.ExpertService.Intf.pas', + DN.ExpertService in '..\..\DN.ExpertService.pas', + DN.FileService.Intf in '..\..\DN.FileService.Intf.pas', + DN.FileService in '..\..\DN.FileService.pas', + DN.Graphics.Loader in '..\..\DN.Graphics.Loader.pas', + DN.Graphics in '..\..\DN.Graphics.pas', + DN.HttpClient.Cache.Intf in '..\..\DN.HttpClient.Cache.Intf.pas', + DN.HttpClient.Cache in '..\..\DN.HttpClient.Cache.pas', + DN.HttpClient.Intf in '..\..\DN.HttpClient.Intf.pas', + DN.HttpClient in '..\..\DN.HttpClient.pas', + DN.HttpClient.WinHttp in '..\..\DN.HttpClient.WinHttp.pas', + DN.Import.WinHttp in '..\..\DN.Import.WinHttp.pas', + DN.Installer.Delphinus in '..\..\DN.Installer.Delphinus.pas', + DN.Installer.IDE in '..\..\DN.Installer.IDE.pas', + DN.Installer.Intf in '..\..\DN.Installer.Intf.pas', + DN.Installer in '..\..\DN.Installer.pas', + DN.IOUtils in '..\..\DN.IOUtils.pas', + DN.JSon in '..\..\DN.JSon.pas', + DN.JSonFile.CacheInfo in '..\..\DN.JSonFile.CacheInfo.pas', + DN.JSonFile.Info in '..\..\DN.JSonFile.Info.pas', + DN.JSonFile.Installation in '..\..\DN.JSonFile.Installation.pas', + DN.JSonFile.InstalledInfo in '..\..\DN.JSonFile.InstalledInfo.pas', + DN.JSonFile in '..\..\DN.JSonFile.pas', + DN.JSonFile.Uninstallation in '..\..\DN.JSonFile.Uninstallation.pas', + DN.Package.Dependency.Intf in '..\..\DN.Package.Dependency.Intf.pas', + DN.Package.Dependency in '..\..\DN.Package.Dependency.pas', + DN.Package.DirectoryLoader.Intf in '..\..\DN.Package.DirectoryLoader.Intf.pas', + DN.Package.DirectoryLoader in '..\..\DN.Package.DirectoryLoader.pas', + DN.Package.Finder.Intf in '..\..\DN.Package.Finder.Intf.pas', + DN.Package.Finder in '..\..\DN.Package.Finder.pas', + DN.Package.Github in '..\..\DN.Package.Github.pas', + DN.Package.Gitlab in '..\..\DN.Package.Gitlab.pas', + DN.Package.Intf in '..\..\DN.Package.Intf.pas', + DN.Package in '..\..\DN.Package.pas', + DN.Package.Version.Finder.Intf in '..\..\DN.Package.Version.Finder.Intf.pas', + DN.Package.Version.Finder in '..\..\DN.Package.Version.Finder.pas', + DN.Package.Version.Intf in '..\..\DN.Package.Version.Intf.pas', + DN.Package.Version in '..\..\DN.Package.Version.pas', + DN.PackageDetailView in '..\..\DN.PackageDetailView.pas' {PackageDetailView: TFrame}, + DN.PackageFilter in '..\..\DN.PackageFilter.pas', + DN.PackageOverview in '..\..\DN.PackageOverview.pas', + DN.PackageProvider.Folder in '..\..\DN.PackageProvider.Folder.pas', + DN.PackageProvider.GitHub in '..\..\DN.PackageProvider.GitHub.pas', + DN.PackageProvider.GitHub.State in '..\..\DN.PackageProvider.GitHub.State.pas', + DN.PackageProvider.GitHubRepo in '..\..\DN.PackageProvider.GitHubRepo.pas', + DN.PackageProvider.GitLab in '..\..\DN.PackageProvider.GitLab.pas', + DN.PackageProvider.GitLab.State in '..\..\DN.PackageProvider.GitLab.State.pas', + DN.PackageProvider.Installed in '..\..\DN.PackageProvider.Installed.pas', + DN.PackageProvider.Intf in '..\..\DN.PackageProvider.Intf.pas', + DN.PackageProvider.MultiSource in '..\..\DN.PackageProvider.MultiSource.pas', + DN.PackageProvider in '..\..\DN.PackageProvider.pas', + DN.PackageProvider.State.Intf in '..\..\DN.PackageProvider.State.Intf.pas', + DN.PackageProvider.State in '..\..\DN.PackageProvider.State.pas', + DN.PackageSource.ConfigPage.Folder in '..\..\DN.PackageSource.ConfigPage.Folder.pas' {DNFolderConfigPage: TFrame}, + DN.PackageSource.ConfigPage.Github in '..\..\DN.PackageSource.ConfigPage.Github.pas' {DNGithubSourceConfigPage: TFrame}, + DN.PackageSource.ConfigPage.Gitlab in '..\..\DN.PackageSource.ConfigPage.Gitlab.pas' {DNGitlabSourceConfigPage: TFrame}, + DN.PackageSource.ConfigPage.Intf in '..\..\DN.PackageSource.ConfigPage.Intf.pas', + DN.PackageSource.ConfigPage in '..\..\DN.PackageSource.ConfigPage.pas', + DN.PackageSource.Folder in '..\..\DN.PackageSource.Folder.pas', + DN.PackageSource.Github in '..\..\DN.PackageSource.Github.pas', + DN.PackageSource.Gitlab in '..\..\DN.PackageSource.Gitlab.pas', + DN.PackageSource.Intf in '..\..\DN.PackageSource.Intf.pas', + DN.PackageSource in '..\..\DN.PackageSource.pas', + DN.PackageSource.Registry.Intf in '..\..\DN.PackageSource.Registry.Intf.pas', + DN.PackageSource.Registry in '..\..\DN.PackageSource.Registry.pas', + DN.PackageSource.Settings.Field.Intf in '..\..\DN.PackageSource.Settings.Field.Intf.pas', + DN.PackageSource.Settings.Field in '..\..\DN.PackageSource.Settings.Field.pas', + DN.PackageSource.Settings.Folder in '..\..\DN.PackageSource.Settings.Folder.pas', + DN.PackageSource.Settings.Github in '..\..\DN.PackageSource.Settings.Github.pas', + DN.PackageSource.Settings.Gitlab in '..\..\DN.PackageSource.Settings.Gitlab.pas', + DN.PackageSource.Settings.Intf in '..\..\DN.PackageSource.Settings.Intf.pas', + DN.PackageSource.Settings in '..\..\DN.PackageSource.Settings.pas', + DN.Preview in '..\..\DN.Preview.pas', + DN.Progress.Intf in '..\..\DN.Progress.Intf.pas', + DN.Progress in '..\..\DN.Progress.pas', + DN.ProjectGroupInfo.Intf in '..\..\DN.ProjectGroupInfo.Intf.pas', + DN.ProjectGroupInfo in '..\..\DN.ProjectGroupInfo.pas', + DN.ProjectInfo.Intf in '..\..\DN.ProjectInfo.Intf.pas', + DN.ProjectInfo in '..\..\DN.ProjectInfo.pas', + DN.Settings.Intf in '..\..\DN.Settings.Intf.pas', + DN.Settings in '..\..\DN.Settings.pas', + DN.Setup.Core in '..\..\DN.Setup.Core.pas', + DN.Setup.Dependency.Intf in '..\..\DN.Setup.Dependency.Intf.pas', + DN.Setup.Dependency in '..\..\DN.Setup.Dependency.pas', + DN.Setup.Dependency.Processor.Intf in '..\..\DN.Setup.Dependency.Processor.Intf.pas', + DN.Setup.Dependency.Processor in '..\..\DN.Setup.Dependency.Processor.pas', + DN.Setup.Dependency.Resolver.Install in '..\..\DN.Setup.Dependency.Resolver.Install.pas', + DN.Setup.Dependency.Resolver.Intf in '..\..\DN.Setup.Dependency.Resolver.Intf.pas', + DN.Setup.Dependency.Resolver.UnInstall in '..\..\DN.Setup.Dependency.Resolver.UnInstall.pas', + DN.Setup.Intf in '..\..\DN.Setup.Intf.pas', + DN.Setup in '..\..\DN.Setup.pas', + DN.TextTable.Intf in '..\..\DN.TextTable.Intf.pas', + DN.TextTable in '..\..\DN.TextTable.pas', + DN.ToolsApi in '..\..\DN.ToolsApi.pas', + DN.Types in '..\..\DN.Types.pas', + DN.Uninstaller.Delphinus in '..\..\DN.Uninstaller.Delphinus.pas', + DN.Uninstaller.IDE in '..\..\DN.Uninstaller.IDE.pas', + DN.Uninstaller.Intf in '..\..\DN.Uninstaller.Intf.pas', + DN.Uninstaller in '..\..\DN.Uninstaller.pas', + DN.Utils in '..\..\DN.Utils.pas', + DN.VariableResolver.Compiler.Factory in '..\..\DN.VariableResolver.Compiler.Factory.pas', + DN.VariableResolver.Compiler in '..\..\DN.VariableResolver.Compiler.pas', + DN.VariableResolver.Intf in '..\..\DN.VariableResolver.Intf.pas', + DN.VariableResolver in '..\..\DN.VariableResolver.pas', + DN.Version in '..\..\DN.Version.pas', + DN.Zip in '..\..\DN.Zip.pas'; + +end. + + + + diff --git a/Packages/DelphiX-Tokyo/Delphinus.dproj b/Packages/DelphiX-Tokyo/Delphinus.dproj new file mode 100644 index 0000000..0d89cad --- /dev/null +++ b/Packages/DelphiX-Tokyo/Delphinus.dproj @@ -0,0 +1,704 @@ + + + {0990B172-C221-4312-816E-1E634AF7EE2C} + Delphinus.dpk + 18.2 + VCL + True + Debug + Win32 + 1 + Package + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + ..;$(DCC_UnitSearchPath) + System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) + true + Delphinus + true + true + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + false + false + false + false + false + + + rtl;dbrtl;DbxCommonDriver;IndyCore;IndySystem;IndyProtocols;$(DCC_UsePackage) + + + rtl;vclimg;dbrtl;DbxCommonDriver;IndyCore;IndySystem;IndyProtocols;vcl;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + + + rtl;vclimg;dbrtl;DbxCommonDriver;IndyCore;IndySystem;IndyProtocols;vcl;$(DCC_UsePackage) + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + $(BDS)\bin\bds.exe + false + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + + MainSource + + + + + + + +
AboutDialog
+ dfm +
+ +
CategoryFilterView
+ dfm + TFrame +
+ + +
DelphiInstallationView
+ dfm + TFrame +
+ +
DependencyDialog
+ dfm +
+ +
DelphinusDialog
+ dfm +
+ + +
LicenseDialog
+ dfm +
+ + +
DelphinusOptionsDialog
+ dfm +
+ +
TypeSelectionDialog
+ dfm +
+ +
ProgressDialog
+ dfm +
+ + + +
SetupDialog
+ dfm +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageDetailView
+ dfm + TFrame +
+ + + + + + + + + + + + + + + +
DNFolderConfigPage
+ dfm + TFrame +
+ +
DNGithubSourceConfigPage
+ dfm + TFrame +
+ +
DNGitlabSourceConfigPage
+ dfm + TFrame +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DelphinusImages.res
+
+ +
Delphinus.res
+
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + Delphi.Personality.12 + Package + + + + Delphinus.dpk + + + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + + + Delphinus.bpl + true + + + + + 1 + + + Contents\MacOS + 0 + + + + + classes + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + + + res\values + 1 + + + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + + + 1 + + + 1 + + + 0 + + + + + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + + + + 1 + + + 1 + + + 1 + + + + + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 0 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + False + True + False + + + 12 + + + + +
diff --git a/Packages/DelphiX-Tokyo/Delphinus.res b/Packages/DelphiX-Tokyo/Delphinus.res new file mode 100644 index 0000000..36f26e2 Binary files /dev/null and b/Packages/DelphiX-Tokyo/Delphinus.res differ diff --git a/Packages/DelphiX-Tokyo/DelphinusImages.res b/Packages/DelphiX-Tokyo/DelphinusImages.res new file mode 100644 index 0000000..a121995 Binary files /dev/null and b/Packages/DelphiX-Tokyo/DelphinusImages.res differ diff --git a/Packages/DelphiXE/Delphinus.dpk b/Packages/DelphiXE/Delphinus.dpk index 63fdb5e..4993b35 100644 --- a/Packages/DelphiXE/Delphinus.dpk +++ b/Packages/DelphiXE/Delphinus.dpk @@ -36,112 +36,146 @@ contains Delphinus.Main in '..\Delphinus.Main.pas', Delphinus.Controller in '..\Delphinus.Controller.pas', Delphinus.Dialog in '..\Delphinus.Dialog.pas' {DelphinusDialog}, - DN.Compiler.Intf in '..\..\DN.Compiler.Intf.pas', - DN.Compiler.MSBuild in '..\..\DN.Compiler.MSBuild.pas', - DN.Compiler in '..\..\DN.Compiler.pas', - DN.Installer.Intf in '..\..\DN.Installer.Intf.pas', - DN.Installer in '..\..\DN.Installer.pas', - DN.Package.Intf in '..\..\DN.Package.Intf.pas', - DN.Package in '..\..\DN.Package.pas', - DN.PackageOverview in '..\..\DN.PackageOverview.pas', - DN.PackageProvider.Intf in '..\..\DN.PackageProvider.Intf.pas', - DN.PackageProvider.GitHub in '..\..\DN.PackageProvider.GitHub.pas', - DN.Preview in '..\..\DN.Preview.pas', - DN.ProjectInfo.Intf in '..\..\DN.ProjectInfo.Intf.pas', - DN.ProjectInfo in '..\..\DN.ProjectInfo.pas', - DN.Types in '..\..\DN.Types.pas', - DN.Uninstaller.Intf in '..\..\DN.Uninstaller.Intf.pas', - DN.Uninstaller in '..\..\DN.Uninstaller.pas', - DN.Zip in '..\..\DN.Zip.pas', Delphinus.SetupDialog in '..\Delphinus.SetupDialog.pas' {SetupDialog}, - DN.PackageProvider in '..\..\DN.PackageProvider.pas', - DN.PackageProvider.Installed in '..\..\DN.PackageProvider.Installed.pas', - DN.Installer.IDE in '..\..\DN.Installer.IDE.pas', - DN.ToolsApi in '..\..\DN.ToolsApi.pas', - DN.Uninstaller.IDE in '..\..\DN.Uninstaller.IDE.pas', - DN.ProjectGroupInfo in '..\..\DN.ProjectGroupInfo.pas', - DN.ProjectGroupInfo.Intf in '..\..\DN.ProjectGroupInfo.Intf.pas', - DN.JSonFile in '..\..\DN.JSonFile.pas', - DN.JSonFile.Info in '..\..\DN.JSonFile.Info.pas', - DN.JSonFile.Installation in '..\..\DN.JSonFile.Installation.pas', - DN.Controls.Button in '..\..\DN.Controls.Button.pas', - DN.Controls in '..\..\DN.Controls.pas', - DN.Graphics in '..\..\DN.Graphics.pas', - DN.PackageDetailView in '..\..\DN.PackageDetailView.pas' {PackageDetailView: TFrame}, - DN.JSonFile.Uninstallation in '..\..\DN.JSonFile.Uninstallation.pas', - DN.JSonFile.InstalledInfo in '..\..\DN.JSonFile.InstalledInfo.pas', - DN.Package.Github in '..\..\DN.Package.Github.pas', - DN.JSonFile.CacheInfo in '..\..\DN.JSonFile.CacheInfo.pas', - DN.Package.Version.Intf in '..\..\DN.Package.Version.Intf.pas', - DN.Package.Version in '..\..\DN.Package.Version.pas', Delphinus.UiTypes in '..\Delphinus.UiTypes.pas', - DN.JSon in '..\..\DN.JSon.pas', Delphinus.Forms in '..\Delphinus.Forms.pas', Delphinus.OptionsDialog in '..\Delphinus.OptionsDialog.pas' {DelphinusOptionsDialog}, - DN.Setup.Intf in '..\..\DN.Setup.Intf.pas', - DN.Setup in '..\..\DN.Setup.pas', - DN.IOUtils in '..\..\DN.IOUtils.pas', Delphinus.LicenseDialog in '..\Delphinus.LicenseDialog.pas' {LicenseDialog}, Delphinus.CategoryFilterView in '..\Delphinus.CategoryFilterView.pas', Delphinus.ProgressDialog in '..\Delphinus.ProgressDialog.pas' {ProgressDialog}, - DN.PackageFilter in '..\..\DN.PackageFilter.pas', - DN.Progress.Intf in '..\..\DN.Progress.Intf.pas', - DN.Progress in '..\..\DN.Progress.pas', - DN.HttpClient.Intf in '..\..\DN.HttpClient.Intf.pas', - DN.HttpClient in '..\..\DN.HttpClient.pas', - DN.HttpClient.WinHttp in '..\..\DN.HttpClient.WinHttp.pas', - DN.Import.WinHttp in '..\..\DN.Import.WinHttp.pas', - DN.HttpClient.Cache.Intf in '..\..\DN.HttpClient.Cache.Intf.pas', - DN.HttpClient.Cache in '..\..\DN.HttpClient.Cache.pas', - DN.Environment in '..\..\DN.Environment.pas', - DN.ComCtrls.Helper in '..\..\DN.ComCtrls.Helper.pas', - DN.ActiveX in '..\..\DN.ActiveX.pas', - DN.Setup.Core in '..\..\DN.Setup.Core.pas', - DN.Settings.Intf in '..\..\DN.Settings.Intf.pas', - DN.Settings in '..\..\DN.Settings.pas', - DN.FileService.Intf in '..\..\DN.FileService.Intf.pas', - DN.FileService in '..\..\DN.FileService.pas', - DN.VariableResolver.Compiler in '..\..\DN.VariableResolver.Compiler.pas', - DN.VariableResolver.Intf in '..\..\DN.VariableResolver.Intf.pas', - DN.VariableResolver in '..\..\DN.VariableResolver.pas', Delphinus.Version in '..\Delphinus.Version.pas', - DN.Version in '..\..\DN.Version.pas', Delphinus.Resources.Names in '..\Delphinus.Resources.Names.pas', Delphinus.Resources in '..\Delphinus.Resources.pas', Delphinus.About in '..\Delphinus.About.pas' {AboutDialog}, - DN.Graphics.Loader in '..\..\DN.Graphics.Loader.pas', + Delphinus.DependencyDialog in '..\Delphinus.DependencyDialog.pas' {DependencyDialog}, + Delphinus.OptionsDialog.TypeSelection in '..\Delphinus.OptionsDialog.TypeSelection.pas' {TypeSelectionDialog}, + DN.ActiveX in '..\..\DN.ActiveX.pas', + DN.BPLService.Intf in '..\..\DN.BPLService.Intf.pas', + DN.BPLService.Registry in '..\..\DN.BPLService.Registry.pas', + DN.BPLService.ToolsApi in '..\..\DN.BPLService.ToolsApi.pas', + DN.Character in '..\..\DN.Character.pas', + DN.ComCtrls.Helper in '..\..\DN.ComCtrls.Helper.pas', DN.Compiler.IDE in '..\..\DN.Compiler.IDE.pas', + DN.Compiler.Intf in '..\..\DN.Compiler.Intf.pas', + DN.Compiler.MSBuild in '..\..\DN.Compiler.MSBuild.pas', + DN.Compiler in '..\..\DN.Compiler.pas', DN.Compiler.ValueOverrides.Factory in '..\..\DN.Compiler.ValueOverrides.Factory.pas', DN.Compiler.ValueOverrides.Intf in '..\..\DN.Compiler.ValueOverrides.Intf.pas', DN.Compiler.ValueOverrides in '..\..\DN.Compiler.ValueOverrides.pas', + DN.Controls.Button in '..\..\DN.Controls.Button.pas', + DN.Controls in '..\..\DN.Controls.pas', + DN.DelphiInstallation.Editions in '..\..\DN.DelphiInstallation.Editions.pas', + DN.DelphiInstallation.Intf in '..\..\DN.DelphiInstallation.Intf.pas', + DN.DelphiInstallation in '..\..\DN.DelphiInstallation.pas', + DN.DelphiInstallation.Provider.Intf in '..\..\DN.DelphiInstallation.Provider.Intf.pas', + DN.DelphiInstallation.Provider in '..\..\DN.DelphiInstallation.Provider.pas', DN.DPRProperties.Intf in '..\..\DN.DPRProperties.Intf.pas', DN.DPRProperties in '..\..\DN.DPRProperties.pas', - DN.PackageProvider.GitHub.State in '..\..\DN.PackageProvider.GitHub.State.pas', - DN.PackageProvider.State.Intf in '..\..\DN.PackageProvider.State.Intf.pas', - DN.PackageProvider.State in '..\..\DN.PackageProvider.State.pas', + DN.Environment in '..\..\DN.Environment.pas', + DN.EnvironmentOptions.IDE in '..\..\DN.EnvironmentOptions.IDE.pas', DN.EnvironmentOptions.Intf in '..\..\DN.EnvironmentOptions.Intf.pas', + DN.EnvironmentOptions in '..\..\DN.EnvironmentOptions.pas', + DN.EnvironmentOptions.Registry in '..\..\DN.EnvironmentOptions.Registry.pas', DN.ExpertService.Intf in '..\..\DN.ExpertService.Intf.pas', DN.ExpertService in '..\..\DN.ExpertService.pas', - DN.BPLService.Intf in '..\..\DN.BPLService.Intf.pas', - DN.BPLService.ToolsApi in '..\..\DN.BPLService.ToolsApi.pas', - DN.EnvironmentOptions.IDE in '..\..\DN.EnvironmentOptions.IDE.pas', - DN.EnvironmentOptions in '..\..\DN.EnvironmentOptions.pas', - DN.VariableResolver.Compiler.Factory in '..\..\DN.VariableResolver.Compiler.Factory.pas', - DN.Utils in '..\..\DN.Utils.pas', + DN.FileService.Intf in '..\..\DN.FileService.Intf.pas', + DN.FileService in '..\..\DN.FileService.pas', + DN.Graphics.Loader in '..\..\DN.Graphics.Loader.pas', + DN.Graphics in '..\..\DN.Graphics.pas', + DN.HttpClient.Cache.Intf in '..\..\DN.HttpClient.Cache.Intf.pas', + DN.HttpClient.Cache in '..\..\DN.HttpClient.Cache.pas', + DN.HttpClient.Intf in '..\..\DN.HttpClient.Intf.pas', + DN.HttpClient in '..\..\DN.HttpClient.pas', + DN.HttpClient.WinHttp in '..\..\DN.HttpClient.WinHttp.pas', + DN.Import.WinHttp in '..\..\DN.Import.WinHttp.pas', + DN.Installer.Delphinus in '..\..\DN.Installer.Delphinus.pas', + DN.Installer.IDE in '..\..\DN.Installer.IDE.pas', + DN.Installer.Intf in '..\..\DN.Installer.Intf.pas', + DN.Installer in '..\..\DN.Installer.pas', + DN.IOUtils in '..\..\DN.IOUtils.pas', + DN.JSon in '..\..\DN.JSon.pas', + DN.JSonFile.CacheInfo in '..\..\DN.JSonFile.CacheInfo.pas', + DN.JSonFile.Info in '..\..\DN.JSonFile.Info.pas', + DN.JSonFile.Installation in '..\..\DN.JSonFile.Installation.pas', + DN.JSonFile.InstalledInfo in '..\..\DN.JSonFile.InstalledInfo.pas', + DN.JSonFile in '..\..\DN.JSonFile.pas', + DN.JSonFile.Uninstallation in '..\..\DN.JSonFile.Uninstallation.pas', DN.Package.Dependency.Intf in '..\..\DN.Package.Dependency.Intf.pas', DN.Package.Dependency in '..\..\DN.Package.Dependency.pas', + DN.Package.DirectoryLoader.Intf in '..\..\DN.Package.DirectoryLoader.Intf.pas', + DN.Package.DirectoryLoader in '..\..\DN.Package.DirectoryLoader.pas', + DN.Package.Finder.Intf in '..\..\DN.Package.Finder.Intf.pas', + DN.Package.Finder in '..\..\DN.Package.Finder.pas', + DN.Package.Github in '..\..\DN.Package.Github.pas', + DN.Package.Intf in '..\..\DN.Package.Intf.pas', + DN.Package in '..\..\DN.Package.pas', + DN.Package.Version.Finder.Intf in '..\..\DN.Package.Version.Finder.Intf.pas', + DN.Package.Version.Finder in '..\..\DN.Package.Version.Finder.pas', + DN.Package.Version.Intf in '..\..\DN.Package.Version.Intf.pas', + DN.Package.Version in '..\..\DN.Package.Version.pas', + DN.PackageDetailView in '..\..\DN.PackageDetailView.pas' {PackageDetailView: TFrame}, + DN.PackageFilter in '..\..\DN.PackageFilter.pas', + DN.PackageOverview in '..\..\DN.PackageOverview.pas', + DN.PackageProvider.Folder in '..\..\DN.PackageProvider.Folder.pas', + DN.PackageProvider.GitHub in '..\..\DN.PackageProvider.GitHub.pas', + DN.PackageProvider.GitHub.State in '..\..\DN.PackageProvider.GitHub.State.pas', + DN.PackageProvider.GitHubRepo in '..\..\DN.PackageProvider.GitHubRepo.pas', + DN.PackageProvider.Installed in '..\..\DN.PackageProvider.Installed.pas', + DN.PackageProvider.Intf in '..\..\DN.PackageProvider.Intf.pas', + DN.PackageProvider.MultiSource in '..\..\DN.PackageProvider.MultiSource.pas', + DN.PackageProvider in '..\..\DN.PackageProvider.pas', + DN.PackageProvider.State.Intf in '..\..\DN.PackageProvider.State.Intf.pas', + DN.PackageProvider.State in '..\..\DN.PackageProvider.State.pas', + DN.PackageSource.ConfigPage.Folder in '..\..\DN.PackageSource.ConfigPage.Folder.pas' {DNFolderConfigPage: TFrame}, + DN.PackageSource.ConfigPage.Github in '..\..\DN.PackageSource.ConfigPage.Github.pas' {DNGithubSourceConfigPage: TFrame}, + DN.PackageSource.ConfigPage.Intf in '..\..\DN.PackageSource.ConfigPage.Intf.pas', + DN.PackageSource.ConfigPage in '..\..\DN.PackageSource.ConfigPage.pas', + DN.PackageSource.Folder in '..\..\DN.PackageSource.Folder.pas', + DN.PackageSource.Github in '..\..\DN.PackageSource.Github.pas', + DN.PackageSource.Intf in '..\..\DN.PackageSource.Intf.pas', + DN.PackageSource in '..\..\DN.PackageSource.pas', + DN.PackageSource.Registry.Intf in '..\..\DN.PackageSource.Registry.Intf.pas', + DN.PackageSource.Registry in '..\..\DN.PackageSource.Registry.pas', + DN.PackageSource.Settings.Field.Intf in '..\..\DN.PackageSource.Settings.Field.Intf.pas', + DN.PackageSource.Settings.Field in '..\..\DN.PackageSource.Settings.Field.pas', + DN.PackageSource.Settings.Folder in '..\..\DN.PackageSource.Settings.Folder.pas', + DN.PackageSource.Settings.Github in '..\..\DN.PackageSource.Settings.Github.pas', + DN.PackageSource.Settings.Intf in '..\..\DN.PackageSource.Settings.Intf.pas', + DN.PackageSource.Settings in '..\..\DN.PackageSource.Settings.pas', + DN.Preview in '..\..\DN.Preview.pas', + DN.Progress.Intf in '..\..\DN.Progress.Intf.pas', + DN.Progress in '..\..\DN.Progress.pas', + DN.ProjectGroupInfo.Intf in '..\..\DN.ProjectGroupInfo.Intf.pas', + DN.ProjectGroupInfo in '..\..\DN.ProjectGroupInfo.pas', + DN.ProjectInfo.Intf in '..\..\DN.ProjectInfo.Intf.pas', + DN.ProjectInfo in '..\..\DN.ProjectInfo.pas', + DN.Settings.Intf in '..\..\DN.Settings.Intf.pas', + DN.Settings in '..\..\DN.Settings.pas', + DN.Setup.Core in '..\..\DN.Setup.Core.pas', + DN.Setup.Dependency.Intf in '..\..\DN.Setup.Dependency.Intf.pas', + DN.Setup.Dependency in '..\..\DN.Setup.Dependency.pas', DN.Setup.Dependency.Processor.Intf in '..\..\DN.Setup.Dependency.Processor.Intf.pas', DN.Setup.Dependency.Processor in '..\..\DN.Setup.Dependency.Processor.pas', DN.Setup.Dependency.Resolver.Install in '..\..\DN.Setup.Dependency.Resolver.Install.pas', DN.Setup.Dependency.Resolver.Intf in '..\..\DN.Setup.Dependency.Resolver.Intf.pas', DN.Setup.Dependency.Resolver.UnInstall in '..\..\DN.Setup.Dependency.Resolver.UnInstall.pas', - DN.Setup.Dependency in '..\..\DN.Setup.Dependency.pas', - DN.Setup.Dependency.Intf in '..\..\DN.Setup.Dependency.Intf.pas', - DN.Package.Finder.Intf in '..\..\DN.Package.Finder.Intf.pas', - DN.Package.Finder in '..\..\DN.Package.Finder.pas', - DN.Package.DirectoryLoader.Intf in '..\..\DN.Package.DirectoryLoader.Intf.pas', - DN.Package.DirectoryLoader in '..\..\DN.Package.DirectoryLoader.pas', - Delphinus.DependencyDialog in '..\Delphinus.DependencyDialog.pas' {DependencyDialog}; + DN.Setup.Intf in '..\..\DN.Setup.Intf.pas', + DN.Setup in '..\..\DN.Setup.pas', + DN.TextTable.Intf in '..\..\DN.TextTable.Intf.pas', + DN.TextTable in '..\..\DN.TextTable.pas', + DN.ToolsApi in '..\..\DN.ToolsApi.pas', + DN.Types in '..\..\DN.Types.pas', + DN.Uninstaller.Delphinus in '..\..\DN.Uninstaller.Delphinus.pas', + DN.Uninstaller.IDE in '..\..\DN.Uninstaller.IDE.pas', + DN.Uninstaller.Intf in '..\..\DN.Uninstaller.Intf.pas', + DN.Uninstaller in '..\..\DN.Uninstaller.pas', + DN.Utils in '..\..\DN.Utils.pas', + DN.VariableResolver.Compiler.Factory in '..\..\DN.VariableResolver.Compiler.Factory.pas', + DN.VariableResolver.Compiler in '..\..\DN.VariableResolver.Compiler.pas', + DN.VariableResolver.Intf in '..\..\DN.VariableResolver.Intf.pas', + DN.VariableResolver in '..\..\DN.VariableResolver.pas', + DN.Version in '..\..\DN.Version.pas', + DN.Zip in '..\..\DN.Zip.pas'; end. diff --git a/Packages/DelphiXE/Delphinus.dproj b/Packages/DelphiXE/Delphinus.dproj index d6975ab..57a2871 100644 --- a/Packages/DelphiXE/Delphinus.dproj +++ b/Packages/DelphiXE/Delphinus.dproj @@ -71,60 +71,15 @@ dfm
DelphinusDialog
- - - - - - - - - - - - - - - - - dfm
SetupDialog
- - - - - - - - - - - - - - - dfm -
PackageDetailView
- TFrame -
- - - - - - -
DelphinusOptionsDialog
- - -
LicenseDialog
@@ -132,68 +87,154 @@
ProgressDialog
- - - - - - - - - - - - - - - - - - - - -
AboutDialog
- + +
DependencyDialog
+
+ +
TypeSelectionDialog
+
+ + + + + + + + + + + + + + + + - - - + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageDetailView
+ TFrame +
+ + + + + + + + + + + + + +
DNFolderConfigPage
+ TFrame +
+ +
DNGithubSourceConfigPage
+ TFrame +
+ + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - -
DependencyDialog
-
+ + + + + + + + + + + + + + + + +
DelphinusImages.res
diff --git a/Packages/DelphiXE6/Delphinus.dpk b/Packages/DelphiXE6/Delphinus.dpk index e10bb16..617a08b 100644 --- a/Packages/DelphiXE6/Delphinus.dpk +++ b/Packages/DelphiXE6/Delphinus.dpk @@ -144,7 +144,27 @@ contains DN.Setup.Dependency.Processor.Intf in '..\..\DN.Setup.Dependency.Processor.Intf.pas', DN.Setup.Dependency.Processor in '..\..\DN.Setup.Dependency.Processor.pas', DN.Setup.Dependency.Resolver.Install in '..\..\DN.Setup.Dependency.Resolver.Install.pas', - DN.Setup.Dependency.Resolver.UnInstall in '..\..\DN.Setup.Dependency.Resolver.UnInstall.pas'; + DN.Setup.Dependency.Resolver.UnInstall in '..\..\DN.Setup.Dependency.Resolver.UnInstall.pas', + DN.PackageSource.Registry.Intf in '..\..\DN.PackageSource.Registry.Intf.pas', + DN.PackageSource.Registry in '..\..\DN.PackageSource.Registry.pas', + DN.PackageSource.Intf in '..\..\DN.PackageSource.Intf.pas', + DN.PackageSource in '..\..\DN.PackageSource.pas', + DN.PackageSource.Settings.Intf in '..\..\DN.PackageSource.Settings.Intf.pas', + DN.PackageSource.Settings in '..\..\DN.PackageSource.Settings.pas', + DN.PackageSource.Settings.Field.Intf in '..\..\DN.PackageSource.Settings.Field.Intf.pas', + DN.PackageSource.Settings.Field in '..\..\DN.PackageSource.Settings.Field.pas', + DN.PackageSource.Github in '..\..\DN.PackageSource.Github.pas', + DN.PackageSource.Settings.Github in '..\..\DN.PackageSource.Settings.Github.pas', + DN.Character in '..\..\DN.Character.pas', + DN.PackageSource.ConfigPage in '..\..\DN.PackageSource.ConfigPage.pas', + DN.PackageSource.ConfigPage.Intf in '..\..\DN.PackageSource.ConfigPage.Intf.pas', + DN.PackageSource.ConfigPage.Github in '..\..\DN.PackageSource.ConfigPage.Github.pas' {DNGithubSourceConfigPage: TFrame}, + DN.PackageProvider.MultiSource in '..\..\DN.PackageProvider.MultiSource.pas', + DN.PackageProvider.Folder in '..\..\DN.PackageProvider.Folder.pas', + DN.PackageSource.Folder in '..\..\DN.PackageSource.Folder.pas', + DN.PackageSource.Settings.Folder in '..\..\DN.PackageSource.Settings.Folder.pas', + DN.PackageSource.ConfigPage.Folder in '..\..\DN.PackageSource.ConfigPage.Folder.pas' {DNFolderConfigPage: TFrame}, + Delphinus.OptionsDialog.TypeSelection in '..\Delphinus.OptionsDialog.TypeSelection.pas' {TypeSelectionDialog}; end. diff --git a/Packages/DelphiXE6/Delphinus.dproj b/Packages/DelphiXE6/Delphinus.dproj index eefafc2..edcd18e 100644 --- a/Packages/DelphiXE6/Delphinus.dproj +++ b/Packages/DelphiXE6/Delphinus.dproj @@ -2,7 +2,7 @@ {0990B172-C221-4312-816E-1E634AF7EE2C} Delphinus.dpk - 15.4 + 18.2 VCL True Debug @@ -13,11 +13,6 @@ true - - true - Base - true - true Base @@ -59,9 +54,6 @@ false false - - rtl;dbrtl;DbxCommonDriver;IndyCore;IndySystem;IndyProtocols;$(DCC_UsePackage) - rtl;vclimg;dbrtl;DbxCommonDriver;IndyCore;IndySystem;IndyProtocols;vcl;$(DCC_UsePackage) Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) @@ -226,6 +218,37 @@ + + + + + + + + + + + + + + +
DNGithubSourceConfigPage
+ dfm + TFrame +
+ + + + + +
DNFolderConfigPage
+ dfm + TFrame +
+ +
TypeSelectionDialog
+ dfm +
DelphinusImages.res
@@ -257,9 +280,372 @@ Microsoft Office XP Sample Automation Server Wrapper Components - + + + + Delphinus.bpl + true + + + + + 1 + + + Contents\MacOS + 0 + + + + + classes + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + + + res\values + 1 + + + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + + + 1 + + + 1 + + + 0 + + + + + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + + + + 1 + + + 1 + + + 1 + + + + + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 0 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + - False True False @@ -268,4 +654,5 @@ + diff --git a/Packages/DelphiXE6/Delphinus.res b/Packages/DelphiXE6/Delphinus.res new file mode 100644 index 0000000..36f26e2 Binary files /dev/null and b/Packages/DelphiXE6/Delphinus.res differ diff --git a/Packages/DelphiXE6/DelphinusImages.res b/Packages/DelphiXE6/DelphinusImages.res new file mode 100644 index 0000000..ff5b610 Binary files /dev/null and b/Packages/DelphiXE6/DelphinusImages.res differ diff --git a/Packages/Delphinus.CategoryFilterView.dfm b/Packages/Delphinus.CategoryFilterView.dfm index cbd9eb9..c692f45 100644 --- a/Packages/Delphinus.CategoryFilterView.dfm +++ b/Packages/Delphinus.CategoryFilterView.dfm @@ -30,6 +30,5 @@ object CategoryFilterView: TCategoryFilterView OnAdvancedCustomDrawItem = tvCategoriesAdvancedCustomDrawItem OnChange = tvCategoriesChange OnCollapsing = tvCategoriesCollapsing - ExplicitHeight = 105 end end diff --git a/Packages/Delphinus.CategoryFilterView.pas b/Packages/Delphinus.CategoryFilterView.pas index 1c6c459..94acad7 100644 --- a/Packages/Delphinus.CategoryFilterView.pas +++ b/Packages/Delphinus.CategoryFilterView.pas @@ -14,7 +14,7 @@ interface type TPackageCategory = (pcOnline, pcInstalled, pcUpdates); - TCategoryChanged = procedure(Sender: TObject; ACategory: TPackageCategory) of object; + TCategoryChanged = procedure(Sender: TObject; ACategory: TPackageCategory; ASubNode: Integer) of object; TFilterChanged = procedure(Sender: TObject; ANewFilter: TPackageFilter) of object; TCategoryFilterView = class(TFrame) @@ -29,24 +29,31 @@ TCategoryFilterView = class(TFrame) private { Private declarations } FOnlineNodeIndex: Integer; + FOnlineSubNodes: TArray; + FOnlineSubNodeNames: TArray; + FOnlineSubNodeCounts: TArray; FInstalledNodeIndex: Integer; FUpdatesNodeIndex: Integer; FOnCategoryChanged: TCategoryChanged; FOnlineCount: Integer; FInstalledCount: Integer; FUpdatesCount: Integer; - procedure CategoryChanged(ANewCategory: TPackageCategory); + procedure CategoryChanged(ANewCategory: TPackageCategory; ASubNode: Integer); function GetNumberedCaption(const AText: string; AValue: Integer): string; procedure SetInstalledCount(const Value: Integer); procedure SetOnlineCount(const Value: Integer); procedure SetUpdatesCount(const Value: Integer); + function GetSubOnlineCount(const AIndex: Integer): Integer; + procedure SetSubOnlineCount(const AIndex, Value: Integer); public { Public declarations } constructor Create(AOwner: TComponent); override; + procedure SetOnlineSubnodes(const ANames: TArray); property OnCategoryChanged: TCategoryChanged read FOnCategoryChanged write FOnCategoryChanged; property OnlineCount: Integer read FOnlineCount write SetOnlineCount; property InstalledCount: Integer read FInstalledCount write SetInstalledCount; property UpdatesCount: Integer read FUpdatesCount write SetUpdatesCount; + property SubOnlineCount[const AIndex: Integer]: Integer read GetSubOnlineCount write SetSubOnlineCount; end; implementation @@ -64,10 +71,10 @@ implementation { TCategoryFilterView } -procedure TCategoryFilterView.CategoryChanged(ANewCategory: TPackageCategory); +procedure TCategoryFilterView.CategoryChanged(ANewCategory: TPackageCategory; ASubNode: Integer); begin if Assigned(FOnCategoryChanged) then - FOnCategoryChanged(Self, ANewCategory); + FOnCategoryChanged(Self, ANewCategory, ASubNode); end; constructor TCategoryFilterView.Create(AOwner: TComponent); @@ -81,9 +88,9 @@ constructor TCategoryFilterView.Create(AOwner: TComponent); //See(in german): http://www.delphipraxis.net/89993-treenode-treeview-automatisches-destroy.html LOnlineNode := tvCategories.Items.AddChild(nil, GetNumberedCaption(COnline, FOnlineCount)); LOnlineNode.Selected := True; - FOnlineNodeIndex := LOnlineNode.AbsoluteIndex; - FInstalledNodeIndex := tvCategories.Items.AddChild(nil, GetNumberedCaption(CInstalled, FInstalledCount)).AbsoluteIndex; - FUpdatesNodeIndex := tvCategories.Items.AddChild(nil, GetNumberedCaption(CUpdates, FUpdatesCount)).AbsoluteIndex; + FOnlineNodeIndex := LOnlineNode.Index; + FInstalledNodeIndex := tvCategories.Items.AddChild(nil, GetNumberedCaption(CInstalled, FInstalledCount)).Index; + FUpdatesNodeIndex := tvCategories.Items.AddChild(nil, GetNumberedCaption(CUpdates, FUpdatesCount)).Index; LRect := LOnlineNode.DisplayRect(False); tvCategories.ClientHeight := (LRect.Bottom - LRect.Top)*3; end; @@ -103,6 +110,11 @@ function TCategoryFilterView.GetNumberedCaption(const AText: string; Result := AText; end; +function TCategoryFilterView.GetSubOnlineCount(const AIndex: Integer): Integer; +begin + Result := FOnlineSubNodeCounts[AIndex]; +end; + procedure TCategoryFilterView.SetInstalledCount(const Value: Integer); begin FInstalledCount := Value; @@ -115,6 +127,35 @@ procedure TCategoryFilterView.SetOnlineCount(const Value: Integer); tvCategories.Items.Item[FOnlineNodeIndex].Text := GetNumberedCaption(COnline, FOnlineCount); end; +procedure TCategoryFilterView.SetOnlineSubnodes(const ANames: TArray); +var + LOnlineNode, LSubNode: TTreeNode; + i: Integer; +begin + FOnlineSubNodeNames := ANames; + SetLength(FOnlineSubNodes, Length(ANames)); + SetLength(FOnlineSubNodeCounts, Length(ANames)); + LOnlineNode := tvCategories.Items.Item[FOnlineNodeIndex]; + FInstalledNodeIndex := FOnlineNodeIndex + 1; + FUpdatesNodeIndex := FOnlineNodeIndex + 2; + for i := Pred(LOnlineNode.Count) downto 0 do + tvCategories.Items.Delete(LOnlineNode.Item[i]); + + for i := 0 to High(FOnlineSubNodeNames) do + begin + LSubNode := tvCategories.Items.AddChild(LOnlineNode, FOnlineSubNodeNames[i]); + FOnlineSubNodes[i] := LSubNode.Index; + Inc(FInstalledNodeIndex); + Inc(FUpdatesNodeIndex); + end; +end; + +procedure TCategoryFilterView.SetSubOnlineCount(const AIndex, Value: Integer); +begin + FOnlineSubNodeCounts[AIndex] := Value; + tvCategories.Items[FOnlineNodeIndex].Item[FOnlineSubNodes[AIndex]].Text := GetNumberedCaption(FOnlineSubNodeNames[AIndex], Value); +end; + procedure TCategoryFilterView.SetUpdatesCount(const Value: Integer); begin FUpdatesCount := Value; @@ -135,7 +176,6 @@ procedure TCategoryFilterView.tvCategoriesAdvancedCustomDrawItem( begin LRect := Node.DisplayRect(False); LText := Node.Text; - if cdsSelected in State then LBackground := clSkyBlue else if cdsHot in State then @@ -146,8 +186,19 @@ procedure TCategoryFilterView.tvCategoriesAdvancedCustomDrawItem( Sender.Canvas.Brush.Color := LBackground; Sender.Canvas.FillRect(LRect); SetBkMode(Sender.Canvas.Handle, TRANSPARENT); - LRect.Left := 3; + LRect.Left := 16; + if Assigned(Node.Parent) then + LRect.Left := LRect.Left + 10; Sender.Canvas.TextRect(LRect, LText); + if Node.Count > 0 then + begin + LRect.Left := 2; + if Node.Expanded then + LText := '-' + else + LText := '+'; + Sender.Canvas.TextRect(LRect, LText); + end; DefaultDraw := True; end; end; @@ -155,17 +206,23 @@ procedure TCategoryFilterView.tvCategoriesAdvancedCustomDrawItem( procedure TCategoryFilterView.tvCategoriesChange(Sender: TObject; Node: TTreeNode); begin - case Node.Index of - 0: CategoryChanged(pcOnline); - 1: CategoryChanged(pcInstalled); - 2: CategoryChanged(pcUpdates); - end; + if not Assigned(Node.Parent) then + begin + if Node.AbsoluteIndex = FOnlineNodeIndex then + CategoryChanged(pcOnline, -1) + else if Node.AbsoluteIndex = FInstalledNodeIndex then + CategoryChanged(pcInstalled, -1) + else if Node.AbsoluteIndex = FUpdatesNodeIndex then + CategoryChanged(pcUpdates, -1); + end + else + CategoryChanged(pcOnline, Node.Index); end; procedure TCategoryFilterView.tvCategoriesCollapsing(Sender: TObject; Node: TTreeNode; var AllowCollapse: Boolean); begin - AllowCollapse := False; + AllowCollapse := True; end; end. diff --git a/Packages/Delphinus.Dialog.dfm b/Packages/Delphinus.Dialog.dfm index b50ecca..69e7deb 100644 --- a/Packages/Delphinus.Dialog.dfm +++ b/Packages/Delphinus.Dialog.dfm @@ -35,6 +35,7 @@ object DelphinusDialog: TDelphinusDialog BevelOuter = bvNone ShowCaption = False TabOrder = 0 + Visible = False DesignSize = ( 984 32) diff --git a/Packages/Delphinus.Dialog.pas b/Packages/Delphinus.Dialog.pas index 734fa42..28caaa9 100644 --- a/Packages/Delphinus.Dialog.pas +++ b/Packages/Delphinus.Dialog.pas @@ -30,9 +30,11 @@ interface DN.PackageFilter, DN.Version, DN.EnvironmentOptions.Intf, + DN.PackageSource.Registry.Intf, + DN.PackageSource.Settings.Intf, ExtCtrls, StdCtrls, - Registry; + Registry, System.Actions, System.ImageList; type TDelphinusDialog = class(TForm) @@ -79,11 +81,14 @@ TDelphinusDialog = class(TForm) FSettings: IDNSettings; FCategoryFilteView: TCategoryFilterView; FCategory: TPackageCategory; + FCategorySubNode: Integer; FProgressDialog: TProgressDialog; FFilter: string; FFileService: IDNFileService; FDummyPic: TGraphic; FEnvironmentOptionsService: IDNEnvironmentOptionsService; + FSourceRegistry: IDNPackageSourceRegistry; + FProviders: TList; procedure ReloadPackages; procedure InstallPackage(const APackage: IDNPackage); procedure UnInstallPackage(const APackage: IDNPackage); @@ -105,7 +110,7 @@ TDelphinusDialog = class(TForm) function CreateInstallDependencyResolver: IDNSetupDependencyResolver; function CreateUninstallDependencyResolver: IDNSetupDependencyResolver; function IsStarter: Boolean; - procedure HandleCategoryChanged(Sender: TObject; ANewCategory: TPackageCategory); + procedure HandleCategoryChanged(Sender: TObject; ANewCategory: TPackageCategory; ASubNode: Integer); procedure HandleSelectedPackageChanged(Sender: TObject); procedure HandleAsyncProgress(const ATask, AItem: string; AProgress, AMax: Int64); function GetActivePackageSource: TList; @@ -114,6 +119,7 @@ TDelphinusDialog = class(TForm) procedure FilterPackage(const APackage: IDNPackage; var AAccepted: Boolean); procedure LoadIcons; procedure ShowWarning(const AMessage: string); + function SourceSettingsFactory(const ASourceName: string; out ASettings: IDNPackageSourceSettings): Boolean; public { Public declarations } constructor Create(AOwner: TComponent); override; @@ -134,7 +140,6 @@ implementation DN.Types, DN.Package.Finder.Intf, DN.Package.Finder, - DN.PackageProvider.GitHub, DN.PackageProvider.Installed, DN.PackageProvider.State.Intf, Delphinus.SetupDialog, @@ -150,8 +155,6 @@ implementation DN.Setup.Dependency.Resolver.Uninstall, DN.Setup.Dependency.Processor, Delphinus.OptionsDialog, - DN.HttpClient.Intf, - DN.HttpClient.WinHttp, DN.Progress.Intf, DN.Settings, DN.ExpertService, @@ -163,6 +166,12 @@ implementation DN.VariableResolver.Intf, DN.VariableResolver.Compiler, DN.VariableResolver.Compiler.Factory, + DN.PackageSource.Registry, + DN.PackageSource.Intf, + DN.PackageSource.GitHub, + DN.PackageSource.GitLab, + DN.PackageSource.Folder, + DN.PackageProvider.MultiSource, Delphinus.Resources.Names, Delphinus.Resources, Delphinus.About, @@ -193,7 +202,7 @@ procedure TDelphinusDialog.actOptionsExecute(Sender: TObject); var LDialog: TDelphinusOptionsDialog; begin - LDialog := TDelphinusOptionsDialog.Create(nil); + LDialog := TDelphinusOptionsDialog.Create(FSourceRegistry); try LDialog.LoadSettings(FSettings); if LDialog.ShowModal = mrOk then @@ -230,12 +239,17 @@ procedure TDelphinusDialog.btnInstallFolderClick(Sender: TObject); constructor TDelphinusDialog.Create(AOwner: TComponent); begin inherited; - FSettings := TDNSettings.Create(); + FSourceRegistry := TDNPackageSourceRegistry.Create(); + FSourceRegistry.RegisterSource(TDNGithubPackageSource.Create() as IDNPackageSource); + FSourceRegistry.RegisterSource(TDNGitlabPackageSource.Create() as IDNPackageSource); + FSourceRegistry.RegisterSource(TDNFolderPackageSource.Create() as IDNPackageSource); + FSettings := TDNSettings.Create(SourceSettingsFactory); FPackages := TList.Create(); FInstalledPackages := TList.Create(); FUpdatePackages := TList.Create(); FFileService := TDNFileService.Create((BorlandIDEServices as IOTAServices).GetBaseRegistryKey); FEnvironmentOptionsService := TDNIDEEnvironmentOptionsService.Create(); + FProviders := TList.Create(); FProgressDialog := TProgressDialog.Create(Self); FDetailView := TPackageDetailView.Create(Self); @@ -347,6 +361,7 @@ destructor TDelphinusDialog.Destroy; FPackageProvider := nil; FInstalledPackageProvider := nil; FSettings := nil; + FProviders.Free; FDummyPic.Free; inherited; end; @@ -413,7 +428,13 @@ function TDelphinusDialog.GetActiveOverView: TPackageOverView; function TDelphinusDialog.GetActivePackageSource: TList; begin case FCategory of - pcOnline: Result := FPackages; + pcOnline: + begin + if FCategorySubNode = -1 then + Result := FPackages + else + Result := FProviders[FCategorySubNode].Packages; + end; pcInstalled: Result := FInstalledPackages; pcUpdates: Result := FUpdatePackages; else @@ -510,10 +531,10 @@ procedure TDelphinusDialog.HandleAsyncProgress(const ATask, AItem: string; ); end; -procedure TDelphinusDialog.HandleCategoryChanged(Sender: TObject; - ANewCategory: TPackageCategory); +procedure TDelphinusDialog.HandleCategoryChanged(Sender: TObject; ANewCategory: TPackageCategory; ASubNode: Integer); begin FCategory := ANewCategory; + FCategorySubNode := ASubNode; RefreshOverview(); end; @@ -595,26 +616,49 @@ procedure TDelphinusDialog.LoadIcons; procedure TDelphinusDialog.RecreatePackageProvider; var - LClient: IDNHttpClient; + LSource: IDNPackageSource; + LSetting: IDNPackageSourceSettings; + LNames: TArray; + i: Integer; begin - LClient := TDNWinHttpClient.Create(); - if FSettings.OAuthToken <> '' then - LClient.Authentication := Format(CGithubOAuthAuthentication, [FSettings.OAuthToken]); - FPackageProvider := TDNGitHubPackageProvider.Create(LClient); + FPackageProvider := nil; + FProviders.Clear; + SetLength(LNames, Length(FSettings.SourceSettings)); + i := 0; + for LSetting in FSettings.SourceSettings do + begin + if FSourceRegistry.TryGetSource(LSetting.SourceName, LSource) then + begin + FProviders.Add(LSource.NewProvider(LSetting)); + LNames[i] := LSetting.Name; + Inc(i); + end; + end; + SetLength(LNames, i); + FCategoryFilteView.SetOnlineSubnodes(LNames); + FPackageProvider := TDNMultiSourceProvider.Create(FProviders.ToArray); end; procedure TDelphinusDialog.RefreshInstalledPackages; var LInstalledPackage: IDNPackage; LState: IDNPackageProviderState; + LProvider: IDNPackageProvider; begin - if Supports(FPackageProvider, IDNPackageProviderState, LState) then + for LProvider in FProviders do begin - if LState.State <> psOk then - ShowWarning(LState.LastError) - else - pnlWarning.Visible := False; + if Supports(LProvider, IDNPackageProviderState, LState) then + begin + if LState.State <> psOk then + begin + ShowWarning(LState.LastError); + Break; + end + else + pnlWarning.Visible := False; + end; end; + if FInstalledPackageProvider.Reload() then begin FInstalledPackages.Clear; @@ -659,9 +703,13 @@ procedure TDelphinusDialog.ReloadPackages; LProgress.OnProgress := nil; TThread.Queue(nil, procedure + var + i: Integer; begin begin FCategoryFilteView.OnlineCount := FPackages.Count; + for i := 0 to Pred(FProviders.Count) do + FCategoryFilteView.SubOnlineCount[i] := FProviders[i].Packages.Count; RefreshInstalledPackages(); FProgressDialog.ModalResult := mrOk; end; @@ -697,6 +745,16 @@ procedure TDelphinusDialog.ShowWarning(const AMessage: string); pnlWarning.Visible := True; end; +function TDelphinusDialog.SourceSettingsFactory(const ASourceName: string; + out ASettings: IDNPackageSourceSettings): Boolean; +var + LSource: IDNPackageSource; +begin + Result := FSourceRegistry.TryGetSource(ASourceName, LSource); + if Result then + ASettings := LSource.NewSettings; +end; + procedure TDelphinusDialog.UnInstallPackage(const APackage: IDNPackage); var LDialog: TSetupDialog; diff --git a/Packages/Delphinus.LicenseDialog.pas b/Packages/Delphinus.LicenseDialog.pas index 500044c..df932c3 100644 --- a/Packages/Delphinus.LicenseDialog.pas +++ b/Packages/Delphinus.LicenseDialog.pas @@ -6,7 +6,8 @@ interface Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, DN.Package.Intf, - Delphinus.Forms, Vcl.ComCtrls; + Delphinus.Forms, + ComCtrls; type TLicenseDialog = class(TForm) diff --git a/Packages/Delphinus.OptionsDialog.TypeSelection.dfm b/Packages/Delphinus.OptionsDialog.TypeSelection.dfm new file mode 100644 index 0000000..238a781 --- /dev/null +++ b/Packages/Delphinus.OptionsDialog.TypeSelection.dfm @@ -0,0 +1,73 @@ +object TypeSelectionDialog: TTypeSelectionDialog + Left = 0 + Top = 0 + BorderStyle = bsDialog + Caption = 'Source Type Selection' + ClientHeight = 125 + ClientWidth = 309 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + DesignSize = ( + 309 + 125) + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 8 + Top = 8 + Width = 125 + Height = 13 + Caption = 'Select the type of source:' + end + object Label2: TLabel + Left = 8 + Top = 51 + Width = 31 + Height = 13 + Caption = 'Name:' + end + object cbSourceType: TComboBox + Left = 8 + Top = 24 + Width = 293 + Height = 21 + Style = csDropDownList + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + end + object btnOK: TButton + Left = 145 + Top = 92 + Width = 75 + Height = 25 + Anchors = [akRight, akBottom] + Caption = 'OK' + TabOrder = 1 + OnClick = btnOKClick + end + object btnCancel: TButton + Left = 226 + Top = 92 + Width = 75 + Height = 25 + Anchors = [akRight, akBottom] + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 2 + end + object edSourceName: TEdit + Left = 8 + Top = 67 + Width = 293 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 3 + TextHint = 'New Name' + end +end diff --git a/Packages/Delphinus.OptionsDialog.TypeSelection.pas b/Packages/Delphinus.OptionsDialog.TypeSelection.pas new file mode 100644 index 0000000..3b84c3b --- /dev/null +++ b/Packages/Delphinus.OptionsDialog.TypeSelection.pas @@ -0,0 +1,95 @@ +unit Delphinus.OptionsDialog.TypeSelection; + +interface + +uses + Messages, + SysUtils, + Variants, + Classes, + Graphics, + Controls, + Forms, + Dialogs, + StdCtrls, + DN.PackageSource.Intf; + +type + TIsNameValid = reference to function(const AName: string): Boolean; + + TTypeSelectionDialog = class(TForm) + cbSourceType: TComboBox; + btnOK: TButton; + btnCancel: TButton; + Label1: TLabel; + Label2: TLabel; + edSourceName: TEdit; + procedure btnOKClick(Sender: TObject); + private + FOnValidateName: TIsNameValid; + FSources: TArray; + function GetSelectedSource: IDNPackageSource; + function GetSourceName: string; + { Private declarations } + public + { Public declarations } + constructor Create(const ASources: TArray); reintroduce; + property SelectedSource: IDNPackageSource read GetSelectedSource; + property SourceName: string read GetSourceName; + property OnValidateName: TIsNameValid read FOnValidateName write FOnValidateName; + end; + +var + TypeSelectionDialog: TTypeSelectionDialog; + +implementation + +{$R *.dfm} + +procedure TTypeSelectionDialog.btnOKClick(Sender: TObject); +var + LName: string; +begin + if cbSourceType.ItemIndex < 0 then + begin + MessageDlg('You must select a sourcetype!', mtInformation, [mbOK], 0); + Exit; + end; + + LName := SourceName; + if LName = '' then + begin + MessageDlg('Name can not be empty!', mtInformation, [mbOK], 0); + Exit; + end; + + if not FOnValidateName(LName) then + begin + MessageDlg('Name is already in use!', mtInformation, [mbOK], 0); + Exit; + end; + ModalResult := mrOk; +end; + +constructor TTypeSelectionDialog.Create( + const ASources: TArray); +var + LSource: IDNPackageSource; +begin + inherited Create(nil); + FSources := ASources; + for LSource in FSources do + cbSourceType.Items.Add(LSource.Name); +end; + +function TTypeSelectionDialog.GetSelectedSource: IDNPackageSource; +begin + Result := FSources[cbSourceType.ItemIndex]; +end; + +function TTypeSelectionDialog.GetSourceName: string; +begin + Result := Trim(edSourceName.Text); +end; + +end. diff --git a/Packages/Delphinus.OptionsDialog.dfm b/Packages/Delphinus.OptionsDialog.dfm index d8e2140..fde46ee 100644 --- a/Packages/Delphinus.OptionsDialog.dfm +++ b/Packages/Delphinus.OptionsDialog.dfm @@ -4,8 +4,8 @@ object DelphinusOptionsDialog: TDelphinusOptionsDialog BorderIcons = [biSystemMenu] BorderStyle = bsSingle Caption = 'Options' - ClientHeight = 166 - ClientWidth = 395 + ClientHeight = 408 + ClientWidth = 525 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -14,55 +14,99 @@ object DelphinusOptionsDialog: TDelphinusOptionsDialog Font.Style = [] OldCreateOrder = False Position = poMainFormCenter + DesignSize = ( + 525 + 408) PixelsPerInch = 96 TextHeight = 13 object Label1: TLabel - Left = 8 - Top = 8 - Width = 64 + Left = 3 + Top = 36 + Width = 42 Height = 13 - Caption = 'OAuth-Token' - end - object lbResponse: TLabel - Left = 8 - Top = 54 - Width = 298 - Height = 13 - AutoSize = False - end - object edToken: TEdit - Left = 8 - Top = 27 - Width = 298 - Height = 21 - PasswordChar = '*' - TabOrder = 0 - end - object btnTest: TButton - Left = 312 - Top = 25 - Width = 75 - Height = 25 - Caption = 'Test' - TabOrder = 1 - OnClick = btnTestClick + Caption = 'Sources:' end object btnOK: TButton - Left = 231 - Top = 133 + Left = 364 + Top = 381 Width = 75 Height = 25 + Anchors = [akRight, akBottom] Caption = 'OK' ModalResult = 1 - TabOrder = 2 + TabOrder = 0 + ExplicitLeft = 221 + ExplicitTop = 152 end object btnCancel: TButton - Left = 312 - Top = 133 + Left = 445 + Top = 381 Width = 75 Height = 25 + Anchors = [akRight, akBottom] Caption = 'Cancel' ModalResult = 2 + TabOrder = 1 + ExplicitLeft = 302 + ExplicitTop = 152 + end + object lvSources: TListView + AlignWithMargins = True + Left = 3 + Top = 55 + Width = 126 + Height = 350 + Margins.Top = 25 + Align = alLeft + Columns = <> + TabOrder = 2 + ViewStyle = vsList + OnSelectItem = lvSourcesSelectItem + ExplicitHeight = 121 + end + object pnlSettings: TPanel + Left = 135 + Top = 33 + Width = 385 + Height = 342 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone TabOrder = 3 + ExplicitWidth = 242 + ExplicitHeight = 113 + end + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 525 + Height = 30 + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 31 + Caption = 'ToolBar1' + Images = ilToolbar + TabOrder = 4 + ExplicitWidth = 382 + object tbAdd: TToolButton + Left = 0 + Top = 0 + Caption = 'tbAdd' + ImageIndex = 0 + OnClick = tbAddClick + end + object tbDelete: TToolButton + Left = 31 + Top = 0 + Caption = 'tbDelete' + ImageIndex = 1 + OnClick = tbDeleteClick + end + end + object ilToolbar: TImageList + ColorDepth = cd32Bit + Height = 24 + Width = 24 + Left = 184 + Top = 88 end end diff --git a/Packages/Delphinus.OptionsDialog.pas b/Packages/Delphinus.OptionsDialog.pas index ea4a6c1..0f77097 100644 --- a/Packages/Delphinus.OptionsDialog.pas +++ b/Packages/Delphinus.OptionsDialog.pas @@ -10,24 +10,44 @@ interface uses + Generics.Collections, Windows, Messages, SysUtils, Variants, Classes, Graphics, - Controls, Forms, Dialogs, - Delphinus.Forms, StdCtrls, - DN.Settings.Intf; + Controls, Forms, + Dialogs, + Delphinus.Forms, + DN.PackageSource.Registry.Intf, + DN.Settings.Intf, + DN.PackageSource.Settings.Intf, + DN.PackageSource.ConfigPage.Intf, + StdCtrls, + ComCtrls, + ExtCtrls, ToolWin, ImgList, System.ImageList; type TDelphinusOptionsDialog = class(TForm) - edToken: TEdit; - Label1: TLabel; - btnTest: TButton; btnOK: TButton; btnCancel: TButton; - lbResponse: TLabel; - procedure btnTestClick(Sender: TObject); + lvSources: TListView; + pnlSettings: TPanel; + ToolBar1: TToolBar; + tbAdd: TToolButton; + tbDelete: TToolButton; + ilToolbar: TImageList; + Label1: TLabel; + procedure lvSourcesSelectItem(Sender: TObject; Item: TListItem; + Selected: Boolean); + procedure tbDeleteClick(Sender: TObject); + procedure tbAddClick(Sender: TObject); private { Private declarations } + FRegistry: IDNPackageSourceRegistry; + FSettings: TList; + FPages: TDictionary; + procedure RebuildSettingsList; public { Public declarations } + constructor Create(const ARegistry: IDNPackageSourceRegistry); reintroduce; + destructor Destroy; override; procedure LoadSettings(const ASettings: IDNSettings); procedure StoreSettings(const ASettings: IDNSettings); end; @@ -38,48 +58,130 @@ TDelphinusOptionsDialog = class(TForm) implementation uses - DN.PackageProvider.GitHub, - DN.JSon, - DN.HttpClient.Intf, - DN.HttpClient.WinHttp; + DN.PackageSource.Intf, + Delphinus.Resources, + Delphinus.Resources.Names, + Delphinus.OptionsDialog.TypeSelection; {$R *.dfm} { TDelphinusOptionsDialog } -procedure TDelphinusOptionsDialog.btnTestClick(Sender: TObject); +constructor TDelphinusOptionsDialog.Create(const ARegistry: IDNPackageSourceRegistry); +begin + inherited Create(nil); + FSettings := TList.Create(); + FPages := TDictionary.Create(); + FRegistry := ARegistry; + tbAdd.ImageIndex := AddIconToImageList(ilToolbar, Ico_Add); + tbDelete.ImageIndex := AddIconToImageList(ilToolbar, Ico_Delete); +end; + +destructor TDelphinusOptionsDialog.Destroy; +begin + FPages.Free; + FSettings.Free; + inherited; +end; + +procedure TDelphinusOptionsDialog.LoadSettings(const ASettings: IDNSettings); +begin + FSettings.Clear(); + FSettings.AddRange(ASettings.SourceSettings); + RebuildSettingsList(); +end; + +procedure TDelphinusOptionsDialog.lvSourcesSelectItem(Sender: TObject; + Item: TListItem; Selected: Boolean); var - LClient: IDNHttpClient; - LResult: Integer; - LResponse: string; - LJSon: TJSONObject; + LSource: IDNPackageSource; + LSettings: IDNPackageSourceSettings; + LPage, LOldPage: IDNPackageSourceConfigPage; begin - LClient := TDNWinHttpClient.Create(); - LClient.Authentication := Format(CGithubOAuthAuthentication, [Trim(edToken.Text)]); - LResult := LClient.GetText('https://api.github.com/user', LResponse); - if LResult = HTTPErrorOk then + LPage := nil; + if Selected then begin - LJSon := TJSonObject.ParseJSONValue(LResponse) as TJSonObject; - try - lbResponse.Caption := 'Authenticated as ' + LJSon.GetValue('login').Value; - finally - LJSon.Free; + LSettings := FSettings[Item.Index]; + if not FPages.TryGetValue(LSettings, LPage) then + begin + if not FRegistry.TryGetSource(LSettings.SourceName, LSource) then + Exit; + LPage := LSource.NewConfigPage; + FPages.Add(LSettings, LPage); end; - end - else - begin - lbResponse.Caption := 'Failed with ResponseCode ' + IntToStr(LResult); + LPage.Parent := pnlSettings; + LPage.Load(LSettings); end; + + for LOldPage in FPages.Values do + if LOldPage <> LPage then + LOldPage.Parent := nil; end; -procedure TDelphinusOptionsDialog.LoadSettings(const ASettings: IDNSettings); +procedure TDelphinusOptionsDialog.RebuildSettingsList; +var + LSetting: IDNPackageSourceSettings; begin - edToken.Text := ASettings.OAuthToken; + lvSources.Clear; + for LSetting in FSettings do + lvSources.AddItem(LSetting.Name, nil); end; procedure TDelphinusOptionsDialog.StoreSettings(const ASettings: IDNSettings); +var + LPair: TPair; +begin + for LPair in FPages do + LPair.Value.Save(LPair.Key); + ASettings.SourceSettings := FSettings.ToArray; +end; + +procedure TDelphinusOptionsDialog.tbDeleteClick(Sender: TObject); +var + LSettings: IDNPackageSourceSettings; + LPage: IDNPackageSourceConfigPage; begin - ASettings.OAuthToken := Trim(edToken.Text); + if lvSources.ItemIndex > -1 then + begin + LSettings := FSettings[lvSources.ItemIndex]; + if FPages.TryGetValue(LSettings, LPage) then + begin + LPage.Parent := nil; + FPages.Remove(LSettings); + end; + + FSettings.Delete(lvSources.ItemIndex); + RebuildSettingsList; + end; +end; + +procedure TDelphinusOptionsDialog.tbAddClick(Sender: TObject); +var + LDialog: TTypeSelectionDialog; + LSettings: IDNPackageSourceSettings; +begin + LDialog := TTypeSelectionDialog.Create(FRegistry.Sources); + try + LDialog.OnValidateName := + function(const AName: string): Boolean + var + LSettings: IDNPackageSourceSettings; + begin + Result := True; + for LSettings in FSettings do + if AnsiSameText(LSettings.Name, AName) then + Exit(False); + end; + if LDialog.ShowModal() = mrOk then + begin + LSettings := LDialog.SelectedSource.NewSettings; + LSettings.Name := LDialog.SourceName; + FSettings.Add(LSettings); + RebuildSettingsList; + end; + finally + LDialog.Free; + end; end; end. diff --git a/Packages/Delphinus.Resources.Names.pas b/Packages/Delphinus.Resources.Names.pas index 6ea1c81..c872d4c 100644 --- a/Packages/Delphinus.Resources.Names.pas +++ b/Packages/Delphinus.Resources.Names.pas @@ -14,6 +14,7 @@ interface Ico_Agreement = 'Ico_Agreement'; Ico_Agreement_Disabled = 'Ico_Agreement_Disabled'; Ico_Close = 'Ico_Close'; + Ico_Add = 'Ico_Add'; Ico_Delete = 'Ico_Delete'; Ico_Delphinus = 'Ico_Dolphin16'; Ico_Delphinus32 = 'Ico_Dolphin32'; diff --git a/Packages/DelphinusImages.rc b/Packages/DelphinusImages.rc index acd1f64..4790622 100644 --- a/Packages/DelphinusImages.rc +++ b/Packages/DelphinusImages.rc @@ -2,6 +2,7 @@ Ico_About ICON "..\\Icons\\About.ico" Ico_Agreement ICON "..\\Icons\\Agreement.ico" Ico_Agreement_Disabled ICON "..\\Icons\\AGreement_Disabled.ico" Ico_Close ICON "..\\Icons\\Close.ico" +Ico_Add ICON "..\\Icons\\Add.ico" Ico_Delete ICON "..\\Icons\\Delete.ico" Ico_Dolphin16 ICON "..\\Icons\\Dolphin16.ico" Ico_Dolphin32 ICON "..\\Icons\\Dolphin32.ico" diff --git a/Tools/Commandline/DN.DPM.pas b/Tools/Commandline/DN.DPM.pas index 9c829fe..513ecec 100644 --- a/Tools/Commandline/DN.DPM.pas +++ b/Tools/Commandline/DN.DPM.pas @@ -9,7 +9,9 @@ interface DN.Command.Environment.Intf, DN.PackageProvider.Intf, DN.Settings.Intf, - DN.DelphiInstallation.Provider.Intf; + DN.DelphiInstallation.Provider.Intf, + DN.PackageSource.Settings.Intf, + DN.PackageSource.Registry.Intf; type TDPM = class @@ -19,6 +21,9 @@ TDPM = class FOnlinePackageProvider: IDNPackageProvider; FDelphiProvider: IDNDelphiInstallationProvider; FDispatcher: IDNCommandDispatcher; + FSourceRegistry: IDNPackageSourceRegistry; + function SourceSettingsFactory(const ASourceName: string; + out ASettings: IDNPackageSourceSettings): Boolean; function GetCommandLine: string; function GetKnownCommands: TArray; public @@ -52,17 +57,36 @@ implementation DN.HttpClient.WinHttp, DN.Settings, DN.DelphiInstallation.Editions, - DN.DelphiInstallation.Provider; + DN.DelphiInstallation.Provider, + DN.PackageSource.Intf, + DN.PackageSource.Registry, + DN.PackageSource.Github, + DN.PackageSource.Gitlab, + DN.PackageSource.Folder; { TDPM } +function TDPM.SourceSettingsFactory(const ASourceName: string; + out ASettings: IDNPackageSourceSettings): Boolean; +var + LSource: IDNPackageSource; +begin + Result := FSourceRegistry.TryGetSource(ASourceName, LSource); + if Result then + ASettings := LSource.NewSettings; +end; + constructor TDPM.Create; var LHTTP: IDNHttpClient; LFactory: TInstalledPackageProviderFactory; begin inherited; - FSettings := TDNSettings.Create(); + FSourceRegistry := TDNPackageSourceRegistry.Create(); + FSourceRegistry.RegisterSource(TDNGithubPackageSource.Create() as IDNPackageSource); + FSourceRegistry.RegisterSource(TDNGitlabPackageSource.Create() as IDNPackageSource); + FSourceRegistry.RegisterSource(TDNFolderPackageSource.Create() as IDNPackageSource); + FSettings := TDNSettings.Create(SourceSettingsFactory); LHTTP := TDNWinHttpClient.Create(); if FSettings.OAuthToken <> '' then LHTTP.Authentication := Format(CGithubOAuthAuthentication, [FSettings.OAuthToken]); diff --git a/Tools/WebSetup/Delphinus.WebSetup.Dialog.dfm b/Tools/WebSetup/Delphinus.WebSetup.Dialog.dfm index f5fe1ea..3c91c60 100644 --- a/Tools/WebSetup/Delphinus.WebSetup.Dialog.dfm +++ b/Tools/WebSetup/Delphinus.WebSetup.Dialog.dfm @@ -37,6 +37,10 @@ object DNWebSetupDialog: TDNWebSetupDialog Enabled = False ImageIndex = 4 TabVisible = False + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 object Image2: TImage Left = 3 Top = 16 @@ -178,6 +182,10 @@ object DNWebSetupDialog: TDNWebSetupDialog object tsProgress: TTabSheet ImageIndex = 2 TabVisible = False + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 DesignSize = ( 404 167) @@ -212,6 +220,10 @@ object DNWebSetupDialog: TDNWebSetupDialog Caption = 'Log' ImageIndex = 3 TabVisible = False + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 object mLog: TMemo Left = 0 Top = 0 @@ -300,7 +312,7 @@ object DNWebSetupDialog: TDNWebSetupDialog Left = 408 Top = 72 Bitmap = { - 494C0101010008004C0010001000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600 + 494C010101000800040010001000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600 0000000000003600000028000000400000001000000001002000000000000010 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 diff --git a/Tools/WebSetup/Delphinus.WebSetup.Dialog.pas b/Tools/WebSetup/Delphinus.WebSetup.Dialog.pas index aa8bd95..55249de 100644 --- a/Tools/WebSetup/Delphinus.WebSetup.Dialog.pas +++ b/Tools/WebSetup/Delphinus.WebSetup.Dialog.pas @@ -16,7 +16,10 @@ interface DN.VariableResolver.Intf, DN.VariableResolver.Compiler.Factory, Buttons, ActnList, - pngimage; + pngimage, System.ImageList, + DN.PackageSource.Registry, + DN.PackageSource.Registry.Intf, + DN.PackageSource.Settings.Intf; type TDNWebSetupDialog = class(TForm) @@ -64,6 +67,9 @@ TDNWebSetupDialog = class(TForm) FCanExitPage: TDictionary>; FSettings: IDNElevatedSettings; FLog: TStringList; + FSourceRegistry: IDNPackageSourceRegistry; + function SourceSettingsFactory(const ASourceName: string; + out ASettings: IDNPackageSourceSettings): Boolean; procedure FillVersions; procedure LoadPackage; procedure RunSetupAsync; @@ -116,7 +122,11 @@ implementation DN.Package.Version.Intf, DN.VariableResolver.Compiler, DN.DelphiInstallation.Editions, - Delphinus.WebSetup; + Delphinus.WebSetup, + DN.PackageSource.Intf, + DN.PackageSource.Github, + DN.PackageSource.Gitlab, + DN.PackageSource.Folder; {$R *.dfm} @@ -179,6 +189,16 @@ procedure TDNWebSetupDialog.cbNoVersionClick(Sender: TObject); cbVersions.Enabled := not cbNoVersion.Checked; end; +function TDNWebSetupDialog.SourceSettingsFactory(const ASourceName: string; + out ASettings: IDNPackageSourceSettings): Boolean; +var + LSource: IDNPackageSource; +begin + Result := FSourceRegistry.TryGetSource(ASourceName, LSource); + if Result then + ASettings := LSource.NewSettings; +end; + constructor TDNWebSetupDialog.Create(AOwner: TComponent); begin inherited; @@ -195,8 +215,12 @@ constructor TDNWebSetupDialog.Create(AOwner: TComponent); FCanExitPage.Add(tsDelphiSelection, DelphiSelectionCanExit); FCanExitPage.Add(tsSettings, SettingsCanExit); - FLog := TStringList.Create(); - FSettings := TDNSettings.Create(); + FSourceRegistry := TDNPackageSourceRegistry.Create(); + FSourceRegistry.RegisterSource(TDNGithubPackageSource.Create() as IDNPackageSource); + FSourceRegistry.RegisterSource(TDNGitlabPackageSource.Create() as IDNPackageSource); + FSourceRegistry.RegisterSource(TDNFolderPackageSource.Create() as IDNPackageSource); + FLog := TStringList.Create; + FSettings := TDNSettings.Create(SourceSettingsFactory); if FSettings.InstallationDirectory <> '' then begin edInstallDirectory.Text := FSettings.InstallationDirectory;