mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 19:35:58 +02:00
gtk, gtk2: implement GetObject for HPEN
git-svn-id: trunk@16805 -
This commit is contained in:
parent
063a3f6e16
commit
d31a48a9d4
@ -138,10 +138,10 @@ type
|
||||
TGDIColorFlags = set of TGDIColorFlag;
|
||||
|
||||
TGDIColor = record
|
||||
ColorRef : TColorRef; //Color passed - can be a SYSCOLOR or RGB
|
||||
ColorRef: TColorRef; //Color passed - can be a SYSCOLOR or RGB
|
||||
ColorFlags: TGDIColorFlags;
|
||||
Color: TGDKColor; //Actual GDK Color(If any) for use with GC's
|
||||
Colormap : PGDKColormap; //Colormap GDKColor was allocated with
|
||||
Colormap: PGDKColormap; //Colormap GDKColor was allocated with
|
||||
end;
|
||||
PGDIColor = ^TGDIColor;
|
||||
|
||||
|
@ -5336,10 +5336,8 @@ end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: GetObject
|
||||
Params: none
|
||||
Returns: Nothing
|
||||
|
||||
|
||||
Params: GDIObj - handle, BufSize - size of Buf argument, Buf - buffer
|
||||
Returns: Size of buffer
|
||||
------------------------------------------------------------------------------}
|
||||
function TGtkWidgetSet.GetObject(GDIObj: HGDIOBJ; BufSize: Integer; Buf: Pointer): Integer;
|
||||
function GetObject_Bitmap: Integer;
|
||||
@ -5472,14 +5470,15 @@ function TGtkWidgetSet.GetObject(GDIObj: HGDIOBJ; BufSize: Integer; Buf: Pointer
|
||||
|
||||
var
|
||||
GDIObject: PGDIObject absolute GDIObj;
|
||||
ALogPen: PLogPen absolute Buf;
|
||||
begin
|
||||
Assert(False, 'trace:[TGtkWidgetSet.GetObject]');
|
||||
Result := 0;
|
||||
if not IsValidGDIObject(GDIObj) then Exit;
|
||||
|
||||
case GDIObject^.GDIType of
|
||||
gdiBitmap: Result := GetObject_Bitmap;
|
||||
|
||||
gdiBitmap:
|
||||
Result := GetObject_Bitmap;
|
||||
gdiBrush:
|
||||
begin
|
||||
Assert(False, 'Trace:TODO: [TGtkWidgetSet.GetObject] gdiBrush');
|
||||
@ -5504,7 +5503,17 @@ begin
|
||||
end;
|
||||
gdiPen:
|
||||
begin
|
||||
Assert(False, 'Trace:TODO: [TGtkWidgetSet.GetObject] gdiPen');
|
||||
if Buf = nil then
|
||||
Result := SizeOf(TLogPen)
|
||||
else
|
||||
if BufSize >= SizeOf(TLogPen) then
|
||||
begin
|
||||
ALogPen^.lopnColor := GDIObject^.GDIPenColor.ColorRef;
|
||||
ALogPen^.lopnWidth := Point(GDIObject^.GDIPenWidth, 0);
|
||||
ALogPen^.lopnStyle := GDIObject^.GDIPenStyle;
|
||||
end
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
gdiRegion:
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user