summaryrefslogtreecommitdiff
path: root/gfx/x11
diff options
context:
space:
mode:
authorFelipe Menteiro de Carvalho <sekelsenmat@users.sourceforge.net>2006-11-19 19:59:53 +0000
committerFelipe Menteiro de Carvalho <sekelsenmat@users.sourceforge.net>2006-11-19 19:59:53 +0000
commit85b11e2c5ac5ecd1d4c9eb7ab5ee630b1b796a72 (patch)
treea64bce2280dff777f0c58fc3ded52f6d522ff00f /gfx/x11
parent1a48cbf0fc7f2b3cec7526929fcd0ab4c6f08b4f (diff)
downloadfpGUI-85b11e2c5ac5ecd1d4c9eb7ab5ee630b1b796a72.tar.xz
Removed 4 bits and 24 bits image formats because they are not portable enougth.
Diffstat (limited to 'gfx/x11')
-rw-r--r--gfx/x11/gfx_x11.pas24
1 files changed, 9 insertions, 15 deletions
diff --git a/gfx/x11/gfx_x11.pas b/gfx/x11/gfx_x11.pas
index ac74f781..fd8705ea 100644
--- a/gfx/x11/gfx_x11.pas
+++ b/gfx/x11/gfx_x11.pas
@@ -111,7 +111,7 @@ type
procedure DoTextOut(const APosition: TPoint; const AText: String); override;
procedure DoCopyRect(ASource: TFCustomCanvas; const ASourceRect: TRect; const ADestPos: TPoint); override;
procedure DoMaskedCopyRect(ASource, AMask: TFCustomCanvas; const ASourceRect: TRect; const AMaskPos, ADestPos: TPoint); override;
- procedure DoDrawImageRect(AImage: TFCustomImage; ASourceRect: TRect; const ADestPos: TPoint); override;
+ procedure DoDrawImageRect(AImage: TFCustomBitmap; ASourceRect: TRect; const ADestPos: TPoint); override;
public
constructor Create(AColormap: TColormap; AXDrawable: X.TDrawable; ADefaultFont: PXFontStruct);
destructor Destroy; override;
@@ -152,20 +152,16 @@ type
constructor Create(AColormap: TColormap; AHandle: TPixmap);
end;
+ { TX11Bitmap }
- TX11Image = class(TFCustomImage)
+ TX11Bitmap = class(TFCustomBitmap)
private
IsLocked: Boolean;
- protected
- FStride: LongWord;
- FData: Pointer;
public
constructor Create(AWidth, AHeight: Integer; APixelFormat: TGfxPixelFormat); override;
destructor Destroy; override;
procedure Lock(var AData: Pointer; var AStride: LongWord); override;
procedure Unlock; override;
- property Stride: LongWord read FStride;
- property Data: Pointer read FData;
end;
{ TX11Screen }
@@ -777,7 +773,7 @@ begin
XSetRegion(gApplication.Handle, GC, Region);
end;
-procedure TX11Canvas.DoDrawImageRect(AImage: TFCustomImage; ASourceRect: TRect;
+procedure TX11Canvas.DoDrawImageRect(AImage: TFCustomBitmap; ASourceRect: TRect;
const ADestPos: TPoint);
var
Image: XLib.PXImage;
@@ -898,30 +894,28 @@ begin
inherited Create(AColormap, AHandle, PixelFormatMono);
end;
-{ TX11Image }
+{ TX11Bitmap }
-constructor TX11Image.Create(AWidth, AHeight: Integer; APixelFormat: TGfxPixelFormat);
+constructor TX11Bitmap.Create(AWidth, AHeight: Integer; APixelFormat: TGfxPixelFormat);
begin
inherited Create(AWidth, AHeight, APixelFormat);
case APixelFormat.FormatType of
ftMono:
FStride := (AWidth + 7) shr 3;
- ftPal4, ftPal4A:
- FStride := (AWidth + 1) and not 1;
else
FStride := AWidth * (FormatTypeBPPTable[APixelFormat.FormatType] shr 3);
end;
GetMem(FData, FStride * Height);
end;
-destructor TX11Image.Destroy;
+destructor TX11Bitmap.Destroy;
begin
FreeMem(FData);
inherited Destroy;
end;
-procedure TX11Image.Lock(var AData: Pointer; var AStride: LongWord);
+procedure TX11Bitmap.Lock(var AData: Pointer; var AStride: LongWord);
begin
ASSERT(not IsLocked);
IsLocked := True;
@@ -930,7 +924,7 @@ begin
AStride := Stride;
end;
-procedure TX11Image.Unlock;
+procedure TX11Bitmap.Unlock;
begin
ASSERT(IsLocked);
IsLocked := False;