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:
paul 2010-03-15 08:33:23 +00:00
parent f281b3a82e
commit 6bf6b20594
4 changed files with 26 additions and 25 deletions

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;