You've already forked linux-packaging-mono
Imported Upstream version 4.0.0~alpha1
Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
@ -52,12 +52,10 @@ namespace System.Drawing
|
||||
#region constructors
|
||||
// constructors
|
||||
|
||||
#if NET_2_0
|
||||
// required for XmlSerializer (#323246)
|
||||
private Bitmap ()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
internal Bitmap (IntPtr ptr)
|
||||
{
|
||||
@ -189,11 +187,7 @@ namespace System.Drawing
|
||||
// unmanaged call for normal (successful) calls
|
||||
if ((this.PixelFormat & PixelFormat.Indexed) != 0) {
|
||||
string msg = Locale.GetText ("SetPixel cannot be called on indexed bitmaps.");
|
||||
#if NET_2_0
|
||||
throw new InvalidOperationException (msg);
|
||||
#else
|
||||
throw new Exception (msg);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
GDIPlus.CheckStatus (s);
|
||||
@ -270,9 +264,7 @@ namespace System.Drawing
|
||||
return LockBits (rect, flags, format, result);
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
public
|
||||
#endif
|
||||
BitmapData LockBits (Rectangle rect, ImageLockMode flags, PixelFormat format, BitmapData bitmapData)
|
||||
{
|
||||
Status status = GDIPlus.GdipBitmapLockBits (nativeObject, ref rect, flags, format, bitmapData);
|
||||
|
@ -50,7 +50,6 @@ namespace System.Drawing {
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
protected Brush ()
|
||||
{
|
||||
}
|
||||
@ -59,11 +58,6 @@ namespace System.Drawing {
|
||||
{
|
||||
nativeObject = brush;
|
||||
}
|
||||
#else
|
||||
internal Brush ()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
|
@ -26,7 +26,6 @@
|
||||
//
|
||||
//
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.InteropServices;
|
||||
@ -115,4 +114,3 @@ namespace System.Drawing
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -26,7 +26,6 @@
|
||||
//
|
||||
//
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.InteropServices;
|
||||
@ -84,4 +83,3 @@ namespace System.Drawing
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -26,7 +26,6 @@
|
||||
//
|
||||
//
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
namespace System.Drawing
|
||||
{
|
||||
@ -49,4 +48,3 @@ namespace System.Drawing
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -60,7 +60,6 @@ namespace System.Drawing
|
||||
length = value;
|
||||
}
|
||||
}
|
||||
#if NET_2_0
|
||||
public override bool Equals (object obj)
|
||||
{
|
||||
if (!(obj is CharacterRange))
|
||||
@ -84,6 +83,5 @@ namespace System.Drawing
|
||||
{
|
||||
return ((cr1.first != cr2.first) || (cr1.length != cr2.length));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -39,9 +39,6 @@ using System.Runtime.InteropServices;
|
||||
namespace System.Drawing
|
||||
{
|
||||
[TypeConverter(typeof(ColorConverter))]
|
||||
#if ONLY_1_1
|
||||
[ComVisible (true)]
|
||||
#endif
|
||||
[Editor ("System.Drawing.Design.ColorEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))]
|
||||
[Serializable]
|
||||
public struct Color {
|
||||
|
@ -32,12 +32,8 @@ using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
#if NET_2_0
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
using STATSTG = System.Runtime.InteropServices.ComTypes.STATSTG;
|
||||
#else
|
||||
using IStream = System.Runtime.InteropServices.UCOMIStream;
|
||||
#endif
|
||||
|
||||
namespace System.Drawing
|
||||
{
|
||||
|
@ -30,9 +30,6 @@ using System.ComponentModel;
|
||||
|
||||
namespace System.Drawing {
|
||||
|
||||
#if ONLY_1_1
|
||||
[Serializable]
|
||||
#endif
|
||||
[Editor ("System.Drawing.Design.ContentAlignmentEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))]
|
||||
public enum ContentAlignment {
|
||||
TopLeft = 0x001,
|
||||
|
@ -26,7 +26,6 @@
|
||||
//
|
||||
//
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
@ -55,5 +54,4 @@ namespace System.Drawing
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -45,10 +45,8 @@ namespace System.Drawing
|
||||
public sealed class Font : MarshalByRefObject, ISerializable, ICloneable, IDisposable
|
||||
{
|
||||
private IntPtr fontObject = IntPtr.Zero;
|
||||
#if NET_2_0
|
||||
private string systemFontName;
|
||||
private string originalFontName;
|
||||
#endif
|
||||
private float _size;
|
||||
private object olf;
|
||||
|
||||
@ -57,13 +55,7 @@ namespace System.Drawing
|
||||
|
||||
private void CreateFont (string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte charSet, bool isVertical)
|
||||
{
|
||||
#if ONLY_1_1
|
||||
if (familyName == null)
|
||||
throw new ArgumentNullException ("familyName");
|
||||
#endif
|
||||
#if NET_2_0
|
||||
originalFontName = familyName;
|
||||
#endif
|
||||
FontFamily family;
|
||||
// NOTE: If family name is null, empty or invalid,
|
||||
// MS creates Microsoft Sans Serif font.
|
||||
@ -374,13 +366,11 @@ namespace System.Drawing
|
||||
{
|
||||
CreateFont (familyName, emSize, style, unit, gdiCharSet, gdiVerticalFont );
|
||||
}
|
||||
#if NET_2_0
|
||||
internal Font (string familyName, float emSize, string systemName)
|
||||
: this (familyName, emSize, FontStyle.Regular, GraphicsUnit.Point, DefaultCharSet, false)
|
||||
{
|
||||
systemFontName = systemName;
|
||||
}
|
||||
#endif
|
||||
public object Clone ()
|
||||
{
|
||||
return new Font (this, Style);
|
||||
@ -435,7 +425,6 @@ namespace System.Drawing
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
[Browsable(false)]
|
||||
public bool IsSystemFont {
|
||||
get {
|
||||
@ -445,7 +434,6 @@ namespace System.Drawing
|
||||
return StringComparer.InvariantCulture.Compare (systemFontName, string.Empty) != 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
private bool _italic;
|
||||
|
||||
@ -500,7 +488,6 @@ namespace System.Drawing
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
[Browsable(false)]
|
||||
public string SystemFontName {
|
||||
get {
|
||||
@ -514,7 +501,6 @@ namespace System.Drawing
|
||||
return originalFontName;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
private bool _underline;
|
||||
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
@ -637,11 +623,7 @@ namespace System.Drawing
|
||||
throw new ArgumentNullException ("graphics");
|
||||
|
||||
if (logFont == null) {
|
||||
#if NET_2_0
|
||||
throw new AccessViolationException ("logFont");
|
||||
#else
|
||||
throw new NullReferenceException ("logFont");
|
||||
#endif
|
||||
}
|
||||
|
||||
Type st = logFont.GetType ();
|
||||
|
@ -319,9 +319,7 @@ namespace System.Drawing
|
||||
}
|
||||
|
||||
public sealed class FontNameConverter : TypeConverter
|
||||
#if NET_2_0
|
||||
, IDisposable
|
||||
#endif
|
||||
{
|
||||
FontFamily [] fonts;
|
||||
|
||||
@ -329,11 +327,9 @@ namespace System.Drawing
|
||||
{
|
||||
fonts = FontFamily.Families;
|
||||
}
|
||||
#if NET_2_0
|
||||
void IDisposable.Dispose ()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
|
||||
{
|
||||
if (sourceType == typeof (string))
|
||||
|
@ -28,9 +28,6 @@
|
||||
|
||||
namespace System.Drawing {
|
||||
|
||||
#if ONLY_1_1
|
||||
[Serializable]
|
||||
#endif
|
||||
[Flags]
|
||||
public enum FontStyle {
|
||||
Regular = 0,
|
||||
|
@ -40,13 +40,8 @@ using System.Text;
|
||||
|
||||
namespace System.Drawing
|
||||
{
|
||||
#if !NET_2_0
|
||||
[ComVisible(false)]
|
||||
#endif
|
||||
public sealed class Graphics : MarshalByRefObject, IDisposable
|
||||
#if NET_2_0
|
||||
, IDeviceContext
|
||||
#endif
|
||||
{
|
||||
internal IntPtr nativeObject = IntPtr.Zero;
|
||||
internal IMacContext maccontext;
|
||||
@ -55,18 +50,12 @@ namespace System.Drawing
|
||||
private static float defDpiY = 0;
|
||||
private IntPtr deviceContextHdc;
|
||||
|
||||
#if !NET_2_0
|
||||
[ComVisible(false)]
|
||||
#endif
|
||||
public delegate bool EnumerateMetafileProc (EmfPlusRecordType recordType,
|
||||
int flags,
|
||||
int dataSize,
|
||||
IntPtr data,
|
||||
PlayRecordCallback callbackData);
|
||||
|
||||
#if !NET_2_0
|
||||
[ComVisible (false)]
|
||||
#endif
|
||||
public delegate bool DrawImageAbort (IntPtr callbackData);
|
||||
|
||||
internal Graphics (IntPtr nativeGraphics)
|
||||
@ -158,7 +147,6 @@ namespace System.Drawing
|
||||
status = GDIPlus.GdipGraphicsClear (nativeObject, color.ToArgb ());
|
||||
GDIPlus.CheckStatus (status);
|
||||
}
|
||||
#if NET_2_0
|
||||
[MonoLimitation ("Works on Win32 and on X11 (but not on Cocoa and Quartz)")]
|
||||
public void CopyFromScreen (Point upperLeftSource, Point upperLeftDestination, Size blockRegionSize)
|
||||
{
|
||||
@ -289,7 +277,6 @@ namespace System.Drawing
|
||||
GDIPlus.XDestroyImage (image);
|
||||
GDIPlus.XFree (vPtr);
|
||||
}
|
||||
#endif
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
@ -986,7 +973,6 @@ namespace System.Drawing
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
public void DrawImageUnscaledAndClipped (Image image, Rectangle rect)
|
||||
{
|
||||
if (image == null)
|
||||
@ -997,7 +983,6 @@ namespace System.Drawing
|
||||
|
||||
DrawImageUnscaled (image, rect.X, rect.Y, width, height);
|
||||
}
|
||||
#endif
|
||||
|
||||
public void DrawLine (Pen pen, PointF pt1, PointF pt2)
|
||||
{
|
||||
@ -1202,10 +1187,8 @@ namespace System.Drawing
|
||||
|
||||
public void EndContainer (GraphicsContainer container)
|
||||
{
|
||||
#if NET_2_0
|
||||
if (container == null)
|
||||
throw new ArgumentNullException ("container");
|
||||
#endif
|
||||
Status status = GDIPlus.GdipEndContainer(nativeObject, container.NativeObject);
|
||||
GDIPlus.CheckStatus (status);
|
||||
}
|
||||
@ -1804,9 +1787,6 @@ namespace System.Drawing
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
#if !NET_2_0
|
||||
[EditorBrowsable (EditorBrowsableState.Advanced)]
|
||||
#endif
|
||||
public IntPtr GetHdc ()
|
||||
{
|
||||
GDIPlus.CheckStatus (GDIPlus.GdipGetDC (this.nativeObject, out deviceContextHdc));
|
||||
@ -2041,20 +2021,14 @@ namespace System.Drawing
|
||||
ReleaseHdcInternal (hdc);
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
[SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
|
||||
public void ReleaseHdc ()
|
||||
{
|
||||
ReleaseHdcInternal (deviceContextHdc);
|
||||
}
|
||||
#endif
|
||||
|
||||
[MonoLimitation ("Can only be used when hdc was provided by Graphics.GetHdc() method")]
|
||||
#if NET_2_0
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
#else
|
||||
[EditorBrowsable (EditorBrowsableState.Advanced)]
|
||||
#endif
|
||||
[SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
|
||||
public void ReleaseHdcInternal (IntPtr hdc)
|
||||
{
|
||||
@ -2469,7 +2443,6 @@ namespace System.Drawing
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
[MonoTODO]
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
public object GetContextInfo ()
|
||||
@ -2477,6 +2450,5 @@ namespace System.Drawing
|
||||
// only known source of information @ http://blogs.wdevs.com/jdunlap/Default.aspx
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -28,9 +28,6 @@
|
||||
|
||||
namespace System.Drawing {
|
||||
|
||||
#if ONLY_1_1
|
||||
[Serializable]
|
||||
#endif
|
||||
public enum GraphicsUnit {
|
||||
World = 0,
|
||||
Display = 1,
|
||||
|
@ -26,7 +26,6 @@
|
||||
//
|
||||
//
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
@ -39,5 +38,4 @@ namespace System.Drawing
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -42,9 +42,6 @@ using System.Security.Permissions;
|
||||
|
||||
namespace System.Drawing
|
||||
{
|
||||
#if !NET_2_0
|
||||
[ComVisible (false)]
|
||||
#endif
|
||||
[Serializable]
|
||||
#if !MONOTOUCH
|
||||
[Editor ("System.Drawing.Design.IconEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))]
|
||||
@ -283,7 +280,6 @@ namespace System.Drawing
|
||||
si.AddValue ("IconData", ms.ToArray ());
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
public Icon (Stream stream, Size size) :
|
||||
this (stream, size.Width, size.Height)
|
||||
{
|
||||
@ -313,7 +309,6 @@ namespace System.Drawing
|
||||
|
||||
return SystemIcons.WinLogo;
|
||||
}
|
||||
#endif
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
|
@ -50,9 +50,7 @@ namespace System.Drawing
|
||||
public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISerializable
|
||||
{
|
||||
public delegate bool GetThumbnailImageAbort();
|
||||
#if NET_2_0
|
||||
private object tag;
|
||||
#endif
|
||||
|
||||
internal IntPtr nativeObject = IntPtr.Zero;
|
||||
// when using MS GDI+ and IStream we must ensure the stream stays alive for all the life of the Image
|
||||
@ -739,7 +737,6 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
[DefaultValue (null)]
|
||||
[LocalizableAttribute(false)]
|
||||
[BindableAttribute(true)]
|
||||
@ -748,7 +745,6 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
|
||||
get { return tag; }
|
||||
set { tag = value; }
|
||||
}
|
||||
#endif
|
||||
public float VerticalResolution {
|
||||
get {
|
||||
float resolution;
|
||||
|
@ -30,9 +30,6 @@
|
||||
|
||||
namespace System.Drawing {
|
||||
|
||||
#if ONLY_1_1
|
||||
[Serializable]
|
||||
#endif
|
||||
public enum KnownColor {
|
||||
ActiveBorder = 1,
|
||||
ActiveCaption = 2,
|
||||
@ -201,7 +198,6 @@ namespace System.Drawing {
|
||||
WhiteSmoke = 165,
|
||||
Yellow = 166,
|
||||
YellowGreen = 167,
|
||||
#if NET_2_0
|
||||
ButtonFace = 168,
|
||||
ButtonHighlight = 169,
|
||||
ButtonShadow = 170,
|
||||
@ -209,6 +205,5 @@ namespace System.Drawing {
|
||||
GradientInactiveCaption = 172,
|
||||
MenuBar = 173,
|
||||
MenuHighlight = 174
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -30,15 +30,7 @@
|
||||
|
||||
namespace System.Drawing {
|
||||
|
||||
#if NET_2_0
|
||||
internal static class KnownColors {
|
||||
#else
|
||||
internal class KnownColors {
|
||||
|
||||
private KnownColors ()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
// FindColorMatch relies on the index + 1 == KnowColor match
|
||||
static internal uint[] ArgbValues = new uint[] {
|
||||
0x00000000, /* 000 - Empty */
|
||||
@ -209,7 +201,6 @@ namespace System.Drawing {
|
||||
0xFFF5F5F5, /* 165 - WhiteSmoke */
|
||||
0xFFFFFF00, /* 166 - Yellow */
|
||||
0xFF9ACD32, /* 167 - YellowGreen */
|
||||
#if NET_2_0
|
||||
0xFFECE9D8, /* 168 - ButtonFace */
|
||||
0xFFFFFFFF, /* 169 - ButtonHighlight */
|
||||
0xFFACA899, /* 170 - ButtonShadow */
|
||||
@ -217,7 +208,6 @@ namespace System.Drawing {
|
||||
0xFF9DB9EB, /* 172 - GradientInactiveCaption */
|
||||
0xFFECE9D8, /* 173 - MenuBar */
|
||||
0xFF316AC5, /* 174 - MenuHighlight */
|
||||
#endif
|
||||
};
|
||||
|
||||
static KnownColors ()
|
||||
@ -266,7 +256,6 @@ namespace System.Drawing {
|
||||
ArgbValues [(int)KnownColor.Window] = GetSysColor (GetSysColorIndex.COLOR_WINDOW);
|
||||
ArgbValues [(int)KnownColor.WindowFrame] = GetSysColor (GetSysColorIndex.COLOR_WINDOWFRAME);
|
||||
ArgbValues [(int)KnownColor.WindowText] = GetSysColor (GetSysColorIndex.COLOR_WINDOWTEXT);
|
||||
#if NET_2_0
|
||||
ArgbValues [(int)KnownColor.ButtonFace] = GetSysColor (GetSysColorIndex.COLOR_BTNFACE);
|
||||
ArgbValues [(int)KnownColor.ButtonHighlight] = GetSysColor (GetSysColorIndex.COLOR_BTNHIGHLIGHT);
|
||||
ArgbValues [(int)KnownColor.ButtonShadow] = GetSysColor (GetSysColorIndex.COLOR_BTNSHADOW);
|
||||
@ -274,7 +263,6 @@ namespace System.Drawing {
|
||||
ArgbValues [(int)KnownColor.GradientInactiveCaption] = GetSysColor (GetSysColorIndex.COLOR_GRADIENTINACTIVECAPTION);
|
||||
ArgbValues [(int)KnownColor.MenuBar] = GetSysColor (GetSysColorIndex.COLOR_MENUBAR);
|
||||
ArgbValues [(int)KnownColor.MenuHighlight] = GetSysColor (GetSysColorIndex.COLOR_MENUHIGHLIGHT);
|
||||
#endif
|
||||
}
|
||||
|
||||
public static Color FromKnownColor (KnownColor kc)
|
||||
@ -284,9 +272,6 @@ namespace System.Drawing {
|
||||
if ((n <= 0) || (n >= ArgbValues.Length)) {
|
||||
// This is what it returns!
|
||||
c = Color.FromArgb (0, 0, 0, 0);
|
||||
#if ONLY_1_1
|
||||
c.name = kc.ToString ();
|
||||
#endif
|
||||
c.state |= (short) Color.ColorType.Named;
|
||||
} else {
|
||||
c = new Color ();
|
||||
@ -294,9 +279,6 @@ namespace System.Drawing {
|
||||
if ((n < 27) || (n > 169))
|
||||
c.state |= (short) Color.ColorType.System;
|
||||
c.Value = ArgbValues [n];
|
||||
#if ONLY_1_1
|
||||
c.name = GetName (n);
|
||||
#endif
|
||||
}
|
||||
c.knownColor = n;
|
||||
return c;
|
||||
@ -472,7 +454,6 @@ namespace System.Drawing {
|
||||
case 165: return "WhiteSmoke";
|
||||
case 166: return "Yellow";
|
||||
case 167: return "YellowGreen";
|
||||
#if NET_2_0
|
||||
case 168: return "ButtonFace";
|
||||
case 169: return "ButtonHighlight";
|
||||
case 170: return "ButtonShadow";
|
||||
@ -480,7 +461,6 @@ namespace System.Drawing {
|
||||
case 172: return "GradientInactiveCaption";
|
||||
case 173: return "MenuBar";
|
||||
case 174: return "MenuHighlight";
|
||||
#endif
|
||||
default: return String.Empty;
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user