fpImage is now used as default, deactivate it with -dDisableFPImage

git-svn-id: trunk@5149 -
This commit is contained in:
mattias 2004-02-02 22:01:51 +00:00
parent 540ac3e8a3
commit 5606ba0fe2
7 changed files with 37 additions and 25 deletions

View File

@ -33,7 +33,7 @@ uses
// base types and base functions
LCLProc, LCLType, GraphMath, VCLGlobals, FileCtrl, LMessages,
// the interface base
InterfaceBase, {$IFDEF UseFPImage}IntfGraphics,{$ENDIF}
InterfaceBase, {$IFNDEF DisableFPImage}IntfGraphics,{$ENDIF}
// components and functions
Buttons, Extctrls, Calendar, Clipbrd, Forms, LCLIntf, Spin,
Comctrls, Graphics, StdCtrls, Arrow, Controls, ImgList, Menus, Toolwin,
@ -48,6 +48,9 @@ end.
{ =============================================================================
$Log$
Revision 1.8 2004/02/02 22:01:51 mattias
fpImage is now used as default, deactivate it with -dDisableFPImage
Revision 1.7 2004/01/26 11:58:37 mattias
excluded dirsel.pp from makefile

View File

@ -33,7 +33,7 @@ interface
uses
SysUtils, Classes, FPCAdds,
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
FPImage, FPReadPNG, FPWritePNG, FPReadBMP, FPWriteBMP, IntfGraphics,
{$ENDIF}
LCLStrConsts, vclGlobals, LMessages, LCLType, LCLProc, LCLIntf, LResources,
@ -521,7 +521,7 @@ type
FormatID: TClipboardFormat); virtual;
procedure GetSupportedSourceMimeTypes(List: TStrings); virtual;
function GetDefaultMimeType: string; virtual;
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
class function GetFPReaderForFileExt(
const FileExtension: string): TFPCustomImageReaderClass; virtual;
class function GetFPWriterForFileExt(
@ -868,7 +868,7 @@ type
FTransparentColor: TColor;
FTransparentMode: TTransparentMode;
FInternalState: TBitmapInternalState;
{$IFNDEF UseFPImage}
{$IFDEF DisableFPImage}
FWidth: integer;
FHeight: integer;
{$ENDIF}
@ -907,7 +907,7 @@ type
procedure SetWidth(NewWidth: Integer); override;
procedure WriteData(Stream: TStream); override;
procedure StoreOriginalStream(Stream: TStream; Size: integer); virtual;
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
procedure ReadStreamWithFPImage(Stream: TStream; Size: Longint;
ReaderClass: TFPCustomImageReaderClass); virtual;
procedure WriteStreamWithFPImage(Stream: TStream; WriteSize: boolean;
@ -938,7 +938,7 @@ type
procedure WriteStream(Stream: TStream; WriteSize: Boolean); virtual;
Function ReleaseHandle: HBITMAP;
function ReleasePalette: HPALETTE;
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
class function GetFPReaderForFileExt(
const FileExtension: string): TFPCustomImageReaderClass; override;
class function GetFPWriterForFileExt(
@ -972,7 +972,7 @@ type
TPortableNetworkGraphic = class(TBitmap)
public
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
class function GetFPReaderForFileExt(
const FileExtension: string): TFPCustomImageReaderClass; override;
class function GetFPWriterForFileExt(
@ -997,7 +997,7 @@ function GraphicFilter(GraphicClass: TGraphicClass): string;
function GraphicExtension(GraphicClass: TGraphicClass): string;
function GraphicFileMask(GraphicClass: TGraphicClass): string;
function GetGraphicClassForFileExtension(const FileExt: string): TGraphicClass;
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
function GetFPImageReaderForFileExtension(const FileExt: string
): TFPCustomImageReaderClass;
function GetFPImageWriterForFileExtension(const FileExt: string
@ -1261,6 +1261,9 @@ end.
{ =============================================================================
$Log$
Revision 1.107 2004/02/02 22:01:51 mattias
fpImage is now used as default, deactivate it with -dDisableFPImage
Revision 1.106 2004/02/02 19:13:31 mattias
started reading TImageList in Delphi format

View File

@ -44,7 +44,7 @@ end;
procedure TBitMap.Assign(Source: TPersistent);
var
SrcBitmap: TBitmap;
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
SrcFPImage: TFPCustomImage;
IntfImage: TLazIntfImage;
ImgHandle,ImgMaskHandle: HBitmap;
@ -68,7 +68,7 @@ begin
FImage:=SrcBitmap.FImage;
FImage.Reference;
//writeln('TBitMap.Assign B ',Width,',',Height,' ',HandleAllocated,' RefCount=',FImage.RefCount);
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
end else if Source is TFPCustomImage then begin
SrcFPImage:=TFPCustomImage(Source);
IntfImage:=TLazIntfImage.Create(0,0);
@ -377,7 +377,7 @@ procedure TBitmap.ReadStream(Stream: TStream; Size: Longint);
'TBitmap.ReadStream: Invalid windows bitmap (header)');
end;
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
var
MemStream: TMemoryStream;
StreamType: TBitmapNativeType;
@ -409,7 +409,7 @@ begin
MemStream.Free;
end;
end;
{$ELSE if not UseFPImage}
{$ELSE if DisableFPImage}
var
MemStream: TMemoryStream;
@ -549,7 +549,7 @@ begin
FImage.SaveStream:=MemStream;
end;
end;
{$ENDIF if not UseFPImage}
{$ENDIF if DisableFPImage}
procedure TBitmap.LoadFromMimeStream(Stream: TStream; const MimeType: string);
begin
@ -578,7 +578,7 @@ begin
end;
procedure TBitmap.WriteStream(Stream: TStream; WriteSize: Boolean);
{$IFNDEF UseFPImage}
{$IFDEF DisableFPImage}
Type
TBITMAPHEADER = packed record
FileHeader : tagBitmapFileHeader;
@ -696,7 +696,7 @@ var
Header: TBitmapHeader;
{$ENDIF}
begin
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
WriteStreamWithFPImage(Stream,WriteSize,TFPWriterBMP);
if (FImage.SaveStream<>nil) and (FImage.SaveStreamType=bnNone) then
FImage.SaveStreamType:=bnWinBitmap;
@ -747,7 +747,7 @@ begin
FImage.SaveStream.Position:=0;
end;
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
procedure TBitmap.ReadStreamWithFPImage(Stream: TStream; Size: Longint;
ReaderClass: TFPCustomImageReaderClass);
var
@ -917,7 +917,7 @@ begin
Result := 0;
end;
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
function TBitmap.GetFPReaderForFileExt(const FileExtension: string
): TFPCustomImageReaderClass;
begin
@ -1011,6 +1011,9 @@ end;
{ =============================================================================
$Log$
Revision 1.57 2004/02/02 22:01:51 mattias
fpImage is now used as default, deactivate it with -dDisableFPImage
Revision 1.56 2004/01/26 11:55:35 mattias
fixed resizing synedit

View File

@ -190,7 +190,7 @@ begin
FModified := False;
end;
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
function TGraphic.GetFPReaderForFileExt(const FileExtension: string
): TFPCustomImageReaderClass;
begin

View File

@ -47,7 +47,7 @@ begin
inherited Create;
Add('bmp', 'Bitmaps', TBitmap);
Add('xpm', 'Pixmap', TPixmap);
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
Add('png', 'Portable Network Graphic', TPortableNetworkGraphic);
{$ENDIF}
{$IFDEF HasIconGraphic}
@ -316,7 +316,7 @@ begin
Result:=GetPicFileFormats.FindExt(FileExt);
end;
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
function GetFPImageReaderForFileExtension(const FileExt: string
): TFPCustomImageReaderClass;
var
@ -539,7 +539,7 @@ begin
SetGraphic(TPicture(Source).Graphic)
else if Source is TGraphic then
SetGraphic(TGraphic(Source))
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
else if Source is TFPCustomImage then
Bitmap.Assign(Source)
{$ENDIF}

View File

@ -269,7 +269,7 @@ begin
end;
procedure TPixmap.WriteStream(Stream: TStream; WriteSize: Boolean);
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
begin
WriteStreamWithFPImage(Stream,WriteSize,TFPWriterBMP);
if (FImage.SaveStream<>nil) and (FImage.SaveStreamType=bnNone) then
@ -286,6 +286,9 @@ end;
{ =============================================================================
$Log$
Revision 1.24 2004/02/02 22:01:51 mattias
fpImage is now used as default, deactivate it with -dDisableFPImage
Revision 1.23 2003/12/25 14:17:07 mattias
fixed many range check warnings

View File

@ -20,7 +20,7 @@
{ TPortableNetworkGraphic }
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
function TPortableNetworkGraphic.GetFPReaderForFileExt(
const FileExtension: string): TFPCustomImageReaderClass;
begin
@ -42,7 +42,7 @@ end;
procedure TPortableNetworkGraphic.ReadStream(Stream: TStream; Size: Longint);
begin
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
ReadStreamWithFPImage(Stream,Size,TFPReaderPNG);
{$ELSE}
RaiseGDBException('TPortableNetworkGraphic.ReadStream needs FPImage');
@ -52,7 +52,7 @@ end;
procedure TPortableNetworkGraphic.WriteStream(Stream: TStream;
WriteSize: Boolean);
begin
{$IFDEF UseFPImage}
{$IFNDEF DisableFPImage}
WriteStreamWithFPImage(Stream,WriteSize,TFPWriterPNG);
{$ELSE}
RaiseGDBException('TPortableNetworkGraphic.WriteStream needs FPImage');