You've already forked linux-packaging-mono
Imported Upstream version 4.3.2.467
Former-commit-id: 9c2cb47f45fa221e661ab616387c9cda183f283d
This commit is contained in:
@@ -12,7 +12,7 @@ LIB_MCS_FLAGS = /unsafe /r:$(corlib) \
|
||||
|
||||
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -define:TEST -resource:Test/resources/indexed.png,indexed.png \
|
||||
-r:System.Drawing.dll -r:System.Runtime.Serialization.Formatters.Soap.dll -r:System.Xml.dll \
|
||||
-nowarn:0618 -nowarn:219 -nowarn:169 -nowarn:1595
|
||||
-nowarn:0618 -nowarn:219 -nowarn:169
|
||||
|
||||
include ../../build/library.make
|
||||
|
||||
|
||||
@@ -843,7 +843,7 @@ namespace System.Drawing.Printing
|
||||
if (!settings.PrintToFile) {
|
||||
StringBuilder sb = new StringBuilder (1024);
|
||||
int length = sb.Capacity;
|
||||
cupsTempFile (sb, length);
|
||||
cupsTempFd (sb, length);
|
||||
name = sb.ToString ();
|
||||
tmpfile = name;
|
||||
}
|
||||
@@ -889,7 +889,7 @@ namespace System.Drawing.Printing
|
||||
static extern void cupsFreeDests (int num_dests, IntPtr dests);
|
||||
|
||||
[DllImport("libcups", CharSet=CharSet.Ansi)]
|
||||
static extern IntPtr cupsTempFile (StringBuilder sb, int len);
|
||||
static extern IntPtr cupsTempFd (StringBuilder sb, int len);
|
||||
|
||||
[DllImport("libcups", CharSet=CharSet.Ansi)]
|
||||
static extern IntPtr cupsGetDefault ();
|
||||
|
||||
@@ -38,8 +38,10 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Drawing
|
||||
{
|
||||
#if !MONOTOUCH && !MONOMAC
|
||||
[TypeConverter(typeof(ColorConverter))]
|
||||
[Editor ("System.Drawing.Design.ColorEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))]
|
||||
#endif
|
||||
[Serializable]
|
||||
public struct Color {
|
||||
|
||||
|
||||
@@ -42,12 +42,11 @@ namespace System.Drawing {
|
||||
|
||||
public static Color FromHtml (string htmlColor)
|
||||
{
|
||||
if ((htmlColor == null) || (htmlColor.Length == 0))
|
||||
return Color.Empty;
|
||||
if (string.IsNullOrEmpty (htmlColor)) return Color.Empty;
|
||||
|
||||
switch (htmlColor.ToLowerInvariant ()) {
|
||||
case "buttonface":
|
||||
case "threedface":
|
||||
case "threedface":
|
||||
return SystemColors.Control;
|
||||
case "buttonhighlight":
|
||||
case "threedlightshadow":
|
||||
@@ -70,7 +69,13 @@ namespace System.Drawing {
|
||||
case "lightgrey":
|
||||
return Color.LightGray;
|
||||
}
|
||||
|
||||
|
||||
if (htmlColor[0] == '#' && htmlColor.Length == 4)
|
||||
{
|
||||
char r = htmlColor[1], g = htmlColor[2], b = htmlColor[3];
|
||||
htmlColor = new string ( new char [] { '#', r, r, g, g, b, b } );
|
||||
}
|
||||
|
||||
TypeConverter converter = TypeDescriptor.GetConverter (typeof (Color));
|
||||
return (Color) converter.ConvertFromString (htmlColor);
|
||||
}
|
||||
|
||||
@@ -210,6 +210,7 @@ namespace System.Drawing {
|
||||
0xFF316AC5, /* 174 - MenuHighlight */
|
||||
};
|
||||
|
||||
#if !MONOTOUCH && !MONOMAC
|
||||
static KnownColors ()
|
||||
{
|
||||
if (GDIPlus.RunningOnWindows ()) {
|
||||
@@ -264,6 +265,7 @@ namespace System.Drawing {
|
||||
ArgbValues [(int)KnownColor.MenuBar] = GetSysColor (GetSysColorIndex.COLOR_MENUBAR);
|
||||
ArgbValues [(int)KnownColor.MenuHighlight] = GetSysColor (GetSysColorIndex.COLOR_MENUHIGHLIGHT);
|
||||
}
|
||||
#endif
|
||||
|
||||
public static Color FromKnownColor (KnownColor kc)
|
||||
{
|
||||
|
||||
@@ -40,7 +40,9 @@ namespace System.Drawing
|
||||
{
|
||||
[Serializable]
|
||||
[ComVisible (true)]
|
||||
#if !MONOTOUCH && !MONOMAC
|
||||
[TypeConverter (typeof (PointConverter))]
|
||||
#endif
|
||||
public struct Point
|
||||
{
|
||||
// Private x and y coordinate fields.
|
||||
@@ -226,7 +228,7 @@ namespace System.Drawing
|
||||
public Point (int dw)
|
||||
{
|
||||
y = dw >> 16;
|
||||
x = dw & 0xffff;
|
||||
x = unchecked ((short) (dw & 0xffff));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -39,7 +39,9 @@ namespace System.Drawing
|
||||
{
|
||||
[Serializable]
|
||||
[ComVisible (true)]
|
||||
#if !MONOTOUCH && !MONOMAC
|
||||
[TypeConverter (typeof (RectangleConverter))]
|
||||
#endif
|
||||
public struct Rectangle
|
||||
{
|
||||
private int x, y, width, height;
|
||||
|
||||
@@ -40,7 +40,9 @@ namespace System.Drawing
|
||||
{
|
||||
[Serializable]
|
||||
[ComVisible (true)]
|
||||
#if !MONOTOUCH && !MONOMAC
|
||||
[TypeConverter (typeof (SizeConverter))]
|
||||
#endif
|
||||
public struct Size
|
||||
{
|
||||
|
||||
|
||||
@@ -40,7 +40,9 @@ namespace System.Drawing
|
||||
{
|
||||
[Serializable]
|
||||
[ComVisible (true)]
|
||||
#if !MONOTOUCH && !MONOMAC
|
||||
[TypeConverter (typeof (SizeFConverter))]
|
||||
#endif
|
||||
public struct SizeF
|
||||
{
|
||||
// Private height and width fields.
|
||||
|
||||
@@ -71,6 +71,8 @@ namespace MonoTests.System.Drawing {
|
||||
Assert.AreEqual (0, ColorTranslator.FromHtml ("#0").ToArgb (), "#0");
|
||||
Assert.AreEqual (1, ColorTranslator.FromHtml ("#1").ToArgb (), "#1");
|
||||
Assert.AreEqual (255, ColorTranslator.FromHtml ("#FF").ToArgb (), "#FF");
|
||||
Assert.AreEqual (-15654349, ColorTranslator.FromHtml ("#123").ToArgb (), "#123");
|
||||
Assert.AreEqual (-1, ColorTranslator.FromHtml ("#FFF").ToArgb (), "#FFF");
|
||||
Assert.AreEqual (65535, ColorTranslator.FromHtml ("#FFFF").ToArgb (), "#FFFF");
|
||||
Assert.AreEqual (-15584170, ColorTranslator.FromHtml ("#123456").ToArgb (), "#123456");
|
||||
Assert.AreEqual (-1, ColorTranslator.FromHtml ("#FFFFFF").ToArgb (), "#FFFFFF");
|
||||
|
||||
@@ -155,6 +155,15 @@ namespace MonoTests.System.Drawing{
|
||||
Assert.AreEqual (pt_i, pt1_1, "#2");
|
||||
Assert.AreEqual (pt_sz, pt1_1, "#3");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ConstructorNegativeLocationTest ()
|
||||
{
|
||||
var pt = new Point (unchecked ((int) 0xffe0fc00));
|
||||
|
||||
Assert.AreEqual (-32, pt.Y, "#1"); // (short) 0xffe0
|
||||
Assert.AreEqual (-1024, pt.X, "#2"); // (short) 0xfc00
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PropertyTest ()
|
||||
|
||||
Reference in New Issue
Block a user