diff --git a/lcl/interfaces/gtk/gtkdef.pp b/lcl/interfaces/gtk/gtkdef.pp index a258a0f61e..5f9f0d788f 100644 --- a/lcl/interfaces/gtk/gtkdef.pp +++ b/lcl/interfaces/gtk/gtkdef.pp @@ -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; diff --git a/lcl/interfaces/gtk/gtkwinapi.inc b/lcl/interfaces/gtk/gtkwinapi.inc index 00a3cbf561..e9056a236c 100644 --- a/lcl/interfaces/gtk/gtkwinapi.inc +++ b/lcl/interfaces/gtk/gtkwinapi.inc @@ -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