From bbfe1342b3700ab883a686a4f357fa6b5a74b0b1 Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 25 Aug 2003 16:43:32 +0000 Subject: [PATCH] moved many graphics types form graphtype.pp to graphics.pp git-svn-id: trunk@4522 - --- lcl/graphics.pp | 11 +-- lcl/graphtype.pp | 145 +--------------------------------- lcl/include/interfacebase.inc | 11 +-- lcl/include/winapi.inc | 9 ++- lcl/include/winapih.inc | 9 ++- lcl/lmessages.pp | 11 ++- 6 files changed, 30 insertions(+), 166 deletions(-) diff --git a/lcl/graphics.pp b/lcl/graphics.pp index 9ff30e1d7f..b938f38463 100644 --- a/lcl/graphics.pp +++ b/lcl/graphics.pp @@ -38,7 +38,6 @@ uses {$IFDEF UseFPImage}, FPReadPNG, IntfGraphics{$ENDIF} ; - {$IFDEF NewGraphType} type PColor = ^TColor; TColor = TGraphicsColor; @@ -177,9 +176,6 @@ type tmFixed ); - {$ELSE} - {$ENDIF} - const // The follow colors match the predefined Delphi Colors clBlack = TColor($000000); @@ -824,10 +820,6 @@ type to convert it automatically to the best internal format. That is why the Handle is interface dependent. } - {$IFNDEF NewGraphType} - TTransparentMode = (tmAuto, tmFixed); - {$ENDIF} - TBitmapInternalStateFlag = ( bmisCreateingCanvas ); @@ -1181,6 +1173,9 @@ end. { ============================================================================= $Log$ + Revision 1.83 2003/08/25 16:43:32 mattias + moved many graphics types form graphtype.pp to graphics.pp + Revision 1.82 2003/08/20 17:03:47 mattias implemented TPixmap and TPortableNetworkGraphic with fpImage diff --git a/lcl/graphtype.pp b/lcl/graphtype.pp index b1840d8e05..79fb85040a 100644 --- a/lcl/graphtype.pp +++ b/lcl/graphtype.pp @@ -35,153 +35,11 @@ uses {$ASSERTIONS ON} {$endif} - {$IFDEF NewGraphType} type TGraphicsColor = -$7FFFFFFF-1..$7FFFFFFF; TGraphicsFillStyle = (fsSurface, fsBorder); TGraphicsBevelCut = (bvNone, bvLowered, bvRaised); - {$ELSE} -type - PColor = ^TColor; - // don't define TColor as longint, or else the RTTI can't distinguish them - TColor = -$7FFFFFFF-1..$7FFFFFFF; - - TFontPitch = (fpDefault, fpVariable, fpFixed); - TFontName = string; - TFontCharSet = 0..255; - TFontDataName = string[LF_FACESIZE -1]; - TFontStyle = (fsBold, fsItalic, fsStrikeOut, fsUnderline); - TFontStyles = set of TFontStyle; - TFontStylesbase = set of TFontStyle; - - TFontData = record - Handle : HFont; - Height : Integer; - Pitch : TFontPitch; - Style : TFontStylesBase; - CharSet : TFontCharSet; - Name : TFontDataName; - end; - - { Reflects text style when drawn in a rectangle } - - TTextLayout = (tlTop, tlCenter, tlBottom); - TTextStyle = packed record - Alignment : TAlignment; // TextRect Only : horizontal alignment - - Layout : TTextLayout; // TextRect Only : vertical alignment - - SingleLine : boolean; // If WordBreak is false then process #13, #10 as - // standard chars and perform no Line breaking. - - Clipping : boolean; // TextRect Only : Clip Text to passed Rectangle - - ExpandTabs : boolean; // currently ignored - - ShowPrefix : boolean; // TextRect Only : Process first single '&' per - // line as an underscore and draw '&&' as '&' - - Wordbreak : boolean; // TextRect Only : If line of text is too long - // too fit between left and right boundaries - // try to break into multiple lines between - // words - - Opaque : boolean; // TextRect : Fills background with current Brush - // TextOut : Fills background with current - // foreground color - - SystemFont : Boolean; // Use the system font instead of Canvas Font - end; - - TPenStyle = (psSolid, psDash, psDot, psDashDot, psDashDotDot, psClear, - psInsideframe); - TPenMode = (pmBlack, pmWhite, pmNop, pmNot, pmCopy, pmNotCopy, pmMergePenNot, - pmMaskPenNot, pmMergeNotPen, pmMaskNotPen, pmMerge,pmNotMerge, pmMask, - pmNotMask, pmXor, pmNotXor - ); - - TPenData = record - Handle : HPen; - Color : TColor; - Width : Integer; - Style : TPenStyle; - end; - - TBrushStyle = (bsSolid, bsClear, bsHorizontal, bsVertical, bsFDiagonal, - bsBDiagonal, bsCross, bsDiagCross); - - TFillStyle = (fsSurface, fsBorder); - TFillMode = (fmAlternate, fmWinding); - - TCopymode = longint; - - TCanvasStates = (csHandleValid, csFontValid, csPenvalid, csBrushValid, - csRegionValid); - TCanvasState = set of TCanvasStates; - TCanvasOrientation = (csLefttoRight, coRighttoLeft); - - { TProgressEvent is a generic progress notification event which may be - used by TGraphic classes with computationally intensive (slow) - operations, such as loading, storing, or transforming image data. - Event params: - Stage - Indicates whether this call to the OnProgress event is to - prepare for, process, or clean up after a graphic operation. If - OnProgress is called at all, the first call for a graphic operation - will be with Stage = psStarting, to allow the OnProgress event handler - to allocate whatever resources it needs to process subsequent progress - notifications. After Stage = psStarting, you are guaranteed that - OnProgress will be called again with Stage = psEnding to allow you - to free those resources, even if the graphic operation is aborted by - an exception. Zero or more calls to OnProgress with Stage = psRunning - may occur between the psStarting and psEnding calls. - PercentDone - The ratio of work done to work remaining, on a scale of - 0 to 100. Values may repeat or even regress (get smaller) in - successive calls. PercentDone is usually only a guess, and the - guess may be dramatically altered as new information is discovered - in decoding the image. - RedrawNow - Indicates whether the graphic can be/should be redrawn - immediately. Useful for showing successive approximations of - an image as data is available instead of waiting for all the data - to arrive before drawing anything. Since there is no message loop - activity during graphic operations, you should call Update to force - a control to be redrawn immediately in the OnProgress event handler. - Redrawing a graphic when RedrawNow = False could corrupt the image - and/or cause exceptions. - Rect - Area of image that has changed and needs to be redrawn. - Msg - Optional text describing in one or two words what the graphic - class is currently working on. Ex: "Loading" "Storing" - "Reducing colors". The Msg string can also be empty. - Msg strings should be resourced for translation, should not - contain trailing periods, and should be used only for - display purposes. (do not: if Msg = 'Loading' then...) - } - TProgressStage = (psStarting, psRunning, psEnding); - TProgressEvent = procedure (Sender: TObject; Stage: TProgressStage; - PercentDone: Byte; RedrawNow: Boolean; const R: TRect; - const Msg: string; var Continue : Boolean) of object; - - TBevelCut = (bvNone, bvLowered, bvRaised); - - { For Delphi compatibility } - TPixelFormat = ( - pfDevice, - pf1bit, - pf4bit, - pf8bit, - pf15bit, - pf16bit, - pf24bit, - pf32bit, - pfCustom - ); - - TTransparentMode = ( - tmAuto, - tmFixed - ); - - {$ENDIF} //------------------------------------------------------------------------------ // raw image data type @@ -268,6 +126,9 @@ end. { ============================================================================= $Log$ + Revision 1.20 2003/08/25 16:43:32 mattias + moved many graphics types form graphtype.pp to graphics.pp + Revision 1.19 2003/08/19 12:23:23 mattias moved types from graphtype.pp back to graphics.pp diff --git a/lcl/include/interfacebase.inc b/lcl/include/interfacebase.inc index 76794907d1..fd9cfec136 100644 --- a/lcl/include/interfacebase.inc +++ b/lcl/include/interfacebase.inc @@ -787,8 +787,8 @@ begin end; function TInterfaceBase.FloodFill(DC: HDC; X, Y: Integer; - Color: {$IFDEF NewGraphType}TGraphicsColor{$ELSE}TColor{$ENDIF}; - FillStyle: {$IFDEF NewGraphType}TGraphicsFillStyle{$ELSE}TFillStyle{$ENDIF}; + Color: TGraphicsColor; + FillStyle: TGraphicsFillStyle; Brush: HBRUSH): Boolean; begin Result := false; @@ -805,9 +805,7 @@ begin end; function TInterfaceBase.Frame3d(DC: HDC; var ARect: TRect; - const FrameWidth: integer; - const Style: {$IFDEF NewGraphType}TGraphicsBevelCut{$ELSE}TBevelCut{$ENDIF} - ) : boolean; + const FrameWidth: integer; const Style: TGraphicsBevelCut) : boolean; begin Result:= false; end; @@ -1824,6 +1822,9 @@ end; { ============================================================================= $Log$ + Revision 1.101 2003/08/25 16:43:32 mattias + moved many graphics types form graphtype.pp to graphics.pp + Revision 1.100 2003/08/19 12:23:23 mattias moved types from graphtype.pp back to graphics.pp diff --git a/lcl/include/winapi.inc b/lcl/include/winapi.inc index 771ded139c..d2b478997e 100644 --- a/lcl/include/winapi.inc +++ b/lcl/include/winapi.inc @@ -308,8 +308,7 @@ begin end; function FloodFill(DC: HDC; X, Y: Integer; - Color: {$IFDEF NewGraphType}TGraphicsColor{$ELSE}TColor{$ENDIF}; - FillStyle: {$IFDEF NewGraphType}TGraphicsFillStyle{$ELSE}TFillStyle{$ENDIF}; + Color: TGraphicsColor; FillStyle: TGraphicsFillStyle; Brush: HBRUSH): Boolean; begin Result := InterfaceObject.FloodFill(DC,X,Y,Color,FillStyle,Brush); @@ -321,8 +320,7 @@ begin end; function Frame3d(DC : HDC; var ARect : TRect; const FrameWidth : integer; - const Style: {$IFDEF NewGraphType}TGraphicsBevelCut{$ELSE}TBevelCut{$ENDIF} - ) : boolean; + const Style: TGraphicsBevelCut) : boolean; begin Result:= InterfaceObject.Frame3d(DC, ARect, FrameWidth, Style); end; @@ -1673,6 +1671,9 @@ end; { ============================================================================= $Log$ + Revision 1.96 2003/08/25 16:43:32 mattias + moved many graphics types form graphtype.pp to graphics.pp + Revision 1.95 2003/08/19 12:23:23 mattias moved types from graphtype.pp back to graphics.pp diff --git a/lcl/include/winapih.inc b/lcl/include/winapih.inc index b922028839..e711579e76 100644 --- a/lcl/include/winapih.inc +++ b/lcl/include/winapih.inc @@ -107,12 +107,12 @@ function ExtSelectClipRGN(dc: hdc; rgn : hrgn; Mode : Longint) : Integer; {$IFD function FillRect(DC: HDC; const Rect: TRect; Brush: HBRUSH): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function FillRgn(DC: HDC; RegionHnd: HRGN; hbr: HBRUSH): BOOL; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function FloodFill(DC: HDC; X, Y: Integer; - Color: {$IFDEF NewGraphType}TGraphicsColor{$ELSE}TColor{$ENDIF}; - FillStyle: {$IFDEF NewGraphType}TGraphicsFillStyle{$ELSE}TFillStyle{$ENDIF}; + Color: TGraphicsColor; + FillStyle: TGraphicsFillStyle; Brush: HBRUSH): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function Frame(DC: HDC; const ARect: TRect): Integer; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function Frame3d(DC: HDC; var ARect: TRect; const FrameWidth : integer; - const Style : {$IFDEF NewGraphType}TGraphicsBevelCut{$ELSE}TBevelCut{$ENDIF} + const Style : TGraphicsBevelCut ): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function FrameRect(DC: HDC; const ARect: TRect; hBr: HBRUSH): Integer; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} @@ -396,6 +396,9 @@ procedure RaiseLastOSError; { ============================================================================= $Log$ + Revision 1.86 2003/08/25 16:43:32 mattias + moved many graphics types form graphtype.pp to graphics.pp + Revision 1.85 2003/08/19 12:23:23 mattias moved types from graphtype.pp back to graphics.pp diff --git a/lcl/lmessages.pp b/lcl/lmessages.pp index 1f46d71b24..b6097bf001 100644 --- a/lcl/lmessages.pp +++ b/lcl/lmessages.pp @@ -421,7 +421,7 @@ type TLMCanvasDrawRect = Record R : TRect; ReDraw : Boolean; - PenColor : {$IFDEF NewGraphType}TGraphicsColor{$ELSE}TColor{$ENDIF}; + PenColor : TGraphicsColor; end; PLMCanvasDrawLine = ^TLMCanvasDrawLine; @@ -430,7 +430,7 @@ type y1 : Integer; x2 : Integer; y2 : Integer; - PenColor : {$IFDEF NewGraphType}TGraphicsColor{$ELSE}TColor{$ENDIF}; + PenColor : TGraphicsColor; ReDraw : Boolean; end; @@ -440,7 +440,7 @@ type y1 : Integer; Str : String; Font : TObject; - PenColor : {$IFDEF NewGraphType}TGraphicsColor{$ELSE}TColor{$ENDIF}; + PenColor : TGraphicsColor; ReDraw : Boolean; end; @@ -730,7 +730,7 @@ type TLMSetGetPixel = record X,Y : Integer; - PixColor : {$IFDEF NewGraphType}TGraphicsColor{$ELSE}TColor{$ENDIF}; + PixColor : TGraphicsColor; end; TLMSize = packed record @@ -1057,6 +1057,9 @@ end. { $Log$ + Revision 1.52 2003/08/25 16:43:32 mattias + moved many graphics types form graphtype.pp to graphics.pp + Revision 1.51 2003/08/19 12:23:23 mattias moved types from graphtype.pp back to graphics.pp