rs26src.zip from torry.net

This commit is contained in:
2020-09-21 23:06:13 +00:00
commit fa01ec3931
79 changed files with 13525 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,66 @@
unit AboutDlgUnit;
{-------------------------------------------------------------------------------
About Dialog Unit
-----------------
The about dialog shows copyright and other information about Resource.
---------------------------------------------
reSource v2.6
Copyright (C) 1998-2001 Victor Kasenda / gruv
http://go.to/gruv
email: vickas@singnet.com.sg
---------------------------------------------
-------------------------------------------------------------------------------}
(**) interface (**)
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, ComCtrls, ExtCtrls, ShellAPI;
type
TAboutDlg = class(TForm)
Label1: TLabel;
CopyrightLabel: TLabel;
VersionLabel: TLabel;
Label4: TLabel;
Label5: TLabel;
Label2: TLabel;
Button1: TButton;
Button2: TButton;
procedure FormShow(Sender: TObject);
procedure Label2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
AboutDlg: TAboutDlg;
(**) implementation (**)
uses CreditFormUnit, StructsUnit;
{$R *.DFM}
procedure TAboutDlg.FormShow(Sender: TObject);
begin
VersionLabel.Caption := reSourceVerStr;
CopyrightLabel.Caption := reSourceCopyrightStr;
end;
procedure TAboutDlg.Label2Click(Sender: TObject);
begin
ShellExecute(0, Nil, 'http://gruv.tripod.com/resource/', Nil, Nil, SW_NORMAL);
end;
procedure TAboutDlg.Button1Click(Sender: TObject);
begin
CreditsForm.ShowModal;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,101 @@
unit AddOptionsDlgUnit;
{-------------------------------------------------------------------------------
Add Options Dialog Unit
-----------------------
---------------------------------------------
reSource v2.6
Copyright (C) 1998-2001 Victor Kasenda / gruv
http://go.to/gruv
email: vickas@singnet.com.sg
---------------------------------------------
Desc:
Shown when the user wants to add files to the archive.
Allows user to select files to add to the archive through the use of
a FileList. A directory tree allows the uses to change directory easily.
User can also change drive through a combo box.
No typing in of files to add is required. User need only select the files
to add.
Notes:
The dialog will check if the user selected the archive file itself to
be added. It is impossible to add the archive file to itself so an error
will be reported. The archive file will be deselected from the FileList and
the user can confirm again the files he selected.
This check is only done when the OK button is pressed because it is the most
efficient implementation for the set of controls. There are no support events
for "OnSelectChange" or similar events.
Not supported:
Directories cannot be added to the archive. To add all files in a directory,
select all of them in the FileList.
-------------------------------------------------------------------------------}
(**) interface (**)
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, ComCtrls, FileCtrl;
type
TAddOptionsDlg = class(TForm)
OKBtn: TBitBtn;
CancelBtn: TBitBtn;
DirectoryListBox: TDirectoryListBox;
FileListBox: TFileListBox;
DriveComboBox: TDriveComboBox;
procedure FormCreate(Sender: TObject);
procedure OKBtnClick(Sender: TObject);
private
public
{set parameters before calling for error check}
archive_file_folder, archive_file_name: string;
end;
var
AddOptionsDlg: TAddOptionsDlg;
(**) implementation (**)
{$R *.DFM}
procedure TAddOptionsDlg.FormCreate(Sender: TObject);
begin
{$IFDEF DEBUG}
//DirectoryListBox.Directory := 'c:\ctest\corpus';
{$ENDIF}
end;
procedure TAddOptionsDlg.OKBtnClick(Sender: TObject);
var
i: integer;
begin
// Check that the archive file is not added in
// The directory format stored in FileListBox.Directory does not include
// the back slash, so it must be added
if (CompareText(FileListBox.Directory + '\', archive_file_folder) = 0) then
begin
for i := 0 to FileListBox.Items.Count-1 do
begin
if FileListBox.Selected[i] then
if (CompareText(FileListBox.Items[i], archive_file_name) = 0) then
begin
// found the archive file that was selected
// show message box to deselect it
Application.MessageBox('You have selected the archive file. It will be deselected.',
'Select Error', 0);
// deselect the file
FileListBox.Selected[i] := false;
// prevent the form from closing for the user to confirm selection again
ModalResult := 0;
break;
end;
end;
end;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,72 @@
unit BrowseForDirUnit;
{-------------------------------------------------------------------------------
Browse for Dir Unit
-------------------
Contains a form which allows the user to select a directory by means of
a directory tree.
---------------------------------------------
reSource v2.6
Copyright (C) 1998-2001 Victor Kasenda / gruv
http://go.to/gruv
email: vickas@singnet.com.sg
---------------------------------------------
Used in:
ConigDialog, where the user selects the custom temp directory.
Usage:
retrieve the directory from the directory property.
The dialog box will open in the current directory.
-------------------------------------------------------------------------------}
(**) interface (**)
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, FileCtrl;
type
TBrowseForDirForm = class(TForm)
DirectoryListBox: TDirectoryListBox;
OKBtn: TBitBtn;
CancelBtn: TBitBtn;
Label1: TLabel;
Label2: TLabel;
procedure OKBtnClick(Sender: TObject);
procedure CancelBtnClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
fdirectory: string;
public
property directory: string read fdirectory;
end;
var
BrowseForDirForm: TBrowseForDirForm;
(**) implementation (**)
Uses Main;
{$R *.DFM}
procedure TBrowseForDirForm.OKBtnClick(Sender: TObject);
begin
fdirectory := DirectoryListBox.Directory;
end;
procedure TBrowseForDirForm.CancelBtnClick(Sender: TObject);
begin
fdirectory := '';
end;
procedure TBrowseForDirForm.FormShow(Sender: TObject);
begin
CentreFormToMain(Self);
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,204 @@
unit CompressionStatsDlgUnit;
{-------------------------------------------------------------------------------
Compression Statistics Dialog Unit
----------------------------------
---------------------------------------------
reSource v2.6
Copyright (C) 1998-2001 Victor Kasenda / gruv
http://go.to/gruv
email: vickas@singnet.com.sg
---------------------------------------------
Desc:
The compression stats dialog shows compression stats and averages for the
files in the archive.
Useful for comparing against other archivers.
Features:
Able to print out the compression stats.
Font can be changed.
Workings:
The stats are calculated just before the form is shown. (OnShow)
-------------------------------------------------------------------------------}
(**) interface (**)
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Menus, StdCtrls, Buttons, ComCtrls;
type
TCompressionStatsDlg = class(TForm)
RichEdit: TRichEdit;
PrintDialog: TPrintDialog;
MainMenu: TMainMenu;
File1: TMenuItem;
MIPrint: TMenuItem;
MIExit: TMenuItem;
FontDialog: TFontDialog;
RichEditPopup: TPopupMenu;
MIFont: TMenuItem;
N1: TMenuItem;
MICopytoClipboard: TMenuItem;
procedure MIPrintClick(Sender: TObject);
procedure MIExitClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FontDialogApply(Sender: TObject; Wnd: Integer);
procedure MIFontClick(Sender: TObject);
procedure MICopytoClipboardClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
CompressionStatsDlg: TCompressionStatsDlg;
(**) implementation (**)
uses Main, ArchiveHeadersUnit, StructsUnit;
{$R *.DFM}
procedure TCompressionStatsDlg.MIPrintClick(Sender: TObject);
begin
if PrintDialog.Execute then
begin
// print the statistics
RichEdit.Print('Caption');
end;
end;
procedure TCompressionStatsDlg.MIExitClick(Sender: TObject);
begin
Close;
end;
procedure TCompressionStatsDlg.FormShow(Sender: TObject);
procedure AddColLine(const s: string);
begin
// The tabs have to be set for every paragraph in Rich Edit.
// Each line is a paragraph, so the tabs have to be set for every line.
with RichEdit do
begin
SelStart := length(Text);
With Paragraph do
begin
Tab[0] := 100; // filename
Tab[1] := Tab[0] + 80; // uncompressed
Tab[2] := Tab[1] + 80; // compressed
Tab[3] := Tab[2] + 80; // ratio
Tab[4] := Tab[3] + 80; // bits per byte
end;
Lines.Add(s);
end;
end;
var
i: integer;
CentralFileHeader: TCentralFileHeader;
s, ws: string;
total_bits_per_byte: extended;
bits_per_byte: extended;
compression_ratio, total_ratio: integer; // ratios
total_raw_size, total_compressed_size: integer;
num_files: integer;
begin
CentreFormToMain(Self);
with RichEdit.Lines, MainForm do
begin
num_files := Resource1.ArchiveMan.ArchiveFile.CentralDir.Count;
total_bits_per_byte := 0;
total_ratio := 0;
total_raw_size := 0;
total_compressed_size := 0;
Clear;
Add('reSource Engine ' + reSourceVerStr);
Add('Burrows Wheeler Transformation (BWT) Compression');
Add('');
Add('Compression statistics for file: ' + Resource1.ArchiveMan.archive_file_full_path);
Add('');
if (num_files > 0) then
begin
AddColLine('File name' + #9 + 'Raw size' + #9 + 'Compressed' + #9 + 'Ratio' + #9 + 'Bits per byte');
AddColLine('---------' + #9 + '--------' + #9 + '----------' + #9 + '-----' + #9 + '-------------');
for i := 0 to num_files-1 do
begin
CentralFileHeader := Resource1.ArchiveMan.ArchiveFile.CentralDir[i] as TCentralFileHeader;
with CentralFileHeader do
begin
// update bits per byte
bits_per_byte := GetBitsPerByte(compressed_size, uncompressed_size);
total_bits_per_byte := total_bits_per_byte + bits_per_byte;
// update compression ratio
compression_ratio := GetCompressionRatio(compressed_size, uncompressed_size);
inc(total_ratio, compression_ratio);
// update totals
inc(total_raw_size, uncompressed_size);
inc(total_compressed_size, compressed_size);
s := '';
s := filename + #9 +
IntToStr(uncompressed_size) + #9 +
IntToStr(compressed_size) + #9 +
IntToStr(compression_ratio) + '%' + #9 +
GetBitsPerByteStr(compressed_size, uncompressed_size);
AddColLine(s);
end;
end;
Str((total_bits_per_byte / num_files):5:3 {(total_compressed_size * 8 / total_raw_size):5:3}, ws);
s := 'Average' + #9 +
IntToStr(total_raw_size) + #9 +
IntToStr(total_compressed_size) + #9 +
IntToStr(total_ratio div num_files) + '%' + #9 + // add average ratio
ws; // add average bits per byte
AddColLine('---------' + #9 + '------------' + #9 + '----------' + #9 + '-----' + #9 + '-------------');
AddColLine(s);
Add('');
Add('Number of files: ' + IntToStr(num_files));
end
else
begin
Add('There are no files in this archive.');
end;
end; {with}
end;
procedure TCompressionStatsDlg.FontDialogApply(Sender: TObject;
Wnd: Integer);
begin
RichEdit.Font := FontDialog.Font;
end;
procedure TCompressionStatsDlg.MIFontClick(Sender: TObject);
begin
FontDialog.Font := RichEdit.Font;
if FontDialog.Execute then
RichEdit.Font := FontDialog.Font;
end;
procedure TCompressionStatsDlg.MICopytoClipboardClick(Sender: TObject);
begin
MainForm.ShowBusy;
with RichEdit do
begin
SelectAll; // select everything then copy to clipboard
CopyToClipBoard;
SelLength := 0; // deselect everything
end;
MainForm.ShowReady;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,144 @@
unit ConfigDlgUnit;
{-------------------------------------------------------------------------------
Configuration Dialog Unit
-------------------------
---------------------------------------------
reSource v2.6
Copyright (C) 1998-2001 Victor Kasenda / gruv
http://go.to/gruv
email: vickas@singnet.com.sg
---------------------------------------------
Desc:
The interface for ConfigMan.
Anything that is configurable by the user is exposed through ConfigDlg
It will also check if the input is valid.
-------------------------------------------------------------------------------}
(**) interface (**)
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, ComCtrls;
type
TConfigDlg = class(TForm)
PageControl: TPageControl;
OKBtn: TBitBtn;
CancelBtn: TBitBtn;
TabSheet1: TTabSheet;
GroupBox1: TGroupBox;
RBUseWindowsDefaultTempDir: TRadioButton;
RBUseCustomTempDir: TRadioButton;
WinDefTempDirLabel: TLabel;
TabSheet2: TTabSheet;
GroupBox2: TGroupBox;
XBConfirmOnDelete: TCheckBox;
CustomTempDirBtn: TBitBtn;
CustomTempDirLabel: TLabel;
procedure FormActivate(Sender: TObject);
procedure CustomTempDirBtnClick(Sender: TObject);
procedure OKBtnClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
public
end;
var
ConfigDlg: TConfigDlg;
(**) implementation (**)
uses ConfigUnit, BrowseForDirUnit, EDosUnit, Main;
{$R *.DFM}
{-------------------------------------------------------------------------------
FormActivate
------------
Init all the fields with their respective data from ConfigMan.
-------------------------------------------------------------------------------}
procedure TConfigDlg.FormActivate(Sender: TObject);
begin
// read in the config from ConfigMan
with ConfigMan do
begin
// temporary directory
WinDefTempDirLabel.Caption := ConfigMan.default_temp_dir;
if (temp_dir = default_temp_dir) then
RBUseWindowsDefaultTempDir.Checked := true
else
begin
RBUseCustomTempDir.Checked := true;
CustomTempDirLabel.Caption := temp_dir;
end;
// confirmation
XBConfirmOnDelete.Checked := confirm_on_delete;
end;
end;
{-------------------------------------------------------------------------------
CustomTempDirBtnClick
---------------------
Let the user choose their own cutom directory using BrowseForDirForm.
Will auto select the radio button for custom temp dir if user has not done so
-------------------------------------------------------------------------------}
procedure TConfigDlg.CustomTempDirBtnClick(Sender: TObject);
var
dir: string;
begin
if (BrowseForDirForm.ShowModal = mrOK) then
begin
dir := BrowseForDirForm.Directory;
EDos.AddSlash(dir);
CustomTempDirLabel.Caption := dir;
RBUseCustomTempDir.Checked := true;
end
else
RBUseWindowsDefaultTempDir.Checked := true;
end;
{-------------------------------------------------------------------------------
OKBtnClick
----------
Save the config to ConfigMan
-------------------------------------------------------------------------------}
procedure TConfigDlg.OKBtnClick(Sender: TObject);
begin
// save the config to ConfigMan
// confirm on delete
ConfigMan.confirm_on_delete := XBConfirmOnDelete.Checked;
// temporary directory
if (RBUseWindowsDefaultTempDir.Checked) then
ConfigMan.temp_dir := ConfigMan.default_temp_dir
else
begin
// check the temp_dir is not empty
if (CustomTempDirLabel.Caption = '') then
begin
Application.MessageBox('The custom temporary directory is invalid. Please correct it.', 'Error', 0);
PageControl.ActivePage := TabSheet1;
ModalResult := 0;
end
else
ConfigMan.temp_dir := CustomTempDirLabel.Caption;
end;
end;
procedure TConfigDlg.FormShow(Sender: TObject);
begin
CentreFormToMain(Self);
end;
end.

View File

@@ -0,0 +1,97 @@
unit ConfigUnit;
{-------------------------------------------------------------------------------
Configuration Unit
------------------
---------------------------------------------
reSource v2.6
Copyright (C) 1998-2001 Victor Kasenda / gruv
http://go.to/gruv
email: vickas@singnet.com.sg
---------------------------------------------
Desc:
All configurable variables are stored in the ConfigMan class.
The user uses the interface, ConfigDlg to change these values.
-------------------------------------------------------------------------------}
(**) interface (**)
uses SysUtils, Windows;
type
TConfigMan = class
private
FShowDebugForm: boolean;
procedure EnableDebugForm(enable: boolean);
public
ClipDebugFormToMainForm: boolean;
temp_dir: string;
default_temp_dir: string;
confirm_on_delete: boolean;
property ShowDebugForm: boolean read FShowDebugForm write EnableDebugForm;
constructor Create;
procedure ResetDefaults;
end;
var
ConfigMan: TConfigMan;
(**) implementation (**)
uses DebugFormUnit, EDosUnit;
constructor TConfigMan.Create;
begin
inherited Create;
ResetDefaults;
end;
procedure TConfigMan.ResetDefaults;
var
dir: PChar;
begin
ShowDebugForm := false;
ClipDebugFormToMainForm := true;
// get the windows default temp dir
dir := StrAlloc(MAX_PATH + 1);
GetTempPath(MAX_PATH, dir);
default_temp_dir := dir;
StrDispose(dir);
EDos.AddSlash(default_temp_dir);
temp_dir := default_temp_dir;
confirm_on_delete := false;
end;
procedure TConfigMan.EnableDebugForm(enable: boolean);
begin
FShowDebugForm := enable;
if (enable = false) then
begin
if Assigned(DebugForm) then
begin
DebugForm.Free;
DebugForm := nil;
end;
end
else
begin
DebugForm := TDebugForm.Create(nil);
DebugForm.Show;
end;
end;
initialization
ConfigMan := TConfigMan.Create;
finalization
ConfigMan.Free;
end.

View File

@@ -0,0 +1,99 @@
object CreditsForm: TCreditsForm
Left = 250
Top = 171
BorderStyle = bsDialog
Caption = 'Credits'
ClientHeight = 276
ClientWidth = 369
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Memo1: TMemo
Left = 9
Top = 14
Width = 352
Height = 211
Lines.Strings = (
'read readme.txt for more info'
'read resource.txt for description of files and more information ' +
'about'
'understanding this whole program.'
''
''
'credits:'
'i would like to thank:'
''
' Mark Nelson, who with his wonderful book,'
''
' Michael Burrows and David J. Wheeler for the block sorting'
'algorithm.'
''
' Peter Fenwick'#39's for his tuned structured arithmetic encoder'
''
' Kunihiko Sadakane'#39's Suffix sort, which rocks, and imho is th' +
'e'
'best'
' general purpose sorter for the block sorting algorithm.'
''
' Angus Johnson, Anders Melander & Graham Wideman for their'
'wonderful, totally incredible drag and drop package. I had'
'managed to incorporate the older version of their package into'
'resource and it turned instantly totally drag and drop to and fr' +
'om'
'explorer.. simply amazing.'
''
' Julian Seward, author of BZip. BZip really inspired me to wri' +
'te on,'
'although i didn'#39't really understand much of the '#39'c'#39' implementati' +
'on of'
'the BWT algorithm... ;-)'
''
''
' the author(s) of the delphi superpage and delphi deli, withou' +
't'
'which i may not even have been able to have finished.'
''
''
' and of course Inprise for creating Delphi, which is totally r' +
'adical!'
' (and Inprise: when are we gonna have inline functions? it wil' +
'l'
'surely'
'speed up delphi apps alot!)'
''
' loop guru for excellent groove and inspirational music. if yo' +
'u'
'haven'#39't listened to them, you don'#39't know what real cross cultura' +
'l,'
#39'no'
'barriers'#39' is...')
ScrollBars = ssVertical
TabOrder = 0
end
object Button1: TButton
Left = 288
Top = 240
Width = 75
Height = 25
Cancel = True
Caption = 'Close'
ModalResult = 1
TabOrder = 1
end
end

View File

@@ -0,0 +1,39 @@
unit CreditFormUnit;
{-------------------------------------------------------------------------------
Credits Form
Shows credits.
---------------------------------------------
reSource v2.6
Copyright (C) 1998-2001 Victor Kasenda / gruv
http://go.to/gruv
email: vickas@singnet.com.sg
---------------------------------------------
-------------------------------------------------------------------------------}
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TCreditsForm = class(TForm)
Memo1: TMemo;
Button1: TButton;
private
{ Private declarations }
public
{ Public declarations }
end;
var
CreditsForm: TCreditsForm;
implementation
{$R *.DFM}
end.

Binary file not shown.

View File

@@ -0,0 +1,92 @@
unit DebugFormUnit;
{-------------------------------------------------------------------------------
DebugFormUnit
-------------
---------------------------------------------
reSource v2.6
Copyright (C) 1998-2001 Victor Kasenda / gruv
http://go.to/gruv
email: vickas@singnet.com.sg
---------------------------------------------
Desc:
Currently defunct.
Used for showing the status or stage of the compression. Useful to detect
for stalls or 'hangs' that may occur (and many did).
-------------------------------------------------------------------------------}
(**) interface (**)
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls;
type
TDebugForm = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
ArrowImage: TImage;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
procedure DoingSorting;
procedure DoingMTF;
procedure DoingTransform;
procedure DoingAriCompress;
end;
var
DebugForm: TDebugForm;
(**) implementation (**)
uses ConfigUnit;
{$R *.DFM}
const
ArrowInitialTop = 15;
ArrowMoveHeight = 25;
procedure TDebugForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
DebugForm := nil;
ConfigMan.ShowDebugForm := false;
end;
procedure TDebugForm.DoingSorting;
begin
ArrowImage.Top := ArrowInitialTop;
Application.ProcessMessages;
end;
procedure TDebugForm.DoingTransform;
begin
ArrowImage.Top := ArrowInitialTop + ArrowMoveHeight;
Application.ProcessMessages;
end;
procedure TDebugForm.DoingMTF;
begin
ArrowImage.Top := ArrowInitialTop + ArrowMoveHeight*2;
Application.ProcessMessages;
end;
procedure TDebugForm.DoingAriCompress;
begin
ArrowImage.Top := ArrowInitialTop + ArrowMoveHeight*3;
Application.ProcessMessages;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,92 @@
unit ExtractOptionsDlgUnit;
{-------------------------------------------------------------------------------
ExtractOptionsDlgUnit
---------------------
---------------------------------------------
reSource v2.6
Copyright (C) 1998-2001 Victor Kasenda / gruv
http://go.to/gruv
email: vickas@singnet.com.sg
---------------------------------------------
Desc:
Shows a directory list that allows the user to select the directory
to extract to.
-------------------------------------------------------------------------------}
{ if not EDos.FileExists(DriveComboBox.drive + ':') then
begin
Application.MessageBox(PChar('The drive ' + DriveComboBox.drive + ' is not available. Please select another drive.'),
'IO Error', 0);
end;}
(**) interface (**)
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
Buttons, ExtCtrls, FileCtrl, ComCtrls, Dialogs;
type
TExtractOptionsDlg = class(TForm)
GroupBox1: TGroupBox;
RBExtractAllFiles: TRadioButton;
RBExtractSelectedFiles: TRadioButton;
Label1: TLabel;
OKBtn: TBitBtn;
CancelBtn: TBitBtn;
DirTree: TDirectoryListBox;
DriveComboBox: TDriveComboBox;
procedure DirectoryListBoxChange(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
private
public
function ExtractDir: string;
end;
var
ExtractOptionsDlg: TExtractOptionsDlg;
(**) implementation (**)
uses EDosUnit, Main;
{$R *.DFM}
function TExtractOptionsDlg.ExtractDir: string;
begin
result := DirTree.Directory;
EDos.AddSlash(result);
end;
procedure TExtractOptionsDlg.DirectoryListBoxChange(Sender: TObject);
begin
//ExtractDirEdit.Text := DirectoryListBox.Directory;
end;
procedure TExtractOptionsDlg.FormActivate(Sender: TObject);
begin
//ExtractDirEdit.Text := DirectoryListBox.Directory;
end;
procedure TExtractOptionsDlg.FormCreate(Sender: TObject);
begin
{$IFDEF DEBUG}
//DirTree.Directory := 'c:\ctestout';
{$ENDIF}
end;
procedure TExtractOptionsDlg.FormShow(Sender: TObject);
begin
CentreFormToMain(Self);
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,110 @@
unit FileAttrDlgUnit;
{-------------------------------------------------------------------------------
File Attribute Dialog Unit
--------------------------
---------------------------------------------
reSource v2.6
Copyright (C) 1998-2001 Victor Kasenda / gruv
http://go.to/gruv
email: vickas@singnet.com.sg
---------------------------------------------
Interface for the user to change the file attributes in the archive.
-------------------------------------------------------------------------------}
(**) interface (**)
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons,
ArchiveHeadersUnit;
type
TFileAttrDlg = class(TForm)
NameEdit: TEdit;
Label1: TLabel;
Label2: TLabel;
GroupBox1: TGroupBox;
XBReadOnly: TCheckBox;
XBHidden: TCheckBox;
XBArchive: TCheckBox;
XBSystem: TCheckBox;
OKBtn: TBitBtn;
CancelBtn: TBitBtn;
LastModifiedDateLabel: TLabel;
Label3: TLabel;
SizeLabel: TLabel;
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
function Execute(CentralFileHeader: TCentralFileHeader): integer;
procedure GetCentralFileHeader(CentralFileHeader: TCentralFileHeader);
end;
var
FileAttrDlg: TFileAttrDlg;
(**) implementation (**)
uses Main;
{$R *.DFM}
function TFileAttrDlg.Execute(CentralFileHeader: TCentralFileHeader): integer;
var
s: string;
begin
// initialize fields with info from CentralFileHeader
with CentralFileHeader do
begin
// name
NameEdit.Text := FileName;
// size
SizeLabel.Caption := Format('%d', [uncompressed_size]) + ' bytes';
// date
DateTimeToString(s, 'dddd, mmmm d, yyyy hh:nn:ss AM/PM', FileDateToDateTime(time));
LastModifiedDateLabel.Caption := s;
// attributes
XBReadOnly.Checked := (attr and faReadOnly <> 0);
XBArchive.Checked := (attr and faArchive <> 0);
XBHidden.Checked := (attr and faHidden <> 0);
XBSystem.Checked := (attr and faSysFile <> 0);
end;
result := ShowModal;
end;
{-------------------------------------------------------------------------------
GetCentralFileHeader
--------------------
Updates CentralFileHeader with the data in the dialog
-------------------------------------------------------------------------------}
procedure TFileAttrDlg.GetCentralFileHeader(CentralFileHeader: TCentralFileHeader);
var
nattr: integer;
begin
// store new attribute in nattr
nattr := 0;
if (XBReadOnly.Checked) then nattr := nattr or faReadOnly;
if (XBArchive.Checked) then nattr := nattr or faArchive;
if (XBHidden.Checked) then nattr := nattr or faHidden;
if (XBSystem.Checked) then nattr := nattr or faSysFile;
with CentralFileHeader do
begin
FileName := NameEdit.Text;
attr := nattr;
end;
end;
procedure TFileAttrDlg.FormShow(Sender: TObject);
begin
CentreFormToMain(Self);
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,76 @@
unit ProgStatsDlgUnit;
{-------------------------------------------------------------------------------
Program Statistics Dialog
-------------------------
show program statistics
---------------------------------------------
reSource v2.6
Copyright (C) 1998-2001 Victor Kasenda / gruv
http://go.to/gruv
email: vickas@singnet.com.sg
---------------------------------------------
Use:
To check if memory is enough, or if we are out of memory.
To help in debugging if the user reports a bug to the developer.
-------------------------------------------------------------------------------}
(**) interface (**)
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls;
type
TProgStatsDlg = class(TForm)
RichEdit: TRichEdit;
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
ProgStatsDlg: TProgStatsDlg;
(**) implementation (**)
uses Main, StructsUnit;
{$R *.DFM}
procedure TProgStatsDlg.FormShow(Sender: TObject);
var
HeapStatus: THeapStatus;
begin
CentreFormToMain(Self);
// fill in the program stats richedit
HeapStatus := GetHeapStatus;
with RichEdit.Lines, RichEdit, HeapStatus do
begin
Clear;
Add('reSource ' + reSourceVerStr);
Add('Burrows Wheeler Transformation (BWT) Compressor');
Add(reSourceCopyrightStr);
Add('');
Add('Engine:');
Add('Block Size = ' + IntToStr(BlockSize));
Add('');
Add('Program:');
Add('rs Total Allocated = ' + IntToStr(TotalAllocated));
Add('Heap manager overhead = ' + IntToStr(Overhead));
Add('');
Add('System:');
Add('Win Total Address Space = ' + IntToStr(TotalAddrSpace));
Add('Win Total Uncommitted = ' + IntToStr(TotalUncommitted));
SelStart := 0;
end;
end;
end.

BIN
Archiver Demo/RSIcon2.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

View File

@@ -0,0 +1,5 @@
//SUPPRESSIONPROJ:ReSource
//VERSION:5.00
//ENABLE:Yes
!include DELPHI.SUP

View File

@@ -0,0 +1,35 @@
-$A+
-$B-
-$C+
-$D+
-$E-
-$F-
-$G+
-$H+
-$I+
-$J+
-$K-
-$L+
-$M-
-$N+
-$O+
-$P+
-$Q+
-$R+
-$S-
-$T-
-$U-
-$V+
-$W-
-$X+
-$YD
-$Z1
-cg
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
-H+
-W+
-M
-$M16384,1048576
-K$00400000
-LE"c:\borland\delphi5\Projects\Bpl"
-LN"c:\borland\delphi5\Projects\Bpl"

109
Archiver Demo/ReSource.dof Normal file
View File

@@ -0,0 +1,109 @@
[Compiler]
A=1
B=0
C=1
D=1
E=0
F=0
G=1
H=1
I=1
J=1
K=0
L=1
M=0
N=1
O=1
P=1
Q=1
R=1
S=0
T=0
U=0
V=1
W=0
X=1
Y=1
Z=1
ShowHints=1
ShowWarnings=1
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[Linker]
MapFile=0
OutputObjs=0
ConsoleApp=1
DebugInfo=0
RemoteSymbols=0
MinStackSize=16384
MaxStackSize=1048576
ImageBase=4194304
ExeDescription=
[Directories]
OutputDir=
UnitOutputDir=
PackageDLLOutputDir=
PackageDCPOutputDir=
SearchPath=
Packages=VCL50;VCLX50;VCLSMP50;VCLDB50;VCLADO50;ibevnt50;VCLBDE50;VCLDBX50;QRPT50;TEEUI50;TEEDB50;TEE50;DSS50;TEEQR50;VCLIB50;VCLMID50;VCLIE50;INETDB50;INET50;NMFAST50;WEBMID50;dclocx50;dclaxserver50;DragDropD5;ColorPicker;preview;Icsdel50;galoled
Conditionals=
DebugSourceDirs=
UsePackages=0
[Parameters]
RunParams=
HostApplication=
[Language]
ActiveLang=
ProjectLang=$00000409
RootDir=
[Version Info]
IncludeVerInfo=1
AutoIncBuild=0
MajorVer=2
MinorVer=6
Release=0
Build=0
Debug=0
PreRelease=1
Special=0
Private=0
DLL=0
Locale=1033
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=Resource
FileVersion=2.6.0.0
InternalName=Resource experimental
LegalCopyright=Victor K
LegalTrademarks=
OriginalFilename=Resource
ProductName=Resource
ProductVersion=1.0.0.0
Comments=The BWT Block compressor
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
Count=1
Item0=C:\Save\Delphi\resource\Component
[HistoryLists\hlUnitOutputDirectory]
Count=1
Item0=C:\temp\rs
[HistoryLists\hlOutputDirectorry]
Count=2
Item0=C:\temp\rs
Item1=c:\temp\cg
[HistoryLists\hlBPLOutput]
Count=1
Item0=c:\temp\rs

View File

@@ -0,0 +1,34 @@
program reSource;
uses
Forms,
main in 'main.pas' {MainForm},
DebugFormUnit in 'DebugFormUnit.pas' {DebugForm},
ConfigUnit in 'ConfigUnit.pas',
ExtractOptionsDlgUnit in 'ExtractOptionsDlgUnit.pas' {ExtractOptionsDlg},
AddOptionsDlgUnit in 'AddOptionsDlgUnit.pas' {AddOptionsDlg},
AboutDlgUnit in 'AboutDlgUnit.pas' {AboutDlg},
ConfigDlgUnit in 'ConfigDlgUnit.pas' {ConfigDlg},
FileAttrDlgUnit in 'FileAttrDlgUnit.pas' {FileAttrDlg},
BrowseForDirUnit in 'BrowseForDirUnit.pas' {BrowseForDirForm},
CompressionStatsDlgUnit in 'CompressionStatsDlgUnit.pas' {CompressionStatsDlg},
ProgStatsDlgUnit in 'ProgStatsDlgUnit.pas' {ProgStatsDlg},
CreditFormUnit in 'CreditFormUnit.pas' {CreditsForm};
{$R *.RES}
begin
Application.Initialize;
Application.Title := 'reSource v2.6';
Application.CreateForm(TMainForm, MainForm);
Application.CreateForm(TExtractOptionsDlg, ExtractOptionsDlg);
Application.CreateForm(TAddOptionsDlg, AddOptionsDlg);
Application.CreateForm(TAboutDlg, AboutDlg);
Application.CreateForm(TConfigDlg, ConfigDlg);
Application.CreateForm(TFileAttrDlg, FileAttrDlg);
Application.CreateForm(TBrowseForDirForm, BrowseForDirForm);
Application.CreateForm(TCompressionStatsDlg, CompressionStatsDlg);
Application.CreateForm(TProgStatsDlg, ProgStatsDlg);
Application.CreateForm(TCreditsForm, CreditsForm);
Application.Run;
end.

282
Archiver Demo/ReSource.dsk Normal file
View File

@@ -0,0 +1,282 @@
[Closed Files]
File_0=SourceModule,'C:\Save\Delphi\resource\Archiver Demo\ProgStatsDlgUnit.pas',0,1,1,1,13,1,0
File_1=SourceModule,'C:\Save\Delphi\resource\Archiver Demo\main.pas',0,1,1,1,13,1,0
File_2=SourceModule,'C:\Save\Delphi\resource\Archiver Demo\FileAttrDlgUnit.pas',0,1,1,1,12,1,0
File_3=SourceModule,'C:\Save\Delphi\resource\Archiver Demo\ExtractOptionsDlgUnit.pas',0,1,1,1,12,1,0
File_4=SourceModule,'C:\Save\Delphi\resource\Archiver Demo\DebugFormUnit.pas',0,1,1,1,12,1,0
File_5=SourceModule,'C:\Save\Delphi\resource\Archiver Demo\CreditFormUnit.pas',0,1,1,1,12,0,0
File_6=SourceModule,'C:\Save\Delphi\resource\Archiver Demo\ConfigUnit.pas',0,1,1,1,12,0,0
File_7=SourceModule,'C:\Save\Delphi\resource\Archiver Demo\ConfigDlgUnit.pas',0,1,1,1,12,0,0
File_8=SourceModule,'C:\Save\Delphi\resource\Archiver Demo\CompressionStatsDlgUnit.pas',0,1,1,1,12,0,0
File_9=SourceModule,'C:\Save\Delphi\resource\Archiver Demo\BrowseForDirUnit.pas',0,1,1,1,14,1,0
[Modules]
Module0=C:\Save\Delphi\resource\Archiver Demo\ReSource.dpr
Count=1
EditWindowCount=1
[C:\Save\Delphi\resource\Archiver Demo\ReSource.dpr]
ModuleType=SourceModule
FormState=0
FormOnTop=0
[C:\Save\Delphi\resource\Archiver Demo\ProjectGroup1.bpg]
FormState=0
FormOnTop=0
[EditWindow0]
ViewCount=1
CurrentView=0
View0=0
CodeExplorer=CodeExplorer@EditWindow0
MessageView=MessageView@EditWindow0
Create=1
Visible=1
State=2
Left=229
Top=232
Width=564
Height=334
MaxLeft=-4
MaxTop=100
MaxWidth=808
MaxHeight=476
ClientWidth=800
ClientHeight=449
LeftPanelSize=0
LeftPanelClients=CodeExplorer@EditWindow0
LeftPanelData=00000400010000000C000000436F64654578706C6F7265720000000000000000000000000000000000FFFFFFFF
RightPanelSize=0
BottomPanelSize=77
BottomPanelClients=CallStackWindow,WatchWindow,MessageView@EditWindow0
BottomPanelData=00000400020000000F00000043616C6C537461636B57696E646F770B000000576174636857696E646F772003000000000000004D000000000000000100000000200300000B0000004D65737361676556696577FFFFFFFF
[View0]
Module=C:\Save\Delphi\resource\Archiver Demo\ReSource.dpr
CursorX=59
CursorY=9
TopLine=1
LeftCol=1
[Watches]
Count=0
[Breakpoints]
Count=1
Breakpoint0='C:\Save\Delphi\resource\Component\BWTCompressUnit.pas',299,'',0,1,'',1,0,0,'',1,'','',''
[AddressBreakpoints]
Count=0
[Main Window]
Create=1
Visible=1
State=2
Left=0
Top=28
Width=777
Height=105
MaxLeft=-1
MaxTop=-1
MaxWidth=808
MaxHeight=105
ClientWidth=800
ClientHeight=78
[ProjectManager]
Create=1
Visible=0
State=0
Left=155
Top=124
Width=448
Height=413
MaxLeft=-1
MaxTop=-1
ClientWidth=440
ClientHeight=391
TBDockHeight=303
LRDockWidth=510
Dockable=1
[CPUWindow]
Create=1
Visible=0
State=0
Left=10
Top=108
Width=732
Height=433
MaxLeft=-1
MaxTop=-1
ClientWidth=724
ClientHeight=406
DumpPane=79
DisassemblyPane=349
RegisterPane=231
FlagPane=64
[AlignmentPalette]
Create=1
Visible=0
State=0
Left=50
Top=119
Width=156
Height=80
MaxLeft=-1
MaxTop=-1
ClientWidth=150
ClientHeight=60
[PropertyInspector]
Create=1
Visible=1
State=0
Left=304
Top=200
Width=236
Height=303
MaxLeft=-1
MaxTop=-1
ClientWidth=226
ClientHeight=279
TBDockHeight=494
LRDockWidth=164
Dockable=0
SplitPos=108
ArrangeBy=Name
SelectedItem=
ExpandedItems=BorderIcons,Brush,Dragtypes,Font.Style,Options,Pen
HiddenCategories=Legacy
ShowStatusBar=1
[WatchWindow]
Create=1
Visible=0
State=0
Left=12
Top=0
Width=788
Height=77
MaxLeft=-1
MaxTop=-1
ClientWidth=788
ClientHeight=77
TBDockHeight=77
LRDockWidth=421
Dockable=1
[BreakpointWindow]
Create=1
Visible=0
State=0
Left=181
Top=255
Width=453
Height=197
MaxLeft=-1
MaxTop=-1
ClientWidth=445
ClientHeight=175
TBDockHeight=197
LRDockWidth=453
Dockable=1
Column0Width=100
Column1Width=75
Column2Width=225
Column3Width=40
Column4Width=75
Column5Width=75
[CallStackWindow]
Create=1
Visible=0
State=0
Left=412
Top=0
Width=388
Height=77
MaxLeft=-1
MaxTop=-1
ClientWidth=388
ClientHeight=77
TBDockHeight=77
LRDockWidth=379
Dockable=1
[LocalVarsWindow]
Create=1
Visible=0
State=0
Left=273
Top=197
Width=421
Height=192
MaxLeft=-1
MaxTop=-1
ClientWidth=413
ClientHeight=170
TBDockHeight=192
LRDockWidth=421
Dockable=1
[ToDo List]
Create=1
Visible=0
State=0
Left=154
Top=175
Width=470
Height=250
MaxLeft=-1
MaxTop=-1
ClientWidth=462
ClientHeight=228
TBDockHeight=250
LRDockWidth=470
Dockable=1
Column0Width=260
Column1Width=30
Column2Width=100
Column3Width=70
Column4Width=70
SortOrder=4
ShowHints=1
ShowChecked=1
[CodeExplorer@EditWindow0]
Create=1
Visible=0
State=0
Left=0
Top=12
Width=200
Height=348
MaxLeft=-1
MaxTop=-1
ClientWidth=200
ClientHeight=348
TBDockHeight=305
LRDockWidth=200
Dockable=1
[MessageView@EditWindow0]
Create=1
Visible=1
State=0
Left=12
Top=0
Width=788
Height=77
MaxLeft=-1
MaxTop=-1
ClientWidth=788
ClientHeight=77
TBDockHeight=77
LRDockWidth=443
Dockable=1
[DockHosts]
DockHostCount=0

View File

@@ -0,0 +1,42 @@
-$A+
-$B-
-$C+
-$D+
-$E-
-$F-
-$G+
-$H+
-$I+
-$J+
-$K-
-$L+
-$M-
-$N+
-$O+
-$P+
-$Q+
-$R+
-$S-
-$T-
-$U-
-$V+
-$W-
-$X+
-$YD
-$Z1
-cg
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
-H+
-W+
-M
-$M16384,1048576
-K$00400000
-E"c:\temp\cg"
-N"c:\temp\cg"
-LE"c:\borland\delphi5\Projects\Bpl"
-LN"c:\borland\delphi5\Projects\Bpl"
-U"c:\save\delphi\flib"
-O"c:\save\delphi\flib"
-I"c:\save\delphi\flib"
-R"c:\save\delphi\flib"
-Z

BIN
Archiver Demo/main.dfm Normal file

Binary file not shown.

2018
Archiver Demo/main.pas Normal file

File diff suppressed because it is too large Load Diff

BIN
Archiver Demo/reSource.res Normal file

Binary file not shown.