diff options
author | Frederik Carlier <frederik.carlier@quamotion.mobi> | 2017-06-15 15:35:07 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2017-06-15 19:51:09 +0300 |
commit | c238778b63aa5673cb4177eb80d5288d1ff7fb9d (patch) | |
tree | 5d00414193ecaaa506ac92823c5782d3cc415f83 /mcs/class/System.Drawing | |
parent | 4a054b40ae67944cd94226966d943015470e5554 (diff) |
Use Drawing2D classes from CoreFX
Diffstat (limited to 'mcs/class/System.Drawing')
16 files changed, 100 insertions, 793 deletions
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/AdjustableArrowCap.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/AdjustableArrowCap.cs deleted file mode 100644 index 497b578e5b4..00000000000 --- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/AdjustableArrowCap.cs +++ /dev/null @@ -1,122 +0,0 @@ -// -// System.Drawing.Drawing2D.AdjustableArrowCap.cs -// -// Authors: -// Dennis Hayes (dennish@Raytek.com) -// Ravindra (rkumar@novell.com) -// -// Copyright (C) 2002/3 Ximian, Inc. http://www.ximian.com -// Copyright (C) 2004 Novell, Inc. http://www.novell.com -// - -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Drawing.Drawing2D -{ - /// <summary> - /// Summary description for AdjustableArrowCap. - /// </summary> - public sealed class AdjustableArrowCap : CustomLineCap - { - // Constructors - - internal AdjustableArrowCap (IntPtr ptr) : base (ptr) - { - } - - public AdjustableArrowCap (float width, float height) : this (width, height, true) - { - } - - public AdjustableArrowCap (float width, float height, bool isFilled) - { - Status status = GDIPlus.GdipCreateAdjustableArrowCap (height, width, isFilled, out nativeObject); - GDIPlus.CheckStatus (status); - } - - // Public Properities - - public bool Filled { - get { - bool isFilled; - Status status = GDIPlus.GdipGetAdjustableArrowCapFillState (nativeObject, out isFilled); - GDIPlus.CheckStatus (status); - - return isFilled; - } - - set { - Status status = GDIPlus.GdipSetAdjustableArrowCapFillState (nativeObject, value); - GDIPlus.CheckStatus (status); - } - } - - public float Width { - get { - float width; - Status status = GDIPlus.GdipGetAdjustableArrowCapWidth (nativeObject, out width); - GDIPlus.CheckStatus (status); - - return width; - } - - set { - Status status = GDIPlus.GdipSetAdjustableArrowCapWidth (nativeObject, value); - GDIPlus.CheckStatus (status); - } - } - - public float Height { - get { - float height; - Status status = GDIPlus.GdipGetAdjustableArrowCapHeight (nativeObject, out height); - GDIPlus.CheckStatus (status); - - return height; - } - - set { - Status status = GDIPlus.GdipSetAdjustableArrowCapHeight (nativeObject, value); - GDIPlus.CheckStatus (status); - } - } - - public float MiddleInset { - get { - float middleInset; - Status status = GDIPlus.GdipGetAdjustableArrowCapMiddleInset (nativeObject, out middleInset); - GDIPlus.CheckStatus (status); - - return middleInset; - } - - set { - Status status = GDIPlus.GdipSetAdjustableArrowCapMiddleInset (nativeObject, value); - GDIPlus.CheckStatus (status); - } - } - } -} diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/CustomLineCap.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/CustomLineCap.cs deleted file mode 100644 index 4f98318e65d..00000000000 --- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/CustomLineCap.cs +++ /dev/null @@ -1,176 +0,0 @@ -// -// System.Drawing.Drawing2D.CustomLineCap.cs -// -// Authors: -// Dennis Hayes (dennish@Raytek.com) -// Andreas Nahr (ClassDevelopment@A-SoftTech.com) -// Ravindra (rkumar@novell.com) -// -// Copyright (C) 2002/3 Ximian, Inc. http://www.ximian.com -// Copyright (C) 2004,2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Drawing.Drawing2D { - - public class CustomLineCap : MarshalByRefObject, ICloneable, IDisposable - { - private bool disposed; - internal IntPtr nativeObject; - - // Constructors - - internal CustomLineCap () - { - } - - internal CustomLineCap (IntPtr ptr) - { - nativeObject = ptr; - } - - public CustomLineCap (GraphicsPath fillPath, GraphicsPath strokePath) : this (fillPath, strokePath, LineCap.Flat, 0) - { - } - - public CustomLineCap (GraphicsPath fillPath, GraphicsPath strokePath, LineCap baseCap) : this (fillPath, strokePath, baseCap, 0) - { - } - - public CustomLineCap(GraphicsPath fillPath, GraphicsPath strokePath, LineCap baseCap, float baseInset) - { - IntPtr fill = IntPtr.Zero; - IntPtr stroke = IntPtr.Zero; - - if (fillPath != null) - fill = fillPath.nativePath; - if (strokePath != null) - stroke = strokePath.nativePath; - - Status status = GDIPlus.GdipCreateCustomLineCap (fill, stroke, baseCap, baseInset, out nativeObject); - GDIPlus.CheckStatus (status); - } - - public LineCap BaseCap { - get { - LineCap baseCap; - Status status = GDIPlus.GdipGetCustomLineCapBaseCap (nativeObject, out baseCap); - GDIPlus.CheckStatus (status); - - return baseCap; - } - - set { - Status status = GDIPlus.GdipSetCustomLineCapBaseCap (nativeObject, value); - GDIPlus.CheckStatus (status); - } - } - - public LineJoin StrokeJoin { - get { - LineJoin strokeJoin; - Status status = GDIPlus.GdipGetCustomLineCapStrokeJoin (nativeObject, out strokeJoin); - GDIPlus.CheckStatus (status); - - return strokeJoin; - } - - set { - Status status = GDIPlus.GdipSetCustomLineCapStrokeJoin (nativeObject, value); - GDIPlus.CheckStatus (status); - } - } - - public float BaseInset { - get { - float baseInset; - Status status = GDIPlus.GdipGetCustomLineCapBaseInset (nativeObject, out baseInset); - GDIPlus.CheckStatus (status); - - return baseInset; - } - - set { - Status status = GDIPlus.GdipSetCustomLineCapBaseInset (nativeObject, value); - GDIPlus.CheckStatus (status); - } - } - - public float WidthScale { - get { - float widthScale; - Status status = GDIPlus.GdipGetCustomLineCapWidthScale (nativeObject, out widthScale); - GDIPlus.CheckStatus (status); - - return widthScale; - } - - set { - Status status = GDIPlus.GdipSetCustomLineCapWidthScale (nativeObject, value); - GDIPlus.CheckStatus (status); - } - } - - // Public Methods - - public object Clone () - { - IntPtr clonePtr; - Status status = GDIPlus.GdipCloneCustomLineCap (nativeObject, out clonePtr); - GDIPlus.CheckStatus (status); - - return new CustomLineCap (clonePtr); - } - - public void Dispose () - { - Dispose (true); - System.GC.SuppressFinalize (this); - } - - protected virtual void Dispose (bool disposing) - { - if (! disposed) { - Status status = GDIPlus.GdipDeleteCustomLineCap (nativeObject); - GDIPlus.CheckStatus (status); - disposed = true; - nativeObject = IntPtr.Zero; - } - } - - ~CustomLineCap () - { - Dispose (false); - } - - public void GetStrokeCaps (out LineCap startCap, out LineCap endCap) - { - Status status = GDIPlus.GdipGetCustomLineCapStrokeCaps (nativeObject, out startCap, out endCap); - GDIPlus.CheckStatus (status); - } - - public void SetStrokeCaps(LineCap startCap, LineCap endCap) - { - Status status = GDIPlus.GdipSetCustomLineCapStrokeCaps (nativeObject, startCap, endCap); - GDIPlus.CheckStatus (status); - } - } -} diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/DashCap.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/DashCap.cs deleted file mode 100644 index 356b2b770c9..00000000000 --- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/DashCap.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Drawing.Drawing2D.DashCap.cs -// -// Author: -// Stefan Maierhofer <sm@cg.tuwien.ac.at> -// Dennis Hayes (dennish@Raytek.com) -// -// (C) 2002/3 Ximian, Inc -// Copyright (C) 2004,2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Drawing.Drawing2D { - - public enum DashCap { - Flat, - Round = 2, - Triangle = 3 - } -} diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.cs index dc747fdfb58..ee539c548f0 100644 --- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.cs +++ b/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.cs @@ -630,7 +630,7 @@ namespace System.Drawing.Drawing2D IntPtr sformat = (format == null) ? IntPtr.Zero : format.NativeObject; // note: the NullReferenceException on s.Length is the expected (MS) exception - Status status = GDIPlus.GdipAddPathStringI (nativePath, s, s.Length, family.NativeObject, style, emSize, ref layoutRect, sformat); + Status status = GDIPlus.GdipAddPathStringI (nativePath, s, s.Length, family.NativeFamily, style, emSize, ref layoutRect, sformat); GDIPlus.CheckStatus (status); } @@ -642,7 +642,7 @@ namespace System.Drawing.Drawing2D IntPtr sformat = (format == null) ? IntPtr.Zero : format.NativeObject; // note: the NullReferenceException on s.Length is the expected (MS) exception - Status status = GDIPlus.GdipAddPathString (nativePath, s, s.Length, family.NativeObject, style, emSize, ref layoutRect, sformat); + Status status = GDIPlus.GdipAddPathString (nativePath, s, s.Length, family.NativeFamily, style, emSize, ref layoutRect, sformat); GDIPlus.CheckStatus (status); } @@ -699,7 +699,7 @@ namespace System.Drawing.Drawing2D { RectangleF retval; IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix; - IntPtr p = (pen == null) ? IntPtr.Zero : pen.nativeObject; + IntPtr p = (pen == null) ? IntPtr.Zero : pen.NativePen; Status s = GDIPlus.GdipGetPathWorldBounds (nativePath, out retval, m, p); @@ -746,7 +746,7 @@ namespace System.Drawing.Drawing2D bool result; IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject; - Status s = GDIPlus.GdipIsOutlineVisiblePathPointI (nativePath, x, y, pen.nativeObject, g, out result); + Status s = GDIPlus.GdipIsOutlineVisiblePathPointI (nativePath, x, y, pen.NativePen, g, out result); GDIPlus.CheckStatus (s); return result; @@ -760,7 +760,7 @@ namespace System.Drawing.Drawing2D bool result; IntPtr g = (graphics == null) ? IntPtr.Zero : graphics.nativeObject; - Status s = GDIPlus.GdipIsOutlineVisiblePathPoint (nativePath, x, y, pen.nativeObject, g, out result); + Status s = GDIPlus.GdipIsOutlineVisiblePathPoint (nativePath, x, y, pen.NativePen, g, out result); GDIPlus.CheckStatus (s); return result; @@ -889,7 +889,7 @@ namespace System.Drawing.Drawing2D return; IntPtr m = (matrix == null) ? IntPtr.Zero : matrix.nativeMatrix; - Status s = GDIPlus.GdipWidenPath (nativePath, pen.nativeObject, m, flatness); + Status s = GDIPlus.GdipWidenPath (nativePath, pen.NativePen, m, flatness); GDIPlus.CheckStatus (s); } } diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPathIterator.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPathIterator.cs deleted file mode 100644 index 3de4e2127cf..00000000000 --- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPathIterator.cs +++ /dev/null @@ -1,208 +0,0 @@ -// -// System.Drawing.Drawing2D.GraphicsPathIterator.cs -// -// Author: -// Dennis Hayes (dennish@Raytek.com) -// Duncan Mak (duncan@ximian.com) -// Ravindra (rkumar@novell.com) -// -// Copyright (C) 2002/3 Ximian, Inc (http://www.ximian.com) -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.Drawing; - -namespace System.Drawing.Drawing2D -{ - public sealed class GraphicsPathIterator : MarshalByRefObject, IDisposable - { - private IntPtr nativeObject = IntPtr.Zero; - - // Constructors - internal GraphicsPathIterator (IntPtr native) - { - this.nativeObject = native; - } - - public GraphicsPathIterator (GraphicsPath path) - { - if (path != null) { - Status status = GDIPlus.GdipCreatePathIter (out nativeObject, path.NativeObject); - GDIPlus.CheckStatus (status); - } - } - - internal IntPtr NativeObject { - get { - return nativeObject; - } - set { - nativeObject = value; - } - } - - // Public Properites - - public int Count { - get { - if (nativeObject == IntPtr.Zero) - return 0; - - int count; - Status status = GDIPlus.GdipPathIterGetCount (nativeObject, out count); - GDIPlus.CheckStatus (status); - - return count; - } - } - - public int SubpathCount { - get { - int count; - Status status = GDIPlus.GdipPathIterGetSubpathCount (nativeObject, out count); - GDIPlus.CheckStatus (status); - - return count; - } - } - - internal void Dispose (bool disposing) - { - Status status; - if (nativeObject != IntPtr.Zero) { - status = GDIPlus.GdipDeletePathIter (nativeObject); - GDIPlus.CheckStatus (status); - - nativeObject = IntPtr.Zero; - } - } - - // Public Methods. - - public int CopyData (ref PointF [] points, ref byte [] types, int startIndex, int endIndex) - { - Status status; - int resultCount; - - // no null checks, MS throws a NullReferenceException here - if (points.Length != types.Length) - throw new ArgumentException ("Invalid arguments passed. Both arrays should have the same length."); - - status = GDIPlus.GdipPathIterCopyData (nativeObject, out resultCount, points, types, startIndex, endIndex); - GDIPlus.CheckStatus (status); - - return resultCount; - } - - public void Dispose () - { - Dispose (true); - System.GC.SuppressFinalize (this); - } - - ~GraphicsPathIterator () - { - Dispose (false); - } - - public int Enumerate (ref PointF [] points, ref byte [] types) - { - Status status; - int resultCount; - // no null checks, MS throws a NullReferenceException here - int count = points.Length; - if (count != types.Length) - throw new ArgumentException ("Invalid arguments passed. Both arrays should have the same length."); - - status = GDIPlus.GdipPathIterEnumerate (nativeObject, out resultCount, points, types, count); - GDIPlus.CheckStatus (status); - - return resultCount; - } - - public bool HasCurve () - { - bool curve; - Status status = GDIPlus.GdipPathIterHasCurve (nativeObject, out curve); - GDIPlus.CheckStatus (status); - - return curve; - } - - public int NextMarker (GraphicsPath path) - { - int resultCount; - IntPtr ptr = (path == null) ? IntPtr.Zero : path.NativeObject; - Status status = GDIPlus.GdipPathIterNextMarkerPath (nativeObject, out resultCount, ptr); - GDIPlus.CheckStatus (status); - - return resultCount; - } - - public int NextMarker (out int startIndex, out int endIndex) - { - Status status; - int resultCount; - status = GDIPlus.GdipPathIterNextMarker (nativeObject, out resultCount, out startIndex, out endIndex); - GDIPlus.CheckStatus (status); - - return resultCount; - } - - public int NextPathType (out byte pathType, out int startIndex, out int endIndex) - { - Status status; - int resultCount; - status = GDIPlus.GdipPathIterNextPathType (nativeObject, out resultCount, out pathType, out startIndex, out endIndex); - GDIPlus.CheckStatus (status); - - return resultCount; - } - - public int NextSubpath (GraphicsPath path, out bool isClosed) - { - int resultCount; - IntPtr ptr = (path == null) ? IntPtr.Zero : path.NativeObject; - Status status = GDIPlus.GdipPathIterNextSubpathPath (nativeObject, out resultCount, ptr, out isClosed); - GDIPlus.CheckStatus (status); - - return resultCount; - } - - public int NextSubpath (out int startIndex, out int endIndex, out bool isClosed) - { - Status status; - int resultCount; - status = GDIPlus.GdipPathIterNextSubpath (nativeObject, out resultCount, out startIndex, out endIndex, out isClosed); - GDIPlus.CheckStatus (status); - - return resultCount; - } - - public void Rewind () - { - Status status = GDIPlus.GdipPathIterRewind (nativeObject); - GDIPlus.CheckStatus (status); - } - } -} diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsState.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsState.cs deleted file mode 100644 index 266780b028d..00000000000 --- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsState.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -// System.Drawing.Drawing2D.GraphicsState.cs -// -// Author: -// Dennis Hayes (dennish@Raytek.com) -// -// (C) 2002/3 Ximian, Inc -// - -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; - -namespace System.Drawing.Drawing2D { - /// <summary> - /// Summary description for GraphicsState. - /// </summary> - public sealed class GraphicsState : MarshalByRefObject - { - // All members inherited - internal uint nativeState; - - // Constructor - internal GraphicsState() - { - // Nothing to be done here - } - - - } -} diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/PathGradientBrush.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/PathGradientBrush.cs index 98df40bc60d..addf2366b92 100644 --- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/PathGradientBrush.cs +++ b/mcs/class/System.Drawing/System.Drawing.Drawing2D/PathGradientBrush.cs @@ -47,7 +47,7 @@ namespace System.Drawing.Drawing2D { throw new ArgumentNullException ("path"); IntPtr nativeObject; - Status status = GDIPlus.GdipCreatePathGradientFromPath (path.NativeObject, out nativeObject); + Status status = GDIPlus.GdipCreatePathGradientFromPath (path.nativePath, out nativeObject); GDIPlus.CheckStatus (status); SetNativeBrush (nativeObject); } diff --git a/mcs/class/System.Drawing/System.Drawing.Text/FontCollection.cs b/mcs/class/System.Drawing/System.Drawing.Text/FontCollection.cs deleted file mode 100644 index 3b3b15df59f..00000000000 --- a/mcs/class/System.Drawing/System.Drawing.Text/FontCollection.cs +++ /dev/null @@ -1,92 +0,0 @@ -// -// System.Drawing.Text.FontCollection.cs -// -// (C) 2002 Ximian, Inc. http://www.ximian.com -// Author: Everaldo Canuto everaldo.canuto@bol.com.br -// Sanjay Gupta (gsanjay@novell.com) -// Peter Dennis Bartok (pbartok@novell.com) -// -// -// Copyright (C) 2004 - 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Drawing.Text { - - public abstract class FontCollection : IDisposable { - - internal IntPtr nativeFontCollection = IntPtr.Zero; - - internal FontCollection () - { - } - - // methods - public void Dispose() - { - Dispose (true); - GC.SuppressFinalize (true); - } - - protected virtual void Dispose (bool disposing) - { - // DO NOT FREE FROM HERE - // FIXME: InstalledFontCollection cannot be freed safely and will leak one time - // (inside libgdiplus). MS has a similar behaviour (but probably doesn't leak) - } - - // properties - public FontFamily[] Families - { - get { - int found; - int returned = 0; - Status status; - FontFamily[] families; - IntPtr[] result; - - // MS doesn't throw ObjectDisposedException in this case - if (nativeFontCollection == IntPtr.Zero) - throw new ArgumentException (Locale.GetText ("Collection was disposed.")); - - status = GDIPlus.GdipGetFontCollectionFamilyCount (nativeFontCollection, out found); - GDIPlus.CheckStatus (status); - if (found == 0) - return new FontFamily [0]; - - result = new IntPtr[found]; - status = GDIPlus.GdipGetFontCollectionFamilyList (nativeFontCollection, found, result, out returned); - - families = new FontFamily [returned]; - for ( int i = 0; i < returned ; i++) { - families[i] = new FontFamily(result[i]); - } - - return families; - } - } - - ~FontCollection() - { - Dispose (false); - } - } -} diff --git a/mcs/class/System.Drawing/System.Drawing.Text/InstalledFontCollection.cs b/mcs/class/System.Drawing/System.Drawing.Text/InstalledFontCollection.cs deleted file mode 100644 index 92f82f00f37..00000000000 --- a/mcs/class/System.Drawing/System.Drawing.Text/InstalledFontCollection.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// System.Drawing.Text.InstalledFontCollection.cs -// -// (C) 2002 Ximian, Inc. http://www.ximian.com -// Author: Everaldo Canuto everaldo.canuto@bol.com.br -// Alexandre Pigolkine ( pigolkine@gmx.de) -// Sanjay Gupta (gsanjay@novell.com) -// -// Copyright (C) 2004, 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Drawing.Text { - - public sealed class InstalledFontCollection : FontCollection { - - public InstalledFontCollection () - { - Status status = GDIPlus.GdipNewInstalledFontCollection (out nativeFontCollection); - GDIPlus.CheckStatus (status); - } - } -} diff --git a/mcs/class/System.Drawing/System.Drawing.dll.sources b/mcs/class/System.Drawing/System.Drawing.dll.sources index ae98c3a9370..df95cf769a7 100755 --- a/mcs/class/System.Drawing/System.Drawing.dll.sources +++ b/mcs/class/System.Drawing/System.Drawing.dll.sources @@ -96,7 +96,7 @@ System.Drawing/ToolboxBitmapAttribute.cs System.Drawing.Design/ToolboxItem.cs System.Drawing.Design/UITypeEditor.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Design/ToolboxItemCollection.cs -System.Drawing.Drawing2D/AdjustableArrowCap.cs +../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/AdjustableArrowCap.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/Blend.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/BrushType.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/ColorBlend.cs @@ -104,16 +104,16 @@ System.Drawing.Drawing2D/AdjustableArrowCap.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/CompositingMode.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/CompositingQuality.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/CoordinateSpace.cs -System.Drawing.Drawing2D/CustomLineCap.cs +../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/CustomLineCap.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/CustomLineCapType.cs -System.Drawing.Drawing2D/DashCap.cs +../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/DashCap.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/DashStyle.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/FillMode.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/FlushIntention.cs System.Drawing.Drawing2D/GraphicsContainer.cs System.Drawing.Drawing2D/GraphicsPath.cs -System.Drawing.Drawing2D/GraphicsPathIterator.cs -System.Drawing.Drawing2D/GraphicsState.cs +../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/GraphicsPathIterator.cs +../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/GraphicsState.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/HatchBrush.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/HatchStyle.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/InterpolationMode.cs @@ -132,6 +132,7 @@ System.Drawing.Drawing2D/PathGradientBrush.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/PixelOffsetMode.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/QualityMode.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/RegionData.cs +../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/SafeCustomLineCapHandle.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/SmoothingMode.cs ../../build/common/MonoTODOAttribute.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/WrapMode.cs @@ -206,10 +207,10 @@ System.Drawing.Printing/PrintRange.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/QueryPageSettingsEventArgs.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/QueryPageSettingsEventHandler.cs System.Drawing.Printing/StandardPrintController.cs -System.Drawing.Text/FontCollection.cs +../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Text/FontCollection.cs System.Drawing.Text/PrivateFontCollection.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Text/GenericFontFamilies.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Text/HotkeyPrefix.cs -System.Drawing.Text/InstalledFontCollection.cs +../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Text/InstalledFontCollection.cs ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Text/TextRenderingHint.cs diff --git a/mcs/class/System.Drawing/System.Drawing/Font.cs b/mcs/class/System.Drawing/System.Drawing/Font.cs index 31861d51238..29d1192204c 100644 --- a/mcs/class/System.Drawing/System.Drawing/Font.cs +++ b/mcs/class/System.Drawing/System.Drawing/Font.cs @@ -67,7 +67,7 @@ namespace System.Drawing } setProperties (family, emSize, style, unit, charSet, isVertical); - Status status = GDIPlus.GdipCreateFont (family.NativeObject, emSize, style, unit, out fontObject); + Status status = GDIPlus.GdipCreateFont (family.NativeFamily, emSize, style, unit, out fontObject); if (status == Status.FontStyleNotFound) throw new ArgumentException (Locale.GetText ("Style {0} isn't supported by font {1}.", style.ToString (), familyName)); @@ -114,6 +114,11 @@ namespace System.Drawing } } + internal void SetSystemFontName (string newSystemFontName) + { + systemFontName = newSystemFontName; + } + internal void unitConversion (GraphicsUnit fromUnit, GraphicsUnit toUnit, float nSrc, out float nTrg) { float inchs = 0; @@ -295,7 +300,7 @@ namespace System.Drawing // no null checks, MS throws a NullReferenceException if original is null setProperties (prototype.FontFamily, prototype.Size, newStyle, prototype.Unit, prototype.GdiCharSet, prototype.GdiVerticalFont); - Status status = GDIPlus.GdipCreateFont (_fontFamily.NativeObject, Size, Style, Unit, out fontObject); + Status status = GDIPlus.GdipCreateFont (_fontFamily.NativeFamily, Size, Style, Unit, out fontObject); GDIPlus.CheckStatus (status); } @@ -337,7 +342,7 @@ namespace System.Drawing Status status; setProperties (family, emSize, style, unit, gdiCharSet, gdiVerticalFont ); - status = GDIPlus.GdipCreateFont (family.NativeObject, emSize, style, unit, out fontObject); + status = GDIPlus.GdipCreateFont (family.NativeFamily, emSize, style, unit, out fontObject); GDIPlus.CheckStatus (status); } diff --git a/mcs/class/System.Drawing/System.Drawing/FontFamily.cs b/mcs/class/System.Drawing/System.Drawing/FontFamily.cs index fc56f466d91..04f8c087e02 100644 --- a/mcs/class/System.Drawing/System.Drawing/FontFamily.cs +++ b/mcs/class/System.Drawing/System.Drawing/FontFamily.cs @@ -75,6 +75,15 @@ namespace System.Drawing { } } + // For CoreFX compatibility + internal IntPtr NativeFamily + { + get + { + return nativeFontFamily; + } + } + public FontFamily (GenericFontFamilies genericFamily) { Status status; diff --git a/mcs/class/System.Drawing/System.Drawing/Graphics.cs b/mcs/class/System.Drawing/System.Drawing/Graphics.cs index 6dc07045480..fb29cca3b0e 100644 --- a/mcs/class/System.Drawing/System.Drawing/Graphics.cs +++ b/mcs/class/System.Drawing/System.Drawing/Graphics.cs @@ -91,6 +91,13 @@ namespace System.Drawing } } + // For CoreFX compatibility + internal IntPtr NativeGraphics { + get { + return nativeObject; + } + } + internal IntPtr NativeObject { get { return nativeObject; @@ -315,7 +322,7 @@ namespace System.Drawing if (pen == null) throw new ArgumentNullException ("pen"); - status = GDIPlus.GdipDrawArc (nativeObject, pen.nativeObject, + status = GDIPlus.GdipDrawArc (nativeObject, pen.NativePen, x, y, width, height, startAngle, sweepAngle); GDIPlus.CheckStatus (status); } @@ -328,7 +335,7 @@ namespace System.Drawing Status status; if (pen == null) throw new ArgumentNullException ("pen"); - status = GDIPlus.GdipDrawArcI (nativeObject, pen.nativeObject, + status = GDIPlus.GdipDrawArcI (nativeObject, pen.NativePen, x, y, width, height, startAngle, sweepAngle); GDIPlus.CheckStatus (status); } @@ -338,7 +345,7 @@ namespace System.Drawing Status status; if (pen == null) throw new ArgumentNullException ("pen"); - status = GDIPlus.GdipDrawBezier (nativeObject, pen.nativeObject, + status = GDIPlus.GdipDrawBezier (nativeObject, pen.NativePen, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y); GDIPlus.CheckStatus (status); @@ -349,7 +356,7 @@ namespace System.Drawing Status status; if (pen == null) throw new ArgumentNullException ("pen"); - status = GDIPlus.GdipDrawBezierI (nativeObject, pen.nativeObject, + status = GDIPlus.GdipDrawBezierI (nativeObject, pen.NativePen, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y); GDIPlus.CheckStatus (status); @@ -360,7 +367,7 @@ namespace System.Drawing Status status; if (pen == null) throw new ArgumentNullException ("pen"); - status = GDIPlus.GdipDrawBezier (nativeObject, pen.nativeObject, x1, + status = GDIPlus.GdipDrawBezier (nativeObject, pen.NativePen, x1, y1, x2, y2, x3, y3, x4, y4); GDIPlus.CheckStatus (status); } @@ -385,7 +392,7 @@ namespace System.Drawing Point p4 = points [i + 3]; status = GDIPlus.GdipDrawBezier (nativeObject, - pen.nativeObject, + pen.NativePen, p1.X, p1.Y, p2.X, p2.Y, p3.X, p3.Y, p4.X, p4.Y); GDIPlus.CheckStatus (status); @@ -412,7 +419,7 @@ namespace System.Drawing PointF p4 = points [i + 3]; status = GDIPlus.GdipDrawBezier (nativeObject, - pen.nativeObject, + pen.NativePen, p1.X, p1.Y, p2.X, p2.Y, p3.X, p3.Y, p4.X, p4.Y); GDIPlus.CheckStatus (status); @@ -428,7 +435,7 @@ namespace System.Drawing throw new ArgumentNullException ("points"); Status status; - status = GDIPlus.GdipDrawClosedCurve (nativeObject, pen.nativeObject, points, points.Length); + status = GDIPlus.GdipDrawClosedCurve (nativeObject, pen.NativePen, points, points.Length); GDIPlus.CheckStatus (status); } @@ -440,7 +447,7 @@ namespace System.Drawing throw new ArgumentNullException ("points"); Status status; - status = GDIPlus.GdipDrawClosedCurveI (nativeObject, pen.nativeObject, points, points.Length); + status = GDIPlus.GdipDrawClosedCurveI (nativeObject, pen.NativePen, points, points.Length); GDIPlus.CheckStatus (status); } @@ -454,7 +461,7 @@ namespace System.Drawing throw new ArgumentNullException ("points"); Status status; - status = GDIPlus.GdipDrawClosedCurve2I (nativeObject, pen.nativeObject, points, points.Length, tension); + status = GDIPlus.GdipDrawClosedCurve2I (nativeObject, pen.NativePen, points, points.Length, tension); GDIPlus.CheckStatus (status); } @@ -468,7 +475,7 @@ namespace System.Drawing throw new ArgumentNullException ("points"); Status status; - status = GDIPlus.GdipDrawClosedCurve2 (nativeObject, pen.nativeObject, points, points.Length, tension); + status = GDIPlus.GdipDrawClosedCurve2 (nativeObject, pen.NativePen, points, points.Length, tension); GDIPlus.CheckStatus (status); } @@ -480,7 +487,7 @@ namespace System.Drawing throw new ArgumentNullException ("points"); Status status; - status = GDIPlus.GdipDrawCurveI (nativeObject, pen.nativeObject, points, points.Length); + status = GDIPlus.GdipDrawCurveI (nativeObject, pen.NativePen, points, points.Length); GDIPlus.CheckStatus (status); } @@ -492,7 +499,7 @@ namespace System.Drawing throw new ArgumentNullException ("points"); Status status; - status = GDIPlus.GdipDrawCurve (nativeObject, pen.nativeObject, points, points.Length); + status = GDIPlus.GdipDrawCurve (nativeObject, pen.NativePen, points, points.Length); GDIPlus.CheckStatus (status); } @@ -504,7 +511,7 @@ namespace System.Drawing throw new ArgumentNullException ("points"); Status status; - status = GDIPlus.GdipDrawCurve2 (nativeObject, pen.nativeObject, points, points.Length, tension); + status = GDIPlus.GdipDrawCurve2 (nativeObject, pen.NativePen, points, points.Length, tension); GDIPlus.CheckStatus (status); } @@ -516,7 +523,7 @@ namespace System.Drawing throw new ArgumentNullException ("points"); Status status; - status = GDIPlus.GdipDrawCurve2I (nativeObject, pen.nativeObject, points, points.Length, tension); + status = GDIPlus.GdipDrawCurve2I (nativeObject, pen.NativePen, points, points.Length, tension); GDIPlus.CheckStatus (status); } @@ -528,7 +535,7 @@ namespace System.Drawing throw new ArgumentNullException ("points"); Status status; - status = GDIPlus.GdipDrawCurve3 (nativeObject, pen.nativeObject, + status = GDIPlus.GdipDrawCurve3 (nativeObject, pen.NativePen, points, points.Length, offset, numberOfSegments, 0.5f); GDIPlus.CheckStatus (status); @@ -542,7 +549,7 @@ namespace System.Drawing throw new ArgumentNullException ("points"); Status status; - status = GDIPlus.GdipDrawCurve3I (nativeObject, pen.nativeObject, + status = GDIPlus.GdipDrawCurve3I (nativeObject, pen.NativePen, points, points.Length, offset, numberOfSegments, tension); GDIPlus.CheckStatus (status); @@ -556,7 +563,7 @@ namespace System.Drawing throw new ArgumentNullException ("points"); Status status; - status = GDIPlus.GdipDrawCurve3 (nativeObject, pen.nativeObject, + status = GDIPlus.GdipDrawCurve3 (nativeObject, pen.NativePen, points, points.Length, offset, numberOfSegments, tension); GDIPlus.CheckStatus (status); @@ -582,7 +589,7 @@ namespace System.Drawing if (pen == null) throw new ArgumentNullException ("pen"); Status status; - status = GDIPlus.GdipDrawEllipseI (nativeObject, pen.nativeObject, x, y, width, height); + status = GDIPlus.GdipDrawEllipseI (nativeObject, pen.NativePen, x, y, width, height); GDIPlus.CheckStatus (status); } @@ -590,7 +597,7 @@ namespace System.Drawing { if (pen == null) throw new ArgumentNullException ("pen"); - Status status = GDIPlus.GdipDrawEllipse (nativeObject, pen.nativeObject, x, y, width, height); + Status status = GDIPlus.GdipDrawEllipse (nativeObject, pen.NativePen, x, y, width, height); GDIPlus.CheckStatus (status); } @@ -987,7 +994,7 @@ namespace System.Drawing { if (pen == null) throw new ArgumentNullException ("pen"); - Status status = GDIPlus.GdipDrawLine (nativeObject, pen.nativeObject, + Status status = GDIPlus.GdipDrawLine (nativeObject, pen.NativePen, pt1.X, pt1.Y, pt2.X, pt2.Y); GDIPlus.CheckStatus (status); } @@ -996,7 +1003,7 @@ namespace System.Drawing { if (pen == null) throw new ArgumentNullException ("pen"); - Status status = GDIPlus.GdipDrawLineI (nativeObject, pen.nativeObject, + Status status = GDIPlus.GdipDrawLineI (nativeObject, pen.NativePen, pt1.X, pt1.Y, pt2.X, pt2.Y); GDIPlus.CheckStatus (status); } @@ -1005,7 +1012,7 @@ namespace System.Drawing { if (pen == null) throw new ArgumentNullException ("pen"); - Status status = GDIPlus.GdipDrawLineI (nativeObject, pen.nativeObject, x1, y1, x2, y2); + Status status = GDIPlus.GdipDrawLineI (nativeObject, pen.NativePen, x1, y1, x2, y2); GDIPlus.CheckStatus (status); } @@ -1015,7 +1022,7 @@ namespace System.Drawing throw new ArgumentNullException ("pen"); if (!float.IsNaN(x1) && !float.IsNaN(y1) && !float.IsNaN(x2) && !float.IsNaN(y2)) { - Status status = GDIPlus.GdipDrawLine (nativeObject, pen.nativeObject, x1, y1, x2, y2); + Status status = GDIPlus.GdipDrawLine (nativeObject, pen.NativePen, x1, y1, x2, y2); GDIPlus.CheckStatus (status); } } @@ -1026,7 +1033,7 @@ namespace System.Drawing throw new ArgumentNullException ("pen"); if (points == null) throw new ArgumentNullException ("points"); - Status status = GDIPlus.GdipDrawLines (nativeObject, pen.nativeObject, points, points.Length); + Status status = GDIPlus.GdipDrawLines (nativeObject, pen.NativePen, points, points.Length); GDIPlus.CheckStatus (status); } @@ -1036,7 +1043,7 @@ namespace System.Drawing throw new ArgumentNullException ("pen"); if (points == null) throw new ArgumentNullException ("points"); - Status status = GDIPlus.GdipDrawLinesI (nativeObject, pen.nativeObject, points, points.Length); + Status status = GDIPlus.GdipDrawLinesI (nativeObject, pen.NativePen, points, points.Length); GDIPlus.CheckStatus (status); } @@ -1046,7 +1053,7 @@ namespace System.Drawing throw new ArgumentNullException ("pen"); if (path == null) throw new ArgumentNullException ("path"); - Status status = GDIPlus.GdipDrawPath (nativeObject, pen.nativeObject, path.nativePath); + Status status = GDIPlus.GdipDrawPath (nativeObject, pen.NativePen, path.nativePath); GDIPlus.CheckStatus (status); } @@ -1068,7 +1075,7 @@ namespace System.Drawing { if (pen == null) throw new ArgumentNullException ("pen"); - Status status = GDIPlus.GdipDrawPie (nativeObject, pen.nativeObject, x, y, width, height, startAngle, sweepAngle); + Status status = GDIPlus.GdipDrawPie (nativeObject, pen.NativePen, x, y, width, height, startAngle, sweepAngle); GDIPlus.CheckStatus (status); } @@ -1079,7 +1086,7 @@ namespace System.Drawing { if (pen == null) throw new ArgumentNullException ("pen"); - Status status = GDIPlus.GdipDrawPieI (nativeObject, pen.nativeObject, x, y, width, height, startAngle, sweepAngle); + Status status = GDIPlus.GdipDrawPieI (nativeObject, pen.NativePen, x, y, width, height, startAngle, sweepAngle); GDIPlus.CheckStatus (status); } @@ -1089,7 +1096,7 @@ namespace System.Drawing throw new ArgumentNullException ("pen"); if (points == null) throw new ArgumentNullException ("points"); - Status status = GDIPlus.GdipDrawPolygonI (nativeObject, pen.nativeObject, points, points.Length); + Status status = GDIPlus.GdipDrawPolygonI (nativeObject, pen.NativePen, points, points.Length); GDIPlus.CheckStatus (status); } @@ -1099,7 +1106,7 @@ namespace System.Drawing throw new ArgumentNullException ("pen"); if (points == null) throw new ArgumentNullException ("points"); - Status status = GDIPlus.GdipDrawPolygon (nativeObject, pen.nativeObject, points, points.Length); + Status status = GDIPlus.GdipDrawPolygon (nativeObject, pen.NativePen, points, points.Length); GDIPlus.CheckStatus (status); } @@ -1114,7 +1121,7 @@ namespace System.Drawing { if (pen == null) throw new ArgumentNullException ("pen"); - Status status = GDIPlus.GdipDrawRectangle (nativeObject, pen.nativeObject, x, y, width, height); + Status status = GDIPlus.GdipDrawRectangle (nativeObject, pen.NativePen, x, y, width, height); GDIPlus.CheckStatus (status); } @@ -1122,7 +1129,7 @@ namespace System.Drawing { if (pen == null) throw new ArgumentNullException ("pen"); - Status status = GDIPlus.GdipDrawRectangleI (nativeObject, pen.nativeObject, x, y, width, height); + Status status = GDIPlus.GdipDrawRectangleI (nativeObject, pen.NativePen, x, y, width, height); GDIPlus.CheckStatus (status); } @@ -1132,7 +1139,7 @@ namespace System.Drawing throw new ArgumentNullException ("image"); if (rects == null) throw new ArgumentNullException ("rects"); - Status status = GDIPlus.GdipDrawRectangles (nativeObject, pen.nativeObject, rects, rects.Length); + Status status = GDIPlus.GdipDrawRectangles (nativeObject, pen.NativePen, rects, rects.Length); GDIPlus.CheckStatus (status); } @@ -1142,7 +1149,7 @@ namespace System.Drawing throw new ArgumentNullException ("image"); if (rects == null) throw new ArgumentNullException ("rects"); - Status status = GDIPlus.GdipDrawRectanglesI (nativeObject, pen.nativeObject, rects, rects.Length); + Status status = GDIPlus.GdipDrawRectanglesI (nativeObject, pen.NativePen, rects, rects.Length); GDIPlus.CheckStatus (status); } @@ -1520,7 +1527,7 @@ namespace System.Drawing throw new ArgumentNullException ("brush"); if (path == null) throw new ArgumentNullException ("path"); - Status status = GDIPlus.GdipFillPath (nativeObject, brush.NativeBrush, path.NativeObject); + Status status = GDIPlus.GdipFillPath (nativeObject, brush.NativeBrush, path.nativePath); GDIPlus.CheckStatus (status); } @@ -2049,7 +2056,7 @@ namespace System.Drawing public void Restore (GraphicsState gstate) { // the possible NRE thrown by gstate.nativeState match MS behaviour - Status status = GDIPlus.GdipRestoreGraphics (nativeObject, gstate.nativeState); + Status status = GDIPlus.GdipRestoreGraphics (nativeObject, (uint)gstate.nativeState); GDIPlus.CheckStatus (status); } @@ -2070,8 +2077,7 @@ namespace System.Drawing Status status = GDIPlus.GdipSaveGraphics (nativeObject, out saveState); GDIPlus.CheckStatus (status); - GraphicsState state = new GraphicsState (); - state.nativeState = saveState; + GraphicsState state = new GraphicsState ((int)saveState); return state; } @@ -2148,7 +2154,7 @@ namespace System.Drawing { if (path == null) throw new ArgumentNullException ("path"); - Status status = GDIPlus.GdipSetClipPath (nativeObject, path.NativeObject, combineMode); + Status status = GDIPlus.GdipSetClipPath (nativeObject, path.nativePath, combineMode); GDIPlus.CheckStatus (status); } diff --git a/mcs/class/System.Drawing/System.Drawing/Pen.cs b/mcs/class/System.Drawing/System.Drawing/Pen.cs index a6dee933aed..d5e0eb8fc5b 100644 --- a/mcs/class/System.Drawing/System.Drawing/Pen.cs +++ b/mcs/class/System.Drawing/System.Drawing/Pen.cs @@ -175,7 +175,7 @@ namespace System.Drawing set { if (isModifiable) { - Status status = GDIPlus.GdipSetPenCustomEndCap (nativeObject, value.nativeObject); + Status status = GDIPlus.GdipSetPenCustomEndCap (nativeObject, value.nativeCap); GDIPlus.CheckStatus (status); endCap = value; } else @@ -190,7 +190,7 @@ namespace System.Drawing set { if (isModifiable) { - Status status = GDIPlus.GdipSetPenCustomStartCap (nativeObject, value.nativeObject); + Status status = GDIPlus.GdipSetPenCustomStartCap (nativeObject, value.nativeCap); GDIPlus.CheckStatus (status); startCap = value; } else @@ -425,6 +425,12 @@ namespace System.Drawing } } + internal IntPtr NativePen { + get { + return nativeObject; + } + } + public object Clone () { IntPtr ptr; diff --git a/mcs/class/System.Drawing/System.Drawing/Region.cs b/mcs/class/System.Drawing/System.Drawing/Region.cs index 9c9a48ef38b..ba84501da38 100644 --- a/mcs/class/System.Drawing/System.Drawing/Region.cs +++ b/mcs/class/System.Drawing/System.Drawing/Region.cs @@ -52,7 +52,7 @@ namespace System.Drawing { if (path == null) throw new ArgumentNullException ("path"); - Status status = GDIPlus.GdipCreateRegionPath (path.NativeObject, out nativeRegion); + Status status = GDIPlus.GdipCreateRegionPath (path.nativePath, out nativeRegion); GDIPlus.CheckStatus (status); } @@ -87,7 +87,7 @@ namespace System.Drawing { if (path == null) throw new ArgumentNullException ("path"); - Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.NativeObject, CombineMode.Union); + Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.nativePath, CombineMode.Union); GDIPlus.CheckStatus (status); } @@ -120,7 +120,7 @@ namespace System.Drawing { if (path == null) throw new ArgumentNullException ("path"); - Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.NativeObject, CombineMode.Intersect); + Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.nativePath, CombineMode.Intersect); GDIPlus.CheckStatus (status); } @@ -151,7 +151,7 @@ namespace System.Drawing { if (path == null) throw new ArgumentNullException ("path"); - Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.NativeObject, CombineMode.Complement); + Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.nativePath, CombineMode.Complement); GDIPlus.CheckStatus (status); } @@ -182,7 +182,7 @@ namespace System.Drawing { if (path == null) throw new ArgumentNullException ("path"); - Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.NativeObject, CombineMode.Exclude); + Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.nativePath, CombineMode.Exclude); GDIPlus.CheckStatus (status); } @@ -213,7 +213,7 @@ namespace System.Drawing { if (path == null) throw new ArgumentNullException ("path"); - Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.NativeObject, CombineMode.Xor); + Status status = GDIPlus.GdipCombineRegionPath (nativeRegion, path.nativePath, CombineMode.Xor); GDIPlus.CheckStatus (status); } diff --git a/mcs/class/System.Drawing/System.Drawing/StringFormat.cs b/mcs/class/System.Drawing/System.Drawing/StringFormat.cs index 7e9a218f990..9a130c67523 100644 --- a/mcs/class/System.Drawing/System.Drawing/StringFormat.cs +++ b/mcs/class/System.Drawing/System.Drawing/StringFormat.cs @@ -261,6 +261,14 @@ namespace System.Drawing { } } + // For CoreFX compat + internal IntPtr nativeFormat + { + get{ + return nativeStrFmt; + } + } + public void SetTabStops(float firstTabOffset, float[] tabStops) { Status status = GDIPlus.GdipSetStringFormatTabStops(nativeStrFmt, firstTabOffset, tabStops.Length, tabStops); |