LCL: added flag -dDisableLCLPNM

git-svn-id: trunk@56918 -
This commit is contained in:
mattias 2018-01-02 11:12:59 +00:00
parent 9f704743c9
commit 67369fd401
2 changed files with 23 additions and 1 deletions

View File

@ -37,13 +37,17 @@ interface
{$DEFINE HasFPJoinStyle}
{$ENDIF}
{$DEFINE DisableLCLPNM}
uses
// RTL + FCL
SysUtils, Math, Types, Classes, Contnrs, Laz_AVL_Tree,
FPImage, FPCanvas,
FPWriteBMP, // bmp support
FPWritePNG, PNGComn, // png support
{$IFNDEF DisableLCLPNM}
FPReadPNM, FPWritePNM, // PNM (Portable aNyMap) support
{$ENDIF}
{$IFNDEF DisableLCLJPEG}
FPReadJpeg, FPWriteJpeg, // jpg support
{$ENDIF}
@ -456,7 +460,9 @@ type
TPixmap = class; // xpm
TIcon = class; // ico
TPortableNetworkGraphic = class; // png
{$IFNDEF DisableLCLPNM}
TPortableAnyMapGraphic = class; // pnm formats: pbm, pgm and ppm
{$ENDIF}
{$IFNDEF DisableLCLJPEG}
TJpegImage = class; // jpg
{$ENDIF}
@ -960,7 +966,9 @@ type
function GetJpeg: TJpegImage;
{$ENDIF}
function GetPNG: TPortableNetworkGraphic;
{$IFNDEF DisableLCLPNM}
function GetPNM: TPortableAnyMapGraphic;
{$ENDIF}
function GetPixmap: TPixmap;
function GetHeight: Integer;
function GetWidth: Integer;
@ -971,7 +979,9 @@ type
procedure SetJpeg(Value: TJpegImage);
{$ENDIF}
procedure SetPNG(const AValue: TPortableNetworkGraphic);
{$IFNDEF DisableLCLPNM}
procedure SetPNM(const AValue: TPortableAnyMapGraphic);
{$ENDIF}
procedure SetPixmap(Value: TPixmap);
procedure SetGraphic(Value: TGraphic);
procedure WriteData(Stream: TStream);
@ -1020,7 +1030,9 @@ type
{$ENDIF}
property Pixmap: TPixmap read GetPixmap write SetPixmap;
property PNG: TPortableNetworkGraphic read GetPNG write SetPNG;
{$IFNDEF DisableLCLPNM}
property PNM: TPortableAnyMapGraphic read GetPNM write SetPNM;
{$ENDIF}
property Graphic: TGraphic read FGraphic write SetGraphic;
//property PictureAdapter: IChangeNotifier read FNotify write FNotify;
property Height: Integer read GetHeight;
@ -1579,6 +1591,7 @@ type
end;
{$IFNDEF DisableLCLPNM}
{ TSharedPortableAnyMapGraphic }
TSharedPortableAnyMapGraphic = class(TSharedCustomBitmap)
@ -1595,6 +1608,7 @@ type
class function IsStreamFormatSupported(Stream: TStream): Boolean; override;
class function GetFileExtensions: string; override;
end;
{$ENDIF}
TIconImage = class;
TIconImageClass = class of TIconImage;
@ -2396,7 +2410,7 @@ end;
procedure Register;
begin
RegisterClasses([TBitmap,TPixmap,TPortableNetworkGraphic,
TPortableAnyMapGraphic,
{$IFNDEF DisableLCLPNM}TPortableAnyMapGraphic,{$ENDIF}
{$IFNDEF DisableLCLJPEG}TJpegImage,{$ENDIF}
{$IFNDEF DisableLCLGIF}TGIFImage,{$ENDIF}
TPicture,
@ -2785,7 +2799,9 @@ end;
{$I canvas.inc}
{$I pixmap.inc}
{$I png.inc}
{$IFNDEF DisableLCLPNM}
{$I pnm.inc}
{$ENDIF}
{$IFNDEF DisableLCLJPEG}
{$I jpegimage.inc}
{$ENDIF}

View File

@ -58,7 +58,9 @@ begin
{$IFNDEF DisableLCLGIF}
Add(TGIFImage.GetFileExtensions, rsGIF, TGIFImage);
{$ENDIF}
{$IFNDEF DisableLCLPNM}
Add(TPortableAnyMapGraphic.GetFileExtensions, rsPortablePixmap, TPortableAnyMapGraphic);
{$ENDIF}
end;
procedure TPicFileFormatsList.Clear;
@ -426,11 +428,13 @@ begin
Result := TPortableNetworkGraphic(Graphic);
end;
{$IFNDEF DisableLCLPNM}
function TPicture.GetPNM: TPortableAnyMapGraphic;
begin
ForceType(TPortableAnyMapGraphic);
Result := TPortableAnyMapGraphic(Graphic);
end;
{$ENDIF}
function TPicture.GetPixmap: TPixmap;
begin
@ -462,10 +466,12 @@ begin
SetGraphic(AValue);
end;
{$IFNDEF DisableLCLPNM}
procedure TPicture.SetPNM(const AValue: TPortableAnyMapGraphic);
begin
SetGraphic(AValue);
end;
{$ENDIF}
procedure TPicture.SetPixmap(Value: TPixmap);
begin