mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-31 01:47:43 +02:00
gtk, gtk2: move SetWindowRgn to gtk2 code since gtk1 does not have appopriate functions. fixes gtk1 compilation
git-svn-id: trunk@24008 -
This commit is contained in:
parent
f281b3a82e
commit
6bf6b20594
@ -9619,30 +9619,6 @@ begin
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function SetWindowRgn
|
||||
Params: hWnd: HWND; hRgn: HRGN; bRedraw: Boolean
|
||||
Returns: 0 - fails, in other case success
|
||||
------------------------------------------------------------------------------}
|
||||
function TGtkWidgetSet.SetWindowRgn(hWnd: HWND; hRgn: HRGN; bRedraw: Boolean): longint;
|
||||
var
|
||||
Widget: PGtkWidget;
|
||||
Window: PGdkWindow;
|
||||
begin
|
||||
Widget := GetFixedWidget(PGtkWidget(hWnd));
|
||||
if Widget = nil then
|
||||
Widget := PGtkWidget(hWnd);
|
||||
if Widget = nil then
|
||||
Exit(0);
|
||||
Window := GetControlWindow(Widget);
|
||||
if Window = nil then
|
||||
Exit(0);
|
||||
gdk_window_shape_combine_region(Window, PGDIObject(hRgn)^.GDIRegionObject, 0, 0);
|
||||
if bRedraw then
|
||||
gdk_window_invalidate_region(Window, PGDIObject(hRgn)^.GDIRegionObject, True);
|
||||
Result := 1;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: ShowCaret
|
||||
Params: none
|
||||
|
@ -205,7 +205,6 @@ function SetWindowLong(Handle: HWND; Idx: Integer; NewLong: PtrInt): PtrInt; ove
|
||||
function SetWindowOrgEx(dc : hdc; NewX, NewY : Integer; OldPoint: PPoint) : Boolean; override;
|
||||
function SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND;
|
||||
X, Y, cx, cy: Integer; uFlags: UINT): Boolean; override;
|
||||
function SetWindowRgn(hWnd: HWND; hRgn: HRGN; bRedraw: Boolean): longint; override;
|
||||
function ShowCaret(hWnd: HWND): Boolean; override;
|
||||
function ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; override;
|
||||
function ShowWindow(hWnd: HWND; nCmdShow: Integer): Boolean; override;
|
||||
|
@ -679,6 +679,31 @@ begin
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function SetWindowRgn
|
||||
Params: hWnd: HWND; hRgn: HRGN; bRedraw: Boolean
|
||||
Returns: 0 - fails, in other case success
|
||||
------------------------------------------------------------------------------}
|
||||
function TGtk2WidgetSet.SetWindowRgn(hWnd: HWND; hRgn: HRGN; bRedraw: Boolean): longint;
|
||||
var
|
||||
Widget: PGtkWidget;
|
||||
Window: PGdkWindow;
|
||||
begin
|
||||
Widget := GetFixedWidget(PGtkWidget(hWnd));
|
||||
if Widget = nil then
|
||||
Widget := PGtkWidget(hWnd);
|
||||
if Widget = nil then
|
||||
Exit(0);
|
||||
Window := GetControlWindow(Widget);
|
||||
if Window = nil then
|
||||
Exit(0);
|
||||
gdk_window_shape_combine_region(Window, PGDIObject(hRgn)^.GDIRegionObject, 0, 0);
|
||||
if bRedraw then
|
||||
gdk_window_invalidate_region(Window, PGDIObject(hRgn)^.GDIRegionObject, True);
|
||||
Result := 1;
|
||||
end;
|
||||
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
function ShowWindow(hWnd: HWND; nCmdShow: Integer): Boolean;
|
||||
|
||||
|
@ -49,6 +49,7 @@ function GetTextExtentPoint(DC: HDC; Str: PChar; Count: Integer; var Size: TSize
|
||||
|
||||
function ScrollWindowEx(hWnd: HWND; dx, dy: Integer; prcScroll, prcClip: PRect; hrgnUpdate: HRGN; prcUpdate: PRect; flags: UINT): Boolean; override;
|
||||
function SetCursorPos(X, Y: Integer): Boolean; override;
|
||||
function SetWindowRgn(hWnd: HWND; hRgn: HRGN; bRedraw: Boolean): longint; override;
|
||||
function ShowWindow(hWnd: HWND; nCmdShow: Integer): Boolean; override;
|
||||
|
||||
function TextOut(DC: HDC; X,Y : Integer; Str : Pchar; Count: Integer) : Boolean; override;
|
||||
|
Loading…
Reference in New Issue
Block a user