diff --git a/lcl/interfaces/gtk2/gtk2winapi.inc b/lcl/interfaces/gtk2/gtk2winapi.inc index 8db2fed629..e755c4219d 100644 --- a/lcl/interfaces/gtk2/gtk2winapi.inc +++ b/lcl/interfaces/gtk2/gtk2winapi.inc @@ -1745,8 +1745,6 @@ end; Function: CreateRectRgn Params: none Returns: Nothing - - ------------------------------------------------------------------------------} function TGtk2WidgetSet.CreateRectRgn(X1,Y1,X2,Y2 : Integer): HRGN; var @@ -1780,72 +1778,6 @@ begin //DebugLn('TGtk2WidgetSet.CreateRectRgn A ',GDKRegionAsString(RegionObj)); end; -{ - Gdk has no native function for this, so we need to improvise by aproximating - the RoundRect to a Polygon: - - ______<--- Top bar - / \ - | |<--- Right bar - \______/<--- Bottom-Right Corner - -} -function TGtk2WidgetSet.CreateRoundRectRgn(X1, Y1, X2, Y2, nWidthEllipse, nHeightEllipse: Integer): HRGN; -var - points: array[0..15] of TGdkPoint; - n_points: Integer = 16; - GObject: PGdiObject; - RegionObj: PGdkRegion; -begin - // Top bar - points[0].x := X1 + nWidthEllipse; - points[0].y := Y1; - points[1].x := X2 - nWidthEllipse; - points[1].y := Y1; - // Right-Top Rounding - points[2].x := X2 - nWidthEllipse div 2; - points[2].y := Y1 + nHeightEllipse div 5; - points[3].x := X2 - nWidthEllipse div 5; - points[3].y := Y1 + nHeightEllipse div 2; - // Right bar - points[4].x := X2; - points[4].y := Y1 + nHeightEllipse; - points[5].x := X2; - points[5].y := Y2 - nHeightEllipse; - // Right-Bottom Rounding - points[6].x := X2 - nWidthEllipse div 5; - points[6].y := Y2 - nHeightEllipse div 2; - points[7].x := X1 - nWidthEllipse div 2; - points[7].y := Y2 - nHeightEllipse div 5; - // Bottom bar - points[8].x := X2 - nWidthEllipse; - points[8].y := Y2; - points[9].x := X1 + nWidthEllipse; - points[9].y := Y2; - // Bottom-Left Rounding - points[10].x := X1 + nWidthEllipse div 2; - points[10].y := Y2 - nHeightEllipse div 5; - points[11].x := X1 + nWidthEllipse div 5; - points[11].y := Y2 - nHeightEllipse div 2; - // Left bar - points[12].x := X1; - points[12].y := Y2 - nHeightEllipse; - points[13].x := X1; - points[13].y := Y1 + nHeightEllipse; - // Left-Top Rounding - points[14].x := X1 + nWidthEllipse div 5; - points[14].y := Y1 + nHeightEllipse div 2; - points[15].x := X1 + nWidthEllipse div 2; - points[15].y := Y1 + nHeightEllipse div 5; - - GObject := NewGDIObject(gdiRegion); - RegionObj := gdk2.gdk_region_polygon(@points[0], n_points, GDK_WINDING_RULE); - GObject^.GDIRegionObject := RegionObj; - - Result := HRGN({%H-}PtrUInt(GObject)); - //DebugLn('TGtk2WidgetSet.CreateRectRgn A ',GDKRegionAsString(RegionObj)); -end; - {------------------------------------------------------------------------------ Function: CombineRgn Params: Dest, Src1, Src2, fnCombineMode @@ -1874,7 +1806,6 @@ end; NullRegion SimpleRegion ComplexRegion - ------------------------------------------------------------------------------} function TGtk2WidgetSet.CombineRgn(Dest, Src1, Src2: HRGN; fnCombineMode: Longint): Longint; @@ -1926,8 +1857,6 @@ end; Function: DeleteDC Params: none Returns: Nothing - - ------------------------------------------------------------------------------} function TGtk2WidgetSet.DeleteDC(hDC: HDC): Boolean; begin diff --git a/lcl/interfaces/gtk2/gtk2winapih.inc b/lcl/interfaces/gtk2/gtk2winapih.inc index 9c8e27bf1b..92c9c60167 100644 --- a/lcl/interfaces/gtk2/gtk2winapih.inc +++ b/lcl/interfaces/gtk2/gtk2winapih.inc @@ -69,7 +69,6 @@ function CreatePalette(const LogPalette: TLogPalette): HPALETTE; override; function CreatePenIndirect(const LogPen: TLogPen): HPEN; override; function CreatePolygonRgn(Points: PPoint; NumPts: Integer; FillMode: integer): HRGN; override; function CreateRectRgn(X1,Y1,X2,Y2 : Integer): HRGN; override; -function CreateRoundRectRgn(X1, Y1, X2, Y2, nWidthEllipse, nHeightEllipse: Integer): HRGN; override; procedure DeleteCriticalSection(var CritSection: TCriticalSection); override; function DeleteDC(hDC: HDC): Boolean; override;