From 50ab47a69fb6f64fec810a4b9a9c8b07a40015d7 Mon Sep 17 00:00:00 2001 From: blikblum Date: Mon, 13 Dec 2010 21:13:33 +0000 Subject: [PATCH] * Add workaround to Carbon bug 18211 (PaintStruct not initialized) * Add a dummy AlphaBlend function to Carbon interface git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1402 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../branches/4.8/VirtualTrees.pas | 7 +++++- .../4.8/include/intf/carbon/vtgraphicsi.inc | 23 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 components/virtualtreeview-new/branches/4.8/include/intf/carbon/vtgraphicsi.inc diff --git a/components/virtualtreeview-new/branches/4.8/VirtualTrees.pas b/components/virtualtreeview-new/branches/4.8/VirtualTrees.pas index a34c3a72e..453045ae3 100644 --- a/components/virtualtreeview-new/branches/4.8/VirtualTrees.pas +++ b/components/virtualtreeview-new/branches/4.8/VirtualTrees.pas @@ -16444,10 +16444,15 @@ begin if tsVCLDragging in FStates then ImageList_DragShowNolock(False); {$endif} + //todo: workaround to bug 18211. Remove when fixed. + {$ifndef LCLCarbon} if csPaintCopy in ControlState then FUpdateRect := ClientRect else - FUpdateRect:=Message.PaintStruct^.rcPaint; + FUpdateRect := Message.PaintStruct^.rcPaint; + {$else} + FUpdateRect := ClientRect; + {$endif} {$ifdef DEBUG_VTV}Logger.Send([lcPaint],'FUpdateRect', FUpdateRect);{$endif} diff --git a/components/virtualtreeview-new/branches/4.8/include/intf/carbon/vtgraphicsi.inc b/components/virtualtreeview-new/branches/4.8/include/intf/carbon/vtgraphicsi.inc new file mode 100644 index 000000000..1efb80db5 --- /dev/null +++ b/components/virtualtreeview-new/branches/4.8/include/intf/carbon/vtgraphicsi.inc @@ -0,0 +1,23 @@ +//todo: properly implement +procedure AlphaBlend(Source, Destination: HDC; const R: TRect; const Target: TPoint; Mode: TBlendMode; ConstantAlpha, Bias: Integer); +begin + case Mode of + bmConstantAlpha, + bmPerPixelAlpha, + bmMasterAlpha, + bmConstantAlphaAndColor: + begin + BitBlt(Destination, Target.X, Target.Y, R.Right - R.Left, R.Bottom - R.Top, Source, R.Left, R.Right, SRCCOPY); + end; + end; +end; + +function CalculateScanline(Bits: Pointer; Width, Height, Row: Integer): Pointer; +begin + Result := nil; +end; + +function GetBitmapBitsFromBitmap(Bitmap: HBITMAP): Pointer; +begin + Result := nil; +end; \ No newline at end of file