mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 03:09:32 +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;
|
TGDIColorFlags = set of TGDIColorFlag;
|
||||||
|
|
||||||
TGDIColor = record
|
TGDIColor = record
|
||||||
ColorRef : TColorRef; //Color passed - can be a SYSCOLOR or RGB
|
ColorRef: TColorRef; //Color passed - can be a SYSCOLOR or RGB
|
||||||
ColorFlags: TGDIColorFlags;
|
ColorFlags: TGDIColorFlags;
|
||||||
Color: TGDKColor; //Actual GDK Color(If any) for use with GC's
|
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;
|
end;
|
||||||
PGDIColor = ^TGDIColor;
|
PGDIColor = ^TGDIColor;
|
||||||
|
|
||||||
|
@ -5336,10 +5336,8 @@ end;
|
|||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Function: GetObject
|
Function: GetObject
|
||||||
Params: none
|
Params: GDIObj - handle, BufSize - size of Buf argument, Buf - buffer
|
||||||
Returns: Nothing
|
Returns: Size of buffer
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function TGtkWidgetSet.GetObject(GDIObj: HGDIOBJ; BufSize: Integer; Buf: Pointer): Integer;
|
function TGtkWidgetSet.GetObject(GDIObj: HGDIOBJ; BufSize: Integer; Buf: Pointer): Integer;
|
||||||
function GetObject_Bitmap: Integer;
|
function GetObject_Bitmap: Integer;
|
||||||
@ -5472,14 +5470,15 @@ function TGtkWidgetSet.GetObject(GDIObj: HGDIOBJ; BufSize: Integer; Buf: Pointer
|
|||||||
|
|
||||||
var
|
var
|
||||||
GDIObject: PGDIObject absolute GDIObj;
|
GDIObject: PGDIObject absolute GDIObj;
|
||||||
|
ALogPen: PLogPen absolute Buf;
|
||||||
begin
|
begin
|
||||||
Assert(False, 'trace:[TGtkWidgetSet.GetObject]');
|
Assert(False, 'trace:[TGtkWidgetSet.GetObject]');
|
||||||
Result := 0;
|
Result := 0;
|
||||||
if not IsValidGDIObject(GDIObj) then Exit;
|
if not IsValidGDIObject(GDIObj) then Exit;
|
||||||
|
|
||||||
case GDIObject^.GDIType of
|
case GDIObject^.GDIType of
|
||||||
gdiBitmap: Result := GetObject_Bitmap;
|
gdiBitmap:
|
||||||
|
Result := GetObject_Bitmap;
|
||||||
gdiBrush:
|
gdiBrush:
|
||||||
begin
|
begin
|
||||||
Assert(False, 'Trace:TODO: [TGtkWidgetSet.GetObject] gdiBrush');
|
Assert(False, 'Trace:TODO: [TGtkWidgetSet.GetObject] gdiBrush');
|
||||||
@ -5504,7 +5503,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
gdiPen:
|
gdiPen:
|
||||||
begin
|
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;
|
end;
|
||||||
gdiRegion:
|
gdiRegion:
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user