mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-07 11:16:07 +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;
|
function TWidgetSet.CreatePolygonRgn(Points: PPoint; NumPts: Integer;
|
||||||
FillMode: integer): HRGN;
|
FillMode: integer): HRGN;
|
||||||
Begin
|
begin
|
||||||
Result := 0;
|
Result := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -334,7 +334,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TWidgetSet.DrawEdge(DC: HDC; var Rect: TRect; edge: Cardinal; grfFlags: Cardinal): Boolean;
|
function TWidgetSet.DrawEdge(DC: HDC; var Rect: TRect; edge: Cardinal; grfFlags: Cardinal): Boolean;
|
||||||
Begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -765,7 +765,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TWidgetSet.EndPaint(Handle : hwnd; var PS : TPaintStruct): Integer;
|
function TWidgetSet.EndPaint(Handle : hwnd; var PS : TPaintStruct): Integer;
|
||||||
Begin
|
begin
|
||||||
Result:=1;
|
Result:=1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1297,11 +1297,16 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TWidgetSet.OffsetRgn(RGN: HRGN; nXOffset, nYOffset: Integer): Integer;
|
||||||
|
begin
|
||||||
|
Result := Error;
|
||||||
|
end;
|
||||||
|
|
||||||
function TWidgetSet.PeekMessage(var lpMsg : TMsg; Handle : HWND;
|
function TWidgetSet.PeekMessage(var lpMsg : TMsg; Handle : HWND;
|
||||||
wMsgFilterMin, wMsgFilterMax,wRemoveMsg : UINT): Boolean;
|
wMsgFilterMin, wMsgFilterMax,wRemoveMsg : UINT): Boolean;
|
||||||
Begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
End;
|
end;
|
||||||
|
|
||||||
function TWidgetSet.Pie(DC: HDC; x1, y1, x2, y2,
|
function TWidgetSet.Pie(DC: HDC; x1, y1, x2, y2,
|
||||||
sx, sy, ex, ey: Integer): Boolean;
|
sx, sy, ex, ey: Integer): Boolean;
|
||||||
@ -1317,7 +1322,7 @@ function TWidgetSet.PolyBezier(DC: HDC; Points: PPoint; NumPts: Integer;
|
|||||||
var
|
var
|
||||||
APoints : PPoint;
|
APoints : PPoint;
|
||||||
ACount : Longint;
|
ACount : Longint;
|
||||||
Begin
|
begin
|
||||||
APoints := nil;
|
APoints := nil;
|
||||||
ACount := 0;
|
ACount := 0;
|
||||||
PolyBezier2Polyline(Points,NumPts,APoints,ACount,Continuous);
|
PolyBezier2Polyline(Points,NumPts,APoints,ACount,Continuous);
|
||||||
@ -1402,7 +1407,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TWidgetSet.ReleaseCapture : Boolean;
|
function TWidgetSet.ReleaseCapture : Boolean;
|
||||||
Begin
|
begin
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1596,7 +1601,7 @@ end;
|
|||||||
|
|
||||||
function TWidgetSet.SetProp(Handle: hwnd; Str : PChar;
|
function TWidgetSet.SetProp(Handle: hwnd; Str : PChar;
|
||||||
Data : Pointer) : Boolean;
|
Data : Pointer) : Boolean;
|
||||||
Begin
|
begin
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1657,7 +1662,7 @@ end;
|
|||||||
|
|
||||||
function TWidgetSet.SetWindowOrgEx(dc : hdc; NewX, NewY : Integer;
|
function TWidgetSet.SetWindowOrgEx(dc : hdc; NewX, NewY : Integer;
|
||||||
OldPoint: PPoint) : Boolean;
|
OldPoint: PPoint) : Boolean;
|
||||||
Begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -702,6 +702,11 @@ begin
|
|||||||
Result := WidgetSet.MoveToEx(DC, X, Y, OldPoint);
|
Result := WidgetSet.MoveToEx(DC, X, Y, OldPoint);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function OffsetRgn(RGN: HRGN; nXOffset, nYOffset: Integer): Integer;
|
||||||
|
begin
|
||||||
|
Result := WidgetSet.OffsetRgn(RGN, nXOffset, nYOffset);
|
||||||
|
end;
|
||||||
|
|
||||||
function PeekMessage(var lpMsg : TMsg; Handle : HWND;
|
function PeekMessage(var lpMsg : TMsg; Handle : HWND;
|
||||||
wMsgFilterMin, wMsgFilterMax,wRemoveMsg : UINT): Boolean;
|
wMsgFilterMin, wMsgFilterMax,wRemoveMsg : UINT): Boolean;
|
||||||
begin
|
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 MoveToEx(DC: HDC; X, Y: Integer; OldPoint: PPoint): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
|
||||||
|
|
||||||
//function OffsetRect --> independent
|
//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 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}
|
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;
|
function ContainsPoint(const P: TPoint): Boolean;
|
||||||
procedure SetShape(AShape: HIShapeRef);
|
procedure SetShape(AShape: HIShapeRef);
|
||||||
function CombineWith(ARegion: TCarbonRegion; CombineMode: Integer): Integer;
|
function CombineWith(ARegion: TCarbonRegion; CombineMode: Integer): Integer;
|
||||||
|
procedure Offset(dx, dy: Integer);
|
||||||
public
|
public
|
||||||
property Shape: HIShapeRef read FShape write SetShape;
|
property Shape: HIShapeRef read FShape write SetShape;
|
||||||
end;
|
end;
|
||||||
@ -839,6 +840,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCarbonRegion.Offset(dx, dy: Integer);
|
||||||
|
begin
|
||||||
|
HIShapeOffset(FShape, dx, dy);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TCarbonTextLayout }
|
{ TCarbonTextLayout }
|
||||||
|
|
||||||
procedure TCarbonTextLayout.Release;
|
procedure TCarbonTextLayout.Release;
|
||||||
|
@ -2554,6 +2554,14 @@ begin
|
|||||||
Result := inherited MoveWindowOrgEx(DC, dX, dY);
|
Result := inherited MoveWindowOrgEx(DC, dX, dY);
|
||||||
end;
|
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;
|
function TCarbonWidgetSet.PeekMessage(var lpMsg: TMsg; Handle: HWND;
|
||||||
wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): Boolean;
|
wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): Boolean;
|
||||||
begin
|
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 MoveToEx(DC: HDC; X, Y: Integer; OldPoint: PPoint): Boolean; override;
|
||||||
function MoveWindowOrgEx(DC: HDC; dX, dY: Integer): 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 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 PolyBezier(DC: HDC; Points: PPoint; NumPts: Integer; Filled, Continuous: boolean): boolean; override;
|
||||||
function Polygon(DC: HDC; Points: PPoint; NumPts: Integer; Winding: boolean): boolean; override;
|
function Polygon(DC: HDC; Points: PPoint; NumPts: Integer; Winding: boolean): boolean; override;
|
||||||
|
@ -6507,6 +6507,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
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
|
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 MoveToEx(DC: HDC; X, Y: Integer; OldPoint: PPoint): Boolean; override;
|
||||||
function MoveWindowOrgEx(DC: HDC; dX, dY: Integer): 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 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 PolyBezier(DC: HDC; Points: PPoint; NumPts: Integer; Filled, Continuous: boolean): boolean; override;
|
||||||
function Polygon(DC: HDC; Points: PPoint; NumPts: Integer; Winding: boolean): boolean; override;
|
function Polygon(DC: HDC; Points: PPoint; NumPts: Integer; Winding: boolean): boolean; override;
|
||||||
|
@ -4256,6 +4256,30 @@ begin
|
|||||||
Result := True;
|
Result := True;
|
||||||
end;
|
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;
|
function TQtWidgetSet.PeekMessage(var lpMsg : TMsg; Handle : HWND; wMsgFilterMin, wMsgFilterMax,wRemoveMsg : UINT): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
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 MessageBox(hWnd: HWND; lpText, lpCaption: PChar; uType: Cardinal): integer; override;
|
||||||
function MoveToEx(DC: HDC; X, Y: Integer; OldPoint: PPoint): Boolean; 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 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 PolyBezier(DC: HDC; Points: PPoint; NumPts: Integer; Filled, Continuous: boolean): boolean; override;
|
||||||
function Polygon(DC: HDC; Points: PPoint; NumPts: Integer; Winding: 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]));
|
Assert(False, Format('Trace:< [TWin32WidgetSet.MoveToEx] DC:0x%x, X:%d, Y:%d', [DC, X, Y]));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TWin32WidgetSet.OffsetRgn(RGN: HRGN; nXOffset, nYOffset: Integer): Integer;
|
||||||
|
begin
|
||||||
|
Result := Windows.OffsetRgn(RGN, nXOffset, nYOffset);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Method: PeekMessage
|
Method: PeekMessage
|
||||||
|
@ -160,6 +160,8 @@ function MonitorFromRect(lprcScreenCoords: PRect; dwFlags: DWord): HMONITOR; ove
|
|||||||
function MonitorFromWindow(hWnd: HWND; dwFlags: DWord): HMONITOR; override;
|
function MonitorFromWindow(hWnd: HWND; dwFlags: DWord): HMONITOR; override;
|
||||||
function MoveToEx(DC: HDC; X, Y: Integer; OldPoint: PPoint): Boolean; 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 PeekMessage(Var LPMsg: TMsg; Handle: HWND; WMsgFilterMin, WMsgFilterMax, WRemoveMsg: UINT): Boolean; override;
|
||||||
function Pie(DC: HDC; EllipseX1,EllipseY1,EllipseX2,EllipseY2,
|
function Pie(DC: HDC; EllipseX1,EllipseY1,EllipseX2,EllipseY2,
|
||||||
StartX,StartY,EndX,EndY: Integer): Boolean; override;
|
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]));
|
Assert(False, Format('Trace:< [TWinCEWidgetSet.MoveToEx] DC:0x%x, X:%d, Y:%d', [DC, X, Y]));
|
||||||
end;
|
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;
|
{function TWinCEWidgetSet.PolyBezier(DC: HDC; Points: PPoint; NumPts: Integer;
|
||||||
Filled, Continuous: boolean): boolean;
|
Filled, Continuous: boolean): boolean;
|
||||||
begin
|
begin
|
||||||
|
@ -171,6 +171,8 @@ function MonitorFromRect(lprcScreenCoords: PRect; dwFlags: DWord): HMONITOR; ove
|
|||||||
function MonitorFromWindow(hWnd: HWND; dwFlags: DWord): HMONITOR; override;
|
function MonitorFromWindow(hWnd: HWND; dwFlags: DWord): HMONITOR; override;
|
||||||
function MoveToEx(DC: HDC; X, Y: Integer; OldPoint: PPoint): Boolean; 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 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 PolyBezier(DC: HDC; Points: PPoint; NumPts: Integer; Filled, Continuous: boolean): boolean; override;
|
||||||
function Polygon(DC: HDC; Points: PPoint; NumPts: Integer; Winding: boolean): boolean; override;
|
function Polygon(DC: HDC; Points: PPoint; NumPts: Integer; Winding: boolean): boolean; override;
|
||||||
|
Loading…
Reference in New Issue
Block a user