* now units are manually registered by user

git-svn-id: trunk@5888 -
This commit is contained in:
mazen 2004-08-29 17:24:24 +00:00
parent a303ae29e9
commit 90c2b1d394
12 changed files with 202 additions and 78 deletions

View File

@ -5,75 +5,63 @@
<General>
<ProjectType Value="Application"/>
<MainUnit Value="0"/>
<ActiveEditorIndexAtStart Value="3"/>
<ActiveEditorIndexAtStart Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=""/>
<Title Value="Images Example"/>
</General>
<JumpHistory Count="10" HistoryIndex="9">
<JumpHistory Count="7" HistoryIndex="6">
<Position1>
<Filename Value="mainform.pas"/>
<Caret Line="6" Column="81" TopLine="1"/>
<Caret Line="63" Column="35" TopLine="47"/>
</Position1>
<Position2>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/components/images/laztga.pas"/>
<Caret Line="59" Column="22" TopLine="54"/>
<Filename Value="mainform.pas"/>
<Caret Line="62" Column="3" TopLine="16"/>
</Position2>
<Position3>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/include/bitmap.inc"/>
<Caret Line="247" Column="1" TopLine="990"/>
<Filename Value="mainform.pas"/>
<Caret Line="47" Column="35" TopLine="34"/>
</Position3>
<Position4>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/include/bitmap.inc"/>
<Caret Line="910" Column="24" TopLine="897"/>
<Filename Value="mainform.pas"/>
<Caret Line="96" Column="1" TopLine="86"/>
</Position4>
<Position5>
<Filename Value="/home/neifer/FPC/Demo/src/fpc/fcl/image/fpreadtga.pp"/>
<Caret Line="86" Column="31" TopLine="60"/>
<Filename Value="mainform.pas"/>
<Caret Line="151" Column="1" TopLine="139"/>
</Position5>
<Position6>
<Filename Value="/home/neifer/FPC/Demo/src/fpc/fcl/image/fpreadtga.pp"/>
<Caret Line="154" Column="1" TopLine="140"/>
<Filename Value="mainform.pas"/>
<Caret Line="61" Column="19" TopLine="51"/>
</Position6>
<Position7>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/include/bitmap.inc"/>
<Caret Line="909" Column="5" TopLine="897"/>
<Filename Value="mainform.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position7>
<Position8>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/intfgraphics.pas"/>
<Caret Line="1482" Column="1" TopLine="1469"/>
</Position8>
<Position9>
<Filename Value="/home/neifer/FPC/Demo/src/fpc/fcl/image/fpreadtga.pp"/>
<Caret Line="153" Column="1" TopLine="140"/>
</Position9>
<Position10>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/include/bitmap.inc"/>
<Caret Line="847" Column="18" TopLine="833"/>
</Position10>
</JumpHistory>
<Units Count="29">
<Units Count="40">
<Unit0>
<CursorPos X="39" Y="10"/>
<EditorIndex Value="7"/>
<EditorIndex Value="1"/>
<Filename Value="imagesexample.lpr"/>
<IsPartOfProject Value="True"/>
<Loaded Value="True"/>
<TopLine Value="1"/>
<UnitName Value="JPEGExample"/>
<UsageCount Value="38"/>
<UsageCount Value="40"/>
</Unit0>
<Unit1>
<CursorPos X="65" Y="61"/>
<CursorPos X="12" Y="204"/>
<EditorIndex Value="0"/>
<Filename Value="mainform.pas"/>
<ComponentName Value="ImagesExampleForm"/>
<IsPartOfProject Value="True"/>
<Loaded Value="True"/>
<ResourceFilename Value="mainform.lrs"/>
<TopLine Value="56"/>
<TopLine Value="179"/>
<UnitName Value="MainForm"/>
<UsageCount Value="38"/>
<UsageCount Value="40"/>
</Unit1>
<Unit2>
<CursorPos X="20" Y="156"/>
@ -211,13 +199,11 @@
</Unit21>
<Unit22>
<CursorPos X="2" Y="4"/>
<EditorIndex Value="6"/>
<Filename Value="README.txt"/>
<IsPartOfProject Value="True"/>
<Loaded Value="True"/>
<SyntaxHighlighter Value="None"/>
<TopLine Value="1"/>
<UsageCount Value="26"/>
<UsageCount Value="28"/>
</Unit22>
<Unit23>
<CursorPos X="1" Y="468"/>
@ -227,47 +213,112 @@
</Unit23>
<Unit24>
<CursorPos X="31" Y="846"/>
<EditorIndex Value="3"/>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/include/bitmap.inc"/>
<Loaded Value="True"/>
<TopLine Value="833"/>
<UsageCount Value="12"/>
</Unit24>
<Unit25>
<CursorPos X="20" Y="52"/>
<EditorIndex Value="1"/>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/components/images/laztga.pas"/>
<Loaded Value="True"/>
<TopLine Value="54"/>
<UnitName Value="LazTGA"/>
<UsageCount Value="12"/>
</Unit25>
<Unit26>
<CursorPos X="1" Y="153"/>
<EditorIndex Value="2"/>
<Filename Value="/home/neifer/FPC/Demo/src/fpc/fcl/image/fpreadtga.pp"/>
<Loaded Value="True"/>
<TopLine Value="140"/>
<UnitName Value="FPReadTGA"/>
<UsageCount Value="12"/>
</Unit26>
<Unit27>
<CursorPos X="1" Y="1482"/>
<EditorIndex Value="4"/>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/intfgraphics.pas"/>
<Loaded Value="True"/>
<TopLine Value="1469"/>
<UnitName Value="IntfGraphics"/>
<UsageCount Value="12"/>
</Unit27>
<Unit28>
<CursorPos X="1" Y="1469"/>
<EditorIndex Value="5"/>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/interfaces/gtk/gtkobject.inc"/>
<Loaded Value="True"/>
<TopLine Value="1455"/>
<UsageCount Value="12"/>
</Unit28>
<Unit29>
<CursorPos X="16" Y="22"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/components/images/imagesforlazarus.pas"/>
<TopLine Value="1"/>
<UnitName Value="ImagesForLazarus"/>
<UsageCount Value="10"/>
</Unit29>
<Unit30>
<CursorPos X="68" Y="69"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/packager/registration/lazaruspackageintf.pas"/>
<TopLine Value="53"/>
<UnitName Value="LazarusPackageIntf"/>
<UsageCount Value="10"/>
</Unit30>
<Unit31>
<CursorPos X="39" Y="699"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/packager/packagesystem.pas"/>
<TopLine Value="697"/>
<UnitName Value="PackageSystem"/>
<UsageCount Value="10"/>
</Unit31>
<Unit32>
<CursorPos X="14" Y="70"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/components/images/lazpnm.pas"/>
<TopLine Value="61"/>
<UnitName Value="LazPNM"/>
<UsageCount Value="10"/>
</Unit32>
<Unit33>
<CursorPos X="23" Y="463"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/lcl/include/picture.inc"/>
<TopLine Value="453"/>
<UsageCount Value="10"/>
</Unit33>
<Unit34>
<CursorPos X="1" Y="1"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/components/htmllite/lazhtmllite.lpk"/>
<SyntaxHighlighter Value="None"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit34>
<Unit35>
<CursorPos X="51" Y="23"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/components/htmllite/lazhtmllite.pas"/>
<TopLine Value="1"/>
<UnitName Value="LazHTMLLite"/>
<UsageCount Value="10"/>
</Unit35>
<Unit36>
<CursorPos X="1" Y="1"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/components/htmllite/htmllite.pas"/>
<TopLine Value="2945"/>
<UnitName Value="HTMLLite"/>
<UsageCount Value="10"/>
</Unit36>
<Unit37>
<CursorPos X="1" Y="1"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/components/htmllite/htmllite.dcr"/>
<SyntaxHighlighter Value="None"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit37>
<Unit38>
<CursorPos X="1" Y="1"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/components/memds/memdslaz.pas"/>
<TopLine Value="1"/>
<UnitName Value="MemDSLaz"/>
<UsageCount Value="10"/>
</Unit38>
<Unit39>
<CursorPos X="1" Y="1"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/components/memds/memdsicons.lrs"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit39>
</Units>
<PublishOptions>
<Version Value="2"/>
@ -300,12 +351,17 @@
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Linking>
<Debugging>
<GenerateDebugInfo Value="True"/>
</Debugging>
</Linking>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<BreakPoints Count="3">
<BreakPoints Count="5">
<Item1>
<Source Value="/home/satan/pascal/lazarus/lcl/interfaces/gtk2/gtk2int.pas"/>
<Line Value="34"/>
@ -318,6 +374,14 @@
<Source Value="/home/neifer/FPC/Demo/src/fpc/fcl/image/fpreadtga.pp"/>
<Line Value="153"/>
</Item3>
<Item4>
<Source Value="/home/mazen/FPC/Demo/src/lazarus/packager/packagesystem.pas"/>
<Line Value="702"/>
</Item4>
<Item5>
<Source Value="/home/mazen/FPC/Demo/src/lazarus/packager/registration/lazaruspackageintf.pas"/>
<Line Value="69"/>
</Item5>
</BreakPoints>
</Debugging>
</CONFIG>

View File

@ -2,12 +2,12 @@ object ImagesExampleForm: TImagesExampleForm
Caption = 'Example for package "Images For Lazarus"'
ClientHeight = 416
ClientWidth = 425
PixelsPerInch = 101
PixelsPerInch = 95
HorzScrollBar.Page = 426
VertScrollBar.Page = 417
Left = 544
Left = 516
Height = 416
Top = 187
Top = 160
Width = 425
object ImageGroupBox: TGroupBox
Align = alTop

View File

@ -3,8 +3,8 @@
LazarusResources.Add('TImagesExampleForm','FORMDATA',[
'TPF0'#18'TImagesExampleForm'#17'ImagesExampleForm'#7'Caption'#6'(Example for'
+' package "Images For Lazarus"'#12'ClientHeight'#3#160#1#11'ClientWidth'#3
+#169#1#13'PixelsPerInch'#2'e'#18'HorzScrollBar.Page'#3#170#1#18'VertScrollBa'
+'r.Page'#3#161#1#4'Left'#3' '#2#6'Height'#3#160#1#3'Top'#3#187#0#5'Width'#3
+#169#1#13'PixelsPerInch'#2'_'#18'HorzScrollBar.Page'#3#170#1#18'VertScrollBa'
+'r.Page'#3#161#1#4'Left'#3#4#2#6'Height'#3#160#1#3'Top'#3#160#0#5'Width'#3
+#169#1#0#9'TGroupBox'#13'ImageGroupBox'#5'Align'#7#5'alTop'#7'Anchors'#11#5
+'akTop'#6'akLeft'#8'akBottom'#0#7'Caption'#6#3'...'#12'ClientHeight'#3';'#1
+#11'ClientWidth'#3#165#1#11'ParentColor'#9#11'ParentCtl3D'#8#8'TabOrder'#2#0

View File

@ -58,10 +58,8 @@ var
implementation
uses
{Load for all package units : LazPNG, LazPNM, LazJPG, LazBMP, LazTGA, LazXPM}
ImagesForLazarus,
{Need LazJPG to use TJPGImage class}
LazJPG;
{Units of package "Images For Lazarus"}
LazPNM, LazJPG, LazTGA, LazPNG, LazXPM, LazBMP;
{ TImagesExampleForm }
@ -93,8 +91,6 @@ begin
end;
procedure TImagesExampleForm.LoadImageButtonClick(Sender: TObject);
var
JPEG: TJPGImage;
begin
OpenPictureDialog1.Options:=OpenPictureDialog1.Options+[ofFileMustExist];
if not OpenPictureDialog1.Execute then exit;
@ -150,8 +146,6 @@ begin
end;
procedure TImagesExampleForm.SaveImageButtonClick(Sender: TObject);
var
JPEG: TJPGImage;
begin
if Image1.Picture.Graphic=nil then begin
MessageDlg('No image','Please open an image, before save',mtError,
@ -193,7 +187,21 @@ begin
end;
initialization
// LazPNG.Register;
// LazXPM.Register;
LazBMP.Register;
LazPNM.Register;
LazTGA.Register;
LazJPG.Register;
{$I mainform.lrs}
finalization
// LazPNG.UnRegister;
// LazXPM.UnRegister;
LazBMP.UnRegister;
LazPNM.UnRegister;
LazTGA.UnRegister;
LazJPG.UnRegister;
end.

View File

@ -9,8 +9,14 @@
<UnitOutputDirectory Value="lib/"/>
</SearchPaths>
<CodeGeneration>
<UnitStyle Value="0"/>
<Generate Value="Faster"/>
</CodeGeneration>
<Linking>
<Debugging>
<GenerateDebugInfo Value="True"/>
</Debugging>
</Linking>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
@ -23,7 +29,7 @@
<Files Count="7">
<Item1>
<Filename Value="lazpng.pas"/>
<UnitName Value="Lazpng"/>
<UnitName Value="LazPNG"/>
</Item1>
<Item2>
<Filename Value="readme.txt"/>
@ -31,11 +37,13 @@
</Item2>
<Item3>
<Filename Value="lazpnm.pas"/>
<UnitName Value="Lazpnm"/>
<HasRegisterProc Value="True"/>
<UnitName Value="LazPNM"/>
</Item3>
<Item4>
<Filename Value="lazjpg.pas"/>
<UnitName Value="Lazjpg"/>
<HasRegisterProc Value="True"/>
<UnitName Value="LazJPG"/>
</Item4>
<Item5>
<Filename Value="lazbmp.pas"/>
@ -43,6 +51,7 @@
</Item5>
<Item6>
<Filename Value="laztga.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="LazTGA"/>
</Item6>
<Item7>

View File

@ -14,6 +14,9 @@ implementation
procedure Register;
begin
RegisterUnit('LazPNM', @LazPNM.Register);
RegisterUnit('LazJPG', @LazJPG.Register);
RegisterUnit('LazTGA', @LazTGA.Register);
end;
initialization

View File

@ -42,6 +42,9 @@ type
const
DefaultBMPMimeType = 'image/bmp';
procedure Register;
procedure UnRegister;
implementation
{ TBMPImage }
@ -95,13 +98,16 @@ begin
Result:='bmp';
end;
initialization
procedure Register;
begin
TPicture.RegisterFileFormat('bmp', 'BMP Image File', TBMPImage);
TPicture.RegisterClipboardFormat(RegisterClipboardFormat(DefaultBMPMimeType),
TBMPImage);
end;
finalization
procedure UnRegister;
begin
TPicture.UnregisterGraphicClass(TBMPImage);
end;
end.

View File

@ -52,6 +52,9 @@ type
const
DefaultJPGMimeType = 'image/jpeg';
procedure Register;
procedure UnRegister;
implementation
{ TJPGImage }
@ -114,14 +117,18 @@ begin
Result:='jpg;jpeg';
end;
initialization
procedure Register;
begin
TPicture.RegisterFileFormat('jpg', 'JPEG Image File', TJPGImage);
TPicture.RegisterFileFormat('jpeg', 'JPEG Image File', TJPGImage);
TPicture.RegisterClipboardFormat(RegisterClipboardFormat(DefaultJPGMimeType),
TJPGImage);
end;
finalization
procedure UnRegister;
begin
TPicture.UnregisterGraphicClass(TJPGImage);
end;
end.

View File

@ -38,6 +38,9 @@ type
const
DefaultPNGMimeType = 'image/png';
procedure Register;
procedure UnRegister;
implementation
{ TPNGImage }
@ -62,12 +65,16 @@ begin
Result:='png';
end;
initialization
procedure Register;
begin
TPicture.RegisterFileFormat('png', 'PNG Image File', TPNGImage);
TPicture.RegisterClipboardFormat(RegisterClipboardFormat(DefaultPNGMimeType),
TPNGImage);
finalization
end;
procedure UnRegister;
begin
TPicture.UnregisterGraphicClass(TPNGImage);
end;
end.

View File

@ -40,6 +40,9 @@ const
DefaultPGMMimeType = 'image/pgm';
DefaultPBMMimeType = 'image/pbm';
procedure Register;
procedure UnRegister;
implementation
{ TPNMImage }
@ -64,7 +67,8 @@ begin
Result:='ppm;pgm;pbm';
end;
initialization
procedure Register;
begin
TPicture.RegisterFileFormat('ppm', 'PNM Image File', TPNMImage);
TPicture.RegisterFileFormat('pgm', 'PNM Image File', TPNMImage);
TPicture.RegisterFileFormat('pbm', 'PNM Image File', TPNMImage);
@ -74,9 +78,12 @@ initialization
TPNMImage);
TPicture.RegisterClipboardFormat(RegisterClipboardFormat(DefaultPBMMimeType),
TPNMImage);
end;
finalization
procedure UnRegister;
begin
TPicture.UnregisterGraphicClass(TPNMImage);
end;
end.

View File

@ -41,6 +41,9 @@ type
const
DefaultTGAMimeType = 'image/tga';
procedure Register;
procedure UnRegister;
implementation
{ TTGAImage }
@ -95,13 +98,17 @@ begin
Result:='tga';
end;
initialization
procedure Register;
begin
TPicture.RegisterFileFormat('tga', 'TGA Image File', TTGAImage);
TPicture.RegisterClipboardFormat(RegisterClipboardFormat(DefaultTGAMimeType),
TTGAImage);
end;
finalization
procedure UnRegister;
begin
TPicture.UnregisterGraphicClass(TTGAImage);
end;
end.

View File

@ -41,6 +41,9 @@ type
const
DefaultXPMMimeType = 'image/xpm';
procedure Register;
procedure UnRegister;
implementation
{ TXPMImage }
@ -95,13 +98,16 @@ begin
Result:='xpm';
end;
initialization
procedure Register;
begin
TPicture.RegisterFileFormat('xpm', 'XPM Image File', TXPMImage);
TPicture.RegisterClipboardFormat(RegisterClipboardFormat(DefaultXPMMimeType),
TXPMImage);
end;
finalization
procedure UnRegister;
begin
TPicture.UnregisterGraphicClass(TXPMImage);
end;
end.