mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 06:57:54 +02:00
lcl, win32, wince, qt, gtk2, carbon: implement OffsetRGN winapi compatible function
git-svn-id: trunk@29697 -
This commit is contained in:
parent
c66163d8f3
commit
7a9b188e2c
@ -178,7 +178,7 @@ end;
|
||||
|
||||
function TWidgetSet.CreatePolygonRgn(Points: PPoint; NumPts: Integer;
|
||||
FillMode: integer): HRGN;
|
||||
Begin
|
||||
begin
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
@ -334,7 +334,7 @@ begin
|
||||
end;
|
||||
|
||||
function TWidgetSet.DrawEdge(DC: HDC; var Rect: TRect; edge: Cardinal; grfFlags: Cardinal): Boolean;
|
||||
Begin
|
||||
begin
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
@ -765,7 +765,7 @@ begin
|
||||
end;
|
||||
|
||||
function TWidgetSet.EndPaint(Handle : hwnd; var PS : TPaintStruct): Integer;
|
||||
Begin
|
||||
begin
|
||||
Result:=1;
|
||||
end;
|
||||
|
||||
@ -1297,11 +1297,16 @@ begin
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
function TWidgetSet.OffsetRgn(RGN: HRGN; nXOffset, nYOffset: Integer): Integer;
|
||||
begin
|
||||
Result := Error;
|
||||
end;
|
||||
|
||||
function TWidgetSet.PeekMessage(var lpMsg : TMsg; Handle : HWND;
|
||||
wMsgFilterMin, wMsgFilterMax,wRemoveMsg : UINT): Boolean;
|
||||
Begin
|
||||
begin
|
||||
Result := False;
|
||||
End;
|
||||
end;
|
||||
|
||||
function TWidgetSet.Pie(DC: HDC; x1, y1, x2, y2,
|
||||
sx, sy, ex, ey: Integer): Boolean;
|
||||
@ -1317,7 +1322,7 @@ function TWidgetSet.PolyBezier(DC: HDC; Points: PPoint; NumPts: Integer;
|
||||
var
|
||||
APoints : PPoint;
|
||||
ACount : Longint;
|
||||
Begin
|
||||
begin
|
||||
APoints := nil;
|
||||
ACount := 0;
|
||||
PolyBezier2Polyline(Points,NumPts,APoints,ACount,Continuous);
|
||||
@ -1402,7 +1407,7 @@ begin
|
||||
end;
|
||||
|
||||
function TWidgetSet.ReleaseCapture : Boolean;
|
||||
Begin
|
||||
begin
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
@ -1596,7 +1601,7 @@ end;
|
||||
|
||||
function TWidgetSet.SetProp(Handle: hwnd; Str : PChar;
|
||||
Data : Pointer) : Boolean;
|
||||
Begin
|
||||
begin
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
@ -1657,7 +1662,7 @@ end;
|
||||
|
||||
function TWidgetSet.SetWindowOrgEx(dc : hdc; NewX, NewY : Integer;
|
||||
OldPoint: PPoint) : Boolean;
|
||||
Begin
|
||||
begin
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
|
@ -702,6 +702,11 @@ begin
|
||||
Result := WidgetSet.MoveToEx(DC, X, Y, OldPoint);
|
||||
end;
|
||||
|
||||
function OffsetRgn(RGN: HRGN; nXOffset, nYOffset: Integer): Integer;
|
||||
begin
|
||||
Result := WidgetSet.OffsetRgn(RGN, nXOffset, nYOffset);
|
||||
end;
|
||||
|
||||
function PeekMessage(var lpMsg : TMsg; Handle : HWND;
|
||||
wMsgFilterMin, wMsgFilterMax,wRemoveMsg : UINT): Boolean;
|
||||
begin
|
||||
|
@ -203,6 +203,7 @@ function MonitorFromWindow(hWnd: HWND; dwFlags: DWord): HMONITOR; {$IFDEF IF_BAS
|
||||
function MoveToEx(DC: HDC; X, Y: Integer; OldPoint: PPoint): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||
|
||||
//function OffsetRect --> independent
|
||||
function OffsetRgn(RGN: HRGN; nXOffset, nYOffset: Integer): Integer; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||
|
||||
function PeekMessage(var lpMsg : TMsg; Handle : HWND; wMsgFilterMin, wMsgFilterMax,wRemoveMsg : UINT): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||
function Pie(DC: HDC; x1, y1, x2, y2, sx, sy, ex, ey: Integer): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||
|
@ -74,6 +74,7 @@ type
|
||||
function ContainsPoint(const P: TPoint): Boolean;
|
||||
procedure SetShape(AShape: HIShapeRef);
|
||||
function CombineWith(ARegion: TCarbonRegion; CombineMode: Integer): Integer;
|
||||
procedure Offset(dx, dy: Integer);
|
||||
public
|
||||
property Shape: HIShapeRef read FShape write SetShape;
|
||||
end;
|
||||
@ -839,6 +840,12 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCarbonRegion.Offset(dx, dy: Integer);
|
||||
begin
|
||||
HIShapeOffset(FShape, dx, dy);
|
||||
end;
|
||||
|
||||
|
||||
{ TCarbonTextLayout }
|
||||
|
||||
procedure TCarbonTextLayout.Release;
|
||||
|
@ -2554,6 +2554,14 @@ begin
|
||||
Result := inherited MoveWindowOrgEx(DC, dX, dY);
|
||||
end;
|
||||
|
||||
function TCarbonWidgetSet.OffsetRgn(RGN: HRGN; nXOffset, nYOffset: Integer): Integer;
|
||||
begin
|
||||
if not (TObject(RGN) is TCarbonRegion) then
|
||||
Exit(ERROR);
|
||||
TCarbonRegion(RGN).Offset(nXOffset, nYOffset);
|
||||
Result := TCarbonRegion(RGN).GetType;
|
||||
end;
|
||||
|
||||
function TCarbonWidgetSet.PeekMessage(var lpMsg: TMsg; Handle: HWND;
|
||||
wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): Boolean;
|
||||
begin
|
||||
|
@ -159,6 +159,8 @@ function MessageBox(hWnd: HWND; lpText, lpCaption: PChar; uType: Cardinal): inte
|
||||
function MoveToEx(DC: HDC; X, Y: Integer; OldPoint: PPoint): Boolean; override;
|
||||
function MoveWindowOrgEx(DC: HDC; dX, dY: Integer): Boolean; override;
|
||||
|
||||
function OffsetRgn(RGN: HRGN; nXOffset, nYOffset: Integer): Integer; override;
|
||||
|
||||
function PeekMessage(var lpMsg : TMsg; Handle : HWND; wMsgFilterMin, wMsgFilterMax,wRemoveMsg : UINT): Boolean; override;
|
||||
function PolyBezier(DC: HDC; Points: PPoint; NumPts: Integer; Filled, Continuous: boolean): boolean; override;
|
||||
function Polygon(DC: HDC; Points: PPoint; NumPts: Integer; Winding: boolean): boolean; override;
|
||||
|
@ -6507,6 +6507,18 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TGtk2WidgetSet.OffsetRgn(RGN: HRGN; nXOffset, nYOffset: Integer): Integer;
|
||||
var
|
||||
GdkRGN: PGDKRegion;
|
||||
begin
|
||||
if not IsValidGDIObject(RGN) then
|
||||
Exit(Error);
|
||||
|
||||
GdkRGN := PGdiObject(RGN)^.GDIRegionObject;
|
||||
gdk_region_offset(GdkRGN, nXOffset, nYOffset);
|
||||
Result := RegionType(GdkRGN);
|
||||
end;
|
||||
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: PeekMessage
|
||||
|
@ -171,6 +171,8 @@ function MessageBox(hWnd: HWND; lpText, lpCaption: PChar; uType: Cardinal): inte
|
||||
function MoveToEx(DC: HDC; X, Y: Integer; OldPoint: PPoint): Boolean; override;
|
||||
function MoveWindowOrgEx(DC: HDC; dX, dY: Integer): Boolean; override;
|
||||
|
||||
function OffsetRgn(RGN: HRGN; nXOffset, nYOffset: Integer): Integer; override;
|
||||
|
||||
function PeekMessage(var lpMsg : TMsg; Handle : HWND; wMsgFilterMin, wMsgFilterMax,wRemoveMsg : UINT): Boolean; override;
|
||||
function PolyBezier(DC: HDC; Points: PPoint; NumPts: Integer; Filled, Continuous: boolean): boolean; override;
|
||||
function Polygon(DC: HDC; Points: PPoint; NumPts: Integer; Winding: boolean): boolean; override;
|
||||
|
@ -4256,6 +4256,30 @@ begin
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
function TQtWidgetSet.OffsetRgn(RGN: HRGN; nXOffset, nYOffset: Integer): Integer;
|
||||
var
|
||||
QtRgn: QRegionH;
|
||||
begin
|
||||
Result := ERROR;
|
||||
|
||||
if not IsValidGDIObject(RGN) then
|
||||
Exit
|
||||
else
|
||||
QtRgn := TQtRegion(RGN).Widget;
|
||||
|
||||
QRegion_translate(QtRgn, nXOffset, nYOffset);
|
||||
|
||||
if QRegion_isEmpty(QtRgn) then
|
||||
Result := NULLREGION
|
||||
else
|
||||
begin
|
||||
if TQtRegion(RGN).IsPolyRegion or (TQtRegion(RGN).numRects > 0) then
|
||||
Result := COMPLEXREGION
|
||||
else
|
||||
Result := SIMPLEREGION;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TQtWidgetSet.PeekMessage(var lpMsg : TMsg; Handle : HWND; wMsgFilterMin, wMsgFilterMax,wRemoveMsg : UINT): Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
|
@ -159,6 +159,8 @@ function LPtoDP(DC: HDC; var Points; Count: Integer): BOOL; override;
|
||||
function MessageBox(hWnd: HWND; lpText, lpCaption: PChar; uType: Cardinal): integer; override;
|
||||
function MoveToEx(DC: HDC; X, Y: Integer; OldPoint: PPoint): Boolean; override;
|
||||
|
||||
function OffsetRgn(RGN: HRGN; nXOffset, nYOffset: Integer): Integer; override;
|
||||
|
||||
function PeekMessage(var lpMsg : TMsg; Handle : HWND; wMsgFilterMin, wMsgFilterMax,wRemoveMsg : UINT): Boolean; override;
|
||||
function PolyBezier(DC: HDC; Points: PPoint; NumPts: Integer; Filled, Continuous: boolean): boolean; override;
|
||||
function Polygon(DC: HDC; Points: PPoint; NumPts: Integer; Winding: boolean): boolean; override;
|
||||
|
@ -2560,6 +2560,11 @@ begin
|
||||
Assert(False, Format('Trace:< [TWin32WidgetSet.MoveToEx] DC:0x%x, X:%d, Y:%d', [DC, X, Y]));
|
||||
end;
|
||||
|
||||
function TWin32WidgetSet.OffsetRgn(RGN: HRGN; nXOffset, nYOffset: Integer): Integer;
|
||||
begin
|
||||
Result := Windows.OffsetRgn(RGN, nXOffset, nYOffset);
|
||||
end;
|
||||
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: PeekMessage
|
||||
|
@ -160,6 +160,8 @@ function MonitorFromRect(lprcScreenCoords: PRect; dwFlags: DWord): HMONITOR; ove
|
||||
function MonitorFromWindow(hWnd: HWND; dwFlags: DWord): HMONITOR; override;
|
||||
function MoveToEx(DC: HDC; X, Y: Integer; OldPoint: PPoint): Boolean; override;
|
||||
|
||||
function OffsetRgn(RGN: HRGN; nXOffset, nYOffset: Integer): Integer; override;
|
||||
|
||||
function PeekMessage(Var LPMsg: TMsg; Handle: HWND; WMsgFilterMin, WMsgFilterMax, WRemoveMsg: UINT): Boolean; override;
|
||||
function Pie(DC: HDC; EllipseX1,EllipseY1,EllipseX2,EllipseY2,
|
||||
StartX,StartY,EndX,EndY: Integer): Boolean; override;
|
||||
|
@ -2435,6 +2435,11 @@ begin
|
||||
Assert(False, Format('Trace:< [TWinCEWidgetSet.MoveToEx] DC:0x%x, X:%d, Y:%d', [DC, X, Y]));
|
||||
end;
|
||||
|
||||
function TWinCEWidgetSet.OffsetRgn(RGN: HRGN; nXOffset, nYOffset: Integer): Integer;
|
||||
begin
|
||||
Result := Windows.OffsetRgn(RGN, nXOffset, nYOffset);
|
||||
end;
|
||||
|
||||
{function TWinCEWidgetSet.PolyBezier(DC: HDC; Points: PPoint; NumPts: Integer;
|
||||
Filled, Continuous: boolean): boolean;
|
||||
begin
|
||||
|
@ -171,6 +171,8 @@ function MonitorFromRect(lprcScreenCoords: PRect; dwFlags: DWord): HMONITOR; ove
|
||||
function MonitorFromWindow(hWnd: HWND; dwFlags: DWord): HMONITOR; override;
|
||||
function MoveToEx(DC: HDC; X, Y: Integer; OldPoint: PPoint): Boolean; override;
|
||||
|
||||
function OffsetRgn(RGN: HRGN; nXOffset, nYOffset: Integer): Integer; override;
|
||||
|
||||
function PeekMessage(var lpMsg : TMsg; Handle : HWND; wMsgFilterMin, wMsgFilterMax,wRemoveMsg : UINT): Boolean; override;
|
||||
//function PolyBezier(DC: HDC; Points: PPoint; NumPts: Integer; Filled, Continuous: boolean): boolean; override;
|
||||
function Polygon(DC: HDC; Points: PPoint; NumPts: Integer; Winding: boolean): boolean; override;
|
||||
|
Loading…
Reference in New Issue
Block a user