From 76182a0e3196682e45ea0d7e22540cac486ba1e2 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Tue, 21 Mar 2006 18:30:36 +0000 Subject: [PATCH 001/117] 2006-03-21 Mike Kestner * ListView.cs: use OnItemActivated to raise events. Fixes #77834. svn path=/trunk/mcs/; revision=58237 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 4 ++++ .../Managed.Windows.Forms/System.Windows.Forms/ListView.cs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 2c61b9c289f74..0095202a94e53 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,7 @@ +2006-03-21 Mike Kestner + + * ListView.cs: use OnItemActivated to raise events. Fixes #77834. + 2006-03-21 Alexander Olk * Mime.cs: Various speed optimizations. Looking up mime types diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs index efeec8e16d916..f2f5a086b51a3 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs @@ -1280,12 +1280,12 @@ private void ItemsMouseUp (object sender, MouseEventArgs me) if (rect.Contains (pt)) { switch (owner.activation) { case ItemActivation.OneClick: - owner.ItemActivate (this, EventArgs.Empty); + owner.OnItemActivate (EventArgs.Empty); break; case ItemActivation.TwoClick: if (last_clicked_item == clicked_item) { - owner.ItemActivate (this, EventArgs.Empty); + owner.OnItemActivate (EventArgs.Empty); last_clicked_item = null; } else last_clicked_item = clicked_item; From f2ccb97febb186b217b03333930410c52f918bcd Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Tue, 21 Mar 2006 18:32:21 +0000 Subject: [PATCH 002/117] 2006-03-21 Marek Safar * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message. * statement.cs (Block.ResolveMeta): Look for wrong object constants in the blocks too. svn path=/trunk/mcs/; revision=58238 --- mcs/errors/cs0134-2.cs | 10 ++++++++++ mcs/errors/cs0134.cs | 2 +- mcs/mcs/ChangeLog | 7 +++++++ mcs/mcs/const.cs | 9 +++++++-- mcs/mcs/statement.cs | 5 +++++ mcs/tests/test-256.cs | 2 +- 6 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 mcs/errors/cs0134-2.cs diff --git a/mcs/errors/cs0134-2.cs b/mcs/errors/cs0134-2.cs new file mode 100644 index 0000000000000..9a88ae86b906a --- /dev/null +++ b/mcs/errors/cs0134-2.cs @@ -0,0 +1,10 @@ +// cs0134.cs: `o': the constant of reference type other than string can only be initialized with null +// Line: 6 + +public class C +{ + public static void Main () + { + const object o = 1; + } +} diff --git a/mcs/errors/cs0134.cs b/mcs/errors/cs0134.cs index 047a8a2d49bf5..54fdffac58a77 100644 --- a/mcs/errors/cs0134.cs +++ b/mcs/errors/cs0134.cs @@ -1,4 +1,4 @@ -// cs0134.cs: `C.o': A const of reference other than string can only be initialized with null +// cs0134.cs: `C.o': the constant of reference type other than string can only be initialized with null // Line: 6 public class C diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog index 4f03e7d621853..b2ac2a351878d 100644 --- a/mcs/mcs/ChangeLog +++ b/mcs/mcs/ChangeLog @@ -1,3 +1,10 @@ +2006-03-21 Marek Safar + + * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message. + + * statement.cs (Block.ResolveMeta): Look for wrong object constants in + the blocks too. + 2006-03-21 Atsushi Enomoto * doc-bootstrap.cs : fix build. diff --git a/mcs/mcs/const.cs b/mcs/mcs/const.cs index 7a2026646f32a..1e980404b27de 100644 --- a/mcs/mcs/const.cs +++ b/mcs/mcs/const.cs @@ -119,6 +119,12 @@ public static void Error_CyclicDeclaration (MemberCore mc) mc.GetSignatureForError ()); } + public static void Error_ConstantCanBeInitializedWithNullOnly (Location loc, string name) + { + Report.Error (134, loc, "`{0}': the constant of reference type other than string can only be initialized with null", + name); + } + #region IConstant Members public bool ResolveValue () @@ -148,8 +154,7 @@ public bool ResolveValue () return false; if (!MemberType.IsValueType && MemberType != TypeManager.string_type && !value.IsDefaultValue) { - Report.Error (134, Location, "`{0}': A const of reference other than string can only be initialized with null", - GetSignatureForError ()); + Error_ConstantCanBeInitializedWithNullOnly (Location, GetSignatureForError ()); return false; } diff --git a/mcs/mcs/statement.cs b/mcs/mcs/statement.cs index fe2faa0d9c001..6b08fb7abff58 100644 --- a/mcs/mcs/statement.cs +++ b/mcs/mcs/statement.cs @@ -1756,6 +1756,11 @@ public void ResolveMeta (ToplevelBlock toplevel, EmitContext ec, Parameters ip) if (e == null) continue; + if (!variable_type.IsValueType && variable_type != TypeManager.string_type && !ce.IsDefaultValue) { + Const.Error_ConstantCanBeInitializedWithNullOnly (vi.Location, vi.Name); + continue; + } + constants.Add (name, e); } } diff --git a/mcs/tests/test-256.cs b/mcs/tests/test-256.cs index 5d6d063ee619f..17e7d9c478a54 100644 --- a/mcs/tests/test-256.cs +++ b/mcs/tests/test-256.cs @@ -23,7 +23,7 @@ public int TInt public static void Main () { - const object o = 1; + const object o = null; } } From ff91bada35ab0f7e92517e4fd1b98e8eccc67730 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Tue, 21 Mar 2006 20:30:55 +0000 Subject: [PATCH 003/117] 2006-03-21 Marek Safar * expression.cs (StringConcat.Append): Reverted back to no warning state. svn path=/trunk/mcs/; revision=58245 --- mcs/mcs/ChangeLog | 4 ++++ mcs/mcs/expression.cs | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog index b2ac2a351878d..188a436f9abfe 100644 --- a/mcs/mcs/ChangeLog +++ b/mcs/mcs/ChangeLog @@ -1,3 +1,7 @@ +2006-03-21 Marek Safar + + * expression.cs (StringConcat.Append): Reverted back to no warning state. + 2006-03-21 Marek Safar * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message. diff --git a/mcs/mcs/expression.cs b/mcs/mcs/expression.cs index fff59230db7c7..a3a35126bfe1e 100644 --- a/mcs/mcs/expression.cs +++ b/mcs/mcs/expression.cs @@ -2927,8 +2927,12 @@ public void Append (EmitContext ec, Expression operand) // StringConstant sc = operand as StringConstant; if (sc != null) { - if (sc.Value.Length == 0) - Report.Warning (-300, 3, Location, "Appending an empty string has no effect. Did you intend to append a space string?"); +// TODO: it will be better to do this silently as an optimalization +// int i = 0; +// string s = "" + i; +// because this code has poor performace +// if (sc.Value.Length == 0) +// Report.Warning (-300, 3, Location, "Appending an empty string has no effect. Did you intend to append a space string?"); if (operands.Count != 0) { StringConstant last_operand = operands [operands.Count - 1] as StringConstant; From 796bc9cd4ec2877f53879ec23d145c0bb9a0b58e Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Tue, 21 Mar 2006 20:45:44 +0000 Subject: [PATCH 004/117] 2006-03-21 Sebastien Pouliot * gdipFunctions.cs: Import XFree (from libX11) so we can free the memory we allocate. * Graphics.cs: Free the memory we get from XGetVisualInfo. svn path=/trunk/mcs/; revision=58246 --- mcs/class/System.Drawing/System.Drawing/ChangeLog | 6 ++++++ mcs/class/System.Drawing/System.Drawing/Graphics.cs | 1 + mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/mcs/class/System.Drawing/System.Drawing/ChangeLog b/mcs/class/System.Drawing/System.Drawing/ChangeLog index 78dc9a34edfbf..abed14841a8b5 100644 --- a/mcs/class/System.Drawing/System.Drawing/ChangeLog +++ b/mcs/class/System.Drawing/System.Drawing/ChangeLog @@ -1,3 +1,9 @@ +2006-03-21 Sebastien Pouliot + + * gdipFunctions.cs: Import XFree (from libX11) so we can free the + memory we allocate. + * Graphics.cs: Free the memory we get from XGetVisualInfo. + 2006-03-20 Sebastien Pouliot * Brush.cs: Allow Dispose to free the unmanaged memory for the brush diff --git a/mcs/class/System.Drawing/System.Drawing/Graphics.cs b/mcs/class/System.Drawing/System.Drawing/Graphics.cs index a00a93331723c..f78266b4c5404 100644 --- a/mcs/class/System.Drawing/System.Drawing/Graphics.cs +++ b/mcs/class/System.Drawing/System.Drawing/Graphics.cs @@ -235,6 +235,7 @@ public void CopyFromScreen (int sourceX, int sourceY, int destinationX, int dest DrawImage (bmp, 0, 0); bmp.Dispose (); GDIPlus.XDestroyImage (image); + GDIPlus.XFree (vPtr); return; } diff --git a/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs b/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs index 17b6ee198a47e..6dc144278358a 100644 --- a/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs +++ b/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs @@ -1441,7 +1441,9 @@ static internal void CheckStatus (Status status) [DllImport ("libX11", EntryPoint="XVisualIDFromVisual")] internal extern static int XVisualIDFromVisual(IntPtr visual); - + + [DllImport ("libX11", EntryPoint="XFree")] + internal extern static void XFree (IntPtr data); // FontCollection [DllImport ("gdiplus.dll")] From d68e4799096c634a0388c6474dd17bb4dd69f47d Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Tue, 21 Mar 2006 20:56:16 +0000 Subject: [PATCH 005/117] 2006-03-21 Sebastien Pouliot * Brush.cs: Remove unused code. * FontFamily.cs: Remove warnings from build. * gdipFunctions.cs: Add missing p/invoke calls for GdipAddString[I]. svn path=/trunk/mcs/; revision=58247 --- .../System.Drawing/System.Drawing/Brush.cs | 29 +------------------ .../System.Drawing/System.Drawing/ChangeLog | 6 ++++ .../System.Drawing/FontFamily.cs | 6 ++-- .../System.Drawing/gdipFunctions.cs | 5 ++++ 4 files changed, 15 insertions(+), 31 deletions(-) diff --git a/mcs/class/System.Drawing/System.Drawing/Brush.cs b/mcs/class/System.Drawing/System.Drawing/Brush.cs index cb75a3623788a..6b3c48ff57043 100644 --- a/mcs/class/System.Drawing/System.Drawing/Brush.cs +++ b/mcs/class/System.Drawing/System.Drawing/Brush.cs @@ -6,11 +6,7 @@ // Ravindra (rkumar@novell.com) // // (C) Ximian, Inc. http://www.ximian.com -// (C) Novell, Inc. Http://www.novell.com -// - -// -// Copyright (C) 2004 Novell, Inc (http://www.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 @@ -32,11 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -using System; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Collections; - namespace System.Drawing { public abstract class Brush : MarshalByRefObject, ICloneable, IDisposable @@ -74,23 +65,6 @@ internal Brush () } #endif - - internal Brush CreateBrush (IntPtr brush, System.Drawing.BrushType type) - { - switch (type) { - case BrushType.BrushTypeSolidColor: - return new SolidBrush (brush); - - case BrushType.BrushTypeHatchFill: - return new HatchBrush (brush); - - case BrushType.BrushTypeTextureFill: - return new TextureBrush (brush); - - default: - throw new NotImplementedException (); - } - } public void Dispose () { @@ -114,4 +88,3 @@ protected virtual void Dispose (bool disposing) } } } - diff --git a/mcs/class/System.Drawing/System.Drawing/ChangeLog b/mcs/class/System.Drawing/System.Drawing/ChangeLog index abed14841a8b5..ebc7fe1eafc0f 100644 --- a/mcs/class/System.Drawing/System.Drawing/ChangeLog +++ b/mcs/class/System.Drawing/System.Drawing/ChangeLog @@ -1,3 +1,9 @@ +2006-03-21 Sebastien Pouliot + + * Brush.cs: Remove unused code. + * FontFamily.cs: Remove warnings from build. + * gdipFunctions.cs: Add missing p/invoke calls for GdipAddString[I]. + 2006-03-21 Sebastien Pouliot * gdipFunctions.cs: Import XFree (from libX11) so we can free the diff --git a/mcs/class/System.Drawing/System.Drawing/FontFamily.cs b/mcs/class/System.Drawing/System.Drawing/FontFamily.cs index 7c129e002998a..b164e38bbe28d 100644 --- a/mcs/class/System.Drawing/System.Drawing/FontFamily.cs +++ b/mcs/class/System.Drawing/System.Drawing/FontFamily.cs @@ -37,9 +37,9 @@ namespace System.Drawing { public sealed class FontFamily : MarshalByRefObject, IDisposable { - static private FontFamily genericMonospace = null; - static private FontFamily genericSansSerif = null; - static private FontFamily genericSerif = null; + static private FontFamily genericMonospace; + static private FontFamily genericSansSerif; + static private FontFamily genericSerif; private string name; internal IntPtr nativeFontFamily = IntPtr.Zero; diff --git a/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs b/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs index 6dc144278358a..0994898308071 100644 --- a/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs +++ b/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs @@ -739,6 +739,11 @@ static internal void CheckStatus (Status status) [DllImport("gdiplus.dll")] internal static extern Status GdipFlush(IntPtr graphics, FlushIntention intention); + [DllImport("gdiplus.dll")] + internal static extern Status GdipAddString (IntPtr graphics, string s, int len, IntPtr font, int style, float size, ref RectangleF layout, IntPtr format); + [DllImport("gdiplus.dll")] + internal static extern Status GdipAddStringI (IntPtr graphics, string s, int len, IntPtr font, int style, float size, ref Rectangle layout, IntPtr format); + // Pen functions [DllImport("gdiplus.dll")] From bc13a1f4833d2db6895b52db5d63393050207140 Mon Sep 17 00:00:00 2001 From: Gonzalo Paniagua Javier Date: Tue, 21 Mar 2006 21:02:39 +0000 Subject: [PATCH 006/117] 2006-03-21 Gonzalo Paniagua Javier * FileStream.cs: Seek() should flush the buffer, if any. Fixes bug #77863. svn path=/trunk/mcs/; revision=58248 --- mcs/class/corlib/System.IO/ChangeLog | 5 +++++ mcs/class/corlib/System.IO/FileStream.cs | 8 -------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/mcs/class/corlib/System.IO/ChangeLog b/mcs/class/corlib/System.IO/ChangeLog index 3ccfdfa93398b..12f5a624006c1 100644 --- a/mcs/class/corlib/System.IO/ChangeLog +++ b/mcs/class/corlib/System.IO/ChangeLog @@ -1,3 +1,8 @@ +2006-03-21 Gonzalo Paniagua Javier + + * FileStream.cs: Seek() should flush the buffer, if any. Fixes bug + #77863. + 2006-03-07 Carlos Alberto Cortez * Stream.cs: Add 2.0 members to Stream.cs (CanTimeout, diff --git a/mcs/class/corlib/System.IO/FileStream.cs b/mcs/class/corlib/System.IO/FileStream.cs index 738dc0e859ded..9584670a92bff 100644 --- a/mcs/class/corlib/System.IO/FileStream.cs +++ b/mcs/class/corlib/System.IO/FileStream.cs @@ -689,14 +689,6 @@ public override long Seek (long offset, SeekOrigin origin) throw new IOException("Can't seek back over pre-existing data in append mode"); } - if (buf_length > 0) { - if (pos >= buf_start && - pos <= buf_start + buf_length) { - buf_offset = (int) (pos - buf_start); - return pos; - } - } - FlushBuffer (); MonoIOError error; From 74a83b38690bf1c1e966edea144e03932c060b4c Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Tue, 21 Mar 2006 21:03:02 +0000 Subject: [PATCH 007/117] Added a check in case (like myself) you didn't have tiff support compiled in libgdiplus svn path=/trunk/mcs/; revision=58249 --- .../System.Drawing/Samples/System.Drawing/imagecompose.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mcs/class/System.Drawing/Samples/System.Drawing/imagecompose.cs b/mcs/class/System.Drawing/Samples/System.Drawing/imagecompose.cs index 0e17a8b992397..caee595a731d2 100644 --- a/mcs/class/System.Drawing/Samples/System.Drawing/imagecompose.cs +++ b/mcs/class/System.Drawing/Samples/System.Drawing/imagecompose.cs @@ -46,7 +46,10 @@ public static void Main(string[] args) foreach(ImageCodecInfo ice in ImageCodecInfo.GetImageEncoders()) if(ice.MimeType=="image/tiff") info = ice; - + if (info == null) { + Console.WriteLine ("Couldn't get codec for image/tiff"); + return; + } //use the save encoder Encoder enc = Encoder.SaveFlag; EncoderParameters ep=new EncoderParameters(1); From 16232e93ecebae9df3271744c3ce63963aed82a0 Mon Sep 17 00:00:00 2001 From: Gonzalo Paniagua Javier Date: Tue, 21 Mar 2006 21:03:12 +0000 Subject: [PATCH 008/117] 2006-03-21 Gonzalo Paniagua Javier * FileStreamTest.cs: new test from bug #77863. svn path=/trunk/mcs/; revision=58250 --- mcs/class/corlib/Test/System.IO/ChangeLog | 4 +++ .../corlib/Test/System.IO/FileStreamTest.cs | 25 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/mcs/class/corlib/Test/System.IO/ChangeLog b/mcs/class/corlib/Test/System.IO/ChangeLog index 7802da848dd52..bea376cfccfdb 100644 --- a/mcs/class/corlib/Test/System.IO/ChangeLog +++ b/mcs/class/corlib/Test/System.IO/ChangeLog @@ -1,3 +1,7 @@ +2006-03-21 Gonzalo Paniagua Javier + + * FileStreamTest.cs: new test from bug #77863. + 2006-02-27 Gert Driesen * FileTest.cs: In 2.0 profile, no longer expect IOException when path to diff --git a/mcs/class/corlib/Test/System.IO/FileStreamTest.cs b/mcs/class/corlib/Test/System.IO/FileStreamTest.cs index 0851359f69409..858d05221a338 100644 --- a/mcs/class/corlib/Test/System.IO/FileStreamTest.cs +++ b/mcs/class/corlib/Test/System.IO/FileStreamTest.cs @@ -1383,5 +1383,30 @@ public void SetLengthWithClosedBaseStream () File.Delete (fn); } } + + [Test] + public void LengthAfterWrite () + { + string path = TempFolder + DSC + "oneofthefilescreated.txt"; + FileStream fs = null; + DeleteFile (path); + try { + fs = new FileStream (path, FileMode.CreateNew); + fs.WriteByte (Convert.ToByte ('A')); + byte [] buffer = Encoding.ASCII.GetBytes (" is a first character."); + fs.Write (buffer, 0, buffer.Length); + fs.Seek (0, SeekOrigin.Begin); + char a = Convert.ToChar (fs.ReadByte ()); + Assert.AreEqual ('A', a, "#A1"); + Assert.AreEqual (23, fs.Length, "#A2"); + int nread = fs.Read (buffer, 0, 5); + Assert.AreEqual (5, nread, "#A3"); + } finally { + if (fs != null) + fs.Close (); + DeleteFile (path); + } + } } } + From e7231458cf7dab89910afba2307218f47dc72f48 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 21 Mar 2006 21:39:16 +0000 Subject: [PATCH 009/117] * keyboards.resx: The keyboards files. * create_keyboards.cs: A little app used to create the keyboards resource file. Compile with mcs /r:System.Windows.Forms.dll create_keyboards.cs then run and you will get the keyboards.resx file. svn path=/trunk/mcs/; revision=58254 --- .../resources/create-keyboards.cs | 2069 +++++++++++++++++ .../resources/keyboards.resx | 44 + 2 files changed, 2113 insertions(+) create mode 100644 mcs/class/Managed.Windows.Forms/resources/create-keyboards.cs create mode 100644 mcs/class/Managed.Windows.Forms/resources/keyboards.resx diff --git a/mcs/class/Managed.Windows.Forms/resources/create-keyboards.cs b/mcs/class/Managed.Windows.Forms/resources/create-keyboards.cs new file mode 100644 index 0000000000000..6023d60c1fbf3 --- /dev/null +++ b/mcs/class/Managed.Windows.Forms/resources/create-keyboards.cs @@ -0,0 +1,2069 @@ + +using System; +using System.Resources; +using System.Windows.Forms; + + + +public class CreateKeyboards +{ + public static void Main() + { + ResXResourceWriter rsxw = new ResXResourceWriter ("keyboards.resx"); + KeyboardLayout [] table = new KeyboardLayout [64]; + + table [0] = new KeyboardLayout (1033, "United States keyboard layout", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0x5b, 0x7b, }, + new uint [] {0x5d, 0x7d, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0x3b, 0x3a, }, new uint [] {0x27, 0x22, }, + new uint [] {0x5c, 0x7c, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3c, }, new uint [] {0x2e, 0x3e, }, + new uint [] {0x2f, 0x3f, }, new uint [] {}, + new uint [] {}, }); + table [1] = new KeyboardLayout (1033, "United States keyboard layout (phantom key version)", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0x5b, 0x7b, }, + new uint [] {0x5d, 0x7d, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0x3b, 0x3a, }, new uint [] {0x27, 0x22, }, + new uint [] {0x5c, 0x7c, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3c, }, new uint [] {0x2e, 0x3e, }, + new uint [] {0x2f, 0x3f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [2] = new KeyboardLayout (1033, "United States keyboard layout (dvorak)", 1, 2, new uint [][] { + new uint [] {0x60, 0x7e, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x5b, 0x7b, }, + new uint [] {0x5d, 0x7d, }, new uint [] {0x27, 0x22, }, + new uint [] {0x2c, 0x3c, }, new uint [] {0x2e, 0x3e, }, + new uint [] {0x70, 0x50, }, new uint [] {0x79, 0x59, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x63, 0x43, }, new uint [] {0x72, 0x52, }, + new uint [] {0x6c, 0x4c, }, new uint [] {0x2f, 0x3f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x61, 0x41, }, + new uint [] {0x6f, 0x4f, }, new uint [] {0x65, 0x45, }, + new uint [] {0x75, 0x55, }, new uint [] {0x69, 0x49, }, + new uint [] {0x64, 0x44, }, new uint [] {0x68, 0x48, }, + new uint [] {0x74, 0x54, }, new uint [] {0x6e, 0x4e, }, + new uint [] {0x73, 0x53, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x5c, 0x7c, }, new uint [] {0x3b, 0x3a, }, + new uint [] {0x71, 0x51, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x78, 0x58, }, + new uint [] {0x62, 0x42, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x77, 0x57, }, new uint [] {0x76, 0x56, }, + new uint [] {0x7a, 0x5a, }, new uint [] {}, + new uint [] {}, }); + table [3] = new KeyboardLayout (1033, "United States International keyboard layout", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x5c, 0x7c, }, + new uint [] {0x71, 0x51, }, new uint [] {0x77, 0x57, }, + new uint [] {0x65, 0x45, }, new uint [] {0x72, 0x52, }, + new uint [] {0x74, 0x54, }, new uint [] {0x79, 0x59, }, + new uint [] {0x75, 0x55, }, new uint [] {0x69, 0x49, }, + new uint [] {0x6f, 0x4f, }, new uint [] {0x70, 0x50, }, + new uint [] {0x5b, 0x7b, }, new uint [] {0x5d, 0x7d, }, + new uint [] {0x61, 0x41, }, new uint [] {0x73, 0x53, }, + new uint [] {0x64, 0x44, }, new uint [] {0x66, 0x46, }, + new uint [] {0x67, 0x47, }, new uint [] {0x68, 0x48, }, + new uint [] {0x6a, 0x4a, }, new uint [] {0x6b, 0x4b, }, + new uint [] {0x6c, 0x4c, }, new uint [] {0x3b, 0x3a, }, + new uint [] {0x27, 0x22, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3c, }, new uint [] {0x2e, 0x3e, }, + new uint [] {0x2f, 0x3f, }, new uint [] {}, + new uint [] {}, }); + table [4] = new KeyboardLayout (2057, "British keyboard layout", 0, 0, new uint [][] { + new uint [] {0x60, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0xffffffa3, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0x5b, 0x7b, }, + new uint [] {0x5d, 0x7d, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0x3b, 0x3a, }, new uint [] {0x27, 0x40, }, + new uint [] {0x23, 0x7e, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3c, }, new uint [] {0x2e, 0x3e, }, + new uint [] {0x2f, 0x3f, }, new uint [] {0x5c, 0x7c, }, + new uint [] {}, }); + table [5] = new KeyboardLayout (1031, "German keyboard layout", 0, 1, new uint [][] { + new uint [] {0x5e, 0xffffffb0, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0xffffffa7, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, }, + new uint [] {0x38, 0x28, }, new uint [] {0x39, 0x29, }, + new uint [] {0x30, 0x3d, }, new uint [] {0xffffffdf, 0x3f, }, + new uint [] {0xffffffb4, 0x60, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x7a, 0x5a, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xfffffffc, 0xffffffdc, }, + new uint [] {0x2b, 0x2a, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xfffffff6, 0xffffffd6, }, new uint [] {0xffffffe4, 0xffffffc4, }, + new uint [] {0x23, 0x27, }, new uint [] {0x79, 0x59, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x3c, 0x3e, 0x7c, }, + new uint [] {}, }); + table [6] = new KeyboardLayout (1031, "German keyboard layout without dead keys", 0, 1, new uint [][] { + new uint [] {0x5e, 0xffffffb0, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0xffffffa7, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, 0x7b, }, + new uint [] {0x38, 0x28, 0x5b, }, new uint [] {0x39, 0x29, 0x5d, }, + new uint [] {0x30, 0x3d, 0x7d, }, new uint [] {0xffffffdf, 0x3f, 0x5c, }, + new uint [] {0xffffffb4, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x7a, 0x5a, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xfffffffc, 0xffffffdc, }, + new uint [] {0x2b, 0x2a, 0x7e, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xfffffff6, 0xffffffd6, }, new uint [] {0xffffffe4, 0xffffffc4, }, + new uint [] {0x23, 0x27, }, new uint [] {0x79, 0x59, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [7] = new KeyboardLayout (1031, "German keyboard layout for logitech desktop pro", 0, 1, new uint [][] { + new uint [] {0x5e, 0xffffffb0, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0xffffffa7, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, 0x7b, }, + new uint [] {0x38, 0x28, 0x5b, }, new uint [] {0x39, 0x29, 0x5d, }, + new uint [] {0x30, 0x3d, 0x7d, }, new uint [] {0xffffffdf, 0x3f, 0x5c, }, + new uint [] {0x27, 0x60, }, new uint [] {0x71, 0x51, 0x40, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x7a, 0x5a, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xfffffffc, 0xffffffdc, }, + new uint [] {0x2b, 0x2a, 0x7e, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xfffffff6, 0xffffffd6, }, new uint [] {0xffffffe4, 0xffffffc4, }, + new uint [] {0x23, 0x27, }, new uint [] {0x79, 0x59, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x3c, 0x3e, 0x7c, }, + new uint [] {}, }); + table [8] = new KeyboardLayout (1031, "German keyboard layout without dead keys 105", 0, 3, new uint [][] { + new uint [] {0x5e, 0xffffffb0, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, 0xffffffb2, }, new uint [] {0x33, 0xffffffa7, 0xffffffb3, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, 0x7b, }, + new uint [] {0x38, 0x28, 0x5b, }, new uint [] {0x39, 0x29, 0x5d, }, + new uint [] {0x30, 0x3d, 0x7d, }, new uint [] {0xffffffdf, 0x3f, 0x5c, }, + new uint [] {0x27, 0x60, }, new uint [] {0x71, 0x51, 0x40, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x7a, 0x5a, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xfffffffc, 0xffffffdc, }, + new uint [] {0x2b, 0x2a, 0x7e, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xfffffff6, 0xffffffd6, }, new uint [] {0xffffffe4, 0xffffffc4, }, + new uint [] {0x23, 0x27, }, new uint [] {0x3c, 0x3e, 0x7c, }, + new uint [] {0x79, 0x59, }, new uint [] {0x78, 0x58, }, + new uint [] {0x63, 0x43, }, new uint [] {0x76, 0x56, }, + new uint [] {0x62, 0x42, }, new uint [] {0x6e, 0x4e, }, + new uint [] {0x6d, 0x4d, }, new uint [] {0x2c, 0x3b, }, + new uint [] {0x2e, 0x3a, }, new uint [] {0x2d, 0x5f, }, + new uint [] {}, }); + table [9] = new KeyboardLayout (2055, "Swiss German keyboard layout", 0, 1, new uint [][] { + new uint [] {0xffffffa7, 0xffffffb0, }, new uint [] {0x31, 0x2b, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0x2a, }, + new uint [] {0x34, 0xffffffe7, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, }, + new uint [] {0x38, 0x28, }, new uint [] {0x39, 0x29, }, + new uint [] {0x30, 0x3d, }, new uint [] {0x27, 0x3f, }, + new uint [] {0x5e, 0x60, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x7a, 0x5a, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xfffffffc, 0xffffffe8, }, + new uint [] {0xffffffa8, 0x21, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xfffffff6, 0xffffffe9, }, new uint [] {0xffffffe4, 0xffffffe0, }, + new uint [] {0x24, 0xffffffa3, }, new uint [] {0x79, 0x59, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [10] = new KeyboardLayout (4108, "Swiss French keyboard layout", 0, 1, new uint [][] { + new uint [] {0xffffffa7, 0xffffffb0, }, new uint [] {0x31, 0x2b, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0x2a, }, + new uint [] {0x34, 0xffffffe7, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, }, + new uint [] {0x38, 0x28, }, new uint [] {0x39, 0x29, }, + new uint [] {0x30, 0x3d, }, new uint [] {0x27, 0x3f, }, + new uint [] {0x5e, 0x60, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x7a, 0x5a, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xffffffe8, 0xfffffffc, }, + new uint [] {0xffffffa8, 0x21, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xffffffe9, 0xfffffff6, }, new uint [] {0xffffffe0, 0xffffffe4, }, + new uint [] {0x24, 0xffffffa3, }, new uint [] {0x79, 0x59, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [11] = new KeyboardLayout (1053, "Swedish keyboard layout", 0, 5, new uint [][] { + new uint [] {0xffffffa7, 0xffffffbd, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0xffffffa4, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, }, + new uint [] {0x38, 0x28, }, new uint [] {0x39, 0x29, }, + new uint [] {0x30, 0x3d, }, new uint [] {0x2b, 0x3f, }, + new uint [] {0xffffffb4, 0x60, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xffffffe5, 0xffffffc5, }, + new uint [] {0xffffffa8, 0x5e, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xfffffff6, 0xffffffd6, }, new uint [] {0xffffffe4, 0xffffffc4, }, + new uint [] {0x27, 0x2a, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [12] = new KeyboardLayout (1061, "Estonian keyboard layout", 0, 0, new uint [][] { + new uint [] {0xffffffb7, 0x7e, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0xffffffa4, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, }, + new uint [] {0x38, 0x28, }, new uint [] {0x39, 0x29, }, + new uint [] {0x30, 0x3d, }, new uint [] {0x2b, 0x3f, }, + new uint [] {0xffffffb4, 0x60, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xfffffffc, 0xffffffdc, }, + new uint [] {0xfffffff5, 0xffffffd5, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xfffffff6, 0xffffffd6, }, new uint [] {0xffffffe4, 0xffffffc4, }, + new uint [] {0x27, 0x2a, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [13] = new KeyboardLayout (1044, "Norwegian keyboard layout", 0, 0, new uint [][] { + new uint [] {0x7c, 0xffffffa7, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, 0x40, }, new uint [] {0x33, 0x23, 0xffffffa3, }, + new uint [] {0x34, 0xffffffa4, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, 0x7b, }, + new uint [] {0x38, 0x28, 0x5b, }, new uint [] {0x39, 0x29, 0x5d, }, + new uint [] {0x30, 0x3d, 0x7d, }, new uint [] {0x2b, 0x3f, }, + new uint [] {0x5c, 0x60, 0xffffffb4, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xffffffe5, 0xffffffc5, }, + new uint [] {0xffffffa8, 0x5e, 0x7e, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xfffffff8, 0xffffffd8, }, new uint [] {0xffffffe6, 0xffffffc6, }, + new uint [] {0x27, 0x2a, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [14] = new KeyboardLayout (1030, "Danish keyboard layout", 0, 0, new uint [][] { + new uint [] {0xffffffbd, 0xffffffa7, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0xffffffa4, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, }, + new uint [] {0x38, 0x28, }, new uint [] {0x39, 0x29, }, + new uint [] {0x30, 0x3d, }, new uint [] {0x2b, 0x3f, }, + new uint [] {0xffffffb4, 0x60, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xffffffe5, 0xffffffc5, }, + new uint [] {0xffffffa8, 0x5e, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xffffffe6, 0xffffffc6, }, new uint [] {0xfffffff8, 0xffffffd8, }, + new uint [] {0x27, 0x2a, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [15] = new KeyboardLayout (1036, "French keyboard layout", 0, 4, new uint [][] { + new uint [] {0xffffffb2, }, new uint [] {0x26, 0x31, }, + new uint [] {0xffffffe9, 0x32, 0x7e, }, new uint [] {0x22, 0x33, 0x23, }, + new uint [] {0x27, 0x34, 0x7b, }, new uint [] {0x28, 0x35, 0x5b, }, + new uint [] {0x2d, 0x36, 0x7c, }, new uint [] {0xffffffe8, 0x37, 0x60, }, + new uint [] {0x5f, 0x38, 0x5c, }, new uint [] {0xffffffe7, 0x39, 0x5e, 0xffffffb1, }, + new uint [] {0xffffffe0, 0x30, 0x40, }, new uint [] {0x29, 0xffffffb0, 0x5d, }, + new uint [] {0x3d, 0x2b, 0x7d, }, new uint [] {0x61, 0x41, }, + new uint [] {0x7a, 0x5a, }, new uint [] {0x65, 0x45, 0xffffffbf, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0x5e, 0xffffffa8, }, + new uint [] {0x24, 0xffffffa3, 0xffffffa4, }, new uint [] {0x71, 0x51, }, + new uint [] {0x73, 0x53, 0xffffffdf, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0x6d, 0x4d, }, new uint [] {0xfffffff9, 0x25, }, + new uint [] {0x2a, 0xffffffb5, }, new uint [] {0x77, 0x57, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x2c, 0x3f, }, + new uint [] {0x3b, 0x2e, }, new uint [] {0x3a, 0x2f, }, + new uint [] {0x21, 0xffffffa7, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [16] = new KeyboardLayout (3084, "Canadian French keyboard layout", 0, 0, new uint [][] { + new uint [] {0x23, 0x7c, 0x5c, }, new uint [] {0x31, 0x21, 0xffffffb1, }, + new uint [] {0x32, 0x22, 0x40, }, new uint [] {0x33, 0x2f, 0xffffffa3, }, + new uint [] {0x34, 0x24, 0xffffffa2, }, new uint [] {0x35, 0x25, 0xffffffa4, }, + new uint [] {0x36, 0x3f, 0xffffffac, }, new uint [] {0x37, 0x26, 0xffffffa6, }, + new uint [] {0x38, 0x2a, 0xffffffb2, }, new uint [] {0x39, 0x28, 0xffffffb3, }, + new uint [] {0x30, 0x29, 0xffffffbc, }, new uint [] {0x2d, 0x5f, 0xffffffbd, }, + new uint [] {0x3d, 0x2b, 0xffffffbe, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, 0xffffffa7, }, + new uint [] {0x70, 0x50, 0xffffffb6, }, new uint [] {0x5e, 0x5e, 0x5b, }, + new uint [] {0xffffffb8, 0xffffffa8, 0x5d, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0x3b, 0x3a, 0x7e, }, new uint [] {0x60, 0x60, 0x7b, }, + new uint [] {0x3c, 0x3e, 0x7d, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x27, 0x2d, }, new uint [] {0x2e, }, + new uint [] {0xffffffe9, 0xffffffc9, }, new uint [] {0xffffffab, 0xffffffbb, 0xffffffb0, }, + new uint [] {}, }); + table [17] = new KeyboardLayout (3084, "Canadian French keyboard layout (CA_fr)", 0, 0, new uint [][] { + new uint [] {0x23, 0x7c, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0x2f, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x3f, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0x5e, 0x5e, }, + new uint [] {0xffffffb8, 0xffffffa8, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0x3b, 0x3a, }, new uint [] {0x60, 0x60, }, + new uint [] {0x3c, 0x3e, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x27, }, new uint [] {0x2e, }, + new uint [] {0xffffffe9, 0xffffffc9, }, new uint [] {0xffffffab, 0xffffffbb, }, + new uint [] {}, }); + table [18] = new KeyboardLayout (3084, "Canadian keyboard layout", 0, 0, new uint [][] { + new uint [] {0x2f, 0x5c, }, new uint [] {0x31, 0x21, 0xffffffb9, 0xffffffa1, }, + new uint [] {0x32, 0x40, 0xffffffb2, }, new uint [] {0x33, 0x23, 0xffffffb3, 0xffffffa3, }, + new uint [] {0x34, 0x24, 0xffffffbc, 0xffffffa4, }, new uint [] {0x35, 0x25, 0xffffffbd, }, + new uint [] {0x36, 0x3f, 0xffffffbe, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, 0xfffffff8, 0xffffffd8, }, + new uint [] {0x70, 0x50, 0xfffffffe, 0xffffffde, }, new uint [] {0x5e, 0xffffffa8, 0xffffffa8, }, + new uint [] {0xffffffe7, 0xffffffc7, 0x7e, }, new uint [] {0x61, 0x41, 0xffffffe6, 0xffffffc6, }, + new uint [] {0x73, 0x53, 0xffffffdf, 0xffffffa7, }, new uint [] {0x64, 0x44, 0xfffffff0, 0xffffffd0, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0x3b, 0x3a, 0xffffffb4, }, new uint [] {0xffffffe8, 0xffffffc8, }, + new uint [] {0xffffffe0, 0xffffffc0, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, 0xffffffa2, 0xffffffa9, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, 0xffffffb5, 0xffffffba, }, + new uint [] {0x2c, 0x27, }, new uint [] {0x2e, 0x22, 0xffffffb7, 0xfffffff7, }, + new uint [] {0xffffffe9, 0xffffffc9, }, new uint [] {0xfffffff9, 0xffffffd9, }, + new uint [] {}, }); + table [19] = new KeyboardLayout (2060, "Belgian keyboard layout", 0, 4, new uint [][] { + new uint [] {}, new uint [] {0x26, 0x31, 0x7c, }, + new uint [] {0xffffffe9, 0x32, 0x40, }, new uint [] {0x22, 0x33, 0x23, }, + new uint [] {0x27, 0x34, }, new uint [] {0x28, 0x35, }, + new uint [] {0xffffffa7, 0x36, 0x5e, }, new uint [] {0xffffffe8, 0x37, }, + new uint [] {0x21, 0x38, }, new uint [] {0xffffffe7, 0x39, 0x7b, }, + new uint [] {0xffffffe0, 0x30, 0x7d, }, new uint [] {0x29, 0xffffffb0, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x61, 0x41, }, + new uint [] {0x7a, 0x5a, }, new uint [] {0x65, 0x45, 0xffffffa4, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0x5e, 0xffffffa8, 0x5b, }, + new uint [] {0x24, 0x2a, 0x5d, }, new uint [] {0x71, 0x51, }, + new uint [] {0x73, 0x53, 0xffffffdf, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0x6d, 0x4d, }, new uint [] {0xfffffff9, 0x25, 0xffffffb4, }, + new uint [] {0xffffffb5, 0xffffffa3, 0x60, }, new uint [] {0x77, 0x57, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x2c, 0x3f, }, + new uint [] {0x3b, 0x2e, }, new uint [] {0x3a, 0x2f, }, + new uint [] {0x3d, 0x2b, 0x7e, }, new uint [] {0x3c, 0x3e, 0x5c, }, + new uint [] {}, }); + table [20] = new KeyboardLayout (2070, "Portuguese keyboard layout", 0, 0, new uint [][] { + new uint [] {0x5c, 0x7c, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, }, + new uint [] {0x38, 0x28, }, new uint [] {0x39, 0x29, }, + new uint [] {0x30, 0x3d, }, new uint [] {0x27, 0x3f, }, + new uint [] {0xffffffab, 0xffffffbb, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0x2b, 0x2a, }, + new uint [] {0xffffffb4, 0x60, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xffffffe7, 0xffffffc7, }, new uint [] {0xffffffba, 0xffffffaa, }, + new uint [] {0x7e, 0x5e, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [21] = new KeyboardLayout (1046, "Brazilian ABNT-2 keyboard layout", 2, 6, new uint [][] { + new uint [] {0x27, 0x22, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0xffffffa8, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xffffffb4, 0x60, }, + new uint [] {0x5b, 0x7b, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xffffffe7, 0xffffffc7, }, new uint [] {0x7e, 0x5e, }, + new uint [] {0x5d, 0x7d, }, new uint [] {0x5c, 0x7c, }, + new uint [] {0x7a, 0x5a, }, new uint [] {0x78, 0x58, }, + new uint [] {0x63, 0x43, }, new uint [] {0x76, 0x56, }, + new uint [] {0x62, 0x42, }, new uint [] {0x6e, 0x4e, }, + new uint [] {0x6d, 0x4d, }, new uint [] {0x2c, 0x3c, }, + new uint [] {0x2e, 0x3e, }, new uint [] {0x3b, 0x3a, }, + new uint [] {0x2f, 0x3f, }, }); + table [22] = new KeyboardLayout (1046, "Brazilian ABNT-2 keyboard layout ALT GR", 2, 6, new uint [][] { + new uint [] {0x27, 0x22, }, new uint [] {0x31, 0x21, 0x39, }, + new uint [] {0x32, 0x40, 0x32, }, new uint [] {0x33, 0x23, 0x33, }, + new uint [] {0x34, 0x24, 0x23, }, new uint [] {0x35, 0x25, 0x22, }, + new uint [] {0x36, 0x28, 0x2c, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, 0x27, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0x34, 0x60, }, + new uint [] {0x5b, 0x7b, 0x2a, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0x67, 0x47, }, new uint [] {0x7e, 0x5e, }, + new uint [] {0x5d, 0x7d, 0x3a, }, new uint [] {0x5c, 0x7c, }, + new uint [] {0x7a, 0x5a, }, new uint [] {0x78, 0x58, }, + new uint [] {0x63, 0x43, }, new uint [] {0x76, 0x56, }, + new uint [] {0x62, 0x42, }, new uint [] {0x6e, 0x4e, }, + new uint [] {0x6d, 0x4d, }, new uint [] {0x2c, 0x3c, }, + new uint [] {0x2e, 0x3e, }, new uint [] {0x3b, 0x3a, }, + new uint [] {0x2f, 0x3f, 0x30, }, }); + table [23] = new KeyboardLayout (1035, "Finnish keyboard layout", 0, 0, new uint [][] { + new uint [] {0xffffffa7, 0xffffffbd, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0xffffffa4, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, }, + new uint [] {0x38, 0x28, }, new uint [] {0x39, 0x29, }, + new uint [] {0x30, 0x3d, }, new uint [] {0x2b, 0x3f, }, + new uint [] {0xffffffb4, 0x60, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xffffffe5, 0xffffffc5, }, + new uint [] {0xffffffa8, 0x5e, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xfffffff6, 0xffffffd6, }, new uint [] {0xffffffe4, 0xffffffc4, }, + new uint [] {0x27, 0x2a, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [24] = new KeyboardLayout (1026, "Bulgarian bds keyboard layout", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, 0x28, 0x29, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, 0x32, 0x3f, }, new uint [] {0x33, 0x23, 0x33, 0x2b, }, + new uint [] {0x34, 0x24, 0x34, 0x22, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, 0x36, 0x3d, }, new uint [] {0x37, 0x26, 0x37, 0x3a, }, + new uint [] {0x38, 0x2a, 0x38, 0x2f, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, 0x2d, 0x49, }, + new uint [] {0x3d, 0x2b, 0x2e, 0x56, }, new uint [] {0x71, 0x51, 0x2c, 0xfffffffb, }, + new uint [] {0x77, 0x57, 0xfffffff3, 0xffffffd3, }, new uint [] {0x65, 0x45, 0xffffffe5, 0xffffffc5, }, + new uint [] {0x72, 0x52, 0xffffffe8, 0xffffffc8, }, new uint [] {0x74, 0x54, 0xfffffff8, 0xffffffd8, }, + new uint [] {0x79, 0x59, 0xfffffff9, 0xffffffd9, }, new uint [] {0x75, 0x55, 0xffffffea, 0xffffffca, }, + new uint [] {0x69, 0x49, 0xfffffff1, 0xffffffd1, }, new uint [] {0x6f, 0x4f, 0xffffffe4, 0xffffffc4, }, + new uint [] {0x70, 0x50, 0xffffffe7, 0xffffffc7, }, new uint [] {0x5b, 0x7b, 0xfffffff6, 0xffffffd6, }, + new uint [] {0x5d, 0x7d, 0x3b, }, new uint [] {0x61, 0x41, 0xfffffffc, 0xffffffdc, }, + new uint [] {0x73, 0x53, 0xffffffff, 0xffffffdf, }, new uint [] {0x64, 0x44, 0xffffffe0, 0xffffffc0, }, + new uint [] {0x66, 0x46, 0xffffffee, 0xffffffce, }, new uint [] {0x67, 0x47, 0xffffffe6, 0xffffffc6, }, + new uint [] {0x68, 0x48, 0xffffffe3, 0xffffffc3, }, new uint [] {0x6a, 0x4a, 0xfffffff2, 0xffffffd2, }, + new uint [] {0x6b, 0x4b, 0xffffffed, 0xffffffcd, }, new uint [] {0x6c, 0x4c, 0xffffffe2, 0xffffffc2, }, + new uint [] {0x3b, 0x3a, 0xffffffec, 0xffffffcc, }, new uint [] {0x27, 0x22, 0xfffffff7, 0xffffffd7, }, + new uint [] {0x5c, 0x7c, 0x27, 0xffffffdb, }, new uint [] {0x7a, 0x5a, 0xfffffffe, 0xffffffde, }, + new uint [] {0x78, 0x58, 0xffffffe9, 0xffffffc9, }, new uint [] {0x63, 0x43, 0xfffffffa, 0xffffffda, }, + new uint [] {0x76, 0x56, 0xfffffffd, 0xffffffdd, }, new uint [] {0x62, 0x42, 0xfffffff4, 0xffffffd4, }, + new uint [] {0x6e, 0x4e, 0xfffffff5, 0xffffffd5, }, new uint [] {0x6d, 0x4d, 0xffffffef, 0xffffffcf, }, + new uint [] {0x2c, 0x3c, 0xfffffff0, 0xffffffd0, }, new uint [] {0x2e, 0x3e, 0xffffffeb, 0xffffffcb, }, + new uint [] {0x2f, 0x3f, 0xffffffe1, 0xffffffc1, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [25] = new KeyboardLayout (1026, "Bulgarian phonetic keyboard layout", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, 0xfffffff7, 0xffffffd7, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, 0xffffffff, 0xffffffdf, }, + new uint [] {0x77, 0x57, 0xffffffe2, 0xffffffc2, }, new uint [] {0x65, 0x45, 0xffffffe5, 0xffffffc5, }, + new uint [] {0x72, 0x52, 0xfffffff0, 0xffffffd0, }, new uint [] {0x74, 0x54, 0xfffffff2, 0xffffffd2, }, + new uint [] {0x79, 0x59, 0xfffffffa, 0xffffffda, }, new uint [] {0x75, 0x55, 0xfffffff3, 0xffffffd3, }, + new uint [] {0x69, 0x49, 0xffffffe8, 0xffffffc8, }, new uint [] {0x6f, 0x4f, 0xffffffee, 0xffffffce, }, + new uint [] {0x70, 0x50, 0xffffffef, 0xffffffcf, }, new uint [] {0x5b, 0x7b, 0xfffffff8, 0xffffffd8, }, + new uint [] {0x5d, 0x7d, 0xfffffff9, 0xffffffd9, }, new uint [] {0x61, 0x41, 0xffffffe0, 0xffffffc0, }, + new uint [] {0x73, 0x53, 0xfffffff1, 0xffffffd1, }, new uint [] {0x64, 0x44, 0xffffffe4, 0xffffffc4, }, + new uint [] {0x66, 0x46, 0xfffffff4, 0xffffffd4, }, new uint [] {0x67, 0x47, 0xffffffe3, 0xffffffc3, }, + new uint [] {0x68, 0x48, 0xfffffff5, 0xffffffd5, }, new uint [] {0x6a, 0x4a, 0xffffffe9, 0xffffffc9, }, + new uint [] {0x6b, 0x4b, 0xffffffea, 0xffffffca, }, new uint [] {0x6c, 0x4c, 0xffffffeb, 0xffffffcb, }, + new uint [] {0x3b, 0x3a, }, new uint [] {0x27, 0x22, }, + new uint [] {0x5c, 0x7c, 0xfffffffe, 0xffffffde, }, new uint [] {0x7a, 0x5a, 0xffffffe7, 0xffffffc7, }, + new uint [] {0x78, 0x58, 0xfffffffc, 0xffffffdc, }, new uint [] {0x63, 0x43, 0xfffffff6, 0xffffffd6, }, + new uint [] {0x76, 0x56, 0xffffffe6, 0xffffffc6, }, new uint [] {0x62, 0x42, 0xffffffe1, 0xffffffc1, }, + new uint [] {0x6e, 0x4e, 0xffffffed, 0xffffffcd, }, new uint [] {0x6d, 0x4d, 0xffffffec, 0xffffffcc, }, + new uint [] {0x2c, 0x3c, }, new uint [] {0x2e, 0x3e, }, + new uint [] {0x2f, 0x3f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [26] = new KeyboardLayout (1059, "Belarusian keyboard layout", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, 0xffffffa3, 0xffffffb3, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, 0xffffffca, 0xffffffea, }, + new uint [] {0x77, 0x57, 0xffffffc3, 0xffffffe3, }, new uint [] {0x65, 0x45, 0xffffffd5, 0xfffffff5, }, + new uint [] {0x72, 0x52, 0xffffffcb, 0xffffffeb, }, new uint [] {0x74, 0x54, 0xffffffc5, 0xffffffe5, }, + new uint [] {0x79, 0x59, 0xffffffce, 0xffffffee, }, new uint [] {0x75, 0x55, 0xffffffc7, 0xffffffe7, }, + new uint [] {0x69, 0x49, 0xffffffdb, 0xfffffffb, }, new uint [] {0x6f, 0x4f, 0xffffffae, 0xffffffbe, }, + new uint [] {0x70, 0x50, 0xffffffda, 0xfffffffa, }, new uint [] {0x5b, 0x7b, 0xffffffc8, 0xffffffe8, }, + new uint [] {0x5d, 0x7d, 0x27, 0x27, }, new uint [] {0x61, 0x41, 0xffffffc6, 0xffffffe6, }, + new uint [] {0x73, 0x53, 0xffffffd9, 0xfffffff9, }, new uint [] {0x64, 0x44, 0xffffffd7, 0xfffffff7, }, + new uint [] {0x66, 0x46, 0xffffffc1, 0xffffffe1, }, new uint [] {0x67, 0x47, 0xffffffd0, 0xfffffff0, }, + new uint [] {0x68, 0x48, 0xffffffd2, 0xfffffff2, }, new uint [] {0x6a, 0x4a, 0xffffffcf, 0xffffffef, }, + new uint [] {0x6b, 0x4b, 0xffffffcc, 0xffffffec, }, new uint [] {0x6c, 0x4c, 0xffffffc4, 0xffffffe4, }, + new uint [] {0x3b, 0x3a, 0xffffffd6, 0xfffffff6, }, new uint [] {0x27, 0x22, 0xffffffdc, 0xfffffffc, }, + new uint [] {0x5c, 0x7c, 0x2f, 0x7c, }, new uint [] {0x7a, 0x5a, 0xffffffd1, 0xfffffff1, }, + new uint [] {0x78, 0x58, 0xffffffde, 0xfffffffe, }, new uint [] {0x63, 0x43, 0xffffffd3, 0xfffffff3, }, + new uint [] {0x76, 0x56, 0xffffffcd, 0xffffffed, }, new uint [] {0x62, 0x42, 0xffffffa6, 0xffffffb6, }, + new uint [] {0x6e, 0x4e, 0xffffffd4, 0xfffffff4, }, new uint [] {0x6d, 0x4d, 0xffffffd8, 0xfffffff8, }, + new uint [] {0x2c, 0x3c, 0xffffffc2, 0xffffffe2, }, new uint [] {0x2e, 0x3e, 0xffffffc0, 0xffffffe0, }, + new uint [] {0x2f, 0x3f, 0x2e, 0x2c, }, new uint [] {0x3c, 0x3e, 0x7c, 0xffffffa6, }, + new uint [] {}, }); + table [27] = new KeyboardLayout (1049, "Russian keyboard layout", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, 0xffffffca, 0xffffffea, }, + new uint [] {0x77, 0x57, 0xffffffc3, 0xffffffe3, }, new uint [] {0x65, 0x45, 0xffffffd5, 0xfffffff5, }, + new uint [] {0x72, 0x52, 0xffffffcb, 0xffffffeb, }, new uint [] {0x74, 0x54, 0xffffffc5, 0xffffffe5, }, + new uint [] {0x79, 0x59, 0xffffffce, 0xffffffee, }, new uint [] {0x75, 0x55, 0xffffffc7, 0xffffffe7, }, + new uint [] {0x69, 0x49, 0xffffffdb, 0xfffffffb, }, new uint [] {0x6f, 0x4f, 0xffffffdd, 0xfffffffd, }, + new uint [] {0x70, 0x50, 0xffffffda, 0xfffffffa, }, new uint [] {0x5b, 0x7b, 0xffffffc8, 0xffffffe8, }, + new uint [] {0x5d, 0x7d, 0xffffffdf, 0xffffffff, }, new uint [] {0x61, 0x41, 0xffffffc6, 0xffffffe6, }, + new uint [] {0x73, 0x53, 0xffffffd9, 0xfffffff9, }, new uint [] {0x64, 0x44, 0xffffffd7, 0xfffffff7, }, + new uint [] {0x66, 0x46, 0xffffffc1, 0xffffffe1, }, new uint [] {0x67, 0x47, 0xffffffd0, 0xfffffff0, }, + new uint [] {0x68, 0x48, 0xffffffd2, 0xfffffff2, }, new uint [] {0x6a, 0x4a, 0xffffffcf, 0xffffffef, }, + new uint [] {0x6b, 0x4b, 0xffffffcc, 0xffffffec, }, new uint [] {0x6c, 0x4c, 0xffffffc4, 0xffffffe4, }, + new uint [] {0x3b, 0x3a, 0xffffffd6, 0xfffffff6, }, new uint [] {0x27, 0x22, 0xffffffdc, 0xfffffffc, }, + new uint [] {0x5c, 0x7c, }, new uint [] {0x7a, 0x5a, 0xffffffd1, 0xfffffff1, }, + new uint [] {0x78, 0x58, 0xffffffde, 0xfffffffe, }, new uint [] {0x63, 0x43, 0xffffffd3, 0xfffffff3, }, + new uint [] {0x76, 0x56, 0xffffffcd, 0xffffffed, }, new uint [] {0x62, 0x42, 0xffffffc9, 0xffffffe9, }, + new uint [] {0x6e, 0x4e, 0xffffffd4, 0xfffffff4, }, new uint [] {0x6d, 0x4d, 0xffffffd8, 0xfffffff8, }, + new uint [] {0x2c, 0x3c, 0xffffffc2, 0xffffffe2, }, new uint [] {0x2e, 0x3e, 0xffffffc0, 0xffffffe0, }, + new uint [] {0x2f, 0x3f, }, new uint [] {}, + new uint [] {}, }); + table [28] = new KeyboardLayout (1049, "Russian keyboard layout (phantom key version)", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, 0xffffffca, 0xffffffea, }, + new uint [] {0x77, 0x57, 0xffffffc3, 0xffffffe3, }, new uint [] {0x65, 0x45, 0xffffffd5, 0xfffffff5, }, + new uint [] {0x72, 0x52, 0xffffffcb, 0xffffffeb, }, new uint [] {0x74, 0x54, 0xffffffc5, 0xffffffe5, }, + new uint [] {0x79, 0x59, 0xffffffce, 0xffffffee, }, new uint [] {0x75, 0x55, 0xffffffc7, 0xffffffe7, }, + new uint [] {0x69, 0x49, 0xffffffdb, 0xfffffffb, }, new uint [] {0x6f, 0x4f, 0xffffffdd, 0xfffffffd, }, + new uint [] {0x70, 0x50, 0xffffffda, 0xfffffffa, }, new uint [] {0x5b, 0x7b, 0xffffffc8, 0xffffffe8, }, + new uint [] {0x5d, 0x7d, 0xffffffdf, 0xffffffff, }, new uint [] {0x61, 0x41, 0xffffffc6, 0xffffffe6, }, + new uint [] {0x73, 0x53, 0xffffffd9, 0xfffffff9, }, new uint [] {0x64, 0x44, 0xffffffd7, 0xfffffff7, }, + new uint [] {0x66, 0x46, 0xffffffc1, 0xffffffe1, }, new uint [] {0x67, 0x47, 0xffffffd0, 0xfffffff0, }, + new uint [] {0x68, 0x48, 0xffffffd2, 0xfffffff2, }, new uint [] {0x6a, 0x4a, 0xffffffcf, 0xffffffef, }, + new uint [] {0x6b, 0x4b, 0xffffffcc, 0xffffffec, }, new uint [] {0x6c, 0x4c, 0xffffffc4, 0xffffffe4, }, + new uint [] {0x3b, 0x3a, 0xffffffd6, 0xfffffff6, }, new uint [] {0x27, 0x22, 0xffffffdc, 0xfffffffc, }, + new uint [] {0x5c, 0x7c, }, new uint [] {0x7a, 0x5a, 0xffffffd1, 0xfffffff1, }, + new uint [] {0x78, 0x58, 0xffffffde, 0xfffffffe, }, new uint [] {0x63, 0x43, 0xffffffd3, 0xfffffff3, }, + new uint [] {0x76, 0x56, 0xffffffcd, 0xffffffed, }, new uint [] {0x62, 0x42, 0xffffffc9, 0xffffffe9, }, + new uint [] {0x6e, 0x4e, 0xffffffd4, 0xfffffff4, }, new uint [] {0x6d, 0x4d, 0xffffffd8, 0xfffffff8, }, + new uint [] {0x2c, 0x3c, 0xffffffc2, 0xffffffe2, }, new uint [] {0x2e, 0x3e, 0xffffffc0, 0xffffffe0, }, + new uint [] {0x2f, 0x3f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [29] = new KeyboardLayout (1049, "Russian keyboard layout KOI8-R", 0, 0, new uint [][] { + new uint [] {0x28, 0x29, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0x2f, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x3a, }, + new uint [] {0x36, 0x2c, }, new uint [] {0x37, 0x2e, }, + new uint [] {0x38, 0x3b, }, new uint [] {0x39, 0x3f, }, + new uint [] {0x30, 0x25, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0xffffffca, 0xffffffea, }, + new uint [] {0xffffffc3, 0xffffffe3, }, new uint [] {0xffffffd5, 0xfffffff5, }, + new uint [] {0xffffffcb, 0xffffffeb, }, new uint [] {0xffffffc5, 0xffffffe5, }, + new uint [] {0xffffffce, 0xffffffee, }, new uint [] {0xffffffc7, 0xffffffe7, }, + new uint [] {0xffffffdb, 0xfffffffb, }, new uint [] {0xffffffdd, 0xfffffffd, }, + new uint [] {0xffffffda, 0xfffffffa, }, new uint [] {0xffffffc8, 0xffffffe8, }, + new uint [] {0xffffffdf, 0xffffffff, }, new uint [] {0xffffffc6, 0xffffffe6, }, + new uint [] {0xffffffd9, 0xfffffff9, }, new uint [] {0xffffffd7, 0xfffffff7, }, + new uint [] {0xffffffc1, 0xffffffe1, }, new uint [] {0xffffffd0, 0xfffffff0, }, + new uint [] {0xffffffd2, 0xfffffff2, }, new uint [] {0xffffffcf, 0xffffffef, }, + new uint [] {0xffffffcc, 0xffffffec, }, new uint [] {0xffffffc4, 0xffffffe4, }, + new uint [] {0xffffffd6, 0xfffffff6, }, new uint [] {0xffffffdc, 0xfffffffc, }, + new uint [] {0x5c, 0x7c, }, new uint [] {0xffffffd1, 0xfffffff1, }, + new uint [] {0xffffffde, 0xfffffffe, }, new uint [] {0xffffffd3, 0xfffffff3, }, + new uint [] {0xffffffcd, 0xffffffed, }, new uint [] {0xffffffc9, 0xffffffe9, }, + new uint [] {0xffffffd4, 0xfffffff4, }, new uint [] {0xffffffd8, 0xfffffff8, }, + new uint [] {0xffffffc2, 0xffffffe2, }, new uint [] {0xffffffc0, 0xffffffe0, }, + new uint [] {0x2f, 0x3f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [30] = new KeyboardLayout (1049, "Russian keyboard layout cp1251", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, 0xffffffe9, 0xffffffc9, }, + new uint [] {0x77, 0x57, 0xfffffff6, 0xffffffd6, }, new uint [] {0x65, 0x45, 0xfffffff3, 0xffffffd3, }, + new uint [] {0x72, 0x52, 0xffffffea, 0xffffffca, }, new uint [] {0x74, 0x54, 0xffffffe5, 0xffffffc5, }, + new uint [] {0x79, 0x59, 0xffffffed, 0xffffffcd, }, new uint [] {0x75, 0x55, 0xffffffe3, 0xffffffc3, }, + new uint [] {0x69, 0x49, 0xfffffff8, 0xffffffd8, }, new uint [] {0x6f, 0x4f, 0xfffffff9, 0xffffffd9, }, + new uint [] {0x70, 0x50, 0xffffffe7, 0xffffffc7, }, new uint [] {0x5b, 0x7b, 0xfffffff5, 0xffffffd5, }, + new uint [] {0x5d, 0x7d, 0xfffffffa, 0xffffffda, }, new uint [] {0x61, 0x41, 0xfffffff4, 0xffffffd4, }, + new uint [] {0x73, 0x53, 0xfffffffb, 0xffffffdb, }, new uint [] {0x64, 0x44, 0xffffffe2, 0xffffffc2, }, + new uint [] {0x66, 0x46, 0xffffffe0, 0xffffffc0, }, new uint [] {0x67, 0x47, 0xffffffef, 0xffffffcf, }, + new uint [] {0x68, 0x48, 0xfffffff0, 0xffffffd0, }, new uint [] {0x6a, 0x4a, 0xffffffee, 0xffffffce, }, + new uint [] {0x6b, 0x4b, 0xffffffeb, 0xffffffcb, }, new uint [] {0x6c, 0x4c, 0xffffffe4, 0xffffffc4, }, + new uint [] {0x3b, 0x3a, 0xffffffe6, 0xffffffc6, }, new uint [] {0x27, 0x22, 0xfffffffd, 0xffffffdd, }, + new uint [] {0x5c, 0x7c, }, new uint [] {0x7a, 0x5a, 0xffffffff, 0xffffffdf, }, + new uint [] {0x78, 0x58, 0xfffffff7, 0xffffffd7, }, new uint [] {0x63, 0x43, 0xfffffff1, 0xffffffd1, }, + new uint [] {0x76, 0x56, 0xffffffec, 0xffffffcc, }, new uint [] {0x62, 0x42, 0xffffffe8, 0xffffffc8, }, + new uint [] {0x6e, 0x4e, 0xfffffff2, 0xffffffd2, }, new uint [] {0x6d, 0x4d, 0xfffffffc, 0xffffffdc, }, + new uint [] {0x2c, 0x3c, 0xffffffe1, 0xffffffc1, }, new uint [] {0x2e, 0x3e, 0xfffffffe, 0xffffffde, }, + new uint [] {0x2f, 0x3f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [31] = new KeyboardLayout (1049, "Russian phonetic keyboard layout", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, 0xffffffd1, 0xfffffff1, }, + new uint [] {0x77, 0x57, 0xffffffd7, 0xfffffff7, }, new uint [] {0x65, 0x45, 0xffffffc5, 0xffffffe5, }, + new uint [] {0x72, 0x52, 0xffffffd2, 0xfffffff2, }, new uint [] {0x74, 0x54, 0xffffffd4, 0xfffffff4, }, + new uint [] {0x79, 0x59, 0xffffffd9, 0xfffffff9, }, new uint [] {0x75, 0x55, 0xffffffd5, 0xfffffff5, }, + new uint [] {0x69, 0x49, 0xffffffc9, 0xffffffe9, }, new uint [] {0x6f, 0x4f, 0xffffffcf, 0xffffffef, }, + new uint [] {0x70, 0x50, 0xffffffd0, 0xfffffff0, }, new uint [] {0x5b, 0x7b, 0xffffffdb, 0xfffffffb, }, + new uint [] {0x5d, 0x7d, 0xffffffdd, 0xfffffffd, }, new uint [] {0x61, 0x41, 0xffffffc1, 0xffffffe1, }, + new uint [] {0x73, 0x53, 0xffffffd3, 0xfffffff3, }, new uint [] {0x64, 0x44, 0xffffffc4, 0xffffffe4, }, + new uint [] {0x66, 0x46, 0xffffffc6, 0xffffffe6, }, new uint [] {0x67, 0x47, 0xffffffc7, 0xffffffe7, }, + new uint [] {0x68, 0x48, 0xffffffc8, 0xffffffe8, }, new uint [] {0x6a, 0x4a, 0xffffffca, 0xffffffea, }, + new uint [] {0x6b, 0x4b, 0xffffffcb, 0xffffffeb, }, new uint [] {0x6c, 0x4c, 0xffffffcc, 0xffffffec, }, + new uint [] {0x3b, 0x3a, }, new uint [] {0x27, 0x22, }, + new uint [] {0x5c, 0x7c, }, new uint [] {0x7a, 0x5a, 0xffffffda, 0xfffffffa, }, + new uint [] {0x78, 0x58, 0xffffffd8, 0xfffffff8, }, new uint [] {0x63, 0x43, 0xffffffc3, 0xffffffe3, }, + new uint [] {0x76, 0x56, 0xffffffd6, 0xfffffff6, }, new uint [] {0x62, 0x42, 0xffffffc2, 0xffffffe2, }, + new uint [] {0x6e, 0x4e, 0xffffffce, 0xffffffee, }, new uint [] {0x6d, 0x4d, 0xffffffcd, 0xffffffed, }, + new uint [] {0x2c, 0x3c, }, new uint [] {0x2e, 0x3e, }, + new uint [] {0x2f, 0x3f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [32] = new KeyboardLayout (1058, "Ukrainian keyboard layout KOI8-U", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, 0xffffffad, 0xffffffbd, }, new uint [] {0x31, 0x21, 0x31, 0x21, }, + new uint [] {0x32, 0x40, 0x32, 0x22, }, new uint [] {0x33, 0x23, 0x33, 0x27, }, + new uint [] {0x34, 0x24, 0x34, 0x2a, }, new uint [] {0x35, 0x25, 0x35, 0x3a, }, + new uint [] {0x36, 0x5e, 0x36, 0x2c, }, new uint [] {0x37, 0x26, 0x37, 0x2e, }, + new uint [] {0x38, 0x2a, 0x38, 0x3b, }, new uint [] {0x39, 0x28, 0x39, 0x28, }, + new uint [] {0x30, 0x29, 0x30, 0x29, }, new uint [] {0x2d, 0x5f, 0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, 0x3d, 0x2b, }, new uint [] {0x71, 0x51, 0xffffffca, 0xffffffea, }, + new uint [] {0x77, 0x57, 0xffffffc3, 0xffffffe3, }, new uint [] {0x65, 0x45, 0xffffffd5, 0xfffffff5, }, + new uint [] {0x72, 0x52, 0xffffffcb, 0xffffffeb, }, new uint [] {0x74, 0x54, 0xffffffc5, 0xffffffe5, }, + new uint [] {0x79, 0x59, 0xffffffce, 0xffffffee, }, new uint [] {0x75, 0x55, 0xffffffc7, 0xffffffe7, }, + new uint [] {0x69, 0x49, 0xffffffdb, 0xfffffffb, }, new uint [] {0x6f, 0x4f, 0xffffffdd, 0xfffffffd, }, + new uint [] {0x70, 0x50, 0xffffffda, 0xfffffffa, }, new uint [] {0x5b, 0x7b, 0xffffffc8, 0xffffffe8, }, + new uint [] {0x5d, 0x7d, 0xffffffa7, 0xffffffb7, }, new uint [] {0x61, 0x41, 0xffffffc6, 0xffffffe6, }, + new uint [] {0x73, 0x53, 0xffffffa6, 0xffffffb6, }, new uint [] {0x64, 0x44, 0xffffffd7, 0xfffffff7, }, + new uint [] {0x66, 0x46, 0xffffffc1, 0xffffffe1, }, new uint [] {0x67, 0x47, 0xffffffd0, 0xfffffff0, }, + new uint [] {0x68, 0x48, 0xffffffd2, 0xfffffff2, }, new uint [] {0x6a, 0x4a, 0xffffffcf, 0xffffffef, }, + new uint [] {0x6b, 0x4b, 0xffffffcc, 0xffffffec, }, new uint [] {0x6c, 0x4c, 0xffffffc4, 0xffffffe4, }, + new uint [] {0x3b, 0x3a, 0xffffffd6, 0xfffffff6, }, new uint [] {0x27, 0x22, 0xffffffa4, 0xffffffb4, }, + new uint [] {0x5c, 0x7c, 0x5c, 0x7c, }, new uint [] {0x7a, 0x5a, 0xffffffd1, 0xfffffff1, }, + new uint [] {0x78, 0x58, 0xffffffde, 0xfffffffe, }, new uint [] {0x63, 0x43, 0xffffffd3, 0xfffffff3, }, + new uint [] {0x76, 0x56, 0xffffffcd, 0xffffffed, }, new uint [] {0x62, 0x42, 0xffffffc9, 0xffffffe9, }, + new uint [] {0x6e, 0x4e, 0xffffffd4, 0xfffffff4, }, new uint [] {0x6d, 0x4d, 0xffffffd8, 0xfffffff8, }, + new uint [] {0x2c, 0x3c, 0xffffffc2, 0xffffffe2, }, new uint [] {0x2e, 0x3e, 0xffffffc0, 0xffffffe0, }, + new uint [] {0x2f, 0x3f, 0x2f, 0x3f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [33] = new KeyboardLayout (1058, "Ukrainian keyboard layout (standard)", 0, 0, new uint [][] { + new uint [] {0xffffffad, 0xffffffbd, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0x27, }, + new uint [] {0x34, 0x3b, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x3a, }, new uint [] {0x37, 0x3f, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0xffffffca, 0xffffffea, }, + new uint [] {0xffffffc3, 0xffffffe3, }, new uint [] {0xffffffd5, 0xfffffff5, }, + new uint [] {0xffffffcb, 0xffffffeb, }, new uint [] {0xffffffc5, 0xffffffe5, }, + new uint [] {0xffffffce, 0xffffffee, }, new uint [] {0xffffffc7, 0xffffffe7, }, + new uint [] {0xffffffdb, 0xfffffffb, }, new uint [] {0xffffffdd, 0xfffffffd, }, + new uint [] {0xffffffda, 0xfffffffa, }, new uint [] {0xffffffc8, 0xffffffe8, }, + new uint [] {0xffffffa7, 0xffffffb7, }, new uint [] {0xffffffc6, 0xffffffe6, }, + new uint [] {0xffffffa6, 0xffffffb6, }, new uint [] {0xffffffd7, 0xfffffff7, }, + new uint [] {0xffffffc1, 0xffffffe1, }, new uint [] {0xffffffd0, 0xfffffff0, }, + new uint [] {0xffffffd2, 0xfffffff2, }, new uint [] {0xffffffcf, 0xffffffef, }, + new uint [] {0xffffffcc, 0xffffffec, }, new uint [] {0xffffffc4, 0xffffffe4, }, + new uint [] {0xffffffd6, 0xfffffff6, }, new uint [] {0xffffffa4, 0xffffffb4, }, + new uint [] {0x5c, 0x2f, }, new uint [] {0xffffffd1, 0xfffffff1, }, + new uint [] {0xffffffde, 0xfffffffe, }, new uint [] {0xffffffd3, 0xfffffff3, }, + new uint [] {0xffffffcd, 0xffffffed, }, new uint [] {0xffffffc9, 0xffffffe9, }, + new uint [] {0xffffffd4, 0xfffffff4, }, new uint [] {0xffffffd8, 0xfffffff8, }, + new uint [] {0xffffffc2, 0xffffffe2, }, new uint [] {0xffffffc0, 0xffffffe0, }, + new uint [] {0x2e, 0x2c, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [34] = new KeyboardLayout (1049, "Russian keyboard layout (standard)", 0, 0, new uint [][] { + new uint [] {0xffffffa3, 0xffffffb3, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0x27, }, + new uint [] {0x34, 0x3b, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x3a, }, new uint [] {0x37, 0x3f, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0xffffffca, 0xffffffea, }, + new uint [] {0xffffffc3, 0xffffffe3, }, new uint [] {0xffffffd5, 0xfffffff5, }, + new uint [] {0xffffffcb, 0xffffffeb, }, new uint [] {0xffffffc5, 0xffffffe5, }, + new uint [] {0xffffffce, 0xffffffee, }, new uint [] {0xffffffc7, 0xffffffe7, }, + new uint [] {0xffffffdb, 0xfffffffb, }, new uint [] {0xffffffdd, 0xfffffffd, }, + new uint [] {0xffffffda, 0xfffffffa, }, new uint [] {0xffffffc8, 0xffffffe8, }, + new uint [] {0xffffffdf, 0xffffffff, }, new uint [] {0xffffffc6, 0xffffffe6, }, + new uint [] {0xffffffd9, 0xfffffff9, }, new uint [] {0xffffffd7, 0xfffffff7, }, + new uint [] {0xffffffc1, 0xffffffe1, }, new uint [] {0xffffffd0, 0xfffffff0, }, + new uint [] {0xffffffd2, 0xfffffff2, }, new uint [] {0xffffffcf, 0xffffffef, }, + new uint [] {0xffffffcc, 0xffffffec, }, new uint [] {0xffffffc4, 0xffffffe4, }, + new uint [] {0xffffffd6, 0xfffffff6, }, new uint [] {0xffffffdc, 0xfffffffc, }, + new uint [] {0x5c, 0x2f, }, new uint [] {0xffffffd1, 0xfffffff1, }, + new uint [] {0xffffffde, 0xfffffffe, }, new uint [] {0xffffffd3, 0xfffffff3, }, + new uint [] {0xffffffcd, 0xffffffed, }, new uint [] {0xffffffc9, 0xffffffe9, }, + new uint [] {0xffffffd4, 0xfffffff4, }, new uint [] {0xffffffd8, 0xfffffff8, }, + new uint [] {0xffffffc2, 0xffffffe2, }, new uint [] {0xffffffc0, 0xffffffe0, }, + new uint [] {0x2e, 0x2c, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [35] = new KeyboardLayout (1034, "Spanish keyboard layout", 0, 0, new uint [][] { + new uint [] {0xffffffba, 0xffffffaa, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0xffffffb7, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, }, + new uint [] {0x38, 0x28, }, new uint [] {0x39, 0x29, }, + new uint [] {0x30, 0x3d, }, new uint [] {0x27, 0x3f, }, + new uint [] {0xffffffa1, 0xffffffbf, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0x60, 0x5e, }, + new uint [] {0x2b, 0x2a, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xfffffff1, 0xffffffd1, }, new uint [] {0xffffffb4, 0xffffffa8, }, + new uint [] {0xffffffe7, 0xffffffc7, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [36] = new KeyboardLayout (1040, "Italian keyboard layout", 0, 0, new uint [][] { + new uint [] {0x5c, 0x7c, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0xffffffa3, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, }, + new uint [] {0x38, 0x28, }, new uint [] {0x39, 0x29, }, + new uint [] {0x30, 0x3d, }, new uint [] {0x27, 0x3f, }, + new uint [] {0xffffffec, 0x5e, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xffffffe8, 0xffffffe9, }, + new uint [] {0x2b, 0x2a, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xfffffff2, 0xffffffe7, }, new uint [] {0xffffffe0, 0xffffffb0, }, + new uint [] {0xfffffff9, 0xffffffa7, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [37] = new KeyboardLayout (1039, "Icelandic keyboard layout", 0, 0, new uint [][] { + new uint [] {0xffffffb0, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, }, + new uint [] {0x38, 0x28, }, new uint [] {0x39, 0x29, }, + new uint [] {0x30, 0x3d, }, new uint [] {0xfffffff6, 0xffffffd6, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xfffffff0, 0xffffffd0, }, + new uint [] {0x27, 0x3f, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xffffffe6, 0xffffffc6, }, new uint [] {0xffffffb4, 0xffffffc4, }, + new uint [] {0x2b, 0x2a, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0xfffffffe, 0xffffffde, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [38] = new KeyboardLayout (1038, "Hungarian keyboard layout", 0, 1, new uint [][] { + new uint [] {0x30, 0xffffffa7, }, new uint [] {0x31, 0x27, 0x7e, }, + new uint [] {0x32, 0x22, 0xffffffb7, }, new uint [] {0x33, 0x2b, 0x5e, }, + new uint [] {0x34, 0x21, 0xffffffa2, }, new uint [] {0x35, 0x25, 0x30, 0xffffffb0, }, + new uint [] {0x36, 0x2f, 0xffffffb2, }, new uint [] {0x37, 0x3d, 0x60, }, + new uint [] {0x38, 0x28, 0xffffffff, }, new uint [] {0x39, 0x29, 0xffffffb4, }, + new uint [] {0xfffffff6, 0xffffffd6, 0xffffffbd, }, new uint [] {0xfffffffc, 0xffffffdc, 0xffffffa8, }, + new uint [] {0xfffffff3, 0xffffffd3, 0xffffffb8, }, new uint [] {0x71, 0x51, 0x5c, }, + new uint [] {0x77, 0x57, 0x7c, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x7a, 0x5a, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, 0xffffffcd, }, new uint [] {0x6f, 0x4f, 0xfffffff8, }, + new uint [] {0x70, 0x50, }, new uint [] {0xfffffff5, 0xffffffd5, 0xfffffff7, }, + new uint [] {0xfffffffa, 0xffffffda, 0xffffffd7, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, 0xfffffff0, }, new uint [] {0x64, 0x44, 0xffffffd0, }, + new uint [] {0x66, 0x46, 0x5b, }, new uint [] {0x67, 0x47, 0x5d, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, 0xffffffed, }, + new uint [] {0x6b, 0x4b, 0xffffffb3, }, new uint [] {0x6c, 0x4c, 0xffffffa3, }, + new uint [] {0xffffffe9, 0xffffffc9, 0x24, }, new uint [] {0xffffffe1, 0xffffffc1, 0xffffffdf, }, + new uint [] {0xfffffffb, 0xffffffdb, 0xffffffa4, }, new uint [] {0x79, 0x59, 0x3e, }, + new uint [] {0x78, 0x58, 0x23, }, new uint [] {0x63, 0x43, 0x26, }, + new uint [] {0x76, 0x56, 0x40, }, new uint [] {0x62, 0x42, 0x7b, }, + new uint [] {0x6e, 0x4e, 0x7d, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3f, 0x3b, }, new uint [] {0x2e, 0x3a, 0x3e, }, + new uint [] {0x2d, 0x5f, 0x2a, }, new uint [] {0xffffffed, 0xffffffcd, 0x3c, }, + new uint [] {}, }); + table [39] = new KeyboardLayout (1045, "Polish (programmer's) keyboard layout", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, }, new uint [] {0x37, 0x26, 0xffffffa7, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, 0xffffffea, 0xffffffca, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, 0xfffffff3, 0xffffffd3, }, + new uint [] {0x70, 0x50, }, new uint [] {0x5b, 0x7b, }, + new uint [] {0x5d, 0x7d, }, new uint [] {0x61, 0x41, 0xffffffb1, 0xffffffa1, }, + new uint [] {0x73, 0x53, 0xffffffb6, 0xffffffa6, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, 0xffffffb3, 0xffffffa3, }, + new uint [] {0x3b, 0x3a, }, new uint [] {0x27, 0x22, }, + new uint [] {0x5c, 0x7c, }, new uint [] {0x7a, 0x5a, 0xffffffbf, 0xffffffaf, }, + new uint [] {0x78, 0x58, 0xffffffbc, 0xffffffac, }, new uint [] {0x63, 0x43, 0xffffffe6, 0xffffffc6, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, 0xfffffff1, 0xffffffd1, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3c, }, new uint [] {0x2e, 0x3e, }, + new uint [] {0x2f, 0x3f, }, new uint [] {0x3c, 0x3e, 0x7c, }, + new uint [] {}, }); + table [40] = new KeyboardLayout (1060, "Slovenian keyboard layout", 0, 1, new uint [][] { + new uint [] {0xffffffb8, 0xffffffa8, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, }, + new uint [] {0x38, 0x28, }, new uint [] {0x39, 0x29, }, + new uint [] {0x30, 0x3d, }, new uint [] {0x27, 0x3f, }, + new uint [] {0x2b, 0x2a, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x7a, 0x5a, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xffffffb9, 0xffffffa9, }, + new uint [] {0xfffffff0, 0xffffffd0, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xffffffe8, 0xffffffc8, }, new uint [] {0xffffffe6, 0xffffffc6, }, + new uint [] {0xffffffbe, 0xffffffae, }, new uint [] {0x79, 0x59, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [41] = new KeyboardLayout (3098, "Serbian keyboard layout sr", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, }, + new uint [] {0x38, 0x28, }, new uint [] {0x39, 0x29, }, + new uint [] {0x30, 0x3d, }, new uint [] {0x27, 0x3f, }, + new uint [] {0x2b, 0x2a, }, new uint [] {0xffffffa9, 0xffffffb9, }, + new uint [] {0xffffffaa, 0xffffffba, }, new uint [] {0xffffffc5, 0xffffffe5, }, + new uint [] {0xffffffd2, 0xfffffff2, }, new uint [] {0xffffffd4, 0xfffffff4, }, + new uint [] {0xffffffda, 0xfffffffa, }, new uint [] {0xffffffd5, 0xfffffff5, }, + new uint [] {0xffffffc9, 0xffffffe9, }, new uint [] {0xffffffcf, 0xffffffef, }, + new uint [] {0xffffffd0, 0xfffffff0, }, new uint [] {0xffffffdb, 0xfffffffb, }, + new uint [] {0x5b, 0x5d, }, new uint [] {0xffffffc1, 0xffffffe1, }, + new uint [] {0xffffffd3, 0xfffffff3, }, new uint [] {0xffffffc4, 0xffffffe4, }, + new uint [] {0xffffffc6, 0xffffffe6, }, new uint [] {0xffffffc7, 0xffffffe7, }, + new uint [] {0xffffffc8, 0xffffffe8, }, new uint [] {0xffffffa8, 0xffffffb8, }, + new uint [] {0xffffffcb, 0xffffffeb, }, new uint [] {0xffffffcc, 0xffffffec, }, + new uint [] {0xffffffde, 0xfffffffe, }, new uint [] {0xffffffab, 0xffffffbb, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0xffffffa1, 0xffffffb1, }, + new uint [] {0xffffffaf, 0xffffffbf, }, new uint [] {0xffffffc3, 0xffffffe3, }, + new uint [] {0xffffffd7, 0xfffffff7, }, new uint [] {0xffffffc2, 0xffffffe2, }, + new uint [] {0xffffffce, 0xffffffee, }, new uint [] {0xffffffcd, 0xffffffed, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0xffffffd6, 0xfffffff6, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [42] = new KeyboardLayout (3098, "Serbian keyboard layout us,sr", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, 0x32, 0x22, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, 0x36, 0x26, }, new uint [] {0x37, 0x26, 0x37, 0x2f, }, + new uint [] {0x38, 0x2a, 0x38, 0x28, }, new uint [] {0x39, 0x28, 0x39, 0x29, }, + new uint [] {0x30, 0x29, 0x30, 0x3d, }, new uint [] {0x2d, 0x5f, 0x27, 0x3f, }, + new uint [] {0x3d, 0x2b, 0x2b, 0x2a, }, new uint [] {0x71, 0x51, 0xffffffa9, 0xffffffb9, }, + new uint [] {0x77, 0x57, 0xffffffaa, 0xffffffba, }, new uint [] {0x65, 0x45, 0xffffffc5, 0xffffffe5, }, + new uint [] {0x72, 0x52, 0xffffffd2, 0xfffffff2, }, new uint [] {0x74, 0x54, 0xffffffd4, 0xfffffff4, }, + new uint [] {0x79, 0x59, 0xffffffda, 0xfffffffa, }, new uint [] {0x75, 0x55, 0xffffffd5, 0xfffffff5, }, + new uint [] {0x69, 0x49, 0xffffffc9, 0xffffffe9, }, new uint [] {0x6f, 0x4f, 0xffffffcf, 0xffffffef, }, + new uint [] {0x70, 0x50, 0xffffffd0, 0xfffffff0, }, new uint [] {0x5b, 0x7b, 0xffffffdb, 0xfffffffb, }, + new uint [] {0x5d, 0x7d, 0x5b, 0x5d, }, new uint [] {0x61, 0x41, 0xffffffc1, 0xffffffe1, }, + new uint [] {0x73, 0x53, 0xffffffd3, 0xfffffff3, }, new uint [] {0x64, 0x44, 0xffffffc4, 0xffffffe4, }, + new uint [] {0x66, 0x46, 0xffffffc6, 0xffffffe6, }, new uint [] {0x67, 0x47, 0xffffffc7, 0xffffffe7, }, + new uint [] {0x68, 0x48, 0xffffffc8, 0xffffffe8, }, new uint [] {0x6a, 0x4a, 0xffffffa8, 0xffffffb8, }, + new uint [] {0x6b, 0x4b, 0xffffffcb, 0xffffffeb, }, new uint [] {0x6c, 0x4c, 0xffffffcc, 0xffffffec, }, + new uint [] {0x3b, 0x3a, 0xffffffde, 0xfffffffe, }, new uint [] {0x27, 0x22, 0xffffffab, 0xffffffbb, }, + new uint [] {0x5c, 0x7c, 0x2d, 0x5f, }, new uint [] {0x7a, 0x5a, 0xffffffa1, 0xffffffb1, }, + new uint [] {0x78, 0x58, 0xffffffaf, 0xffffffbf, }, new uint [] {0x63, 0x43, 0xffffffc3, 0xffffffe3, }, + new uint [] {0x76, 0x56, 0xffffffd7, 0xfffffff7, }, new uint [] {0x62, 0x42, 0xffffffc2, 0xffffffe2, }, + new uint [] {0x6e, 0x4e, 0xffffffce, 0xffffffee, }, new uint [] {0x6d, 0x4d, 0xffffffcd, 0xffffffed, }, + new uint [] {0x2c, 0x3c, 0x2c, 0x3b, }, new uint [] {0x2e, 0x3e, 0x2e, 0x3a, }, + new uint [] {0x2f, 0x3f, 0xffffffd6, 0xfffffff6, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [43] = new KeyboardLayout (1050, "Croatian keyboard layout", 0, 1, new uint [][] { + new uint [] {0xffffffb8, 0xffffffa8, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, }, + new uint [] {0x38, 0x28, }, new uint [] {0x39, 0x29, }, + new uint [] {0x30, 0x3d, }, new uint [] {0x27, 0x3f, }, + new uint [] {0x2b, 0x2a, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x7a, 0x5a, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xffffffb9, 0xffffffa9, }, + new uint [] {0xfffffff0, 0xffffffd0, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xffffffe8, 0xffffffc8, }, new uint [] {0xffffffe6, 0xffffffc6, }, + new uint [] {0xffffffbe, 0xffffffae, }, new uint [] {0x79, 0x59, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2f, 0x3f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [44] = new KeyboardLayout (1050, "Croatian keyboard layout (specific)", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0x5b, 0x7b, 0xffffffb9, 0xffffffa9, }, + new uint [] {0x5d, 0x7d, 0xfffffff0, 0xffffffd0, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0x3b, 0x3a, 0xffffffe8, 0xffffffc8, }, new uint [] {0x27, 0x22, 0xffffffe6, 0xffffffc6, }, + new uint [] {0x5c, 0x7c, 0xffffffbe, 0xffffffae, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3c, }, new uint [] {0x2e, 0x3e, }, + new uint [] {0x2f, 0x3f, }, new uint [] {0x3c, 0x3e, 0x7c, }, + new uint [] {}, }); + table [45] = new KeyboardLayout (1041, "Japanese 106 keyboard layout", 3, 7, new uint [][] { + new uint [] {0x31, 0x21, }, new uint [] {0x32, 0x22, }, + new uint [] {0x33, 0x23, }, new uint [] {0x34, 0x24, }, + new uint [] {0x35, 0x25, }, new uint [] {0x36, 0x26, }, + new uint [] {0x37, 0x27, }, new uint [] {0x38, 0x28, }, + new uint [] {0x39, 0x29, }, new uint [] {0x30, 0x7e, }, + new uint [] {0x2d, 0x3d, }, new uint [] {0x5e, 0x7e, }, + new uint [] {0x5c, 0x7c, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0x40, 0x60, }, + new uint [] {0x5b, 0x7b, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0x3b, 0x2b, }, new uint [] {0x3a, 0x2a, }, + new uint [] {0x5d, 0x7d, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3c, }, new uint [] {0x2e, 0x3e, }, + new uint [] {0x2f, 0x3f, }, new uint [] {0x5c, 0x5f, }, + new uint [] {}, }); + table [46] = new KeyboardLayout (1041, "Japanese pc98x1 keyboard layout", 0, 0, new uint [][] { + new uint [] {0x31, 0x21, }, new uint [] {0x32, 0x22, }, + new uint [] {0x33, 0x23, }, new uint [] {0x34, 0x24, }, + new uint [] {0x35, 0x25, }, new uint [] {0x36, 0x26, }, + new uint [] {0x37, 0x27, }, new uint [] {0x38, 0x28, }, + new uint [] {0x39, 0x29, }, new uint [] {0x30, }, + new uint [] {0x2d, 0x3d, }, new uint [] {0x5e, 0x60, }, + new uint [] {0x5c, 0x7c, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0x40, 0x7e, }, + new uint [] {0x5b, 0x7b, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0x3b, 0x2b, }, new uint [] {0x3a, 0x2a, }, + new uint [] {0x5d, 0x7d, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3c, }, new uint [] {0x2e, 0x3e, }, + new uint [] {0x2f, 0x3f, }, new uint [] {0x5c, 0x5f, }, + new uint [] {}, }); + table [47] = new KeyboardLayout (1051, "Slovak keyboard layout", 0, 0, new uint [][] { + new uint [] {0x3b, 0x30, }, new uint [] {0x2b, 0x31, }, + new uint [] {0xffffffb5, 0x32, }, new uint [] {0xffffffb9, 0x33, }, + new uint [] {0xffffffe8, 0x34, }, new uint [] {0xffffffbb, 0x35, }, + new uint [] {0xffffffbe, 0x36, }, new uint [] {0xfffffffd, 0x37, }, + new uint [] {0xffffffe1, 0x38, }, new uint [] {0xffffffed, 0x39, }, + new uint [] {0xffffffe9, 0x30, }, new uint [] {0x3d, 0x25, }, + new uint [] {0x27, 0x76, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xfffffffa, 0x2f, }, + new uint [] {0xffffffe4, 0x28, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xfffffff4, 0x22, }, new uint [] {0xffffffa7, 0x21, }, + new uint [] {0xfffffff2, 0x29, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3f, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [48] = new KeyboardLayout (1051, "Slovak and Czech keyboard layout without dead keys", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, 0xffffffe4, 0xffffffc4, }, + new uint [] {0x77, 0x57, 0xffffffec, 0xffffffcc, }, new uint [] {0x65, 0x45, 0xffffffe9, 0xffffffc9, }, + new uint [] {0x72, 0x52, 0xfffffff8, 0xffffffd8, }, new uint [] {0x74, 0x54, 0xffffffbb, 0xffffffab, }, + new uint [] {0x79, 0x59, 0xfffffffd, 0xffffffdd, }, new uint [] {0x75, 0x55, 0xfffffff9, 0xffffffd9, }, + new uint [] {0x69, 0x49, 0xffffffed, 0xffffffcd, }, new uint [] {0x6f, 0x4f, 0xfffffff3, 0xffffffd3, }, + new uint [] {0x70, 0x50, 0xfffffff6, 0xffffffd6, }, new uint [] {0x5b, 0x7b, }, + new uint [] {0x5d, 0x7d, }, new uint [] {0x61, 0x41, 0xffffffe1, 0xffffffc1, }, + new uint [] {0x73, 0x53, 0xffffffb9, 0xffffffa9, }, new uint [] {0x64, 0x44, 0xffffffef, 0xffffffcf, }, + new uint [] {0x66, 0x46, 0xffffffeb, 0xffffffcb, }, new uint [] {0x67, 0x47, 0xffffffe0, 0xffffffc0, }, + new uint [] {0x68, 0x48, 0xfffffffa, 0xffffffda, }, new uint [] {0x6a, 0x4a, 0xfffffffc, 0xffffffdc, }, + new uint [] {0x6b, 0x4b, 0xfffffff4, 0xffffffd4, }, new uint [] {0x6c, 0x4c, 0xffffffb5, 0xffffffa5, }, + new uint [] {0x3b, 0x3a, }, new uint [] {0x27, 0x22, }, + new uint [] {0x5c, 0x7c, }, new uint [] {0x7a, 0x5a, 0xffffffbe, 0xffffffae, }, + new uint [] {0x78, 0x58, 0xffffffa4, }, new uint [] {0x63, 0x43, 0xffffffe8, 0xffffffc8, }, + new uint [] {0x76, 0x56, 0xffffffe7, 0xffffffc7, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, 0xfffffff2, 0xffffffd2, }, new uint [] {0x6d, 0x4d, 0xffffffe5, 0xffffffc5, }, + new uint [] {0x2c, 0x3c, }, new uint [] {0x2e, 0x3e, }, + new uint [] {0x2f, 0x3f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [49] = new KeyboardLayout (1029, "Czech keyboard layout", 0, 0, new uint [][] { + new uint [] {0x3b, }, new uint [] {0x2b, 0x31, }, + new uint [] {0xffffffec, 0x32, }, new uint [] {0xffffffb9, 0x33, }, + new uint [] {0xffffffe8, 0x34, }, new uint [] {0xfffffff8, 0x35, }, + new uint [] {0xffffffbe, 0x36, }, new uint [] {0xfffffffd, 0x37, }, + new uint [] {0xffffffe1, 0x38, }, new uint [] {0xffffffed, 0x39, }, + new uint [] {0xffffffe9, 0x30, 0xffffffbd, 0x29, }, new uint [] {0x3d, 0x25, }, + new uint [] {}, new uint [] {0x71, 0x51, 0x5c, }, + new uint [] {0x77, 0x57, 0x7c, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xfffffffa, 0x2f, 0x5b, 0x7b, }, + new uint [] {0x29, 0x28, 0x5d, 0x7d, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, 0xfffffff0, }, new uint [] {0x64, 0x44, 0xffffffd0, }, + new uint [] {0x66, 0x46, 0x5b, }, new uint [] {0x67, 0x47, 0x5d, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, 0xffffffb3, }, new uint [] {0x6c, 0x4c, 0xffffffa3, }, + new uint [] {0xfffffff9, 0x22, 0x24, }, new uint [] {0xffffffa7, 0x21, 0xffffffdf, }, + new uint [] {0xffffffa8, 0x27, }, new uint [] {0x7a, 0x5a, 0x3e, }, + new uint [] {0x78, 0x58, 0x23, }, new uint [] {0x63, 0x43, 0x26, }, + new uint [] {0x76, 0x56, 0x40, }, new uint [] {0x62, 0x42, 0x7b, }, + new uint [] {0x6e, 0x4e, 0x7d, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3f, 0x3c, }, new uint [] {0x2e, 0x3a, 0x3e, }, + new uint [] {0x2d, 0x5f, 0x2a, }, new uint [] {0x3c, 0x3e, 0x5c, 0x7c, }, + new uint [] {}, }); + table [50] = new KeyboardLayout (1029, "Czech keyboard layout cz", 0, 1, new uint [][] { + new uint [] {0x3b, }, new uint [] {0x2b, 0x31, }, + new uint [] {0xffffffec, 0x32, }, new uint [] {0xffffffb9, 0x33, }, + new uint [] {0xffffffe8, 0x34, }, new uint [] {0xfffffff8, 0x35, }, + new uint [] {0xffffffbe, 0x36, }, new uint [] {0xfffffffd, 0x37, }, + new uint [] {0xffffffe1, 0x38, }, new uint [] {0xffffffed, 0x39, }, + new uint [] {0xffffffe9, 0x30, }, new uint [] {0x3d, 0x25, }, + new uint [] {0xffffffb4, 0xffffffb7, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x7a, 0x5a, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xfffffffa, 0x2f, }, + new uint [] {0x29, 0x28, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xfffffff9, 0x22, }, new uint [] {0xffffffa7, 0x21, }, + new uint [] {0xffffffa8, 0x27, }, new uint [] {0x79, 0x59, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3f, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x5c, }, + new uint [] {}, }); + table [51] = new KeyboardLayout (1029, "Czech keyboard layout cz_qwerty", 0, 0, new uint [][] { + new uint [] {0x3b, }, new uint [] {0x2b, 0x31, }, + new uint [] {0xffffffec, 0x32, }, new uint [] {0xffffffb9, 0x33, }, + new uint [] {0xffffffe8, 0x34, }, new uint [] {0xfffffff8, 0x35, }, + new uint [] {0xffffffbe, 0x36, }, new uint [] {0xfffffffd, 0x37, }, + new uint [] {0xffffffe1, 0x38, }, new uint [] {0xffffffed, 0x39, }, + new uint [] {0xffffffe9, 0x30, }, new uint [] {0x3d, 0x25, }, + new uint [] {0xffffffb4, 0xffffffb7, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xfffffffa, 0x2f, }, + new uint [] {0x29, 0x28, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xfffffff9, 0x22, }, new uint [] {0xffffffa7, 0x21, }, + new uint [] {0xffffffa8, 0x27, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3f, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x5c, }, + new uint [] {}, }); + table [52] = new KeyboardLayout (1034, "Latin American keyboard layout", 0, 0, new uint [][] { + new uint [] {0x7c, 0xffffffb0, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, }, + new uint [] {0x38, 0x28, }, new uint [] {0x39, 0x29, }, + new uint [] {0x30, 0x3d, }, new uint [] {0x27, 0x3f, }, + new uint [] {0xffffffbf, 0xffffffa1, }, new uint [] {0x71, 0x51, 0x40, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xffffffb4, 0xffffffa8, }, + new uint [] {0x2b, 0x2a, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xfffffff1, 0xffffffd1, }, new uint [] {0x7b, 0x5b, 0x5e, }, + new uint [] {0x7d, 0x5d, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [53] = new KeyboardLayout (1063, "Lithuanian (Baltic) keyboard layout", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, }, new uint [] {0xffffffe0, 0xffffffc0, }, + new uint [] {0xffffffe8, 0xffffffc8, }, new uint [] {0xffffffe6, 0xffffffc6, }, + new uint [] {0xffffffeb, 0xffffffcb, }, new uint [] {0xffffffe1, 0xffffffc1, }, + new uint [] {0xfffffff0, 0xffffffd0, }, new uint [] {0xfffffff8, 0xffffffd8, }, + new uint [] {0xfffffffb, 0xffffffdb, }, new uint [] {0xffffffa5, 0x28, }, + new uint [] {0xffffffb4, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0xfffffffe, 0xffffffde, }, new uint [] {0x5c, 0x7c, }, + new uint [] {0x71, 0x51, }, new uint [] {0x77, 0x57, }, + new uint [] {0x65, 0x45, }, new uint [] {0x72, 0x52, }, + new uint [] {0x74, 0x54, }, new uint [] {0x79, 0x59, }, + new uint [] {0x75, 0x55, }, new uint [] {0x69, 0x49, }, + new uint [] {0x6f, 0x4f, }, new uint [] {0x70, 0x50, }, + new uint [] {0x5b, 0x7b, }, new uint [] {0x5d, 0x7d, }, + new uint [] {0x61, 0x41, }, new uint [] {0x73, 0x53, }, + new uint [] {0x64, 0x44, }, new uint [] {0x66, 0x46, }, + new uint [] {0x67, 0x47, }, new uint [] {0x68, 0x48, }, + new uint [] {0x6a, 0x4a, }, new uint [] {0x6b, 0x4b, }, + new uint [] {0x6c, 0x4c, }, new uint [] {0x3b, 0x3a, }, + new uint [] {0x27, 0x22, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3c, }, new uint [] {0x2e, 0x3e, }, + new uint [] {0x2f, 0x3f, }, new uint [] {}, + new uint [] {}, }); + table [54] = new KeyboardLayout (1055, "Turkish keyboard layout", 0, 0, new uint [][] { + new uint [] {0x22, 0xffffffe9, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x27, }, new uint [] {0x33, 0x5e, 0x23, }, + new uint [] {0x34, 0x2b, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, 0x7b, }, + new uint [] {0x38, 0x28, 0x5b, }, new uint [] {0x39, 0x29, 0x5d, }, + new uint [] {0x30, 0x3d, 0x7d, }, new uint [] {0x2a, 0x3f, 0x5c, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x71, 0x51, 0x40, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0xfffffffd, 0x49, 0xffffffee, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xfffffff0, 0xffffffd0, }, + new uint [] {0xfffffffc, 0xffffffdc, 0x7e, }, new uint [] {0x61, 0x41, 0xffffffe6, }, + new uint [] {0x73, 0x53, 0xffffffdf, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xfffffffe, 0xffffffde, }, new uint [] {0x69, 0xffffffdd, }, + new uint [] {0x2c, 0x3b, 0x60, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0xfffffff6, 0xffffffd6, }, new uint [] {0xffffffe7, 0xffffffc7, }, + new uint [] {0x2e, 0x3a, }, new uint [] {}, + new uint [] {}, }); + table [55] = new KeyboardLayout (1055, "Turkish keyboard layout tr", 0, 0, new uint [][] { + new uint [] {0x22, 0x5c, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x27, }, new uint [] {0x33, 0x5e, }, + new uint [] {0x34, 0x2b, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x2f, }, + new uint [] {0x38, 0x28, }, new uint [] {0x39, 0x29, }, + new uint [] {0x30, 0x3d, }, new uint [] {0x2a, 0x3f, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0xffffffb9, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xffffffbb, 0xffffffab, }, + new uint [] {0xfffffffc, 0xffffffdc, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0xffffffba, 0xffffffaa, }, new uint [] {0x69, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0xfffffff6, 0xffffffd6, }, new uint [] {0xffffffe7, 0xffffffc7, }, + new uint [] {0x2e, 0x3a, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [56] = new KeyboardLayout (1055, "Turkish keyboard layout trf", 0, 0, new uint [][] { + new uint [] {0x2b, 0x2a, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0x5e, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x27, }, + new uint [] {0x38, 0x28, }, new uint [] {0x39, 0x29, }, + new uint [] {0x30, 0x3d, }, new uint [] {0x2f, 0x3f, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x66, 0x46, }, + new uint [] {0x67, 0x47, }, new uint [] {0xffffffbb, 0xffffffab, }, + new uint [] {0xffffffb9, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x64, 0x44, }, new uint [] {0x72, 0x52, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x68, 0x48, }, + new uint [] {0x70, 0x50, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, }, new uint [] {0x65, 0x45, }, + new uint [] {0x61, 0x41, }, new uint [] {0xfffffffc, 0xffffffdc, }, + new uint [] {0x74, 0x54, }, new uint [] {0x6b, 0x4b, }, + new uint [] {0x6d, 0x4d, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0x79, 0x59, }, new uint [] {0xffffffba, 0xffffffaa, }, + new uint [] {0x78, 0x58, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0xfffffff6, 0xffffffd6, }, new uint [] {0x76, 0x56, }, + new uint [] {0x63, 0x43, }, new uint [] {0xffffffe7, 0xffffffc7, }, + new uint [] {0x7a, 0x5a, }, new uint [] {0x73, 0x53, }, + new uint [] {0x62, 0x42, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [57] = new KeyboardLayout (1037, "Israelian keyboard layout", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, 0x3b, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, 0x2f, }, + new uint [] {0x77, 0x57, 0x27, }, new uint [] {0x65, 0x45, 0xfffffff7, }, + new uint [] {0x72, 0x52, 0xfffffff8, }, new uint [] {0x74, 0x54, 0xffffffe0, }, + new uint [] {0x79, 0x59, 0xffffffe8, }, new uint [] {0x75, 0x55, 0xffffffe5, }, + new uint [] {0x69, 0x49, 0xffffffef, }, new uint [] {0x6f, 0x4f, 0xffffffed, }, + new uint [] {0x70, 0x50, 0xfffffff4, }, new uint [] {0x5b, 0x7b, }, + new uint [] {0x5d, 0x7d, }, new uint [] {0x61, 0x41, 0xfffffff9, }, + new uint [] {0x73, 0x53, 0xffffffe3, }, new uint [] {0x64, 0x44, 0xffffffe2, }, + new uint [] {0x66, 0x46, 0xffffffeb, }, new uint [] {0x67, 0x47, 0xfffffff2, }, + new uint [] {0x68, 0x48, 0xffffffe9, }, new uint [] {0x6a, 0x4a, 0xffffffe7, }, + new uint [] {0x6b, 0x4b, 0xffffffec, }, new uint [] {0x6c, 0x4c, 0xffffffea, }, + new uint [] {0x3b, 0x3a, 0xfffffff3, }, new uint [] {0x27, 0x22, 0x2c, }, + new uint [] {0x5c, 0x7c, }, new uint [] {0x7a, 0x5a, 0xffffffe6, }, + new uint [] {0x78, 0x58, 0xfffffff1, }, new uint [] {0x63, 0x43, 0xffffffe1, }, + new uint [] {0x76, 0x56, 0xffffffe4, }, new uint [] {0x62, 0x42, 0xfffffff0, }, + new uint [] {0x6e, 0x4e, 0xffffffee, }, new uint [] {0x6d, 0x4d, 0xfffffff6, }, + new uint [] {0x2c, 0x3c, 0xfffffffa, }, new uint [] {0x2e, 0x3e, 0xfffffff5, }, + new uint [] {0x2f, 0x3f, 0x2e, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [58] = new KeyboardLayout (1037, "Israelian phonetic keyboard layout", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, 0xfffffff7, }, + new uint [] {0x77, 0x57, 0xffffffe5, }, new uint [] {0x65, 0x45, 0xffffffe0, }, + new uint [] {0x72, 0x52, 0xfffffff8, }, new uint [] {0x74, 0x54, 0xfffffffa, }, + new uint [] {0x79, 0x59, 0xfffffff2, }, new uint [] {0x75, 0x55, 0xffffffe5, }, + new uint [] {0x69, 0x49, 0xffffffe9, }, new uint [] {0x6f, 0x4f, 0xfffffff1, }, + new uint [] {0x70, 0x50, 0xfffffff4, }, new uint [] {0x5b, 0x7b, }, + new uint [] {0x5d, 0x7d, }, new uint [] {0x61, 0x41, 0xffffffe0, }, + new uint [] {0x73, 0x53, 0xfffffff9, }, new uint [] {0x64, 0x44, 0xffffffe3, }, + new uint [] {0x66, 0x46, 0xfffffff4, }, new uint [] {0x67, 0x47, 0xffffffe2, }, + new uint [] {0x68, 0x48, 0xffffffe4, }, new uint [] {0x6a, 0x4a, 0xffffffe9, }, + new uint [] {0x6b, 0x4b, 0xffffffeb, }, new uint [] {0x6c, 0x4c, 0xffffffec, }, + new uint [] {0x3b, 0x3a, }, new uint [] {0x27, 0x22, }, + new uint [] {0x5c, 0x7c, }, new uint [] {0x7a, 0x5a, 0xffffffe6, }, + new uint [] {0x78, 0x58, 0xffffffe7, }, new uint [] {0x63, 0x43, 0xfffffff6, }, + new uint [] {0x76, 0x56, 0xffffffe5, }, new uint [] {0x62, 0x42, 0xffffffe1, }, + new uint [] {0x6e, 0x4e, 0xfffffff0, }, new uint [] {0x6d, 0x4d, 0xffffffee, }, + new uint [] {0x2c, 0x3c, }, new uint [] {0x2e, 0x3e, }, + new uint [] {0x2f, 0x3f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [59] = new KeyboardLayout (1037, "Israelian Saharon keyboard layout", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, 0xfffffff7, }, + new uint [] {0x77, 0x57, 0xfffffff1, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, 0xfffffff8, }, new uint [] {0x74, 0x54, 0xffffffe8, }, + new uint [] {0x79, 0x59, 0xffffffe3, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, 0xfffffff4, }, new uint [] {0x5b, 0x7b, }, + new uint [] {0x5d, 0x7d, }, new uint [] {0x61, 0x41, 0xffffffe0, }, + new uint [] {0x73, 0x53, 0xffffffe5, }, new uint [] {0x64, 0x44, 0xffffffec, }, + new uint [] {0x66, 0x46, 0xfffffffa, }, new uint [] {0x67, 0x47, 0xffffffe2, }, + new uint [] {0x68, 0x48, 0xffffffe4, }, new uint [] {0x6a, 0x4a, 0xfffffff9, }, + new uint [] {0x6b, 0x4b, 0xffffffeb, }, new uint [] {0x6c, 0x4c, 0xffffffe9, }, + new uint [] {0x3b, 0x3a, }, new uint [] {0x27, 0x22, }, + new uint [] {0x5c, 0x7c, }, new uint [] {0x7a, 0x5a, 0xffffffe6, }, + new uint [] {0x78, 0x58, 0xffffffe7, }, new uint [] {0x63, 0x43, 0xfffffff6, }, + new uint [] {0x76, 0x56, 0xfffffff2, }, new uint [] {0x62, 0x42, 0xffffffe1, }, + new uint [] {0x6e, 0x4e, 0xfffffff0, }, new uint [] {0x6d, 0x4d, 0xffffffee, }, + new uint [] {0x2c, 0x3c, }, new uint [] {0x2e, 0x3e, }, + new uint [] {0x2f, 0x3f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [60] = new KeyboardLayout (1033, "VNC keyboard layout", 4, 8, new uint [][] { + new uint [] {0x31, 0x21, }, new uint [] {0x32, 0x40, }, + new uint [] {0x33, 0x23, }, new uint [] {0x34, 0x24, }, + new uint [] {0x35, 0x25, }, new uint [] {0x36, 0x5e, }, + new uint [] {0x37, 0x26, }, new uint [] {0x38, 0x2a, }, + new uint [] {0x39, 0x28, }, new uint [] {0x30, 0x29, }, + new uint [] {0x2d, 0x5f, }, new uint [] {0x3d, 0x2b, }, + new uint [] {0x5b, 0x7b, }, new uint [] {0x5d, 0x7d, }, + new uint [] {0x3b, 0x3a, }, new uint [] {0x27, 0x22, }, + new uint [] {0x60, 0x7e, }, new uint [] {0x2c, 0x3c, }, + new uint [] {0x2e, 0x3e, }, new uint [] {0x2f, 0x3f, }, + new uint [] {0x5c, 0x7c, }, new uint [] {0x61, 0x41, }, + new uint [] {0x62, 0x42, }, new uint [] {0x63, 0x43, }, + new uint [] {0x64, 0x44, }, new uint [] {0x65, 0x45, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x69, 0x49, }, + new uint [] {0x6a, 0x4a, }, new uint [] {0x6b, 0x4b, }, + new uint [] {0x6c, 0x4c, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0x71, 0x51, }, + new uint [] {0x72, 0x52, }, new uint [] {0x73, 0x53, }, + new uint [] {0x74, 0x54, }, new uint [] {0x75, 0x55, }, + new uint [] {0x76, 0x56, }, new uint [] {0x77, 0x57, }, + new uint [] {0x78, 0x58, }, new uint [] {0x79, 0x59, }, + new uint [] {0x7a, 0x5a, }, new uint [] {}, + new uint [] {}, }); + table [61] = new KeyboardLayout (1032, "Greek keyboard layout", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x40, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x5e, }, new uint [] {0x37, 0x26, }, + new uint [] {0x38, 0x2a, }, new uint [] {0x39, 0x28, }, + new uint [] {0x30, 0x29, }, new uint [] {0x2d, 0x5f, }, + new uint [] {0x3d, 0x2b, }, new uint [] {0x71, 0x51, 0x3b, 0x3a, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, 0xffffffe5, 0xffffffc5, }, + new uint [] {0x72, 0x52, 0xfffffff1, 0xffffffd1, }, new uint [] {0x74, 0x54, 0xfffffff4, 0xffffffd4, }, + new uint [] {0x79, 0x59, 0xfffffff5, 0xffffffd5, }, new uint [] {0x75, 0x55, 0xffffffe8, 0xffffffc8, }, + new uint [] {0x69, 0x49, 0xffffffe9, 0xffffffc9, }, new uint [] {0x6f, 0x4f, 0xffffffef, 0xffffffcf, }, + new uint [] {0x70, 0x50, 0xfffffff0, 0xffffffd0, }, new uint [] {0x5b, 0x7b, }, + new uint [] {0x5d, 0x7d, }, new uint [] {0x61, 0x41, 0xffffffe1, 0xffffffc1, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, 0xffffffe4, 0xffffffc4, }, + new uint [] {0x66, 0x46, 0xfffffff6, 0xffffffd6, }, new uint [] {0x67, 0x47, 0xffffffe3, 0xffffffc3, }, + new uint [] {0x68, 0x48, 0xffffffe7, 0xffffffc7, }, new uint [] {0x6a, 0x4a, 0xffffffee, 0xffffffce, }, + new uint [] {0x6b, 0x4b, 0xffffffea, 0xffffffca, }, new uint [] {0x6c, 0x4c, 0xffffffeb, 0xffffffcb, }, + new uint [] {0x3b, 0x3a, 0xffffffb4, 0xffffffa8, }, new uint [] {0x27, 0x22, }, + new uint [] {0x5c, 0x7c, }, new uint [] {0x7a, 0x5a, 0xffffffe6, 0xffffffc6, }, + new uint [] {0x78, 0x58, 0xfffffff7, 0xffffffd7, }, new uint [] {0x63, 0x43, 0xfffffff8, 0xffffffd8, }, + new uint [] {0x76, 0x56, 0xfffffff9, 0xffffffd9, }, new uint [] {0x62, 0x42, 0xffffffe2, 0xffffffc2, }, + new uint [] {0x6e, 0x4e, 0xffffffed, 0xffffffcd, }, new uint [] {0x6d, 0x4d, 0xffffffec, 0xffffffcc, }, + new uint [] {0x2c, 0x3c, }, new uint [] {0x2e, 0x3e, }, + new uint [] {0x2f, 0x3f, }, new uint [] {0x3c, 0x3e, }, + new uint [] {}, }); + table [62] = new KeyboardLayout (1054, "Thai (Kedmanee) keyboard layout", 0, 0, new uint [][] { + new uint [] {0x60, 0x7e, 0x5f, 0x25, }, new uint [] {0x31, 0x21, 0xffffffe5, 0x2b, }, + new uint [] {0x32, 0x40, 0x2f, 0xfffffff1, }, new uint [] {0x33, 0x23, 0x2d, 0xfffffff2, }, + new uint [] {0x34, 0x24, 0xffffffc0, 0xfffffff3, }, new uint [] {0x35, 0x25, 0xffffffb6, 0xfffffff4, }, + new uint [] {0x36, 0x5e, 0xffffffd8, 0xffffffd9, }, new uint [] {0x37, 0x26, 0xffffffd6, 0xffffffdf, }, + new uint [] {0x38, 0x2a, 0xffffffa4, 0xfffffff5, }, new uint [] {0x39, 0x28, 0xffffffb5, 0xfffffff6, }, + new uint [] {0x30, 0x29, 0xffffffa8, 0xfffffff7, }, new uint [] {0x2d, 0x5f, 0xffffffa2, 0xfffffff8, }, + new uint [] {0x3d, 0x2b, 0xffffffaa, 0xfffffff9, }, new uint [] {0x71, 0x51, 0xffffffe6, 0xfffffff0, }, + new uint [] {0x77, 0x57, 0xffffffe4, 0x22, }, new uint [] {0x65, 0x45, 0xffffffd3, 0xffffffae, }, + new uint [] {0x72, 0x52, 0xffffffbe, 0xffffffb1, }, new uint [] {0x74, 0x54, 0xffffffd0, 0xffffffb8, }, + new uint [] {0x79, 0x59, 0xffffffd1, 0xffffffed, }, new uint [] {0x75, 0x55, 0xffffffd5, 0xffffffea, }, + new uint [] {0x69, 0x49, 0xffffffc3, 0xffffffb3, }, new uint [] {0x6f, 0x4f, 0xffffffb9, 0xffffffcf, }, + new uint [] {0x70, 0x50, 0xffffffc2, 0xffffffad, }, new uint [] {0x5b, 0x7b, 0xffffffba, 0xffffffb0, }, + new uint [] {0x5d, 0x7d, 0xffffffc5, 0x2c, }, new uint [] {0x61, 0x41, 0xffffffbf, 0xffffffc4, }, + new uint [] {0x73, 0x53, 0xffffffcb, 0xffffffa6, }, new uint [] {0x64, 0x44, 0xffffffa1, 0xffffffaf, }, + new uint [] {0x66, 0x46, 0xffffffb4, 0xffffffe2, }, new uint [] {0x67, 0x47, 0xffffffe0, 0xffffffac, }, + new uint [] {0x68, 0x48, 0xffffffe9, 0xffffffe7, }, new uint [] {0x6a, 0x4a, 0xffffffe8, 0xffffffeb, }, + new uint [] {0x6b, 0x4b, 0xffffffd2, 0xffffffc9, }, new uint [] {0x6c, 0x4c, 0xffffffca, 0xffffffc8, }, + new uint [] {0x3b, 0x3a, 0xffffffc7, 0xffffffab, }, new uint [] {0x27, 0x22, 0xffffffa7, 0x2e, }, + new uint [] {0x5c, 0x7c, 0xffffffa3, 0xffffffa5, }, new uint [] {0x7a, 0x5a, 0xffffffbc, 0x28, }, + new uint [] {0x78, 0x58, 0xffffffbb, 0x29, }, new uint [] {0x63, 0x43, 0xffffffe1, 0xffffffa9, }, + new uint [] {0x76, 0x56, 0xffffffcd, 0xffffffce, }, new uint [] {0x62, 0x42, 0xffffffda, }, + new uint [] {0x6e, 0x4e, 0xffffffd7, 0xffffffec, }, new uint [] {0x6d, 0x4d, 0xffffffb7, 0x3f, }, + new uint [] {0x2c, 0x3c, 0xffffffc1, 0xffffffb2, }, new uint [] {0x2e, 0x3e, 0xffffffe3, 0xffffffcc, }, + new uint [] {0x2f, 0x3f, 0xffffffbd, 0xffffffc6, }, new uint [] {}, + new uint [] {}, }); + table [63] = new KeyboardLayout (1043, "Dutch keyboard layout", 0, 0, new uint [][] { + new uint [] {0x40, 0xffffffa7, }, new uint [] {0x31, 0x21, }, + new uint [] {0x32, 0x22, }, new uint [] {0x33, 0x23, }, + new uint [] {0x34, 0x24, }, new uint [] {0x35, 0x25, }, + new uint [] {0x36, 0x26, }, new uint [] {0x37, 0x5f, }, + new uint [] {0x38, 0x28, }, new uint [] {0x39, 0x29, }, + new uint [] {0x30, 0x27, }, new uint [] {0x2f, 0x3f, }, + new uint [] {0xffffffb0, 0x7e, }, new uint [] {0x71, 0x51, }, + new uint [] {0x77, 0x57, }, new uint [] {0x65, 0x45, }, + new uint [] {0x72, 0x52, }, new uint [] {0x74, 0x54, }, + new uint [] {0x79, 0x59, }, new uint [] {0x75, 0x55, }, + new uint [] {0x69, 0x49, }, new uint [] {0x6f, 0x4f, }, + new uint [] {0x70, 0x50, }, new uint [] {0xffffffa8, 0x7e, }, + new uint [] {0x2a, 0x7c, }, new uint [] {0x61, 0x41, }, + new uint [] {0x73, 0x53, }, new uint [] {0x64, 0x44, }, + new uint [] {0x66, 0x46, }, new uint [] {0x67, 0x47, }, + new uint [] {0x68, 0x48, }, new uint [] {0x6a, 0x4a, }, + new uint [] {0x6b, 0x4b, }, new uint [] {0x6c, 0x4c, }, + new uint [] {0x2b, 0xffffffb1, }, new uint [] {0x27, 0x60, }, + new uint [] {0x3c, 0x3e, }, new uint [] {0x7a, 0x5a, }, + new uint [] {0x78, 0x58, }, new uint [] {0x63, 0x43, }, + new uint [] {0x76, 0x56, }, new uint [] {0x62, 0x42, }, + new uint [] {0x6e, 0x4e, }, new uint [] {0x6d, 0x4d, }, + new uint [] {0x2c, 0x3b, }, new uint [] {0x2e, 0x3a, }, + new uint [] {0x2d, 0x3d, }, new uint [] {0x5b, 0x5d, }, + new uint [] {}, }); + + + rsxw.AddResource ("keyboard_table", table); + + short [][] scan_table = new short [][] { + main_key_scan_qwerty, main_key_scan_dvorak, main_key_scan_abnt_qwerty, + main_key_scan_qwerty_jp106, main_key_scan_vnc + }; + rsxw.AddResource ("scan_table", scan_table); + + VirtualKeys [][] vkeys = new VirtualKeys [][] { + main_key_vkey_qwerty, main_key_vkey_qwertz, main_key_vkey_dvorak, + main_key_vkey_qwertz_105, main_key_vkey_azerty, main_key_vkey_qwerty_v2, + main_key_vkey_abnt_qwerty, main_key_vkey_qwerty_jp106, main_key_vkey_vnc + }; + int [][] vkey_table = new int [vkeys.Length][]; + for (int i = 0; i < vkeys.Length; i++) { + int [] cp = new int [vkeys [i].Length]; + for (int r = 0; r < vkeys [i].Length; r++) + cp [r] = (int) vkeys [i][r]; + vkey_table [i] = cp; + } + + rsxw.AddResource ("vkey_table", vkey_table); + + rsxw.Close (); + } + + private static readonly short [] main_key_scan_vnc = new short [] + { + 0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x1A,0x1B,0x27,0x28,0x29,0x33,0x34,0x35,0x2B, + 0x1E,0x30,0x2E,0x20,0x12,0x21,0x22,0x23,0x17,0x24,0x25,0x26,0x32,0x31,0x18,0x19,0x10,0x13,0x1F,0x14,0x16,0x2F,0x11,0x2D,0x15,0x2C, + 0x56 + }; + + private static readonly short [] main_key_scan_qwerty_jp106 = new short [] + { + 0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x29, + 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B, + 0x1E,0x1F,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x2B, + 0x2C,0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35, + 0x56 /* the 102nd key (actually to the right of l-shift) */ + }; + + private static readonly VirtualKeys [] main_key_vkey_vnc = new VirtualKeys [] + { + VirtualKeys.VK_1, VirtualKeys.VK_2, VirtualKeys.VK_3, VirtualKeys.VK_4, VirtualKeys.VK_5, VirtualKeys.VK_6, + VirtualKeys.VK_7, VirtualKeys.VK_8, VirtualKeys.VK_9, VirtualKeys.VK_0, VirtualKeys.VK_OEM_MINUS, + VirtualKeys.VK_OEM_PLUS, VirtualKeys.VK_OEM_4, VirtualKeys.VK_OEM_6, VirtualKeys.VK_OEM_1, + VirtualKeys.VK_OEM_7, VirtualKeys.VK_OEM_3, VirtualKeys.VK_OEM_COMMA, VirtualKeys.VK_OEM_PERIOD, + VirtualKeys.VK_OEM_2, VirtualKeys.VK_OEM_5, VirtualKeys.VK_A, VirtualKeys.VK_B, VirtualKeys.VK_C, + VirtualKeys.VK_D, VirtualKeys.VK_E, VirtualKeys.VK_F, VirtualKeys.VK_G, VirtualKeys.VK_H, + VirtualKeys.VK_I, VirtualKeys.VK_J, VirtualKeys.VK_K, VirtualKeys.VK_L, VirtualKeys.VK_M, + VirtualKeys.VK_N, VirtualKeys.VK_O, VirtualKeys.VK_P, VirtualKeys.VK_Q, VirtualKeys.VK_R, + VirtualKeys.VK_S, VirtualKeys.VK_T, VirtualKeys.VK_U, VirtualKeys.VK_V, VirtualKeys.VK_W, + VirtualKeys.VK_X, VirtualKeys.VK_Y, VirtualKeys.VK_Z, VirtualKeys.VK_OEM_102 + }; + + private static readonly short [] main_key_scan_qwerty = new short [] + { + /* this is my (102-key) keyboard layout, sorry if it doesn't quite match yours */ + /* ` 1 2 3 4 5 6 7 8 9 0 - = */ + 0x29,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D, + /* q w e r t y u i o p [ ] */ + 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B, + /* a s d f g h j k l ; ' \ */ + 0x1E,0x1F,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x2B, + /* z x c v b n m , . / */ + 0x2C,0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35, + 0x56 /* the 102nd key (actually to the right of l-shift) */ + }; + + private static readonly short [] main_key_scan_dvorak = new short [] + { + /* ` 1 2 3 4 5 6 7 8 9 0 [ ] */ + 0x29,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x1A,0x1B, + /* ' , . p y f g c r l / = */ + 0x28,0x33,0x34,0x19,0x15,0x21,0x22,0x2E,0x13,0x26,0x35,0x0D, + /* a o e u i d h t n s - \ */ + 0x1E,0x18,0x12,0x16,0x17,0x20,0x23,0x14,0x31,0x1F,0x0C,0x2B, + /* ; q j k x b m w v z */ + 0x27,0x10,0x24,0x25,0x2D,0x30,0x32,0x11,0x2F,0x2C, + 0x56 /* the 102nd key (actually to the right of l-shift) */ + }; + + private static readonly short [] main_key_scan_abnt_qwerty = new short [] + { + 0x29,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D, + 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B, + 0x1E,0x1F,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x2B, + 0x5e,0x2C,0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35, + 0x56, + }; + + private static readonly VirtualKeys [] main_key_vkey_qwerty = new VirtualKeys [] + { + // NOTE: this layout must concur with the scan codes layout above + VirtualKeys.VK_OEM_3, VirtualKeys.VK_1, VirtualKeys.VK_2, VirtualKeys.VK_3, VirtualKeys.VK_4, + VirtualKeys.VK_5, VirtualKeys.VK_6, VirtualKeys.VK_7, VirtualKeys.VK_8, VirtualKeys.VK_9, + VirtualKeys.VK_0, VirtualKeys.VK_OEM_MINUS, VirtualKeys.VK_OEM_PLUS, VirtualKeys.VK_Q, + VirtualKeys.VK_W, VirtualKeys.VK_E, VirtualKeys.VK_R, VirtualKeys.VK_T, VirtualKeys.VK_Y, + VirtualKeys.VK_U, VirtualKeys.VK_I, VirtualKeys.VK_O, VirtualKeys.VK_P, VirtualKeys.VK_OEM_4, + VirtualKeys.VK_OEM_6, VirtualKeys.VK_A, VirtualKeys.VK_S, VirtualKeys.VK_D, VirtualKeys.VK_F, + VirtualKeys.VK_G, VirtualKeys.VK_H, VirtualKeys.VK_J, VirtualKeys.VK_K, VirtualKeys.VK_L, + VirtualKeys.VK_OEM_1, VirtualKeys.VK_OEM_7, VirtualKeys.VK_OEM_5, VirtualKeys.VK_Z, + VirtualKeys.VK_X, VirtualKeys.VK_C, VirtualKeys.VK_V, VirtualKeys.VK_B, VirtualKeys.VK_N, + VirtualKeys.VK_M, VirtualKeys.VK_OEM_COMMA, VirtualKeys.VK_OEM_PERIOD, VirtualKeys.VK_OEM_2, + VirtualKeys.VK_OEM_102 // the 102nd key (actually to the right of l-shift) + }; + + private static readonly VirtualKeys [] main_key_vkey_qwertz = new VirtualKeys [] + { + VirtualKeys.VK_OEM_3, VirtualKeys.VK_1, VirtualKeys.VK_2, VirtualKeys.VK_3, VirtualKeys.VK_4, + VirtualKeys.VK_5, VirtualKeys.VK_6, VirtualKeys.VK_7, VirtualKeys.VK_8, VirtualKeys.VK_9, + VirtualKeys.VK_0, VirtualKeys.VK_OEM_MINUS, VirtualKeys.VK_OEM_PLUS, + VirtualKeys.VK_Q, VirtualKeys.VK_W, VirtualKeys.VK_E, VirtualKeys.VK_R, VirtualKeys.VK_T, VirtualKeys.VK_Z, + VirtualKeys.VK_U, VirtualKeys.VK_I, VirtualKeys.VK_O, VirtualKeys.VK_P, VirtualKeys.VK_OEM_4, + VirtualKeys.VK_OEM_6, VirtualKeys.VK_A, VirtualKeys.VK_S, VirtualKeys.VK_D, VirtualKeys.VK_F, + VirtualKeys.VK_G, VirtualKeys.VK_H, VirtualKeys.VK_J, VirtualKeys.VK_K, VirtualKeys.VK_L, + VirtualKeys.VK_OEM_1, VirtualKeys.VK_OEM_7, VirtualKeys.VK_OEM_5, VirtualKeys.VK_Y, + VirtualKeys.VK_X, VirtualKeys.VK_C, VirtualKeys.VK_V, VirtualKeys.VK_B, VirtualKeys.VK_N, + VirtualKeys.VK_M, VirtualKeys.VK_OEM_COMMA, VirtualKeys.VK_OEM_PERIOD, VirtualKeys.VK_OEM_2, + VirtualKeys.VK_OEM_102 // the 102nd key (actually to the right of l-shift) + }; + + private static readonly VirtualKeys [] main_key_vkey_dvorak = new VirtualKeys [] + { + // NOTE: this layout must concur with the scan codes layout above + VirtualKeys.VK_OEM_3, VirtualKeys.VK_1, VirtualKeys.VK_2, VirtualKeys.VK_3, VirtualKeys.VK_4, + VirtualKeys.VK_5, VirtualKeys.VK_6, VirtualKeys.VK_7, VirtualKeys.VK_8, VirtualKeys.VK_9, + VirtualKeys.VK_0, VirtualKeys.VK_OEM_4, VirtualKeys.VK_OEM_6, VirtualKeys.VK_OEM_7, + VirtualKeys.VK_OEM_COMMA, VirtualKeys.VK_OEM_PERIOD, VirtualKeys.VK_P, VirtualKeys.VK_Y, + VirtualKeys.VK_F, VirtualKeys.VK_G, VirtualKeys.VK_C, VirtualKeys.VK_R, VirtualKeys.VK_L, + VirtualKeys.VK_OEM_2, VirtualKeys.VK_OEM_PLUS, VirtualKeys.VK_A, VirtualKeys.VK_O, + VirtualKeys.VK_E, VirtualKeys.VK_U, VirtualKeys.VK_I, VirtualKeys.VK_D, VirtualKeys.VK_H, + VirtualKeys.VK_T, VirtualKeys.VK_N, VirtualKeys.VK_S, VirtualKeys.VK_OEM_MINUS, VirtualKeys.VK_OEM_5, + VirtualKeys.VK_OEM_1, VirtualKeys.VK_Q, VirtualKeys.VK_J, VirtualKeys.VK_K, VirtualKeys.VK_X, + VirtualKeys.VK_B, VirtualKeys.VK_M, VirtualKeys.VK_W, VirtualKeys.VK_V, VirtualKeys.VK_Z, + VirtualKeys.VK_OEM_102 // the 102nd key (actually to the right of l-shift) + }; + + private static readonly VirtualKeys [] main_key_vkey_azerty = new VirtualKeys [] + { + // NOTE: this layout must concur with the scan codes layout above + VirtualKeys.VK_OEM_7, VirtualKeys.VK_1, VirtualKeys.VK_2, VirtualKeys.VK_3, VirtualKeys.VK_4, + VirtualKeys.VK_5, VirtualKeys.VK_6, VirtualKeys.VK_7, VirtualKeys.VK_8, VirtualKeys.VK_9, + VirtualKeys.VK_0, VirtualKeys.VK_OEM_4, VirtualKeys.VK_OEM_PLUS, VirtualKeys.VK_A, VirtualKeys.VK_Z, + VirtualKeys.VK_E, VirtualKeys.VK_R, VirtualKeys.VK_T, VirtualKeys.VK_Y, VirtualKeys.VK_U, + VirtualKeys.VK_I, VirtualKeys.VK_O, VirtualKeys.VK_P, VirtualKeys.VK_OEM_6, VirtualKeys.VK_OEM_1, + VirtualKeys.VK_Q, VirtualKeys.VK_S, VirtualKeys.VK_D, VirtualKeys.VK_F, VirtualKeys.VK_G, + VirtualKeys.VK_H, VirtualKeys.VK_J, VirtualKeys.VK_K, VirtualKeys.VK_L, VirtualKeys.VK_M, + VirtualKeys.VK_OEM_3, VirtualKeys.VK_OEM_5, VirtualKeys.VK_W, VirtualKeys.VK_X, VirtualKeys.VK_C, + VirtualKeys.VK_V, VirtualKeys.VK_B, VirtualKeys.VK_N, VirtualKeys.VK_OEM_COMMA, VirtualKeys.VK_OEM_PERIOD, + VirtualKeys.VK_OEM_2, VirtualKeys.VK_OEM_8, + VirtualKeys.VK_OEM_102 // the 102nd key (actually to the right of l-shift) + }; + + + //// WRONG + private static readonly VirtualKeys [] main_key_vkey_qwerty_jp106 = new VirtualKeys [] + { + // NOTE: this layout must concur with the scan codes layout above + VirtualKeys.VK_OEM_7, VirtualKeys.VK_1, VirtualKeys.VK_2, VirtualKeys.VK_3, VirtualKeys.VK_4, + VirtualKeys.VK_5, VirtualKeys.VK_6, VirtualKeys.VK_7, VirtualKeys.VK_8, VirtualKeys.VK_9, + VirtualKeys.VK_0, VirtualKeys.VK_OEM_4, VirtualKeys.VK_OEM_PLUS, VirtualKeys.VK_A, VirtualKeys.VK_Z, + VirtualKeys.VK_E, VirtualKeys.VK_R, VirtualKeys.VK_T, VirtualKeys.VK_Y, VirtualKeys.VK_U, + VirtualKeys.VK_I, VirtualKeys.VK_O, VirtualKeys.VK_P, VirtualKeys.VK_OEM_6, VirtualKeys.VK_OEM_1, + VirtualKeys.VK_Q, VirtualKeys.VK_S, VirtualKeys.VK_D, VirtualKeys.VK_F, VirtualKeys.VK_G, + VirtualKeys.VK_H, VirtualKeys.VK_J, VirtualKeys.VK_K, VirtualKeys.VK_L, VirtualKeys.VK_M, + VirtualKeys.VK_OEM_3, VirtualKeys.VK_OEM_5, VirtualKeys.VK_W, VirtualKeys.VK_X, VirtualKeys.VK_C, + VirtualKeys.VK_V, VirtualKeys.VK_B, VirtualKeys.VK_N, VirtualKeys.VK_OEM_COMMA, VirtualKeys.VK_OEM_PERIOD, + VirtualKeys.VK_OEM_2, VirtualKeys.VK_OEM_8, + VirtualKeys.VK_OEM_102 // the 102nd key (actually to the right of l-shift) + }; + + //// WRONG + private static readonly VirtualKeys [] main_key_vkey_qwertz_105 = new VirtualKeys [] + { + // NOTE: this layout must concur with the scan codes layout above + VirtualKeys.VK_OEM_7, VirtualKeys.VK_1, VirtualKeys.VK_2, VirtualKeys.VK_3, VirtualKeys.VK_4, + VirtualKeys.VK_5, VirtualKeys.VK_6, VirtualKeys.VK_7, VirtualKeys.VK_8, VirtualKeys.VK_9, + VirtualKeys.VK_0, VirtualKeys.VK_OEM_4, VirtualKeys.VK_OEM_PLUS, VirtualKeys.VK_A, VirtualKeys.VK_Z, + VirtualKeys.VK_E, VirtualKeys.VK_R, VirtualKeys.VK_T, VirtualKeys.VK_Y, VirtualKeys.VK_U, + VirtualKeys.VK_I, VirtualKeys.VK_O, VirtualKeys.VK_P, VirtualKeys.VK_OEM_6, VirtualKeys.VK_OEM_1, + VirtualKeys.VK_Q, VirtualKeys.VK_S, VirtualKeys.VK_D, VirtualKeys.VK_F, VirtualKeys.VK_G, + VirtualKeys.VK_H, VirtualKeys.VK_J, VirtualKeys.VK_K, VirtualKeys.VK_L, VirtualKeys.VK_M, + VirtualKeys.VK_OEM_3, VirtualKeys.VK_OEM_5, VirtualKeys.VK_W, VirtualKeys.VK_X, VirtualKeys.VK_C, + VirtualKeys.VK_V, VirtualKeys.VK_B, VirtualKeys.VK_N, VirtualKeys.VK_OEM_COMMA, VirtualKeys.VK_OEM_PERIOD, + VirtualKeys.VK_OEM_2, VirtualKeys.VK_OEM_8, + VirtualKeys.VK_OEM_102 // the 102nd key (actually to the right of l-shift) + }; + + //// WRONG + private static readonly VirtualKeys [] main_key_vkey_qwerty_v2 = new VirtualKeys [] + { + // NOTE: this layout must concur with the scan codes layout above + VirtualKeys.VK_OEM_7, VirtualKeys.VK_1, VirtualKeys.VK_2, VirtualKeys.VK_3, VirtualKeys.VK_4, + VirtualKeys.VK_5, VirtualKeys.VK_6, VirtualKeys.VK_7, VirtualKeys.VK_8, VirtualKeys.VK_9, + VirtualKeys.VK_0, VirtualKeys.VK_OEM_4, VirtualKeys.VK_OEM_PLUS, VirtualKeys.VK_A, VirtualKeys.VK_Z, + VirtualKeys.VK_E, VirtualKeys.VK_R, VirtualKeys.VK_T, VirtualKeys.VK_Y, VirtualKeys.VK_U, + VirtualKeys.VK_I, VirtualKeys.VK_O, VirtualKeys.VK_P, VirtualKeys.VK_OEM_6, VirtualKeys.VK_OEM_1, + VirtualKeys.VK_Q, VirtualKeys.VK_S, VirtualKeys.VK_D, VirtualKeys.VK_F, VirtualKeys.VK_G, + VirtualKeys.VK_H, VirtualKeys.VK_J, VirtualKeys.VK_K, VirtualKeys.VK_L, VirtualKeys.VK_M, + VirtualKeys.VK_OEM_3, VirtualKeys.VK_OEM_5, VirtualKeys.VK_W, VirtualKeys.VK_X, VirtualKeys.VK_C, + VirtualKeys.VK_V, VirtualKeys.VK_B, VirtualKeys.VK_N, VirtualKeys.VK_OEM_COMMA, VirtualKeys.VK_OEM_PERIOD, + VirtualKeys.VK_OEM_2, VirtualKeys.VK_OEM_8, + VirtualKeys.VK_OEM_102 // the 102nd key (actually to the right of l-shift) + }; + + //// WRONG + private static readonly VirtualKeys [] main_key_vkey_abnt_qwerty = new VirtualKeys [] + { + // NOTE: this layout must concur with the scan codes layout above + VirtualKeys.VK_OEM_7, VirtualKeys.VK_1, VirtualKeys.VK_2, VirtualKeys.VK_3, VirtualKeys.VK_4, + VirtualKeys.VK_5, VirtualKeys.VK_6, VirtualKeys.VK_7, VirtualKeys.VK_8, VirtualKeys.VK_9, + VirtualKeys.VK_0, VirtualKeys.VK_OEM_4, VirtualKeys.VK_OEM_PLUS, VirtualKeys.VK_A, VirtualKeys.VK_Z, + VirtualKeys.VK_E, VirtualKeys.VK_R, VirtualKeys.VK_T, VirtualKeys.VK_Y, VirtualKeys.VK_U, + VirtualKeys.VK_I, VirtualKeys.VK_O, VirtualKeys.VK_P, VirtualKeys.VK_OEM_6, VirtualKeys.VK_OEM_1, + VirtualKeys.VK_Q, VirtualKeys.VK_S, VirtualKeys.VK_D, VirtualKeys.VK_F, VirtualKeys.VK_G, + VirtualKeys.VK_H, VirtualKeys.VK_J, VirtualKeys.VK_K, VirtualKeys.VK_L, VirtualKeys.VK_M, + VirtualKeys.VK_OEM_3, VirtualKeys.VK_OEM_5, VirtualKeys.VK_W, VirtualKeys.VK_X, VirtualKeys.VK_C, + VirtualKeys.VK_V, VirtualKeys.VK_B, VirtualKeys.VK_N, VirtualKeys.VK_OEM_COMMA, VirtualKeys.VK_OEM_PERIOD, + VirtualKeys.VK_OEM_2, VirtualKeys.VK_OEM_8, + VirtualKeys.VK_OEM_102 // the 102nd key (actually to the right of l-shift) + }; + /* + private static readonly VirtualKeys [] main_key_vkey_qwerty_jp = new VirtualKeys [] + { + VirtualKeys.VK_1, VirtualKeys.VK_2, VirtualKeys.VK_3, VirtualKeys.VK_4, + VirtualKeys.VK_5, VirtualKeys.VK_6, VirtualKeys.VK_7, VirtualKeys.VK_8, VirtualKeys.VK_9, + VirtualKeys.VK_0, VirtualKeys.VK_OEM_MINUS, VirtualKeys.VK_OEM_PLUS,VirtualKeys.VK_OEM_3, + VirtualKeys.VK_Q, VirtualKeys.VK_W, VirtualKeys.VK_E, VirtualKeys.VK_R, VirtualKeys.VK_T + VirtualKeys.VK_Y, VirtualKeys.VK_U, VirtualKeys.VK_I, VirtualKeys.VK_O, VirtualKeys.VK_P + VirtualKeys.VK_OEM_4,VirtualKeys.VK_OEM_6, + VirtualKeys.VK_A, VirtualKeys.VK_S, VirtualKeys.VK_D, VirtualKeys.VK_F, + VirtualKeys.VK_G, VirtualKeys.VK_H, VirtualKeys.VK_J, VirtualKeys.VK_K, VirtualKeys.VK_L, + VirtualKeys.VK_OEM_1, VirtualKeys.VK_OEM_7, VirtualKeys.VK_OEM_5, VirtualKeys.VK_Z, + VirtualKeys.VK_X, VirtualKeys.VK_C, VirtualKeys.VK_V, VirtualKeys.VK_B, VirtualKeys.VK_N, + VirtualKeys.VK_M, VirtualKeys.VK_OEM_COMMA, VirtualKeys.VK_OEM_PERIOD, VirtualKeys.VK_OEM_2, + VirtualKeys.VK_OEM_102 + };*/ + + internal enum VirtualKeys { + VK_LBUTTON = 0x01, + VK_RBUTTON = 0x02, + VK_CANCEL = 0x03, + VK_MBUTTON = 0x04, + VK_XBUTTON1 = 0x05, + VK_XBUTTON2 = 0x06, + VK_BACK = 0x08, + VK_TAB = 0x09, + VK_CLEAR = 0x0C, + VK_RETURN = 0x0D, + VK_SHIFT = 0x10, + VK_CONTROL = 0x11, + VK_MENU = 0x12, + VK_PAUSE = 0x13, + VK_CAPITAL = 0x14, + VK_ESCAPE = 0x1B, + VK_SPACE = 0x20, + VK_PRIOR = 0x21, + VK_NEXT = 0x22, + VK_END = 0x23, + VK_HOME = 0x24, + VK_LEFT = 0x25, + VK_UP = 0x26, + VK_RIGHT = 0x27, + VK_DOWN = 0x28, + VK_SELECT = 0x29, + VK_PRINT = 0x2A, + VK_EXECUTE = 0x2B, + VK_SNAPSHOT = 0x2C, + VK_INSERT = 0x2D, + VK_DELETE = 0x2E, + VK_HELP = 0x2F, + VK_0 = 0x30, + VK_1 = 0x31, + VK_2 = 0x32, + VK_3 = 0x33, + VK_4 = 0x34, + VK_5 = 0x35, + VK_6 = 0x36, + VK_7 = 0x37, + VK_8 = 0x38, + VK_9 = 0x39, + VK_A = 0x41, + VK_B = 0x42, + VK_C = 0x43, + VK_D = 0x44, + VK_E = 0x45, + VK_F = 0x46, + VK_G = 0x47, + VK_H = 0x48, + VK_I = 0x49, + VK_J = 0x4A, + VK_K = 0x4B, + VK_L = 0x4C, + VK_M = 0x4D, + VK_N = 0x4E, + VK_O = 0x4F, + VK_P = 0x50, + VK_Q = 0x51, + VK_R = 0x52, + VK_S = 0x53, + VK_T = 0x54, + VK_U = 0x55, + VK_V = 0x56, + VK_W = 0x57, + VK_X = 0x58, + VK_Y = 0x59, + VK_Z = 0x5A, + VK_LWIN = 0x5B, + VK_RWIN = 0x5C, + VK_APPS = 0x5D, + VK_NUMPAD0 = 0x60, + VK_NUMPAD1 = 0x61, + VK_NUMPAD2 = 0x62, + VK_NUMPAD3 = 0x63, + VK_NUMPAD4 = 0x64, + VK_NUMPAD5 = 0x65, + VK_NUMPAD6 = 0x66, + VK_NUMPAD7 = 0x67, + VK_NUMPAD8 = 0x68, + VK_NUMPAD9 = 0x69, + VK_MULTIPLY = 0x6A, + VK_ADD = 0x6B, + VK_SEPARATOR = 0x6C, + VK_SUBTRACT = 0x6D, + VK_DECIMAL = 0x6E, + VK_DIVIDE = 0x6F, + VK_F1 = 0x70, + VK_F2 = 0x71, + VK_F3 = 0x72, + VK_F4 = 0x73, + VK_F5 = 0x74, + VK_F6 = 0x75, + VK_F7 = 0x76, + VK_F8 = 0x77, + VK_F9 = 0x78, + VK_F10 = 0x79, + VK_F11 = 0x7A, + VK_F12 = 0x7B, + VK_F13 = 0x7C, + VK_F14 = 0x7D, + VK_F15 = 0x7E, + VK_F16 = 0x7F, + VK_F17 = 0x80, + VK_F18 = 0x81, + VK_F19 = 0x82, + VK_F20 = 0x83, + VK_F21 = 0x84, + VK_F22 = 0x85, + VK_F23 = 0x86, + VK_F24 = 0x87, + VK_NUMLOCK = 0x90, + VK_SCROLL = 0x91, + VK_LSHIFT = 0xA0, + VK_RSHIFT = 0xA1, + VK_LCONTROL = 0xA2, + VK_RCONTROL = 0xA3, + VK_LMENU = 0xA4, + VK_RMENU = 0xA5, + VK_OEM_1 = 0xBA, + VK_OEM_PLUS = 0xBB, + VK_OEM_COMMA = 0xBC, + VK_OEM_MINUS = 0xBD, + VK_OEM_PERIOD = 0xBE, + VK_OEM_2 = 0xBF, + VK_OEM_3 = 0xC0, + VK_OEM_4 = 0xDB, + VK_OEM_5 = 0xDC, + VK_OEM_6 = 0xDD, + VK_OEM_7 = 0xDE, + VK_OEM_8 = 0xDF, + VK_OEM_AX = 0xE1, + VK_OEM_102 = 0xE2, + VK_ICO_HELP = 0xE3, + VK_ICO_00 = 0xE4, + VK_PROCESSKEY = 0xE5, + VK_ATTN = 0xF6, + VK_CRSEL = 0xF7, + VK_EXSEL = 0xF8, + VK_EREOF = 0xF9, + VK_PLAY = 0xFA, + VK_ZOOM = 0xFB, + VK_NONAME = 0xFC, + VK_PA1 = 0xFD, + VK_OEM_CLEAR = 0xFE, + } +} + diff --git a/mcs/class/Managed.Windows.Forms/resources/keyboards.resx b/mcs/class/Managed.Windows.Forms/resources/keyboards.resx new file mode 100644 index 0000000000000..5c39b5f3af7bf --- /dev/null +++ b/mcs/class/Managed.Windows.Forms/resources/keyboards.resx @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + 1.3 + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + AAEAAAD/////AQAAAAAAAAAMAgAAAF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AhAAAAD3YBAAACAAAADzIAAABAAAAAD3cBAAACAAAADzMAAAAjAAAAD3gBAAACAAAADzQAAAAkAAAAD3kBAAACAAAADzUAAAAlAAAAD3oBAAACAAAADzYAAABeAAAAD3sBAAACAAAADzcAAAAmAAAAD3wBAAACAAAADzgAAAAqAAAAD30BAAACAAAADzkAAAAoAAAAD34BAAACAAAADzAAAAApAAAAD38BAAACAAAADy0AAABfAAAAD4ABAAACAAAADz0AAAArAAAAD4EBAAACAAAAD3EAAABRAAAAD4IBAAACAAAAD3cAAABXAAAAD4MBAAACAAAAD2UAAABFAAAAD4QBAAACAAAAD3IAAABSAAAAD4UBAAACAAAAD3QAAABUAAAAD4YBAAACAAAAD3kAAABZAAAAD4cBAAACAAAAD3UAAABVAAAAD4gBAAACAAAAD2kAAABJAAAAD4kBAAACAAAAD28AAABPAAAAD4oBAAACAAAAD3AAAABQAAAAD4sBAAACAAAAD1sAAAB7AAAAD4wBAAACAAAAD10AAAB9AAAAD40BAAACAAAAD2EAAABBAAAAD44BAAACAAAAD3MAAABTAAAAD48BAAACAAAAD2QAAABEAAAAD5ABAAACAAAAD2YAAABGAAAAD5EBAAACAAAAD2cAAABHAAAAD5IBAAACAAAAD2gAAABIAAAAD5MBAAACAAAAD2oAAABKAAAAD5QBAAACAAAAD2sAAABLAAAAD5UBAAACAAAAD2wAAABMAAAAD5YBAAACAAAADzsAAAA6AAAAD5cBAAACAAAADycAAAAiAAAAD5gBAAACAAAAD1wAAAB8AAAAD5kBAAACAAAAD3oAAABaAAAAD5oBAAACAAAAD3gAAABYAAAAD5sBAAACAAAAD2MAAABDAAAAD5wBAAACAAAAD3YAAABWAAAAD50BAAACAAAAD2IAAABCAAAAD54BAAACAAAAD24AAABOAAAAD58BAAACAAAAD20AAABNAAAAD6ABAAACAAAADywAAAA8AAAAD6EBAAACAAAADy4AAAA+AAAAD6IBAAACAAAADy8AAAA/AAAAD6MBAAACAAAADzwAAAA+AAAAD6QBAAAAAAAADw+lAQAAAgAA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AADw8DAAACAAAAD3UAAABVAAAADxADAAACAAAAD2kAAABJAAAADxEDAAACAAAAD28AAABPAAAADxIDAAACAAAAD3AAAABQAAAADxMDAAACAAAAD/z////o////DxQDAAACAAAAD6j///8hAAAADxUDAAACAAAAD2EAAABBAAAADxYDAAACAAAAD3MAAABTAAAADxcDAAACAAAAD2QAAABEAAAADxgDAAACAAAAD2YAAABGAAAADxkDAAACAAAAD2cAAABHAAAADxoDAAACAAAAD2gAAABIAAAADxsDAAACAAAAD2oAAABKAAAADxwDAAACAAAAD2sAAABLAAAADx0DAAACAAAAD2wAAABMAAAADx4DAAACAAAAD/b////p////Dx8DAAACAAAAD+T////g////DyADAAACAAAADyQAAACj////DyEDAAACAAAAD3kAAABZAAAADyIDAAACAAAAD3gAAABYAAAADyMDAAACAAAAD2MAAABDAAAADyQDAAACAAAAD3YAAABWAAAADyUDAAACAAAAD2IAAABCAAAADyYDAAACAAAAD24AAABOAAAADycDAAACAAAAD20AAABNAAAADygDAAACAAAADywAAAA7AAAADykDAAACAAAADy4AAAA6AAAADyoDAAACAAAADy0AAABfAAAADysDAAACAAAADzwAAAA+AAAADywDAAAAAAAADw8tAwAAAgAAAA+n////sP///w8uAwAAAgAAAA8xAAAAKwAAAA8vAwAAAgAAAA8yAAAAIgAAAA8wAwAAAgAAAA8zAAAAKgAAAA8xAwAAAgAAAA80AAAA5////w8yAwAAAgAAAA81AAAAJQAAAA8zAwAAAgAAAA82AAAAJgAAAA80AwAAAgAAAA83AAAALwAAAA81AwAAAgAAAA84AAAAKAAAAA82AwAAAgAAAA85AAAAKQAAAA83AwAAAgAAAA8wAAAAPQAAAA84AwAAAgAAAA8nAAAAPwAAAA85AwAAAgAAAA9eAAAAYAAAAA86AwAAAgAAAA9xAAAAUQAAAA87AwAAAgAAAA93AAAAVwAAAA88AwAAAgAAAA9lAAAARQAAAA89AwAAAgAAAA9yAAAAUgAAAA8+AwAAAgAAAA90AAAAVAAAAA8/AwAAAgAAAA96AAAAWgAAAA9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AD5sDAAACAAAAD7T///9gAAAAD5wDAAACAAAAD3EAAABRAAAAD50DAAACAAAAD3cAAABXAAAAD54DAAACAAAAD2UAAABFAAAAD58DAAACAAAAD3IAAABSAAAAD6ADAAACAAAAD3QAAABUAAAAD6EDAAACAAAAD3kAAABZAAAAD6IDAAACAAAAD3UAAABVAAAAD6MDAAACAAAAD2kAAABJAAAAD6QDAAACAAAAD28AAABPAAAAD6UDAAACAAAAD3AAAABQAAAAD6YDAAACAAAAD/z////c////D6cDAAACAAAAD/X////V////D6gDAAACAAAAD2EAAABBAAAAD6kDAAACAAAAD3MAAABTAAAAD6oDAAACAAAAD2QAAABEAAAAD6sDAAACAAAAD2YAAABGAAAAD6wDAAACAAAAD2cAAABHAAAAD60DAAACAAAAD2gAAABIAAAAD64DAAACAAAAD2oAAABKAAAAD68DAAACAAAAD2sAAABLAAAAD7ADAAACAAAAD2wAAABMAAAAD7EDAAACAAAAD/b////W////D7IDAAACAAAAD+T////E////D7MDAAACAAAADycAAAAqAAAAD7QDAAACAAAAD3oAAABaAAAAD7UDAAACAAAAD3gAAABYAAAAD7YDAAACAAAAD2MAAABDAAAAD7cDAAACAAAAD3YAAABWAAAAD7gDAAACAAAAD2IAAABCAAAAD7kDAAACAAAAD24AAABOAAAAD7oDAAACAAAAD20AAABNAAAAD7sDAAACAAAADywAAAA7AAAAD7wDAAACAAAADy4AAAA6AAAAD70DAAACAAAADy0AAABfAAAAD74DAAACAAAADzwAAAA+AAAAD78DAAAAAAAADw/AAwAAAgAAAA98AAAAp////w/BAwAAAgAAAA8xAAAAIQAAAA/CAwAAAwAAAA8yAAAAIgAAAEAAAAAPwwMAAAMAAAAPMwAAACMAAACj////D8QDAAADAAAADzQAAACk////JAAAAA/FAwAAAgAAAA81AAAAJQAAAA/GAwAAAgAAAA82AAAAJgAAAA/HAwAAAwAAAA83AAAALwAAAHsAAAAPyAMAAAMAAAAPOAAAACgAAABbAAAAD8kDAAADAAAADzkAAAApAAAAXQAAAA/KAwAA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BAAAAgAAAA87AAAAOgAAAA+nBAAAAgAAAA9gAAAAYAAAAA+oBAAAAgAAAA88AAAAPgAAAA+pBAAAAgAAAA96AAAAWgAAAA+qBAAAAgAAAA94AAAAWAAAAA+rBAAAAgAAAA9jAAAAQwAAAA+sBAAAAgAAAA92AAAAVgAAAA+tBAAAAgAAAA9iAAAAQgAAAA+uBAAAAgAAAA9uAAAATgAAAA+vBAAAAgAAAA9tAAAATQAAAA+wBAAAAgAAAA8sAAAAJwAAAA+xBAAAAQAAAA8uAAAAD7IEAAACAAAAD+n////J////D7MEAAACAAAAD6v///+7////D7QEAAAAAAAADw+1BAAAAgAAAA8vAAAAXAAAAA+2BAAABAAAAA8xAAAAIQAAALn///+h////D7cEAAADAAAADzIAAABAAAAAsv///w+4BAAABAAAAA8zAAAAIwAAALP///+j////D7kEAAAEAAAADzQAAAAkAAAAvP///6T///8PugQAAAMAAAAPNQAAACUAAAC9////D7sEAAADAAAADzYAAAA/AAAAvv///w+8BAAAAgAAAA83AAAAJgAAAA+9BAAAAgAAAA84AAAAKgAAAA++BAAAAgAAAA85AAAAKAAAAA+/BAAAAgAAAA8wAAAAKQAAAA/ABAAAAgAAAA8tAAAAXwAAAA/BBAAAAgAAAA89AAAAKwAAAA/CBAAAAgAAAA9xAAAAUQAAAA/DBAAAAgAAAA93AAAAVwAAAA/EBAAAAgAAAA9lAAAARQAAAA/FBAAAAgAAAA9yAAAAUgAAAA/GBAAAAgAAAA90AAAAVAAAAA/HBAAAAgAAAA95AAAAWQAAAA/IBAAAAgAAAA91AAAAVQAAAA/JBAAAAgAAAA9pAAAASQAAAA/KBAAABAAAAA9vAAAATwAAAPj////Y////D8sEAAAEAAAAD3AAAABQAAAA/v///97///8PzAQAAAMAAAAPXgAAAKj///+o////D80EAAADAAAAD+f////H////fgAAAA/OBAAABAAAAA9hAAAAQQAAAOb////G////D88EAAAEAAAAD3MAAABTAAAA3////6f///8P0AQAAAQAAAAPZAAAAEQAAADw////0P///w/RBAAAAgA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AAAiAAAAD60FAAACAAAADzMAAAAjAAAAD64FAAACAAAADzQAAACk////D68FAAACAAAADzUAAAAlAAAAD7AFAAACAAAADzYAAAAmAAAAD7EFAAACAAAADzcAAAAvAAAAD7IFAAACAAAADzgAAAAoAAAAD7MFAAACAAAADzkAAAApAAAAD7QFAAACAAAADzAAAAA9AAAAD7UFAAACAAAADysAAAA/AAAAD7YFAAACAAAAD7T///9gAAAAD7cFAAACAAAAD3EAAABRAAAAD7gFAAACAAAAD3cAAABXAAAAD7kFAAACAAAAD2UAAABFAAAAD7oFAAACAAAAD3IAAABSAAAAD7sFAAACAAAAD3QAAABUAAAAD7wFAAACAAAAD3kAAABZAAAAD70FAAACAAAAD3UAAABVAAAAD74FAAACAAAAD2kAAABJAAAAD78FAAACAAAAD28AAABPAAAAD8AFAAACAAAAD3AAAABQAAAAD8EFAAACAAAAD+X////F////D8IFAAACAAAAD6j///9eAAAAD8MFAAACAAAAD2EAAABBAAAAD8QFAAACAAAAD3MAAABTAAAAD8UFAAACAAAAD2QAAABEAAAAD8YFAAACAAAAD2YAAABGAAAAD8cFAAACAAAAD2cAAABHAAAAD8gFAAACAAAAD2gAAABIAAAAD8kFAAACAAAAD2oAAABKAAAAD8oFAAACAAAAD2sAAABLAAAAD8sFAAACAAAAD2wAAABMAAAAD8wFAAACAAAAD/b////W////D80FAAACAAAAD+T////E////D84FAAACAAAADycAAAAqAAAAD88FAAACAAAAD3oAAABaAAAAD9AFAAACAAAAD3gAAABYAAAAD9EFAAACAAAAD2MAAABDAAAAD9IFAAACAAAAD3YAAABWAAAAD9MFAAACAAAAD2IAAABCAAAAD9QFAAACAAAAD24AAABOAAAAD9UFAAACAAAAD20AAABNAAAAD9YFAAACAAAADywAAAA7AAAAD9cFAAACAAAADy4AAAA6AAAAD9gFAAACAAAADy0AAABfAAAAD9kFAAACAAAADzwAAAA+AAAAD9oFAAAAAAAADw/bBQAABAAAAA9gAAAAfgAAACgAAAApAAAAD9wFAAACAAAADzEAAAAhAAAAD90FAAAEAAAADzIAAABAAAAAMgAAAD8AAAAP3gUAAAQAAAAPMwAAACMAAAAzAAAAKwAAAA/fBQAABAAAAA80AAAAJAAAADQAAAAiAAAAD+AFAAACAAAADzUAAAAlAAAAD+EFAAAEAAAADzYAAABeAAAANgAAAD0AAAAP4gUAAAQAAAAPNwAAACYAAAA3AAAAOgAAAA/jBQAABAAAAA84AAAAKgAAADgAAAAvAAAAD+QFAAACAAAADzkAAAAoAAAAD+UFAAACAAAADzAAAAApAAAAD+YFAAAEAAAADy0AAABfAAAALQAAAEkAAAAP5wUAAAQAAAAPPQAAACsAAAAuAAAAVgAAAA/oBQAABAAAAA9xAAAAUQAAACwAAAD7////D+kFAAAEAAAAD3cAAABXAAAA8////9P///8P6gUAAAQAAAAPZQAAAEUAAADl////xf///w/rBQAABAAAAA9yAAAAUgAAAOj////I////D+wFAAAEAAAAD3QAAABUAAAA+P///9j///8P7QUAAAQAAAAPeQAAAFkAAAD5////2f///w/uBQAABAAAAA91AAAAVQAAAOr////K////D+8FAAAEAAAAD2kAAABJAAAA8f///9H///8P8AUAAAQAAAAPbwAAAE8AAADk////xP///w/xBQAABAAAAA9wAAAAUAAAAOf////H////D/IFAAAEAAAAD1sAAAB7AAAA9v///9b///8P8wUAAAMAAAAPXQAAAH0AAAA7AAAAD/QFAAAEAAAAD2EAAABBAAAA/P///9z///8P9QUAAAQAAAAPcwAAAFMAAAD/////3////w/2BQAABAAAAA9kAAAARAAAAOD////A////D/cFAAAEAAAAD2YAAABGAAAA7v///87///8P+AUAAAQAAAAPZwAAAEcAAADm////xv///w/5BQAABAAAAA9oAAAASAAAAOP////D////D/oFAAAEAAAAD2oAAABKAAAA8v///9L///8P+wUAAAQAAAAPawAAAEsAAADt////zf///w/8BQAABAAAAA9sAAAATAAAAOL////C////D/0FAAAEAAAADzsAAAA6AAAA7P///8z///8P/gUAAAQAAAAPJwAAACIAAAD3////1////w//BQAABAAAAA9cAAAAfAAAACcAAADb////DwAGAAAEAAAAD3oAAABaAAAA/v///97///8PAQYAAAQAAAAPeAAAAFgAAADp////yf///w8CBgAABAAAAA9jAAAAQwAAAPr////a////DwMGAAAEAAAAD3YAAABWAAAA/f///93///8PBAYAAAQAAAAPYgAAAEIAAAD0////1P///w8FBgAABAAAAA9uAAAATgAAAPX////V////DwYGAAAEAAAAD20AAABNAAAA7////8////8PBwYAAAQAAAAPLAAAADwAAADw////0P///w8IBgAABAAAAA8uAAAAPgAAAOv////L////DwkGAAAEAAAADy8AAAA/AAAA4f///8H///8PCgYAAAIAAAAPPAAAAD4AAAAPCwYAAAAAAAAPDwwGAAAEAAAAD2AAAAB+AAAA9////9f///8PDQYAAAIAAAAPMQAAACEAAAAPDgYAAAIAAAAPMgAAAEAAAAAPDwYAAAIAAAAPMwAAACMAAAAPEAYAAAIAAAAPNAAAACQAAAAPEQYAAAIAAAAPNQAAACUAAAAPEgYAAAIAAAAPNgAAAF4AAAAPEwYAAAIAAAAPNwAAACYAAAAPFAYAAAIAAAAPOAAAACoAAAAPFQYAAAIAAAAPOQAAACgAAAAPFgYAAAIAAAAPMAAAACkAAAAPFwYAAAIAAAAPLQAAAF8AAAAPGAYAAAIAAAAPPQAAACsAAAAPGQYAAAQAAAAPcQAAAFEAAAD/////3////w8aBgAABAAAAA93AAAAVwAAAOL////C////DxsGAAAEAAAAD2UAAABFAAAA5f///8X///8PHAYAAAQAAAAPcgAAAFIAAADw////0P///w8dBgAABAAAAA90AAAAVAAAAPL////S////Dx4GAAAEAAAAD3kAAABZAAAA+v///9r///8PHwYAAAQAAAAPdQAAAFUAAADz////0////w8gBgAABAAAAA9pAAAASQAAAOj////I////DyEGAAAEAAAAD28AAABPAAAA7v///87///8PIgYAAAQAAAAPcAAAAFAAAADv////z////w8jBgAABAAAAA9bAAAAewAAAPj////Y////DyQGAAAEAAAAD10AAAB9AAAA+f///9n///8PJQYAAAQAAAAPYQAAAEEAAADg////wP///w8mBgAABAAAAA9zAAAAUwAAAPH////R////DycGAAAEAAAAD2QAAABEAAAA5P///8T///8PKAYAAAQAAAAPZgAAAEYAAAD0////1P///w8pBgAABAAAAA9nAAAARwAAAOP////D////DyoGAAAEAAAAD2gAAABIAAAA9f///9X///8PKwYAAAQAAAAPagAAAEoAAADp////yf///w8sBgAABAAAAA9rAAAASwAAAOr////K////Dy0GAAAEAAAAD2wAAABMAAAA6////8v///8PLgYAAAIAAAAPOwAAADoAAAAPLwYAAAIAAAAPJwAAACIAAAAPMAYAAAQAAAAPXAAAAHwAAAD+////3v///w8xBgAABAAAAA96AAAAWgAAAOf////H////DzIGAAAEAAAAD3gAAABYAAAA/P///9z///8PMwYAAAQAAAAPYwAAAEMAAAD2////1v///w80BgAABAAAAA92AAAAVgAAAOb////G////DzUGAAAEAAAAD2IAAABCAAAA4f///8H///8PNgYAAAQAAAAPbgAAAE4AAADt////zf///w83BgAABAAAAA9tAAAATQAAAOz////M////DzgGAAACAAAADywAAAA8AAAADzkGAAACAAAADy4AAAA+AAAADzoGAAACAAAADy8AAAA/AAAADzsGAAACAAAADzwAAAA+AAAADzwGAAAAAAAADw89BgAABAAAAA9gAAAAfgAAAKP///+z////Dz4GAAACAAAADzEAAAAhAAAADz8GAAACAAAADzIAAABAAAAAD0AGAAACAAAADzMAAAAjAAAAD0EGAAACAAAADzQAAAAkAAAAD0IGAAACAAAADzUAAAAlAAAAD0MGAAACAAAADzYAAABeAAAAD0QGAAACAAAADzcAAAAmAAAAD0UGAAACAAAADzgAAAAqAAAAD0YGAAACAAAADzkAAAAoAAAAD0cGAAACAAAADzAAAAApAAAAD0gGAAACAAAADy0AAABfAAAAD0kGAAACAAAADz0AAAArAAAAD0oGAAAEAAAAD3EAAABRAAAAyv///+r///8PSwYAAAQAAAAPdwAAAFcAAADD////4////w9MBgAABAAAAA9lAAAARQAAANX////1////D00GAAAEAAAAD3IAAABSAAAAy////+v///8PTgYAAAQAAAAPdAAAAFQAAADF////5f///w9PBgAABAAAAA95AAAAWQAAAM7////u////D1AGAAAEAAAAD3UAAABVAAAAx////+f///8PUQYAAAQAAAAPaQAAAEkAAADb////+////w9SBgAABAAAAA9vAAAATwAAAK7///++////D1MGAAAEAAAAD3AAAABQAAAA2v////r///8PVAYAAAQAAAAPWwAAAHsAAADI////6P///w9VBgAABAAAAA9dAAAAfQAAACcAAAAnAAAAD1YGAAAEAAAAD2EAAABBAAAAxv///+b///8PVwYAAAQAAAAPcwAAAFMAAADZ////+f///w9YBgAABAAAAA9kAAAARAAAANf////3////D1kGAAAEAAAAD2YAAABGAAAAwf///+H///8PWgYAAAQAAAAPZwAAAEcAAADQ////8P///w9bBgAABAAAAA9oAAAASAAAANL////y////D1wGAAAEAAAAD2oAAABKAAAAz////+////8PXQYAAAQAAAAPawAAAEsAAADM////7P///w9eBgAABAAAAA9sAAAATAAAAMT////k////D18GAAAEAAAADzsAAAA6AAAA1v////b///8PYAYAAAQAAAAPJwAAACIAAADc/////P///w9hBgAABAAAAA9cAAAAfAAAAC8AAAB8AAAAD2IGAAAEAAAAD3oAAABaAAAA0f////H///8PYwYAAAQAAAAPeAAAAFgAAADe/////v///w9kBgAABAAAAA9jAAAAQwAAANP////z////D2UGAAAEAAAAD3YAAABWAAAAzf///+3///8PZgYAAAQAAAAPYgAAAEIAAACm////tv///w9nBgAABAAAAA9uAAAATgAAANT////0////D2gGAAAEAAAAD20AAABNAAAA2P////j///8PaQYAAAQAAAAPLAAAADwAAADC////4v///w9qBgAABAAAAA8uAAAAPgAAAMD////g////D2sGAAAEAAAADy8AAAA/AAAALgAAACwAAAAPbAYAAAQAAAAPPAAAAD4AAAB8AAAApv///w9tBgAAAAAAAA8PbgYAAAIAAAAPYAAAAH4AAAAPbwYAAAIAAAAPMQAAACEAAAAPcAYAAAIAAAAPMgAAAEAAAAAPcQYAAAIAAAAPMwAAACMAAAAPcgYAAAIAAAAPNAAAACQAAAAPcwYAAAIAAAAPNQAAACUAAAAPdAYAAAIAAAAPNgAAAF4AAAAPdQYAAAIAAAAPNwAAACYAAAAPdgYAAAIAAAAPOAAAACoAAAAPdwYAAAIAAAAPOQAAACgAAAAPeAYAAAIAAAAPMAAAACkAAAAPeQYAAAIAAAAPLQAAAF8AAAAPegYAAAIAAAAPPQAAACsAAAAPewYAAAQAAAAPcQAAAFEAAADK////6v///w98BgAABAAAAA93AAAAVwAAAMP////j////D30GAAAEAAAAD2UAAABFAAAA1f////X///8PfgYAAAQAAAAPcgAAAFIAAADL////6////w9/BgAABAAAAA90AAAAVAAAAMX////l////D4AGAAAEAAAAD3kAAABZAAAAzv///+7///8PgQYAAAQAAAAPdQAAAFUAAADH////5////w+CBgAABAAAAA9pAAAASQAAANv////7////D4MGAAAEAAAAD28AAABPAAAA3f////3///8PhAYAAAQAAAAPcAAAAFAAAADa////+v///w+FBgAABAAAAA9bAAAAewAAAMj////o////D4YGAAAEAAAAD10AAAB9AAAA3/////////8PhwYAAAQAAAAPYQAAAEEAAADG////5v///w+IBgAABAAAAA9zAAAAUwAAANn////5////D4kGAAAEAAAAD2QAAABEAAAA1/////f///8PigYAAAQAAAAPZgAAAEYAAADB////4f///w+LBgAABAAAAA9nAAAARwAAAND////w////D4wGAAAEAAAAD2gAAABIAAAA0v////L///8PjQYAAAQAAAAPagAAAEoAAADP////7////w+OBgAABAAAAA9rAAAASwAAAMz////s////D48GAAAEAAAAD2wAAABMAAAAxP///+T///8PkAYAAAQAAAAPOwAAADoAAADW////9v///w+RBgAABAAAAA8nAAAAIgAAANz////8////D5IGAAACAAAAD1wAAAB8AAAAD5MGAAAEAAAAD3oAAABaAAAA0f////H///8PlAYAAAQAAAAPeAAAAFgAAADe/////v///w+VBgAABAAAAA9jAAAAQwAAANP////z////D5YGAAAEAAAAD3YAAABWAAAAzf///+3///8PlwYAAAQAAAAPYgAAAEIAAADJ////6f///w+YBgAABAAAAA9uAAAATgAAANT////0////D5kGAAAEAAAAD20AAABNAAAA2P////j///8PmgYAAAQAAAAPLAAAADwAAADC////4v///w+bBgAABAAAAA8uAAAAPgAAAMD////g////D5wGAAACAAAADy8AAAA/AAAAD50GAAAAAAAADw+eBgAAAAAAAA8PnwYAAAIAAAAPYAAAAH4AAAAPoAYAAAIAAAAPMQAAACEAAAAPoQYAAAIAAAAPMgAAAEAAAAAPogYAAAIAAAAPMwAAACMAAAAPowYAAAIAAAAPNAAAACQAAAAPpAYAAAIAAAAPNQAAACUAAAAPpQYAAAIAAAAPNgAAAF4AAAAPpgYAAAIAAAAPNwAAACYAAAAPpwYAAAIAAAAPOAAAACoAAAAPqAYAAAIAAAAPOQAAACgAAAAPqQYAAAIAAAAPMAAAACkAAAAPqgYAAAIAAAAPLQAAAF8AAAAPqwYAAAIAAAAPPQAAACsAAAAPrAYAAAQAAAAPcQAAAFEAAADK////6v///w+tBgAABAAAAA93AAAAVwAAAMP////j////D64GAAAEAAAAD2UAAABFAAAA1f////X///8PrwYAAAQAAAAPcgAAAFIAAADL////6////w+wBgAABAAAAA90AAAAVAAAAMX////l////D7EGAAAEAAAAD3kAAABZAAAAzv///+7///8PsgYAAAQAAAAPdQAAAFUAAADH////5////w+zBgAABAAAAA9pAAAASQAAANv////7////D7QGAAAEAAAAD28AAABPAAAA3f////3///8PtQYAAAQAAAAPcAAAAFAAAADa////+v///w+2BgAABAAAAA9bAAAAewAAAMj////o////D7cGAAAEAAAAD10AAAB9AAAA3/////////8PuAYAAAQAAAAPYQAAAEEAAADG////5v///w+5BgAABAAAAA9zAAAAUwAAANn////5////D7oGAAAEAAAAD2QAAABEAAAA1/////f///8PuwYAAAQAAAAPZgAAAEYAAADB////4f///w+8BgAABAAAAA9nAAAARwAAAND////w////D70GAAAEAAAAD2gAAABIAAAA0v////L///8PvgYAAAQAAAAPagAAAEoAAADP////7////w+/BgAABAAAAA9rAAAASwAAAMz////s////D8AGAAAEAAAAD2wAAABMAAAAxP///+T///8PwQYAAAQAAAAPOwAAADoAAADW////9v///w/CBgAABAAAAA8nAAAAIgAAANz////8////D8MGAAACAAAAD1wAAAB8AAAAD8QGAAAEAAAAD3oAAABaAAAA0f////H///8PxQYAAAQAAAAPeAAAAFgAAADe/////v///w/GBgAABAAAAA9jAAAAQwAAANP////z////D8cGAAAEAAAAD3YAAABWAAAAzf///+3///8PyAYAAAQAAAAPYgAAAEIAAADJ////6f///w/JBgAABAAAAA9uAAAATgAAANT////0////D8oGAAAEAAAAD20AAABNAAAA2P////j///8PywYAAAQAAAAPLAAAADwAAADC////4v///w/MBgAABAAAAA8uAAAAPgAAAMD////g////D80GAAACAAAADy8AAAA/AAAAD84GAAACAAAADzwAAAA+AAAAD88GAAAAAAAADw/QBgAAAgAAAA8oAAAAKQAAAA/RBgAAAgAAAA8xAAAAIQAAAA/SBgAAAgAAAA8yAAAAIgAAAA/TBgAAAgAAAA8zAAAALwAAAA/UBgAAAgAAAA80AAAAJAAAAA/VBgAAAgAAAA81AAAAOgAAAA/WBgAAAgAAAA82AAAALAAAAA/XBgAAAgAAAA83AAAALgAAAA/YBgAAAgAAAA84AAAAOwAAAA/ZBgAAAgAAAA85AAAAPwAAAA/aBgAAAgAAAA8wAAAAJQAAAA/bBgAAAgAAAA8tAAAAXwAAAA/cBgAAAgAAAA89AAAAKwAAAA/dBgAAAgAAAA/K////6v///w/eBgAAAgAAAA/D////4////w/fBgAAAgAAAA/V////9f///w/gBgAAAgAAAA/L////6////w/hBgAAAgAAAA/F////5f///w/iBgAAAgAAAA/O////7v///w/jBgAAAgAAAA/H////5////w/kBgAAAgAAAA/b////+////w/lBgAAAgAAAA/d/////f///w/mBgAAAgAAAA/a////+v///w/nBgAAAgAAAA/I////6P///w/oBgAAAgAAAA/f/////////w/pBgAAAgAAAA/G////5v///w/qBgAAAgAAAA/Z////+f///w/rBgAAAgAAAA/X////9////w/sBgAAAgAAAA/B////4f///w/tBgAAAgAAAA/Q////8P///w/uBgAAAgAAAA/S////8v///w/vBgAAAgAAAA/P////7////w/wBgAAAgAAAA/M////7P///w/xBgAAAgAAAA/E////5P///w/yBgAAAgAAAA/W////9v///w/zBgAAAgAAAA/c/////P///w/0BgAAAgAAAA9cAAAAfAAAAA/1BgAAAgAAAA/R////8f///w/2BgAAAgAAAA/e/////v///w/3BgAAAgAAAA/T////8////w/4BgAAAgAAAA/N////7f///w/5BgAAAgAAAA/J////6f///w/6BgAAAgAAAA/U////9P///w/7BgAAAgAAAA/Y////+P///w/8BgAAAgAAAA/C////4v///w/9BgAAAgAAAA/A////4P///w/+BgAAAgAAAA8vAAAAPwAAAA//BgAAAgAAAA88AAAAPgAAAA8ABwAAAAAAAA8PAQcAAAIAAAAPYAAAAH4AAAAPAgcAAAIAAAAPMQAAACEAAAAPAwcAAAIAAAAPMgAAAEAAAAAPBAcAAAIAAAAPMwAAACMAAAAPBQcAAAIAAAAPNAAAACQAAAAPBgcAAAIAAAAPNQAAACUAAAAPBwcAAAIAAAAPNgAAAF4AAAAPCAcAAAIAAAAPNwAAACYAAAAPCQcAAAIAAAAPOAAAACoAAAAPCgcAAAIAAAAPOQAAACgAAAAPCwcAAAIAAAAPMAAAACkAAAAPDAcAAAIAAAAPLQAAAF8AAAAPDQcAAAIAAAAPPQAAACsAAAAPDgcAAAQAAAAPcQAAAFEAAADp////yf///w8PBwAABAAAAA93AAAAVwAAAPb////W////DxAHAAAEAAAAD2UAAABFAAAA8////9P///8PEQcAAAQAAAAPcgAAAFIAAADq////yv///w8SBwAABAAAAA90AAAAVAAAAOX////F////DxMHAAAEAAAAD3kAAABZAAAA7f///83///8PFAcAAAQAAAAPdQAAAFUAAADj////w////w8VBwAABAAAAA9pAAAASQAAAPj////Y////DxYHAAAEAAAAD28AAABPAAAA+f///9n///8PFwcAAAQAAAAPcAAAAFAAAADn////x////w8YBwAABAAAAA9bAAAAewAAAPX////V////DxkHAAAEAAAAD10AAAB9AAAA+v///9r///8PGgcAAAQAAAAPYQAAAEEAAAD0////1P///w8bBwAABAAAAA9zAAAAUwAAAPv////b////DxwHAAAEAAAAD2QAAABEAAAA4v///8L///8PHQcAAAQAAAAPZgAAAEYAAADg////wP///w8eBwAABAAAAA9nAAAARwAAAO/////P////Dx8HAAAEAAAAD2gAAABIAAAA8P///9D///8PIAcAAAQAAAAPagAAAEoAAADu////zv///w8hBwAABAAAAA9rAAAASwAAAOv////L////DyIHAAAEAAAAD2wAAABMAAAA5P///8T///8PIwcAAAQAAAAPOwAAADoAAADm////xv///w8kBwAABAAAAA8nAAAAIgAAAP3////d////DyUHAAACAAAAD1wAAAB8AAAADyYHAAAEAAAAD3oAAABaAAAA/////9////8PJwcAAAQAAAAPeAAAAFgAAAD3////1////w8oBwAABAAAAA9jAAAAQwAAAPH////R////DykHAAAEAAAAD3YAAABWAAAA7P///8z///8PKgcAAAQAAAAPYgAAAEIAAADo////yP///w8rBwAABAAAAA9uAAAATgAAAPL////S////DywHAAAEAAAAD20AAABNAAAA/P///9z///8PLQcAAAQAAAAPLAAAADwAAADh////wf///w8uBwAABAAAAA8uAAAAPgAAAP7////e////Dy8HAAACAAAADy8AAAA/AAAADzAHAAACAAAADzwAAAA+AAAADzEHAAAAAAAADw8yBwAAAgAAAA9gAAAAfgAAAA8zBwAAAgAAAA8xAAAAIQAAAA80BwAAAgAAAA8yAAAAQAAAAA81BwAAAgAAAA8zAAAAIwAAAA82BwAAAgAAAA80AAAAJAAAAA83BwAAAgAAAA81AAAAJQAAAA84BwAAAgAAAA82AAAAXgAAAA85BwAAAgAAAA83AAAAJgAAAA86BwAAAgAAAA84AAAAKgAAAA87BwAAAgAAAA85AAAAKAAAAA88BwAAAgAAAA8wAAAAKQAAAA89BwAAAgAAAA8tAAAAXwAAAA8+BwAAAgAAAA89AAAAKwAAAA8/BwAABAAAAA9xAAAAUQAAANH////x////D0AHAAAEAAAAD3cAAABXAAAA1/////f///8PQQcAAAQAAAAPZQAAAEUAAADF////5f///w9CBwAABAAAAA9yAAAAUgAAANL////y////D0MHAAAEAAAAD3QAAABUAAAA1P////T///8PRAcAAAQAAAAPeQAAAFkAAADZ////+f///w9FBwAABAAAAA91AAAAVQAAANX////1////D0YHAAAEAAAAD2kAAABJAAAAyf///+n///8PRwcAAAQAAAAPbwAAAE8AAADP////7////w9IBwAABAAAAA9wAAAAUAAAAND////w////D0kHAAAEAAAAD1sAAAB7AAAA2/////v///8PSgcAAAQAAAAPXQAAAH0AAADd/////f///w9LBwAABAAAAA9hAAAAQQAAAMH////h////D0wHAAAEAAAAD3MAAABTAAAA0/////P///8PTQcAAAQAAAAPZAAAAEQAAADE////5P///w9OBwAABAAAAA9mAAAARgAAAMb////m////D08HAAAEAAAAD2cAAABHAAAAx////+f///8PUAcAAAQAAAAPaAAAAEgAAADI////6P///w9RBwAABAAAAA9qAAAASgAAAMr////q////D1IHAAAEAAAAD2sAAABLAAAAy////+v///8PUwcAAAQAAAAPbAAAAEwAAADM////7P///w9UBwAAAgAAAA87AAAAOgAAAA9VBwAAAgAAAA8nAAAAIgAAAA9WBwAAAgAAAA9cAAAAfAAAAA9XBwAABAAAAA96AAAAWgAAANr////6////D1gHAAAEAAAAD3gAAABYAAAA2P////j///8PWQcAAAQAAAAPYwAAAEMAAADD////4////w9aBwAABAAAAA92AAAAVgAAANb////2////D1sHAAAEAAAAD2IAAABCAAAAwv///+L///8PXAcAAAQAAAAPbgAAAE4AAADO////7v///w9dBwAABAAAAA9tAAAATQAAAM3////t////D14HAAACAAAADywAAAA8AAAAD18HAAACAAAADy4AAAA+AAAAD2AHAAACAAAADy8AAAA/AAAAD2EHAAACAAAADzwAAAA+AAAAD2IHAAAAAAAADw9jBwAABAAAAA9gAAAAfgAAAK3///+9////D2QHAAAEAAAADzEAAAAhAAAAMQAAACEAAAAPZQcAAAQAAAAPMgAAAEAAAAAyAAAAIgAAAA9mBwAABAAAAA8zAAAAIwAAADMAAAAnAAAAD2cHAAAEAAAADzQAAAAkAAAANAAAACoAAAAPaAcAAAQAAAAPNQAAACUAAAA1AAAAOgAAAA9pBwAABAAAAA82AAAAXgAAADYAAAAsAAAAD2oHAAAEAAAADzcAAAAmAAAANwAAAC4AAAAPawcAAAQAAAAPOAAAACoAAAA4AAAAOwAAAA9sBwAABAAAAA85AAAAKAAAADkAAAAoAAAAD20HAAAEAAAADzAAAAApAAAAMAAAACkAAAAPbgcAAAQAAAAPLQAAAF8AAAAtAAAAXwAAAA9vBwAABAAAAA89AAAAKwAAAD0AAAArAAAAD3AHAAAEAAAAD3EAAABRAAAAyv///+r///8PcQcAAAQAAAAPdwAAAFcAAADD////4////w9yBwAABAAAAA9lAAAARQAAANX////1////D3MHAAAEAAAAD3IAAABSAAAAy////+v///8PdAcAAAQAAAAPdAAAAFQAAADF////5f///w91BwAABAAAAA95AAAAWQAAAM7////u////D3YHAAAEAAAAD3UAAABVAAAAx////+f///8PdwcAAAQAAAAPaQAAAEkAAADb////+////w94BwAABAAAAA9vAAAATwAAAN3////9////D3kHAAAEAAAAD3AAAABQAAAA2v////r///8PegcAAAQAAAAPWwAAAHsAAADI////6P///w97BwAABAAAAA9dAAAAfQAAAKf///+3////D3wHAAAEAAAAD2EAAABBAAAAxv///+b///8PfQcAAAQAAAAPcwAAAFMAAACm////tv///w9+BwAABAAAAA9kAAAARAAAANf////3////D38HAAAEAAAAD2YAAABGAAAAwf///+H///8PgAcAAAQAAAAPZwAAAEcAAADQ////8P///w+BBwAABAAAAA9oAAAASAAAANL////y////D4IHAAAEAAAAD2oAAABKAAAAz////+////8PgwcAAAQAAAAPawAAAEsAAADM////7P///w+EBwAABAAAAA9sAAAATAAAAMT////k////D4UHAAAEAAAADzsAAAA6AAAA1v////b///8PhgcAAAQAAAAPJwAAACIAAACk////tP///w+HBwAABAAAAA9cAAAAfAAAAFwAAAB8AAAAD4gHAAAEAAAAD3oAAABaAAAA0f////H///8PiQcAAAQAAAAPeAAAAFgAAADe/////v///w+KBwAABAAAAA9jAAAAQwAAANP////z////D4sHAAAEAAAAD3YAAABWAAAAzf///+3///8PjAcAAAQAAAAPYgAAAEIAAADJ////6f///w+NBwAABAAAAA9uAAAATgAAANT////0////D44HAAAEAAAAD20AAABNAAAA2P////j///8PjwcAAAQAAAAPLAAAADwAAADC////4v///w+QBwAABAAAAA8uAAAAPgAAAMD////g////D5EHAAAEAAAADy8AAAA/AAAALwAAAD8AAAAPkgcAAAIAAAAPPAAAAD4AAAAPkwcAAAAAAAAPD5QHAAACAAAAD63///+9////D5UHAAACAAAADzEAAAAhAAAAD5YHAAACAAAADzIAAAAiAAAAD5cHAAACAAAADzMAAAAnAAAAD5gHAAACAAAADzQAAAA7AAAAD5kHAAACAAAADzUAAAAlAAAAD5oHAAACAAAADzYAAAA6AAAAD5sHAAACAAAADzcAAAA/AAAAD5wHAAACAAAADzgAAAAqAAAAD50HAAACAAAADzkAAAAoAAAAD54HAAACAAAADzAAAAApAAAAD58HAAACAAAADy0AAABfAAAAD6AHAAACAAAADz0AAAArAAAAD6EHAAACAAAAD8r////q////D6IHAAACAAAAD8P////j////D6MHAAACAAAAD9X////1////D6QHAAACAAAAD8v////r////D6UHAAACAAAAD8X////l////D6YHAAACAAAAD87////u////D6cHAAACAAAAD8f////n////D6gHAAACAAAAD9v////7////D6kHAAACAAAAD93////9////D6oHAAACAAAAD9r////6////D6sHAAACAAAAD8j////o////D6wHAAACAAAAD6f///+3////D60HAAACAAAAD8b////m////D64HAAACAAAAD6b///+2////D68HAAACAAAAD9f////3////D7AHAAACAAAAD8H////h////D7EHAAACAAAAD9D////w////D7IHAAACAAAAD9L////y////D7MHAAACAAAAD8/////v////D7QHAAACAAAAD8z////s////D7UHAAACAAAAD8T////k////D7YHAAACAAAAD9b////2////D7cHAAACAAAAD6T///+0////D7gHAAACAAAAD1wAAAAvAAAAD7kHAAACAAAAD9H////x////D7oHAAACAAAAD97////+////D7sHAAACAAAAD9P////z////D7wHAAACAAAAD83////t////D70HAAACAAAAD8n////p////D74HAAACAAAAD9T////0////D78HAAACAAAAD9j////4////D8AHAAACAAAAD8L////i////D8EHAAACAAAAD8D////g////D8IHAAACAAAADy4AAAAsAAAAD8MHAAACAAAADzwAAAA+AAAAD8QHAAAAAAAADw/FBwAAAgAAAA+j////s////w/GBwAAAgAAAA8xAAAAIQAAAA/HBwAAAgAAAA8yAAAAIgAAAA/IBwAAAgAAAA8zAAAAJwAAAA/JBwAAAgAAAA80AAAAOwAAAA/KBwAAAgAAAA81AAAAJQAAAA/LBwAAAgAAAA82AAAAOgAAAA/MBwAAAgAAAA83AAAAPwAAAA/NBwAAAgAAAA84AAAAKgAAAA/OBwAAAgAAAA85AAAAKAAAAA/PBwAAAgAAAA8wAAAAKQAAAA/QBwAAAgAAAA8tAAAAXwAAAA/RBwAAAgAAAA89AAAAKwAAAA/SBwAAAgAAAA/K////6v///w/TBwAAAgAAAA/D////4////w/UBwAAAgAAAA/V////9f///w/VBwAAAgAAAA/L////6////w/WBwAAAgAAAA/F////5f///w/XBwAAAgAAAA/O////7v///w/YBwAAAgAAAA/H////5////w/ZBwAAAgAAAA/b////+////w/aBwAAAgAAAA/d/////f///w/bBwAAAgAAAA/a////+v///w/cBwAAAgAAAA/I////6P///w/dBwAAAgAAAA/f/////////w/eBwAAAgAAAA/G////5v///w/fBwAAAgAAAA/Z////+f///w/gBwAAAgAAAA/X////9////w/hBwAAAgAAAA/B////4f///w/iBwAAAgAAAA/Q////8P///w/jBwAAAgAAAA/S////8v///w/kBwAAAgAAAA/P////7////w/lBwAAAgAAAA/M////7P///w/mBwAAAgAAAA/E////5P///w/nBwAAAgAAAA/W////9v///w/oBwAAAgAAAA/c/////P///w/pBwAAAgAAAA9cAAAALwAAAA/qBwAAAgAAAA/R////8f///w/rBwAAAgAAAA/e/////v///w/sBwAAAgAAAA/T////8////w/tBwAAAgAAAA/N////7f///w/uBwAAAgAAAA/J////6f///w/vBwAAAgAAAA/U////9P///w/wBwAAAgAAAA/Y////+P///w/xBwAAAgAAAA/C////4v///w/yBwAAAgAAAA/A////4P///w/zBwAAAgAAAA8uAAAALAAAAA/0BwAAAgAAAA88AAAAPgAAAA/1BwAAAAAAAA8P9gcAAAIAAAAPuv///6r///8P9wcAAAIAAAAPMQAAACEAAAAP+AcAAAIAAAAPMgAAACIAAAAP+QcAAAIAAAAPMwAAALf///8P+gcAAAIAAA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AAAAD1wAAAB8AAAADygIAAACAAAADzEAAAAhAAAADykIAAACAAAADzIAAAAiAAAADyoIAAACAAAADzMAAACj////DysIAAACAAAADzQAAAAkAAAADywIAAACAAAADzUAAAAlAAAADy0IAAACAAAADzYAAAAmAAAADy4IAAACAAAADzcAAAAvAAAADy8IAAACAAAADzgAAAAoAAAADzAIAAACAAAADzkAAAApAAAADzEIAAACAAAADzAAAAA9AAAADzIIAAACAAAADycAAAA/AAAADzMIAAACAAAAD+z///9eAAAADzQIAAACAAAAD3EAAABRAAAADzUIAAACAAAAD3cAAABXAAAADzYIAAACAAAAD2UAAABFAAAADzcIAAACAAAAD3IAAABSAAAADzgIAAACAAAAD3QAAABUAAAADzkIAAACAAAAD3kAAABZAAAADzoIAAACAAAAD3UAAABVAAAADzsIAAACAAAAD2kAAABJAAAADzwIAAACAAAAD28AAABPAAAADz0IAAACAAAAD3AAAABQAAAADz4IAAACAAAAD+j////p////Dz8IAAACAAAADysAAAAqAAAAD0AIAAACAAAAD2EAAABBAAAAD0EIAAACAAAAD3MAAABTAAAAD0IIAAACAAAAD2QAAABEAAAAD0MIAAACAAAAD2YAAABGAAAAD0QIAAACAAAAD2cAAABHAAAAD0UIAAACAAAAD2gAAABIAAAAD0YIAAACAAAAD2oAAABKAAAAD0cIAAACAAAAD2sAAABLAAAAD0gIAAACAAAAD2wAAABMAAAAD0kIAAACAAAAD/L////n////D0oIAAACAAAAD+D///+w////D0sIAAACAAAAD/n///+n////D0wIAAACAAAAD3oAAABaAAAAD00IAAACAAAAD3gAAABYAAAAD04IAAACAAAAD2MAAABDAAAAD08IAAACAAAAD3YAAABWAAAAD1AIAAACAAAAD2IAAABCAAAAD1EIAAACAAAAD24AAABOAAAAD1IIAAACAAAAD20AAABNAAAAD1MIAAACAAAADywAAAA7AAAAD1QIAAACAAAADy4AAAA6AAAAD1UIAAACAAAADy0AAABfAAAAD1YIAAACAAAADzwAAAA+AAAAD1cIAAAAAAAADw9YCAAAAQAAAA+w////D1kIAAACAAAADzEAAAAhAAAAD1oIAAACAAAADzIAAAAiAAAAD1sIAAACAAAADzMAAAAjAAAAD1wIAAACAAAADzQAAAAkAAAAD10IAAACAAAADzUAAAAlAAAAD14IAAACAAAADzYAAAAmAAAAD18IAAACAAAADzcAAAAvAAAAD2AIAAACAAAADzgAAAAoAAAAD2EIAAACAAAADzkAAAApAAAAD2IIAAACAAAADzAAAAA9AAAAD2MIAAACAAAAD/b////W////D2QIAAACAAAADy0AAABfAAAAD2UIAAACAAAAD3EAAABRAAAAD2YIAAACAAAAD3cAAABXAAAAD2cIAAACAAAAD2UAAABFAAAAD2gIAAACAAAAD3IAAABSAAAAD2kIAAACAAAAD3QAAABUAAAAD2oIAAACAAAAD3kAAABZAAAAD2sIAAACAAAAD3UAAABVAAAAD2wIAAACAAAAD2kAAABJAAAAD20IAAACAAAAD28AAABPAAAAD24IAAACAAAAD3AAAABQAAAAD28IAAACAAAAD/D////Q////D3AIAAACAAAADycAAAA/AAAAD3EIAAACAAAAD2EAAABBAAAAD3IIAAACAAAAD3MAAABTAAAAD3MIAAACAAAAD2QAAABEAAAAD3QIAAACAAAAD2YAAABGAAAAD3UIAAACAAAAD2cAAABHAAAAD3YIAAACAAAAD2gAAABIAAAAD3cIAAACAAAAD2oAAABKAAAAD3gIAAACAAAAD2sAAABLAAAAD3kIAAACAAAAD2wAAABMAAAAD3oIAAACAAAAD+b////G////D3sIAAACAAAAD7T////E////D3wIAAACAAAADysAAAAqAAAAD30IAAACAAAAD3oAAABaAAAAD34IAAACAAAAD3gAAABYAAAAD38IAAACAAAAD2MAAABDAAAAD4AIAAACAAAAD3YAAABWAAAAD4EIAAACAAAAD2IAAABCAAAAD4IIAAACAAAAD24AAABOAAAAD4MIAAACAAAAD20AAABNAAAAD4QIAAACAAAADywAAAA7AAAAD4UIAAACAAAADy4AAAA6AAAAD4YIAAACAAAAD/7////e////D4cIAAACAAAADzwAAAA+AAAAD4gIAAAAAAAADw+JCAAAAgAAAA8wAAAAp////w+KCAAAAwAAAA8xAAAAJwAAAH4AAAAPiwgAAAMAAAAPMgAAACIAAAC3////D4wIAAADAAAADzMAAAArAAAAXgAAAA+NCAAAAwAAAA80AAAAIQAAAKL///8PjggAAAQAAAAPNQAAACUAAAAwAAAAsP///w+PCAAAAwAAAA82AAAALwAAALL///8PkAgAAAMAAAAPNwAAAD0AAABgAAAAD5EIAAADAAAADzgAAAAoAAAA/////w+SCAAAAwAAAA85AAAAKQAAALT///8PkwgAAAMAAAAP9v///9b///+9////D5QIAAADAAAAD/z////c////qP///w+VCAAAAwAAAA/z////0////7j///8PlggAAAMAAAAPcQAAAFEAAABcAAAAD5cIAAADAAAAD3cAAABXAAAAfAAAAA+YCAAAAgAAAA9lAAAARQAAAA+ZCAAAAgAAAA9yAAAAUgAAAA+aCAAAAgAAAA90AAAAVAAAAA+bCAAAAgAAAA96AAAAWgAAAA+cCAAAAgAAAA91AAAAVQAAAA+dCAAAAwAAAA9pAAAASQAAAM3///8PnggAAAMAAAAPbwAAAE8AAAD4////D58IAAACAAAAD3AAAABQAAAAD6AIAAADAAAAD/X////V////9////w+hCAAAAwAAAA/6////2v///9f///8PoggAAAIAAAAPYQAAAEEAAAAPowgAAAMAAAAPcwAAAFMAAADw////D6QIAAADAAAAD2QAAABEAAAA0P///w+lCAAAAwAAAA9mAAAARgAAAFsAAAAPpggAAAMAAAAPZwAAAEcAAABdAAAAD6cIAAACAAAAD2gAAABIAAAAD6gIAAADAAAAD2oAAABKAAAA7f///w+pCAAAAwAAAA9rAAAASwAAALP///8PqggAAAMAAAAPbAAAAEwAAACj////D6sIAAADAAAAD+n////J////JAAAAA+sCAAAAwAAAA/h////wf///9////8PrQgAAAMAAAAP+////9v///+k////D64IAAADAAAAD3kAAABZAAAAPgAAAA+vCAAAAwAAAA94AAAAWAAAACMAAAAPsAgAAAMAAAAPYwAAAEMAAAAmAAAAD7EIAAADAAAAD3YAAABWAAAAQAAAAA+yCAAAAwAAAA9iAAAAQgAAAHsAAAAPswgAAA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AAAAPCgkAAAIAAAAPagAAAEoAAAAPCwkAAAIAAAAPawAAAEsAAAAPDAkAAAIAAAAPbAAAAEwAAAAPDQkAAAIAAAAP6P///8j///8PDgkAAAIAAAAP5v///8b///8PDwkAAAIAAAAPvv///67///8PEAkAAAIAAAAPeQAAAFkAAAAPEQkAAAIAAAAPeAAAAFgAAAAPEgkAAAIAAAAPYwAAAEMAAAAPEwkAAAIAAAAPdgAAAFYAAAAPFAkAAAIAAAAPYgAAAEIAAAAPFQkAAAIAAAAPbgAAAE4AAAAPFgkAAAIAAAAPbQAAAE0AAAAPFwkAAAIAAAAPLAAAADsAAAAPGAkAAAIAAAAPLgAAADoAAAAPGQkAAAIAAAAPLQAAAF8AAAAPGgkAAAIAAAAPPAAAAD4AAAAPGwkAAAAAAAAPDxwJAAACAAAAD2AAAAB+AAAADx0JAAACAAAADzEAAAAhAAAADx4JAAACAAAADzIAAAAiAAAADx8JAAACAAAADzMAAAAjAAAADyAJAAACAAAADzQAAAAkAAAADyEJAAACAAAADzUAAAAlAAAADyIJAAACAAAADzYAAAAmAAAADyMJAAACAAAADzcAAAAvAAAADyQJAAACAAAADzgAAAAoAAAADyUJAAACAAAADzkAAAApAAAADyYJAAACAAAADzAAAAA9AAAADycJAAACAAAADycAAAA/AAAADygJAAACAAAADysAAAAqAAAADykJAAACAAAAD6n///+5////DyoJAAACAAAAD6r///+6////DysJAAACAAAAD8X////l////DywJAAACAAAAD9L////y////Dy0JAAACAAAAD9T////0////Dy4JAAACAAAAD9r////6////Dy8JAAACAAAAD9X////1////DzAJAAACAAAAD8n////p////DzEJAAACAAAAD8/////v////DzIJAAACAAAAD9D////w////DzMJAAACAAAAD9v////7////DzQJAAACAAAAD1sAAABdAAAADzUJAAACAAAAD8H////h////DzYJAAACAAAAD9P////z////DzcJAAACAAAAD8T////k////DzgJAAACAAAAD8b////m////DzkJAAACAAAAD8f////n////DzoJAAACAAAAD8j////o////DzsJAAACAAAAD6j///+4////DzwJAAACAAAAD8v////r////Dz0JAAACAAAAD8z////s////Dz4JAAACAAAAD97////+////Dz8JAAACAAAAD6v///+7////D0AJAAACAAAADy0AAABfAAAAD0EJAAACAAAAD6H///+x////D0IJAAACAAAAD6////+/////D0MJAAACAAAAD8P////j////D0QJAAACAAAAD9f////3////D0UJAAACAAAAD8L////i////D0YJAAACAAAAD87////u////D0cJAAACAAAAD83////t////D0gJAAACAAAADywAAAA7AAAAD0kJAAACAAAADy4AAAA6AAAAD0oJAAACAAAAD9b////2////D0sJAAACAAAADzwAAAA+AAAAD0wJAAAAAAAADw9NCQAAAgAAAA9gAAAAfgAAAA9OCQAAAgAAAA8xAAAAIQAAAA9PCQAABAAAAA8yAAAAQAAAADIAAAAiAAAAD1AJAAACAAAADzMAAAAjAAAAD1EJAAACAAAADzQAAAAkAAAAD1IJAAACAAAADzUAAAAlAAAAD1MJAAAEAAAADzYAAABeAAAANgAAACYAAAAPVAkAAAQAAAAPNwAAACYAAAA3AAAALwAAAA9VCQAABAAAAA84AAAAKgAAADgAAAAoAAAAD1YJAAAEAAAADzkAAAAoAAAAOQAAACkAAAAPVwkAAAQAAAAPMAAAACkAAAAwAAAAPQAAAA9YCQAABAAAAA8tAAAAXwAAACcAAAA/AAAAD1kJAAAEAAAADz0AAAArAAAAKwAAACoAAAAPWgkAAAQAAAAPcQAAAFEAAACp////uf///w9bCQAABAAAAA93AAAAVwAAAKr///+6////D1wJAAAEAAAAD2UAAABFAAAAxf///+X///8PXQkAAAQAAAAPcgAAAFIAAADS////8v///w9eCQAABAAAAA90AAAAVAAAANT////0////D18JAAAEAAAAD3kAAABZAAAA2v////r///8PYAkAAAQAAAAPdQAAAFUAAADV////9f///w9hCQAABAAAAA9pAAAASQAAAMn////p////D2IJAAAEAAAAD28AAABPAAAAz////+////8PYwkAAAQAAAAPcAAAAFAAAADQ////8P///w9kCQAABAAAAA9bAAAAewAAANv////7////D2UJAAAEAAAAD10AAAB9AAAAWwAAAF0AAAAPZgkAAAQAAAAPYQAAAEEAAADB////4f///w9nCQAABAAAAA9zAAAAUwAAANP////z////D2gJAAAEAAAAD2QAAABEAAAAxP///+T///8PaQkAAAQAAAAPZgAAAEYAAADG////5v///w9qCQAABAAAAA9nAAAARwAAAMf////n////D2sJAAAEAAAAD2gAAABIAAAAyP///+j///8PbAkAAAQAAAAPagAAAEoAAACo////uP///w9tCQAABAAAAA9rAAAASwAAAMv////r////D24JAAAEAAAAD2wAAABMAAAAzP///+z///8PbwkAAAQAAAAPOwAAADoAAADe/////v///w9wCQAABAAAAA8nAAAAIgAAAKv///+7////D3EJAAAEAAAAD1wAAAB8AAAALQAAAF8AAAAPcgkAAAQAAAAPegAAAFoAAACh////sf///w9zCQAABAAAAA94AAAAWAAAAK////+/////D3QJAAAEAAAAD2MAAABDAAAAw////+P///8PdQkAAAQAAAAPdgAAAFYAAADX////9////w92CQAABAAAAA9iAAAAQgAAAML////i////D3cJAAAEAAAAD24AAABOAAAAzv///+7///8PeAkAAAQAAAAPbQAAAE0AAADN////7f///w95CQAABAAAAA8sAAAAPAAAACwAAAA7AAAAD3oJAAAEAAAADy4AAAA+AAAALgAAADoAAAAPewkAAAQAAAAPLwAAAD8AAADW////9v///w98CQAAAgAAAA88AAAAPgAAAA99CQAAAAAAAA8PfgkAAAIAAAAPuP///6j///8PfwkAAAIAAAAPMQAAACEAAAAPgAkAAAIAAAAPMgAAACIAAAAPgQkAAAIAAAAPMwAAACMAAAAPggkAAAIAAAAPNAAAACQAAAAPgwkAAAIAAAAPNQAAACUAAAAPhAkAAAIAAAAPNgAAACYAAAAPhQkAAAIAAAAPNwAAAC8AAAAPhgkAAAIAAAAPOAAAACgAAAAPhwkAAAIAAAAPOQAAACkAAAAPiAkAAAIAAAAPMAAAAD0AAAAPiQkAAAIAAAAPJwAAAD8AAAAPigkAAAIAAAAPKwAAACoAAAAPiwkAAAIAAAAPcQAAAFEAAAAPjAkAAAIAAAAPdwAAAFcAAAAPjQkAAAIAAAAPZQAAAEUAAAAPjgkAAAIAAAAPcgAAA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ADzkAAAApAAAAD+kJAAACAAAADzAAAAB+AAAAD+oJAAACAAAADy0AAAA9AAAAD+sJAAACAAAAD14AAAB+AAAAD+wJAAACAAAAD1wAAAB8AAAAD+0JAAACAAAAD3EAAABRAAAAD+4JAAACAAAAD3cAAABXAAAAD+8JAAACAAAAD2UAAABFAAAAD/AJAAACAAAAD3IAAABSAAAAD/EJAAACAAAAD3QAAABUAAAAD/IJAAACAAAAD3kAAABZAAAAD/MJAAACAAAAD3UAAABVAAAAD/QJAAACAAAAD2kAAABJAAAAD/UJAAACAAAAD28AAABPAAAAD/YJAAACAAAAD3AAAABQAAAAD/cJAAACAAAAD0AAAABgAAAAD/gJAAACAAAAD1sAAAB7AAAAD/kJAAACAAAAD2EAAABBAAAAD/oJAAACAAAAD3MAAABTAAAAD/sJAAACAAAAD2QAAABEAAAAD/wJAAACAAAAD2YAAABGAAAAD/0JAAACAAAAD2cAAABHAAAAD/4JAAACAAAAD2gAAABIAAAAD/8JAAACAAAAD2oAAABKAAAADwAKAAACAAAAD2sAAABLAAAADwEKAAACAAAAD2wAAABMAAAADwIKAAACAAAADzsAAAArAAAADwMKAAACAAAADzoAAAAqAAAADwQKAAACAAAAD10AAAB9AAAADwUKAAACAAAAD3oAAABaAAAADwYKAAACAAAAD3gAAABYAAAADwcKAAACAAAAD2MAAABDAAAADwgKAAACAAAAD3YAAABWAAAADwkKAAACAAAAD2IAAABCAAAADwoKAAACAAAAD24AAABOAAAADwsKAAACAAAAD20AAABNAAAADwwKAAACAAAADywAAAA8AAAADw0KAAACAAAADy4AAAA+AAAADw4KAAACAAAADy8AAAA/AAAADw8KAAACAAAAD1wAAABfAAAADxAKAAAAAAAADw8RCgAAAgAAAA8xAAAAIQAAAA8SCgAAAgAAAA8yAAAAIgAAAA8TCgAAAgAAAA8zAAAAIwAAAA8UCgAAAgAAAA80AAAAJAAAAA8VCgAAAgAAAA81AAAAJQAAAA8WCgAAAgAAAA82AAAAJgAAAA8XCgAAAgAAAA83AAAAJwAAAA8YCgAAAgAAAA84AAAAKAAAAA8ZCgAAAgAAAA85AAAAKQAAAA8aCgAAAQAAAA8wAAAADxsKAAACAAAADy0AAAA9AAAADxwKAAACAAAAD14AAABgAAAADx0KAAACAAAAD1wAAAB8AAAADx4KAAACAAAAD3EAAABRAAAADx8KAAACAAAAD3cAAABXAAAADyAKAAACAAAAD2UAAABFAAAADyEKAAACAAAAD3IAAABSAAAADyIKAAACAAAAD3QAAABUAAAADyMKAAACAAAAD3kAAABZAAAADyQKAAACAAAAD3UAAABVAAAADyUKAAACAAAAD2kAAABJAAAADyYKAAACAAAAD28AAABPAAAADycKAAACAAAAD3AAAABQAAAADygKAAACAAAAD0AAAAB+AAAADykKAAACAAAAD1sAAAB7AAAADyoKAAACAAAAD2EAAABBAAAADysKAAACAAAAD3MAAABTAAAADywKAAACAAAAD2QAAABEAAAADy0KAAACAAAAD2YAAABGAAAADy4KAAACAAAAD2cAAABHAAAADy8KAAACAAAAD2gAAABIAAAADzAKAAACAAAAD2oAAABKAAAADzEKAAACAAAAD2sAAABLAAAADzIKAAACAAAAD2wAAABMAAAADzMKAAACAAAADzsAAAArAAAADzQKAAACAAAADzoAAAAqAAAADzUKAAACAAAAD10AAAB9AAAADzYKAAACAAAAD3oAAABaAAAADzcKAAACAAAAD3gAAABYAAAADzgKAAACAAAAD2MAAABDAAAADzkKAAACAAAAD3YAAABWAAAADzoKAAACAAAAD2IAAABCAAAADzsKAAACAAAAD24AAABOAAAADzwKAAACAAAAD20AAABNAAAADz0KAAACAAAADywAAAA8AAAADz4KAAACAAAADy4AAAA+AAAADz8KAAACAAAADy8AAAA/AAAAD0AKAAACAAAAD1wAAABfAAAAD0EKAAAAAAAADw9CCgAAAgAAAA87AAAAMAAAAA9DCgAAAgAAAA8rAAAAMQAAAA9ECgAAAgAAAA+1////MgAAAA9FCgAAAgAAAA+5////MwAAAA9GCgAAAgAAAA/o////NAAAAA9HCgAAAgAAAA+7////NQAAAA9ICgAAAgAAAA++////NgAAAA9J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AAIAAAAPMwAAACMAAAAPdwoAAAIAAAAPNAAAACQAAAAPeAoAAAIAAAAPNQAAACUAAAAPeQoAAAIAAAAPNgAAAF4AAAAPegoAAAIAAAAPNwAAACYAAAAPewoAAAIAAAAPOAAAACoAAAAPfAoAAAIAAAAPOQAAACgAAAAPfQoAAAIAAAAPMAAAACkAAAAPfgoAAAIAAAAPLQAAAF8AAAAPfwoAAAIAAAAPPQAAACsAAAAPgAoAAAQAAAAPcQAAAFEAAADk////xP///w+BCgAABAAAAA93AAAAVwAAAOz////M////D4IKAAAEAAAAD2UAAABFAAAA6f///8n///8PgwoAAAQAAAAPcgAAAFIAAAD4////2P///w+ECgAABAAAAA90AAAAVAAAALv///+r////D4UKAAAEAAAAD3kAAABZAAAA/f///93///8PhgoAAAQAAAAPdQAAAFUAAAD5////2f///w+HCgAABAAAAA9pAAAASQAAAO3////N////D4gKAAAEAAAAD28AAABPAAAA8////9P///8PiQoAAAQAAAAPcAAAAFAAAAD2////1v///w+KCgAAAgAAAA9bAAAAewAAAA+LCgAAAgAAAA9dAAAAfQAAAA+MCgAABAAAAA9hAAAAQQAAAOH////B////D40KAAAEAAAAD3MAAABTAAAAuf///6n///8PjgoAAAQAAAAPZAAAAEQAAADv////z////w+PCgAABAAAAA9mAAAARgAAAOv////L////D5AKAAAEAAAAD2cAAABHAAAA4P///8D///8PkQoAAAQAAAAPaAAAAEgAAAD6////2v///w+SCgAABAAAAA9qAAAASgAAAPz////c////D5MKAAAEAAAAD2sAAABLAAAA9P///9T///8PlAoAAAQAAAAPbAAAAEwAAAC1////pf///w+VCgAAAgAAAA87AAAAOgAAAA+WCgAAAgAAAA8nAAAAIgAAAA+XCgAAAgAAAA9cAAAAfAAAAA+YCgAABAAAAA96AAAAWgAAAL7///+u////D5kKAAADAAAAD3gAAABYAAAApP///w+aCgAABAAAAA9jAAAAQwAAAOj////I////D5sKAAAEAAAAD3YAAABWAAAA5////8f///8PnAoAAAIAAAAPYgAAAEIAAAAPnQoAAAQAAAAPbgAAAE4AAADy////0v///w+eCgAABAAAAA9tAAAATQAAAOX////F////D58KAAACAAAADywAAAA8AAAAD6AKAAACAAAADy4AAAA+AAAAD6EKAAACAAAADy8AAAA/AAAAD6IKAAACAAAADzwAAAA+AAAAD6MKAAAAAAAADw+kCgAAAQAAAA87AAAAD6UKAAACAAAADysAAAAxAAAAD6YKAAACAAAAD+z///8yAAAAD6cKAAACAAAAD7n///8zAAAAD6gKAAACAAAAD+j///80AAAAD6kKAAACAAAAD/j///81AAAAD6oKAAACAAAAD77///82AAAAD6sKAAACAAAAD/3///83AAAAD6wKAAACAAAAD+H///84AAAAD60KAAACAAAAD+3///85AAAAD64KAAAEAAAAD+n///8wAAAAvf///ykAAAAPrwoAAAIAAAAPPQAAACUAAAAPsAoAAAAAAAAPD7EKAAADAAAAD3EAAABRAAAAXAAAAA+yCgAAAwAAAA93AAAAVwAAAHwAAAAPswoAAAIAAAAPZQAAAEUAAAAPtAoAAAIAAAAPcgAAAFIAAAAPtQoAAAIAAAAPdAAAAFQAAAAPtgoAAAIAAAAPeQAAAFkAAAAPtwoAAAIAAAAPdQAAAFUAAAAPuAoAAAIAAAAPaQAAAEkAAAAPuQoAAAIAAAAPbwAAAE8AAAAPugoAAAIAAAAPcAAAAFAAAAAPuwoAAAQAAAAP+v///y8AAABbAAAAewAAAA+8CgAABAAAAA8pAAAAKAAAAF0AAAB9AAAAD70KAAACAAAAD2EAAABBAAAAD74KAAADAAAAD3MAAABTAAAA8P///w+/CgAAAwAAAA9kAAAARAAAAND///8PwAoAAAMAAAAPZgAAAEYAAABbAAAAD8EKAAADAAAAD2cAAABHAAAAXQAAAA/CCgAAAgAAAA9oAAAASAAAAA/DCgAAAgAAAA9qAAAASgAAAA/ECgAAAwAAAA9rAAAASwAAALP///8PxQoAAAMAAAAPbAAAAEwAAACj////D8YKAAADAAAAD/n///8iAAAAJAAAAA/HCgAAAwAAAA+n////IQAAAN////8PyAoAAAIAAAAPqP///ycAAAAPyQoAAAMAA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A/1CgAAAgAAAA9rAAAASwAAAA/2CgAAAgAAAA9sAAAATAAAAA/3CgAAAgAAAA/5////IgAAAA/4CgAAAgAAAA+n////IQAAAA/5CgAAAgAAAA+o////JwAAAA/6CgAAAgAAAA95AAAAWQAAAA/7CgAAAgAAAA94AAAAWAAAAA/8CgAAAgAAAA9jAAAAQwAAAA/9CgAAAgAAAA92AAAAVgAAAA/+CgAAAgAAAA9iAAAAQgAAAA//CgAAAgAAAA9uAAAATgAAAA8ACwAAAgAAAA9tAAAATQAAAA8BCwAAAgAAAA8sAAAAPwAAAA8CCwAAAgAAAA8uAAAAOgAAAA8DCwAAAgAAAA8tAAAAXwAAAA8ECwAAAQAAAA9cAAAADwULAAAAAAAADw8GCwAAAQAAAA87AAAADwcLAAACAAAADysAAAAxAAAADwgLAAACAAAAD+z///8yAAAADwkLAAACAAAAD7n///8zAAAADwoLAAACAAAAD+j///80AAAADwsLAAACAAAAD/j///81AAAADwwLAAACAAAAD77///82AAAADw0LAAACAAAAD/3///83AAAADw4LAAACAAAAD+H///84AAAADw8LAAACAAAAD+3///85AAAADxALAAACAAAAD+n///8wAAAADxELAAACAAAADz0AAAAlAAAADxILAAACAAAAD7T///+3////DxMLAAACAAAAD3EAAABRAAAADxQLAAACAAAAD3cAAABXAAAADxULAAACAAAAD2UAAABFAAAADxYLAAACAAAAD3IAAABSAAAADxcLAAACAAAAD3QAAABUAAAADxgLAAACAAAAD3kAAABZAAAADxkLAAACAAAAD3UAAABVAAAADxoLAAACAAAAD2kAAABJAAAADxsLAAACAAAAD28AAABPAAAADxwLAAACAAAAD3AAAABQAAAADx0LAAACAAAAD/r///8vAAAADx4LAAACAAAADykAAAAoAAAADx8LAAACAAAAD2EAAABBAAAADyALAAACAAAAD3MAAABTAAAADyELAAACAAAAD2QAAABEAAAADyILAAACAAAAD2YAAABGAAAADyMLAAACAAAAD2cAAABHAAAADyQLAAACAAAAD2gAAABIAAAADyULAAACAAAAD2oAAABKAAAADyYLAAACAAAAD2sAAABLAAAADycLAAACAAAAD2wAAABMAAAADygLAAACAAAAD/n///8iAAAADykLAAACAAAAD6f///8hAAAADyoLAAACAAAAD6j///8nAAAADysLAAACAAAAD3oAAABaAAAADywLAAACAAAAD3gAAABYAAAADy0LAAACAAAAD2MAAABDAAAADy4LAAACAAAAD3YAAABWAAAADy8LAAACAAAAD2IAAABCAAAADzALAAACAAAAD24AAABOAAAADzELAAACAAAAD20AAABNAAAADzILAAACAAAADywAAAA/AAAADzMLAAACAAAADy4AAAA6AAAADzQLAAACAAAADy0AAABfAAAADzULAAABAAAAD1wAAAAPNgsAAAAAAAAPDzcLAAACAAAAD3wAAACw////DzgLAAACAAAADzEAAAAhAAAADzkLAAACAAAADzIAAAAiAAAADzoLAAACAAAADzMAAAAjAAAADzsLAAACAAAADzQAAAAkAAAADzwLAAACAAAADzUAAAAlAAAADz0LAAACAAAADzYAAAAmAAAADz4LAAACAAAADzcAAAAvAAAADz8LAAACAAAADzgAAAAoAAAAD0ALAAACAAAADzkAAAApAAAAD0ELAAACAAAADzAAAAA9AAAAD0ILAAACAAAADycAAAA/AAAAD0MLAAACAAAAD7////+h////D0QLAAADAAAAD3EAAABRAAAAQAAAAA9FCwAAAgAAAA93AAAAVwAAAA9GCwAAAgAAAA9lAAAARQAAAA9HCwAAAgAAAA9yAAAAUgAAAA9ICwAAAgAAAA90AAAAVAAAAA9JCwAAAgAAAA95AAAAWQAAAA9KCwAAAgAAAA91AAAAVQAAAA9LCwAAAgAAAA9pAAAASQAAAA9MCwAAAgAAAA9vAAAATwAAAA9NCwAAAgAAAA9wAAAAUAAAAA9OCwAAAgAAAA+0////qP///w9PCwAAAgAAAA8rAAAAKgAAAA9QCwAAAgAAAA9hAAAAQQAAAA9RCwAAAgAAAA9zAAAAUwAAAA9SCwAAAgAAAA9kAAAARAAAAA9TCwAAAgAAAA9mAAAARgAAAA9UCwAAAgAAAA9nAAAARwAAAA9VCwAAAgAAAA9oAAAASAAAAA9WCwAAAgAAAA9qAAAASgAAAA9XCwAAAgAAAA9rAAAASwAAAA9YCwAAAgAAAA9sAAAATAAAAA9ZCwAAAgAAAA/x////0f///w9aCwAAAwAAAA97AAAAWwAAAF4AAAAPWwsAAAIAAAAPfQAAAF0AAAAPXAsAAAIAAAAPegAAAFoAAAAPXQsAAAIAAAAPeAAAAFgAAAAPXgsAAAIAAAAPYwAAAEMAAAAPXwsAAAIAAAAPdgAAAFYAAAAPYAsAAAIAAAAPYgAAAEIAAAAPYQsAAAIAAAAPbgAAAE4AAAAPYgsAAAIAAAAPbQAAAE0AAAAPYwsAAAIAAAAPLAAAADsAAAAPZAsAAAIAAAAPLgAAADoAAAAPZQsAAAIAAAAPLQAAAF8AAAAPZgsAAAIAAAAPPAAAAD4AAAAPZwsAAAAAAAAPD2gLAAACAAAAD2AAAAB+AAAAD2kLAAACAAAAD+D////A////D2oLAAACAAAAD+j////I////D2sLAAACAAAAD+b////G////D2wLAAACAAAAD+v////L////D20LAAACAAAAD+H////B////D24LAAACAAAAD/D////Q////D28LAAACAAAAD/j////Y////D3ALAAACAAAAD/v////b////D3ELAAACAAAAD6X///8oAAAAD3ILAAACAAAAD7T///8pAAAAD3MLAAACAAAADy0AAABfAAAAD3QLAAACAAAAD/7////e////D3ULAAACAAAAD1wAAAB8AAAAD3YLAAACAAAAD3EAAABRAAAAD3cLAAACAAAAD3cAAABXAAAAD3gLAAACAAAAD2UAAABFAAAAD3kLAAACAAAAD3IAAABSAAAAD3oLAAACAAAAD3QAAABUAAAAD3sLAAACAAAAD3kAAABZAAAAD3wLAAACAAAAD3UAAABVAAAAD30LAAACAAAAD2kAAABJAAAAD34LAAACAAAAD28AAABPAAAAD38LAAACAAAAD3AAAABQAAAAD4ALAAACAAAAD1sAAAB7AAAAD4ELAAACAAAAD10AAAB9AAAAD4ILAAACAAAAD2EAAABBAAAAD4MLAAACAAAAD3MAAABTAAAAD4QLAAACAAAAD2QAAABEAAAAD4ULAAACAAAAD2YAAABGAAAAD4YLAAACAAAAD2cAAABHA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PPQwAAAMAAAAPdAAAAFQAAADg////Dz4MAAADAAAAD3kAAABZAAAA6P///w8/DAAAAwAAAA91AAAAVQAAAOX///8PQAwAAAMAAAAPaQAAAEkAAADv////D0EMAAADAAAAD28AAABPAAAA7f///w9CDAAAAwAAAA9wAAAAUAAAAPT///8PQwwAAAIAAAAPWwAAAHsAAAAPRAwAAAIAAAAPXQAAAH0AAAAPRQwAAAMAAAAPYQAAAEEAAAD5////D0YMAAADAAAAD3MAAABTAAAA4////w9HDAAAAwAAAA9kAAAARAAAAOL///8PSAwAAAMAAAAPZgAAAEYAAADr////D0kMAAADAAAAD2cAAABHAAAA8v///w9KDAAAAwAAAA9oAAAASAAAAOn///8PSwwAAAMAAAAPagAAAEoAAADn////D0wMAAADAAAAD2sAAABLAAAA7P///w9NDAAAAwAAAA9sAAAATAAAAOr///8PTgwAAAMAAAAPOwAAADoAAADz////D08MAAADAAAADycAAAAiAAAALAAAAA9QDAAAAgAAAA9cAAAAfAAAAA9RDAAAAwAAAA96AAAAWgAAAOb///8PUgwAAAMAAAAPeAAAAFgAAADx////D1MMAAADAAAAD2MAAABDAAAA4f///w9UDAAAAwAAAA92AAAAVgAAAOT///8PVQwAAAMAAAAPYgAAAEIAAADw////D1YMAAADAAAAD24AAABOAAAA7v///w9XDAAAAwAAAA9tAAAATQAAAPb///8PWAwAAAMAAAAPLAAAADwAAAD6////D1kMAAADAAAADy4AAAA+AAAA9f///w9aDAAAAwAAAA8vAAAAPwAAAC4AAAAPWwwAAAIAAAAPPAAAAD4AAAAPXAwAAAAAAAAPD10MAAACAAAAD2AAAAB+AAAAD14MAAACAAAADzEAAAAhAAAAD18MAAACAAAADzIAAABAAAAAD2AMAAACAAAADzMAAAAjAAAAD2EMAAACAAAADzQAAAAkAAAAD2IMAAACAAAADzUAAAAlAAAAD2MMAAACAAAADzYAAABeAAAAD2QMAAACAAAADzcAAAAmAAAAD2UMAAACAAAADzgAAAAqAAAAD2YMAAACAAAADzkAAAAoAAAAD2cMAAACAAAADzAAAAApAAAAD2gMAAACAAAADy0AAABfAAAAD2kMAAACAAAADz0AAAArAAAAD2oMAAADAAAAD3EAAABRAAAA9////w9rDAAAAwAAAA93AAAAVwAAAOX///8PbAwAAAMAAAAPZQAAAEUAAADg////D20MAAADAAAAD3IAAABSAAAA+P///w9uDAAAAwAAAA90AAAAVAAAAPr///8PbwwAAAMAAAAPeQAAAFkAAADy////D3AMAAADAAAAD3UAAABVAAAA5f///w9xDAAAAwAAAA9pAAAASQAAAOn///8PcgwAAAMAAAAPbwAAAE8AAADx////D3MMAAADAAAAD3AAAABQAAAA9P///w90DAAAAgAAAA9bAAAAewAAAA91DAAAAgAAAA9dAAAAfQAAAA92DAAAAwAAAA9hAAAAQQAAAOD///8PdwwAAAMAAAAPcwAAAFMAAAD5////D3gMAAADAAAAD2QAAABEAAAA4////w95DAAAAwAAAA9mAAAARgAAAPT///8PegwAAAMAAAAPZwAAAEcAAADi////D3sMAAADAAAAD2gAAABIAAAA5P///w98DAAAAwAAAA9qAAAASgAAAOn///8PfQwAAAMAAAAPawAAAEsAAADr////D34MAAADAAAAD2wAAABMAAAA7P///w9/DAAAAgAAAA87AAAAOgAAAA+ADAAAAgAAAA8nAAAAIgAAAA+BDAAAAgAAAA9cAAAAfAAAAA+CDAAAAwAAAA96AAAAWgAAAOb///8PgwwAAAMAAAAPeAAAAFgAAADn////D4QMAAADAAAAD2MAAABDAAAA9v///w+FDAAAAwAAAA92AAAAVgAAAOX///8PhgwAAAMAAAAPYgAAAEIAAADh////D4cMAAADAAAAD24AAABOAAAA8P///w+IDAAAAwAAAA9tAAAATQAAAO7///8PiQwAAAIAAAAPLAAAADwAAAAPigwAAAIAAAAPLgAAAD4AAAAPiwwAAAIAAAAPLwAAAD8AAAAPjAwAAAIAAAAPPAAAAD4AAAAPjQwAAAAAAAAPD44MAAACAAAAD2AAAAB+AAAAD48MAAACAAAADzEAAAAhAAAAD5AMAAACAAAADzIAAABAAAAAD5EMAAACAAAADzMAAAAjAAAAD5IMAAACAAAADzQAAAAkAAAAD5MMAAACAAAADzUAAAAlAAAAD5QMAAACAAAADzYAAABeAAAAD5UMAAACAAAADzcAAAAmAAAAD5YMAAACAAAADzgAAAAqAAAAD5cMAAACAAAADzkAAAAoAAAAD5gMAAACAAAADzAAAAApAAAAD5kMAAACAAAADy0AAABfAAAAD5oMAAACAAAADz0AAAArAAAAD5sMAAADAAAAD3EAAABRAAAA9////w+cDAAAAwAAAA93AAAAVwAAAPH///8PnQwAAAIAAAAPZQAAAEUAAAAPngwAAAMAAAAPcgAAAFIAAAD4////D58MAAADAAAAD3QAAABUAAAA6P///w+gDAAAAwAAAA95AAAAWQAAAOP///8PoQwAAAIAAAAPdQAAAFUAAAAPogwAAAIAAAAPaQAAAEkAAAAPowwAAAIAAAAPbwAAAE8AAAAPpAwAAAMAAAAPcAAAAFAAAAD0////D6UMAAACAAAAD1sAAAB7AAAAD6YMAAACAAAAD10AAAB9AAAAD6cMAAADAAAAD2EAAABBAAAA4P///w+oDAAAAwAAAA9zAAAAUwAAAOX///8PqQwAAAMAAAAPZAAAAEQAAADs////D6oMAAADAAAAD2YAAABGAAAA+v///w+rDAAAAwAAAA9nAAAARwAAAOL///8PrAwAAAMAAAAPaAAAAEgAAADk////D60MAAADAAAAD2oAAABKAAAA+f///w+uDAAAAwAAAA9rAAAASwAAAOv///8PrwwAAAMAAAAPbAAAAEwAAADp////D7AMAAACAAAADzsAAAA6AAAAD7EMAAACAAAADycAAAAiAAAAD7IMAAACAAAAD1wAAAB8AAAAD7MMAAADAAAAD3oAAABaAAAA5v///w+0DAAAAwAAAA94AAAAWAAAAOf///8PtQwAAAMAAAAPYwAAAEMAAAD2////D7YMAAADAAAAD3YAAABWAAAA8v///w+3DAAAAwAAAA9iAAAAQgAAAOH///8PuAwAAAMAAAAPbgAAAE4AAADw////D7kMAAADAAAAD20AAABNAAAA7v///w+6DAAAAgAAAA8sAAAAPAAAAA+7DAAAAgAAAA8uAAAAPgAAAA+8DAAAAgAA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IAAAAPdQAAAFUAAAAP6QwAAAIAAAAPdgAAAFYAAAAP6gwAAAIAAAAPdwAAAFcAAAAP6wwAAAIAAAAPeAAAAFgAAAAP7AwAAAIAAAAPeQAAAFkAAAAP7QwAAAIAAAAPegAAAFoAAAAP7gwAAAAAAAAPD+8MAAAAAAAADw/wDAAAAgAAAA9gAAAAfgAAAA/xDAAAAgAAAA8xAAAAIQAAAA/yDAAAAgAAAA8yAAAAQAAAAA/zDAAAAgAAAA8zAAAAIwAAAA/0DAAAAgAAAA80AAAAJAAAAA/1DAAAAgAAAA81AAAAJQAAAA/2DAAAAgAAAA82AAAAXgAAAA/3DAAAAgAAAA83AAAAJgAAAA/4DAAAAgAAAA84AAAAKgAAAA/5DAAAAgAAAA85AAAAKAAAAA/6DAAAAgAAAA8wAAAAKQAAAA/7DAAAAgAAAA8tAAAAXwAAAA/8DAAAAgAAAA89AAAAKwAAAA/9DAAABAAAAA9xAAAAUQAAADsAAAA6AAAAD/4MAAACAAAAD3cAAABXAAAAD/8MAAAEAAAAD2UAAABFAAAA5f///8X///8PAA0AAAQAAAAPcgAAAFIAAADx////0f///w8BDQAABAAAAA90AAAAVAAAAPT////U////DwINAAAEAAAAD3kAAABZAAAA9f///9X///8PAw0AAAQAAAAPdQAAAFUAAADo////yP///w8EDQAABAAAAA9pAAAASQAAAOn////J////DwUNAAAEAAAAD28AAABPAAAA7////8////8PBg0AAAQAAAAPcAAAAFAAAADw////0P///w8HDQAAAgAAAA9bAAAAewAAAA8IDQAAAgAAAA9dAAAAfQAAAA8JDQAABAAAAA9hAAAAQQAAAOH////B////DwoNAAACAAAAD3MAAABTAAAADwsNAAAEAAAAD2QAAABEAAAA5P///8T///8PDA0AAAQAAAAPZgAAAEYAAAD2////1v///w8NDQAABAAAAA9nAAAARwAAAOP////D////Dw4NAAAEAAAAD2gAAABIAAAA5////8f///8PDw0AAAQAAAAPagAAAEoAAADu////zv///w8QDQAABAAAAA9rAAAASwAAAOr////K////DxENAAAEAAAAD2wAAABMAAAA6////8v///8PEg0AAAQAAAAPOwAAADoAAAC0////qP///w8TDQAAAgAAAA8nAAAAIgAAAA8UDQAAAgAAAA9cAAAAfAAAAA8VDQAABAAAAA96AAAAWgAAAOb////G////DxYNAAAEAAAAD3gAAABYAAAA9////9f///8PFw0AAAQAAAAPYwAAAEMAAAD4////2P///w8YDQAABAAAAA92AAAAVgAAAPn////Z////DxkNAAAEAAAAD2IAAABCAAAA4v///8L///8PGg0AAAQAAAAPbgAAAE4AAADt////zf///w8bDQAABAAAAA9tAAAATQAAAOz////M////DxwNAAACAAAADywAAAA8AAAADx0NAAACAAAADy4AAAA+AAAADx4NAAACAAAADy8AAAA/AAAADx8NAAACAAAADzwAAAA+AAAADyANAAAAAAAADw8hDQAABAAAAA9gAAAAfgAAAF8AAAAlAAAADyINAAAEAAAADzEAAAAhAAAA5f///ysAAAAPIw0AAAQAAAAPMgAAAEAAAAAvAAAA8f///w8kDQAABAAAAA8zAAAAIwAAAC0AAADy////DyUNAAAEAAAADzQAAAAkAAAAwP////P///8PJg0AAAQAAAAPNQAAACUAAAC2////9P///w8nDQAABAAAAA82AAAAXgAAANj////Z////DygNAAAEAAAADzcAAAAmAAAA1v///9////8PKQ0AAAQAAAAPOAAAACoAAACk////9f///w8qDQAABAAAAA85AAAAKAAAALX////2////DysNAAAEAAAADzAAAAApAAAAqP////f///8PLA0AAAQAAAAPLQAAAF8AAACi////+P///w8tDQAABAAAAA89AAAAKwAAAKr////5////Dy4NAAAEAAAAD3EAAABRAAAA5v////D///8PLw0AAAQAAAAPdwAAAFcAAADk////IgAAAA8wDQAABAAAAA9lAAAARQAAANP///+u////DzENAAAEAAAAD3IAAABSAAAAvv///7H///8PMg0AAAQAAAAPdAAAAFQAAADQ////uP///w8zDQAABAAAAA95AAAAWQAAANH////t////DzQNAAAEAAAAD3UAAABVAAAA1f///+r///8PNQ0AAAQAAAAPaQAAAEkAAADD////s////w82DQAABAAAAA9vAAAATwAAALn////P////DzcNAAAEAAAAD3AAAABQAAAAwv///63///8POA0AAAQAAAAPWwAAAHsAAAC6////sP///w85DQAABAAAAA9dAAAAfQAAAMX///8sAAAADzoNAAAEAAAAD2EAAABBAAAAv////8T///8POw0AAAQAAAAPcwAAAFMAAADL////pv///w88DQAABAAAAA9kAAAARAAAAKH///+v////Dz0NAAAEAAAAD2YAAABGAAAAtP///+L///8PPg0AAAQAAAAPZwAAAEcAAADg////rP///w8/DQAABAAAAA9oAAAASAAAAOn////n////D0ANAAAEAAAAD2oAAABKAAAA6P///+v///8PQQ0AAAQAAAAPawAAAEsAAADS////yf///w9CDQAABAAAAA9sAAAATAAAAMr////I////D0MNAAAEAAAADzsAAAA6AAAAx////6v///8PRA0AAAQAAAAPJwAAACIAAACn////LgAAAA9FDQAABAAAAA9cAAAAfAAAAKP///+l////D0YNAAAEAAAAD3oAAABaAAAAvP///ygAAAAPRw0AAAQAAAAPeAAAAFgAAAC7////KQAAAA9IDQAABAAAAA9jAAAAQwAAAOH///+p////D0kNAAAEAAAAD3YAAABWAAAAzf///87///8PSg0AAAMAAAAPYgAAAEIAAADa////D0sNAAAEAAAAD24AAABOAAAA1////+z///8PTA0AAAQAAAAPbQAAAE0AAAC3////PwAAAA9NDQAABAAAAA8sAAAAPAAAAMH///+y////D04NAAAEAAAADy4AAAA+AAAA4////8z///8PTw0AAAQAAAAPLwAAAD8AAAC9////xv///w9QDQAAAAAAAA8PUQ0AAAAAAAAPD1INAAACAAAAD0AAAACn////D1MNAAACAAAADzEAAAAhAAAAD1QNAAACAAAADzIAAAAiAAAAD1UNAAACAAAADzMAAAAjAAAAD1YNAAACAAAADzQAAAAkAAAAD1cNAAACAAAADzUAAAAlAAAAD1gNAAACAAAADzYAAAAmAAAAD1kNAAACAAAADzcAAABfAAAAD1oNAAACAAAADzgAAAAoAAAAD1sNAAACAAAADzkAAAApAAAAD1wNAAACAAAADzAAAAAnAAAAD10NAAACAAAADy8AAAA/AAAAD14NAAACAAAAD7D///9+AAAAD18NAAACAAAAD3EAAABRAAAAD2ANAAACAAAAD3cAAABXAAAAD2ENAAACAAAAD2UAAABFAAAAD2INAAACAAAAD3IAAABSAAAAD2MNAAACAAAAD3QAAABUAAAAD2QNAAACAAAAD3kAAABZAAAAD2UNAAACAAAAD3UAAABVAAAAD2YNAAACAAAAD2kAAABJAAAAD2cNAAACAAAAD28AAABPAAAAD2gNAAACAAAAD3AAAABQAAAAD2kNAAACAAAAD6j///9+AAAAD2oNAAACAAAADyoAAAB8AAAAD2sNAAACAAAAD2EAAABBAAAAD2wNAAACAAAAD3MAAABTAAAAD20NAAACAAAAD2QAAABEAAAAD24NAAACAAAAD2YAAABGAAAAD28NAAACAAAAD2cAAABHAAAAD3ANAAACAAAAD2gAAABIAAAAD3ENAAACAAAAD2oAAABKAAAAD3INAAACAAAAD2sAAABLAAAAD3MNAAACAAAAD2wAAABMAAAAD3QNAAACAAAADysAAACx////D3UNAAACAAAADycAAABgAAAAD3YNAAACAAAADzwAAAA+AAAAD3cNAAACAAAAD3oAAABaAAAAD3gNAAACAAAAD3gAAABYAAAAD3kNAAACAAAAD2MAAABDAAAAD3oNAAACAAAAD3YAAABWAAAAD3sNAAACAAAAD2IAAABCAAAAD3wNAAACAAAAD24AAABOAAAAD30NAAACAAAAD20AAABNAAAAD34NAAACAAAADywAAAA7AAAAD38NAAACAAAADy4AAAA6AAAAD4ANAAACAAAADy0AAAA9AAAAD4ENAAACAAAAD1sAAABdAAAAD4INAAAAAAAADws= + + AAEAAAD/////AQAAAAAAAAAHAQAAAAEBAAAABQAAAAcHCQIAAAAJAwAAAAkEAAAACQUAAAAJBgAAAA8CAAAAMAAAAAcpAAIAAwAEAAUABgAHAAgACQAKAAsADAANABAAEQASABMAFAAVABYAFwAYABkAGgAbAB4AHwAgACEAIgAjACQAJQAmACcAKAArACwALQAuAC8AMAAxADIAMwA0ADUAVgAPAwAAADAAAAAHKQACAAMABAAFAAYABwAIAAkACgALABoAGwAoADMANAAZABUAIQAiAC4AEwAmADUADQAeABgAEgAWABcAIAAjABQAMQAfAAwAKwAnABAAJAAlAC0AMAAyABEALwAsAFYADwQAAAAxAAAABykAAgADAAQABQAGAAcACAAJAAoACwAMAA0AEAARABIAEwAUABUAFgAXABgAGQAaABsAHgAfACAAIQAiACMAJAAlACYAJwAoACsAXgAsAC0ALgAvADAAMQAyADMANAA1AFYADwUAAAAwAAAABwIAAwAEAAUABgAHAAgACQAKAAsADAANACkAEAARABIAEwAUABUAFgAXABgAGQAaABsAHgAfACAAIQAiACMAJAAlACYAJwAoACsALAAtAC4ALwAwADEAMgAzADQANQBWAA8GAAAAMAAAAAcCAAMABAAFAAYABwAIAAkACgALAAwADQAaABsAJwAoACkAMwA0ADUAKwAeADAALgAgABIAIQAiACMAFwAkACUAJgAyADEAGAAZABAAEwAfABQAFgAvABEALQAVACwAVgAL + + AAEAAAD/////AQAAAAAAAAAHAQAAAAEBAAAACQAAAAcICQIAAAAJAwAAAAkEAAAACQUAAAAJBgAAAAkHAAAACQgAAAAJCQAAAAkKAAAADwIAAAAwAAAACMAAAAAxAAAAMgAAADMAAAA0AAAANQAAADYAAAA3AAAAOAAAADkAAAAwAAAAvQAAALsAAABRAAAAVwAAAEUAAABSAAAAVAAAAFkAAABVAAAASQAAAE8AAABQAAAA2wAAAN0AAABBAAAAUwAAAEQAAABGAAAARwAAAEgAAABKAAAASwAAAEwAAAC6AAAA3gAAANwAAABaAAAAWAAAAEMAAABWAAAAQgAAAE4AAABNAAAAvAAAAL4AAAC/AAAA4gAAAA8DAAAAMAAAAAjAAAAAMQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAAAA5AAAAMAAAAL0AAAC7AAAAUQAAAFcAAABFAAAAUgAAAFQAAABaAAAAVQAAAEkAAABPAAAAUAAAANsAAADdAAAAQQAAAFMAAABEAAAARgAAAEcAAABIAAAASgAAAEsAAABMAAAAugAAAN4AAADcAAAAWQAAAFgAAABDAAAAVgAAAEIAAABOAAAATQAAALwAAAC+AAAAvwAAAOIAAAAPBAAAADAAA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A3AAAAOAAAADkAAAAwAAAA2wAAALsAAABBAAAAWgAAAEUAAABSAAAAVAAAAFkAAABVAAAASQAAAE8AAABQAAAA3QAAALoAAABRAAAAUwAAAEQAAABGAAAARwAAAEgAAABKAAAASwAAAEwAAABNAAAAwAAAANwAAABXAAAAWAAAAEMAAABWAAAAQgAAAE4AAAC8AAAAvgAAAL8AAADfAAAA4gAAAA8JAAAAMAAAAAjeAAAAMQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAAAA5AAAAMAAAANsAAAC7AAAAQQAAAFoAAABFAAAAUgAAAFQAAABZAAAAVQAAAEkAAABPAAAAUAAAAN0AAAC6AAAAUQAAAFMAAABEAAAARgAAAEcAAABIAAAASgAAAEsAAABMAAAATQAAAMAAAADcAAAAVwAAAFgAAABDAAAAVgAAAEIAAABOAAAAvAAAAL4AAAC/AAAA3wAAAOIAAAAPCgAAADAAAAAIMQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAAAA5AAAAMAAAAL0AAAC7AAAA2wAAAN0AAAC6AAAA3gAAAMAAAAC8AAAAvgAAAL8AAADcAAAAQQAAAEIAAABDAAAARAAAAEUAAABGAAAARwAAAEgAAABJAAAASgAAAEsAAABMAAAATQAAAE4AAABPAAAAUAAAAFEAAABSAAAAUwAAAFQAAABVAAAAVgAAAFcAAABYAAAAWQAAAFoAAADiAAAACw== + \ No newline at end of file From 726fa63cb8954211c3c4067bb24d4ae141b2759e Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 21 Mar 2006 21:49:02 +0000 Subject: [PATCH 010/117] flush old entry svn path=/trunk/mcs/; revision=58255 --- .../System.Windows.Forms/ChangeLog | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 0095202a94e53..5deb737bfbac5 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -133,6 +133,21 @@ OnMouseUp. This will fix DataGrid's selection being set to end at the location of the MouseUp. +2006-03-15 Jackson Harper + + * BindingContext.cs: Check the binding after its added so that it + can initialize the binding managers and hookup to events. + * Binding.cs: Data members seem to sometimes include rows/cols in + the format Row.Column we now take this into account. + - Hookup to the position changed event so we can update the + control when the position has changed in the data set. + * CurrencyManager.cs: Take into account the row/col naming + convention when creating dataset tables. + * BindingContext.cs: Using a newer better way of storing + datasource/datamember pairs. Hopefully this better matches MS for + looking up binding managers. + + 2006-03-15 Jackson Harper * BindingContext.cs: The currency manager needs the data member From d9d61f6d4b7ca6fc5e017f24f1d6a165a1a9d84d Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 21 Mar 2006 21:52:30 +0000 Subject: [PATCH 011/117] * System.Windows.Forms.dll.resources: Add the keyboard * resources. svn path=/trunk/mcs/; revision=58256 --- .../Managed.Windows.Forms/System.Windows.Forms.dll.resources | 1 + 1 file changed, 1 insertion(+) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.resources b/mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.resources index 399de36c6a30d..c819860e36486 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.resources +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.resources @@ -7,3 +7,4 @@ -resource:resources/DnDCopy.cur,System.Windows.Forms.DnDCopy.cur -resource:resources/DnDLink.cur,System.Windows.Forms.DnDLink.cur -resource:resources/DnDMove.cur,System.Windows.Forms.DnDMove.cur +-resource:resources/keyboards.resources \ No newline at end of file From 3e4e4052c9aea1010adc1c8a72e9951f56fac219 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 21 Mar 2006 21:52:48 +0000 Subject: [PATCH 012/117] * System.Windows.Forms.dll.resources: Add the keyboard * resources. svn path=/trunk/mcs/; revision=58257 --- mcs/class/Managed.Windows.Forms/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mcs/class/Managed.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/ChangeLog index 5a00519abc65f..5e2731490762c 100644 --- a/mcs/class/Managed.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/ChangeLog @@ -1,3 +1,7 @@ +2006-03-21 Jackson Harper + + * System.Windows.Forms.dll.resources: Add the keyboard resources. + 2006-03-13 Peter Dennis Bartok * System.Windows.Forms.dll.sources: Added ProgressBarStyle.cs From cd4d1abb6d7047064c58fd3beec89ed9ed2baf0a Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 21 Mar 2006 21:58:03 +0000 Subject: [PATCH 013/117] Add the keyboard resources. svn path=/trunk/mcs/; revision=58258 --- mcs/class/Managed.Windows.Forms/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mcs/class/Managed.Windows.Forms/Makefile b/mcs/class/Managed.Windows.Forms/Makefile index f23044066c650..b4d88f5b59f0e 100644 --- a/mcs/class/Managed.Windows.Forms/Makefile +++ b/mcs/class/Managed.Windows.Forms/Makefile @@ -16,7 +16,8 @@ LIB_MCS_FLAGS = /unsafe \ RESX_RESOURCES = \ resources/System.Windows.Forms.resources \ resources/System.Windows.Forms.en.resources \ - resources/System.Windows.Forms.de.resources + resources/System.Windows.Forms.de.resources \ + resources/keyboards.resources CUR_RESOURCES = \ resources/SplitterNS.cur \ From 59327edf2b3137cbf4d04b24f6d3967b5ef0a142 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Tue, 21 Mar 2006 21:59:11 +0000 Subject: [PATCH 014/117] updated svn path=/trunk/mcs/; revision=58259 --- mcs/errors/known-issues-gmcs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mcs/errors/known-issues-gmcs b/mcs/errors/known-issues-gmcs index 31dc18ba97226..d617f26a9def4 100644 --- a/mcs/errors/known-issues-gmcs +++ b/mcs/errors/known-issues-gmcs @@ -89,6 +89,8 @@ cs1547-3.cs cs0553-2.cs cs1669-2.cs NO ERROR cs1677.cs +cs0134-2.cs NO ERROR +cs0134.cs gcs0208-2.cs NO ERROR gcs0208-3.cs NO ERROR From 312c87db9e67cc4d8e264326c46114a74f080eb0 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 21 Mar 2006 21:59:11 +0000 Subject: [PATCH 015/117] Add prebuilt resources file. svn path=/trunk/mcs/; revision=58260 --- .../resources/keyboards.resources.prebuilt | Bin 0 -> 86172 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 mcs/class/Managed.Windows.Forms/resources/keyboards.resources.prebuilt diff --git a/mcs/class/Managed.Windows.Forms/resources/keyboards.resources.prebuilt b/mcs/class/Managed.Windows.Forms/resources/keyboards.resources.prebuilt new file mode 100644 index 0000000000000000000000000000000000000000..6f999ecce9988a8a16820355092a94dac388f83f GIT binary patch literal 86172 zcmdqKcbpXEwzfS@Y8t@;B*!7=oTKENv&0#OA;ZATkb`2*IcI{Ps0gTtAi)HRiV;Mj zq5@(<6hu^b*HxQ)ZJ5D#pYQwa_n*_px~A(|)lYX<)xDnT9`>B=+kV~{iHnQdXG==o zS!wCXlWO)!PD`1Vnv|U8_xdC!j!I6g9zQ89DJ6B{xRKT42PCJajZ2x_qE5})H5=5f zUAt!O>hW!-O-!Gbn%rV?^0f5S#EI48drccTaa>Z@RJ#Io=a@?%A5pn5piE$(2CfXXe0%>tcCMI7{7$1#`EAg-G zN5-XCIW=z71skl3@mP-IS-bI*Ta-HyKslN-W=|X!<4DJ{f$Sg$u<_$!IRRV7av1_P zu5C-s&4xO*@cQf7Qs0&awluV*ku8mFX<`c-Z?I*(Exm0SXiIxr`q^ton_C3$6ea(L4II*AE zZyZC83CD?JsCUcp;ka--+20&9jycDK+G2>lvTsS723mhl*TzE`4_riC=tNNdw zUAz;$GDiAOXBTIdUe$j(yLgqGZQ-5pYA<$7wD;IU2W$!72?6@w@lNOh|2y6Zt?Ylt zJE0%{?|3InD&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iLS4p@JAkCAM6#Wq5bMO(w=ip zlA1bt&X~Pg$+rG}|6yB3tvbo;x~^EI?!WKCS@x6eYE(G4niGDaeX3L8+~^ABQ&nnE z;q3cKa7`+VcXf<6wa=re%@p6$K5J9KbzS+srOG-~hUCfa znTwyCuS)Li&09##FFe zvxgblXA>&qtga&TUl)l@sgP8<+wra{n^75>$J;9x&2ipQW%I0*BWs?t^n)!R?gv{! z+z+;bXpc_0#MVjlil~=A6^|-&Rf(a0Inywgs85CDkTuOzX+VVp(QhiV(QT-ZBrUR1 z<|7TMkSH(byOlc`ji`_;&t#=sfo)5LgwfwVly9{$6_Vz&tjx+KnouEeMkOux5SmgU zc_w6~TmvKF+dAf#0s3Q1Ffm3zhURDK mrOz`GBJ-3!aSlYrwHG-T(jwQ?-Qqlm(p Date: Tue, 21 Mar 2006 21:59:52 +0000 Subject: [PATCH 016/117] flush svn path=/trunk/mcs/; revision=58261 --- mcs/class/Managed.Windows.Forms/resources/ChangeLog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mcs/class/Managed.Windows.Forms/resources/ChangeLog b/mcs/class/Managed.Windows.Forms/resources/ChangeLog index 0f0347d462988..791361e1ea3eb 100644 --- a/mcs/class/Managed.Windows.Forms/resources/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/resources/ChangeLog @@ -1,3 +1,11 @@ +2006-03-21 Jackson Harper + + * keyboards.resx: The keyboards files. + * create_keyboards.cs: A little app used to create the keyboards + resource file. Compile with mcs /r:System.Windows.Forms.dll + create_keyboards.cs then run and you will get the keyboards.resx + file. + 2005-11-01 Peter Dennis Bartok * DnDLink.cur: Added From 1c2ad7479fa67b904597337ff95afc0ff81fdd30 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 21 Mar 2006 22:05:08 +0000 Subject: [PATCH 017/117] * X11Keyboard.cs: improved layout detection. Move the nonchar tables into this file. * KeyboardLayouts.cs: Move the tables into resource files. svn path=/trunk/mcs/; revision=58262 --- .../System.Windows.Forms/ChangeLog | 6 + .../System.Windows.Forms/KeyboardLayouts.cs | 738 ++---------------- .../System.Windows.Forms/X11Keyboard.cs | 254 +++--- 3 files changed, 217 insertions(+), 781 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 5deb737bfbac5..f125509207e99 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,9 @@ +2006-03-21 Jackson Harper + + * X11Keyboard.cs: improved layout detection. Move the nonchar + tables into this file. + * KeyboardLayouts.cs: Move the tables into resource files. + 2006-03-21 Mike Kestner * ListView.cs: use OnItemActivated to raise events. Fixes #77834. diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/KeyboardLayouts.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/KeyboardLayouts.cs index 286b3ade6bfc7..8a6d0098947f1 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/KeyboardLayouts.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/KeyboardLayouts.cs @@ -24,23 +24,19 @@ // // -// TODO: -// - Move these tables into unmanaged code (libgdiplus) and access with a pointer -// - - using System; +using System.Resources; namespace System.Windows.Forms { - internal class KeyboardLayout { + internal class _KeyboardLayout { public string Comment; public int CodePage; - public string [] Key; + public uint [][] Key; public short [] Scan; public VirtualKeys [] VKey; - public KeyboardLayout (string comment, int code_page, string [] key, short [] scan, VirtualKeys [] vkey) + public _KeyboardLayout (string comment, int code_page, uint [][] key, short [] scan, VirtualKeys [] vkey) { Comment = comment; CodePage = code_page; @@ -49,688 +45,86 @@ public KeyboardLayout (string comment, int code_page, string [] key, short [] sc VKey = vkey; } } - - internal class KeyboardLayouts { - - public static readonly int MainLen = 48; - private static readonly string [] main_key_US = new string [] - { - "`~","1!","2@","3#","4$","5%","6^","7&","8*","9(","0)","-_","=+", - "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","[{","]}", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL",";:","'\"","\\|", - "zZ","xX","cC","vV","bB","nN","mM",",<",".>","/?" - }; - - private static string [] main_key_US_phantom = new string [] - { - "`~","1!","2@","3#","4$","5%","6^","7&","8*","9(","0)","-_","=+", - "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","[{","]}", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL",";:","'\"","\\|", - "zZ","xX","cC","vV","bB","nN","mM",",<",".>","/?", - "<>" /* the phantom key */ - }; - - /*** United States keyboard layout (dvorak version) */ - private static readonly string [] main_key_US_dvorak = new string [] - { - "`~","1!","2@","3#","4$","5%","6^","7&","8*","9(","0)","[{","]}", - "'\"",",<",".>","pP","yY","fF","gG","cC","rR","lL","/?","=+", - "aA","oO","eE","uU","iI","dD","hH","tT","nN","sS","-_","\\|", - ";:","qQ","jJ","kK","xX","bB","mM","wW","vV","zZ" - }; - - /*** British keyboard layout */ - private static readonly string [] main_key_UK = new string [] - { - "`","1!","2\"","3£","4$","5%","6^","7&","8*","9(","0)","-_","=+", - "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","[{","]}", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL",";:","'@","#~", - "zZ","xX","cC","vV","bB","nN","mM",",<",".>","/?", - "\\|" - }; - - /*** French keyboard layout (contributed by Eric Pouech) */ - private static readonly string [] main_key_FR = new string [] - { - "²","&1","é2~","\"3#","'4{","(5[","-6|","è7","_8\\","ç9^±","à0@",")°]","=+}", - "aA","zZ","eE","rR","tT","yY","uU","iI","oO","pP","^¨","$£¤", - "qQ","sSß","dD","fF","gG","hH","jJ","kK","lL","mM","ù%","*µ", - "wW","xX","cC","vV","bB","nN",",?",";.",":/","!§", - "<>" - }; - - /*** Icelandic keyboard layout (contributed by Ríkharður Egilsson) */ - private static readonly string [] main_key_IS = new string [] - { - "°","1!","2\"","3#","4$","5%","6&","7/{","8([","9)]","0=}","öÖ\\","-_", - "qQ@","wW","eE","rR","tT","yY","uU","iI","oO","pP","ðÃ","'?~", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL","æÆ","´^","+*`", - "zZ","xX","cC","vV","bB","nN","mM",",;",".:","þÞ", - "<>|" - }; - - /*** German keyboard layout (contributed by Ulrich Weigand) */ - private static readonly string [] main_key_DE = new string [] - { - "^°","1!","2\"²","3§³","4$","5%","6&","7/{","8([","9)]","0=}","ß?\\","'`", - "qQ@","wW","eE€","rR","tT","zZ","uU","iI","oO","pP","üÜ","+*~", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL","öÖ","äÄ","#´", - "yY","xX","cC","vV","bB","nN","mMµ",",;",".:","-_", - "<>|" - }; - - /*** German keyboard layout without dead keys */ - private static readonly string [] main_key_DE_nodead = new string [] - { - "^°","1!","2\"","3§","4$","5%","6&","7/{","8([","9)]","0=}","ß?\\","´", - "qQ","wW","eE","rR","tT","zZ","uU","iI","oO","pP","üÜ","+*~", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL","öÖ","äÄ","#'", - "yY","xX","cC","vV","bB","nN","mM",",;",".:","-_", - "<>" - }; - - /*** Swiss German keyboard layout (contributed by Jonathan Naylor) */ - private static readonly string [] main_key_SG = new string [] - { - "§°","1+|","2\"@","3*#","4ç","5%","6&¬","7/¦","8(¢","9)","0=","'?´","^`~", - "qQ","wW","eE","rR","tT","zZ","uU","iI","oO","pP","üè[","¨!]", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL","öé","äà{","$£}", - "yY","xX","cC","vV","bB","nN","mM",",;",".:","-_", - "<>\\" - }; - - /*** Swiss French keyboard layout (contributed by Philippe Froidevaux) */ - private static readonly string [] main_key_SF = new string [] - { - "§°","1+|","2\"@","3*#","4ç","5%","6&¬","7/¦","8(¢","9)","0=","'?´","^`~", - "qQ","wW","eE","rR","tT","zZ","uU","iI","oO","pP","èü[","¨!]", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL","éö","àä{","$£}", - "yY","xX","cC","vV","bB","nN","mM",",;",".:","-_", - "<>\\" - }; - - /*** Norwegian keyboard layout (contributed by Ove KÃ¥ven) */ - private static readonly string [] main_key_NO = new string [] - { - "|§","1!","2\"@","3#£","4¤$","5%","6&","7/{","8([","9)]","0=}","+?","\\`´", - "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","åÅ","¨^~", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL","øØ","æÆ","'*", - "zZ","xX","cC","vV","bB","nN","mM",",;",".:","-_", - "<>" - }; - - /*** Danish keyboard layout (contributed by Bertho Stultiens) */ - private static readonly string [] main_key_DA = new string [] - { - "½§","1!","2\"@","3#£","4¤$","5%","6&","7/{","8([","9)]","0=}","+?","´`|", - "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","åÅ","¨^~", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL","æÆ","øØ","'*", - "zZ","xX","cC","vV","bB","nN","mM",",;",".:","-_", - "<>\\" - }; - - /*** Swedish keyboard layout (contributed by Peter Bortas) */ - private static readonly string [] main_key_SE = new string [] - { - "§½","1!","2\"@","3#£","4¤$","5%","6&","7/{","8([","9)]","0=}","+?\\","´`", - "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","åÅ","¨^~", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL","öÖ","äÄ","'*", - "zZ","xX","cC","vV","bB","nN","mM",",;",".:","-_", - "<>|" - }; - - /*** Canadian French keyboard layout */ - private static readonly string [] main_key_CF = new string [] - { - "#|\\","1!±","2\"@","3/£","4$¢","5%¤","6?¬","7&¦","8*²","9(³","0)¼","-_½","=+¾", - "qQ","wW","eE","rR","tT","yY","uU","iI","oO§","pP¶","^^[","¸¨]", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL",";:~","``{","<>}", - "zZ","xX","cC","vV","bB","nN","mM",",'-",".","éÉ", - "«»°" - }; - - /*** Portuguese keyboard layout */ - private static readonly string [] main_key_PT = new string [] - { - "\\¦","1!","2\"@","3#£","4$§","5%","6&","7/{","8([","9)]","0=}","'?","«»", - "qQ", "wW","eE", "rR", "tT", "yY", "uU", "iI", "oO", "pP", "+*\\¨","\\'\\`", - "aA", "sS","dD", "fF", "gG", "hH", "jJ", "kK", "lL", "çÇ", "ºª", "\\~\\^", - "zZ", "xX","cC", "vV", "bB", "nN", "mM", ",;", ".:", "-_", - "<>" - }; - - /*** Italian keyboard layout */ - private static readonly string [] main_key_IT = new string [] - { - "\\|","1!¹","2\"²","3£³","4$¼","5%½","6&¾","7/{","8([","9)]","0=}","'?`","ì^~", - "qQ@","wW","eE","rR","tT","yY","uU","iI","oOø","pPþ","èé[","+*]", - "aA","sSß","dDð","fF","gG","hH","jJ","kK","lL","òç@","à°#","ù§", - "zZ","xX","cC","vV","bB","nN","mMµ",",;",".:·","-_", - "<>|" - }; - - /*** Finnish keyboard layout */ - private static readonly string [] main_key_FI = new string [] - { - "","1!","2\"@","3#","4$","5%","6&","7/{","8([","9)]","0=}","+?\\","\'`", - "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","","\"^~", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL","","","'*", - "zZ","xX","cC","vV","bB","nN","mM",",;",".:","-_", - "<>|" - }; - - /*** Russian keyboard layout (contributed by Pavel Roskin) */ - private static readonly string [] main_key_RU = new string [] - { - "`~","1!","2@","3#","4$","5%","6^","7&","8*","9(","0)","-_","=+", - "qQÊê","wWÃã","eEÕõ","rRËë","tTÃ…Ã¥","yYÎî","uUÇç","iIÛû","oOÃý","pPÚú","[{Èè","]}ßÿ", - "aAÆæ","sSÙù","dD×÷","fFÃá","gGÃð","hHÒò","jJÃï","kKÌì","lLÄä",";:Öö","'\"Üü","\\|", - "zZÑñ","xXÞþ","cCÓó","vVÃí","bBÉé","nNÔô","mMØø",",<Ââ",".>Àà","/?" - }; - - /*** Russian keyboard layout (phantom key version) */ - private static readonly string [] main_key_RU_phantom = new string [] - { - "`~","1!","2@","3#","4$","5%","6^","7&","8*","9(","0)","-_","=+", - "qQÊê","wWÃã","eEÕõ","rRËë","tTÃ…Ã¥","yYÎî","uUÇç","iIÛû","oOÃý","pPÚú","[{Èè","]}ßÿ", - "aAÆæ","sSÙù","dD×÷","fFÃá","gGÃð","hHÒò","jJÃï","kKÌì","lLÄä",";:Öö","'\"Üü","\\|", - "zZÑñ","xXÞþ","cCÓó","vVÃí","bBÉé","nNÔô","mMØø",",<Ââ",".>Àà","/?", - "<>" /* the phantom key */ - }; - - /*** Russian keyboard layout KOI8-R */ - private static readonly string [] main_key_RU_koi8r = new string [] - { - "()","1!","2\"","3/","4$","5:","6,","7.","8;","9?","0%","-_","=+", - "Êê","Ãã","Õõ","Ëë","Ã…Ã¥","Îî","Çç","Ûû","Ãý","Úú","Èè","ßÿ", - "Ææ","Ùù","×÷","Ãá","Ãð","Òò","Ãï","Ìì","Ää","Öö","Üü","\\|", - "Ññ","Þþ","Óó","Ãí","Éé","Ôô","Øø","Ââ","Àà","/?", - "<>" /* the phantom key */ - }; - - /*** Ukrainian keyboard layout KOI8-U */ - private static readonly string [] main_key_UA = new string [] - { - "`~­½","1!1!","2@2\"","3#3'","4$4*","5%5:","6^6,","7&7.","8*8;","9(9(","0)0)","-_-_","=+=+", - "qQÊê","wWÃã","eEÕõ","rRËë","tTÃ…Ã¥","yYÎî","uUÇç","iIÛû","oOÃý","pPÚú","[{Èè","]}§·", - "aAÆæ","sS¦¶","dD×÷","fFÃá","gGÃð","hHÒò","jJÃï","kKÌì","lLÄä",";:Öö","'\"¤´","\\|\\|", - "zZÑñ","xXÞþ","cCÓó","vVÃí","bBÉé","nNÔô","mMØø",",<Ââ",".>Àà","/?/?", - "<>" /* the phantom key */ - }; - - /*** Spanish keyboard layout (contributed by José Marcos López) */ - private static readonly string [] main_key_ES = new string [] - { - "ºª\\","1!|","2\"@","3·#","4$","5%","6&¬","7/","8(","9)","0=","'?","¡¿", - "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","`^[","+*]", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL","ñÑ","'¨{","çÇ}", - "zZ","xX","cC","vV","bB","nN","mM",",;",".:","-_", - "<>" - }; - - /*** Belgian keyboard layout ***/ - private static readonly string [] main_key_BE = new string [] - { - "","&1|","é2@","\"3#","'4","(5","§6^","è7","!8","ç9{","à0}",")°","-_", - "aA","zZ","eE¤","rR","tT","yY","uU","iI","oO","pP","^¨[","$*]", - "qQ","sSß","dD","fF","gG","hH","jJ","kK","lL","mM","ù%´","µ£`", - "wW","xX","cC","vV","bB","nN",",?",";.",":/","=+~", - "<>\\" - }; - /*** Hungarian keyboard layout (contributed by Zoltán Kovács) */ - private static readonly string [] main_key_HU = new string [] - { - "0§","1'~","2\"·","3+^","4!¢","5%°","6/²","7=`","8(ÿ","9)´","öÖ½","üܨ","óÓ¸", - "qQ\\","wW|","eE","rR","tT","zZ","uU","iIÃ","oOø","pP","õÕ÷","úÚ×", - "aA","sSð","dDÃ","fF[","gG]","hH","jJí","kK³","lL£","éÉ$","áÃß","ûÛ¤", - "yY>","xX#","cC&","vV@","bB{","nN}","mM",",?;",".:·","-_*", - "íÃ<" - }; - - /*** Polish (programmer's) keyboard layout ***/ - private static readonly string [] main_key_PL = new string [] - { - "`~","1!","2@","3#","4$","5%","6^","7&§","8*","9(","0)","-_","=+", - "qQ","wW","eEêÊ","rR","tT","yY","uU","iI","oOóÓ","pP","[{","]}", - "aA±¡","sS¶¦","dD","fF","gG","hH","jJ","kK","lL³£",";:","'\"","\\|", - "zZ¿¯","xX¼¬","cCæÆ","vV","bB","nNñÑ","mM",",<",".>","/?", - "<>|" - }; - - /*** Croatian keyboard layout ***/ - private static readonly string [] main_key_HR = new string [] - { - "¸¨","1!","2\"·","3#^","4$¢","5%°","6&²","7/`","8(ÿ","9)´","0=½","'?¨","+*¸", - "qQ\\","wW|","eE","rR","tT","zZ","uU","iI","oO","pP","¹©÷","ðÃ×", - "aA","sS","dD","fF[","gG]","hH","jJ","kK³","lL£","èÈ","æÆß","¾®¤", - "yY","xX","cC","vV@","bB{","nN}","mM§",",;",".:","-_/", - "<>" - }; - - /*** Japanese 106 keyboard layout ***/ - private static readonly string [] main_key_JA_jp106 = new string [] - { - "1!","2\"","3#","4$","5%","6&","7'","8(","9)","0~","-=","^~","\\|", - "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","@`","[{", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL",";+",":*","]}", - "zZ","xX","cC","vV","bB","nN","mM",",<",".>","/?", - "\\_", - }; - - /*** Japanese pc98x1 keyboard layout ***/ - private static readonly string [] main_key_JA_pc98x1 = new string [] - { - "1!","2\"","3#","4$","5%","6&","7'","8(","9)","0","-=","^`","\\|", - "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","@~","[{", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL",";+",":*","]}", - "zZ","xX","cC","vV","bB","nN","mM",",<",".>","/?", - "\\_", - }; - - /*** Brazilian ABNT-2 keyboard layout (contributed by Raul Gomes Fernandes) */ - private static readonly string [] main_key_PT_br = new string [] - { - "'\"","1!","2@","3#","4$","5%","6\"","7&","8*","9(","0)","-_","=+", - "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","'`","[{", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL","çÇ","~^","]}", - "zZ","xX","cC","vV","bB","nN","mM",",<",".>","/?" - }; - - /*** US international keyboard layout (contributed by Gustavo Noronha (kov@debian.org)) */ - private static readonly string [] main_key_US_intl = new string [] - { - "`~", "1!", "2@", "3#", "4$", "5%", "6^", "7&", "8*", "9(", "0)", "-_", "=+", "\\|", - "qQ", "wW", "eE", "rR", "tT", "yY", "uU", "iI", "oO", "pP", "[{", "]}", - "aA", "sS", "dD", "fF", "gG", "hH", "jJ", "kK", "lL", ";:", "'\"", - "zZ", "xX", "cC", "vV", "bB", "nN", "mM", ",<", ".>", "/?" - }; - - /*** Slovak keyboard layout (see cssk_ibm(sk_qwerty) in xkbsel) - - dead_abovering replaced with degree - no symbol in iso8859-2 - - brokenbar replaced with bar */ - private static readonly string [] main_key_SK = new string [] - { - ";°`'","+1","µ2","¹3","è4","»5","¾6","ý7","á8","í9","é0)","=%","", - "qQ\\","wW|","eE","rR","tT","yY","uU","iI","oO","pP","ú/÷","ä(×", - "aA","sSð","dDÃ","fF[","gG]","hH","jJ","kK³","lL£","ô\"$","§!ß","ò)¤", - "zZ>","xX#","cC&","vV@","bB{","nN}","mM",",?<",".:>","-_*", - "<>\\|" - }; - - /*** Czech keyboard layout (setxkbmap cz) */ - private static readonly string [] main_key_CZ = new string [] - { - ";","+1","ì2","¹3","è4","ø5","¾6","ý7","á8","í9","é0","=%","´·", - "qQ","wW","eE","rR","tT","zZ","uU","iI","oO","pP","ú/",")(", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL","ù\"","§!","¨'", - "yY","xX","cC","vV","bB","nN","mM",",?",".:","-_", - "\\" - }; + internal class KeyboardLayouts { - /*** Czech keyboard layout (setxkbmap cz_qwerty) */ - private static readonly string [] main_key_CZ_qwerty = new string [] - { - ";","+1","ì2","¹3","è4","ø5","¾6","ý7","á8","í9","é0","=%","´·", - "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","ú/",")(", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL","ù\"","§!","¨'", - "zZ","xX","cC","vV","bB","nN","mM",",?",".:","-_", - "\\" - }; + private KeyboardLayout [] keyboard_layouts; + public int [][] vkey_table; + public short [][] scan_table; - /*** Slovak and Czech (programmer's) keyboard layout (see cssk_dual(cs_sk_ucw)) */ - private static readonly string [] main_key_SK_prog = new string [] - { - "`~","1!","2@","3#","4$","5%","6^","7&","8*","9(","0)","-_","=+", - "qQäÄ","wWìÌ","eEéÉ","rRøØ","tT»«","yYýÃ","uUùÙ","iIíÃ","oOóÓ","pPöÖ","[{","]}", - "aAáÃ","sS¹©","dDïÃ","fFëË","gGàÀ","hHúÚ","jJüÜ","kKôÔ","lLµ¥",";:","'\"","\\|", - "zZ¾®","xX¤","cCèÈ","vVçÇ","bB","nNòÒ","mMåÅ",",<",".>","/?", - "<>" - }; - - /*** Czech keyboard layout (see cssk_ibm(cs_qwerty) in xkbsel) */ - private static readonly string [] main_key_CS = new string [] - { - ";","+1","ì2","¹3","è4","ø5","¾6","ý7","á8","í9","é0½)","=%","", - "qQ\\","wW|","eE","rR","tT","yY","uU","iI","oO","pP","ú/[{",")(]}", - "aA","sSð","dDÃ","fF[","gG]","hH","jJ","kK³","lL£","ù\"$","§!ß","¨'", - "zZ>","xX#","cC&","vV@","bB{","nN}","mM",",?<",".:>","-_*", - "<>\\|" - }; - - /*** Latin American keyboard layout (contributed by Gabriel Orlando Garcia) */ - private static readonly string [] main_key_LA = new string [] - { - "|°¬","1!","2\"","3#","4$","5%","6&","7/","8(","9)","0=","'?\\","¡¿", - "qQ@","wW","eE","rR","tT","yY","uU","iI","oO","pP","´¨","+*~", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL","ñÑ","{[^","}]`", - "zZ","xX","cC","vV","bB","nN","mM",",;",".:","-_", - "<>" - }; - - /*** Lithuanian (Baltic) keyboard layout (contributed by Nerijus Baliûnas) */ - private static readonly string [] main_key_LT_B = new string [] + public KeyboardLayouts () { - "`~","àÀ","èÈ","æÆ","ëË","áÃ","ðÃ","øØ","ûÛ","((","))","-_","þÞ", - "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","[{","]}", - "aA","sS","dD","fF","gG","hH","jJ","kK","lL",";:","'\"","\\|", - "zZ","xX","cC","vV","bB","nN","mM",",<",".>","/?" - }; - - /*** Turkish keyboard Layout */ - private static readonly string [] main_key_TK = new string [] - { - "\"é","1!","2'","3^#","4+$","5%","6&","7/{","8([","9)]","0=}","*?\\","-_", - "qQ@","wW","eE","rR","tT","yY","uU","ýIî","oO","pP","ðÃ","üÜ~", - "aAæ","sSß","dD","fF","gG","hH","jJ","kK","lL","þÞ","iÃ",",;`", - "zZ","xX","cC","vV","bB","nN","mM","öÖ","çÇ",".:" - }; + LoadLayouts (); + } - private static readonly string [] main_key_vnc = new string [] + public void LoadLayouts () { - "1!","2@","3#","4$","5%","6^","7&","8*","9(","0)","-_","=+","[{","]}",";:","'\"","`~",",<",".>","/?","\\|", - "aA","bB","cC","dD","eE","fF","gG","hH","iI","jJ","kK","lL","mM","nN","oO","pP","qQ","rR","sS","tT","uU","vV","wW","xX","yY","zZ" - }; + ResourceManager rm; + rm = new ResourceManager ("keyboards", System.Reflection.Assembly.GetExecutingAssembly()); + keyboard_layouts = (KeyboardLayout []) rm.GetObject ("keyboard_table"); - /*** VNC keyboard layout */ - private static readonly short [] main_key_scan_vnc = new short [] - { - 0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x1A,0x1B,0x27,0x28,0x29,0x33,0x34,0x35,0x2B, - 0x1E,0x30,0x2E,0x20,0x12,0x21,0x22,0x23,0x17,0x24,0x25,0x26,0x32,0x31,0x18,0x19,0x10,0x13,0x1F,0x14,0x16,0x2F,0x11,0x2D,0x15,0x2C, - 0x56 - }; + vkey_table = (int [][]) rm.GetObject ("vkey_table"); + scan_table = (short [][]) rm.GetObject ("scan_table"); + } - private static readonly VirtualKeys [] main_key_vkey_vnc = new VirtualKeys [] - { - VirtualKeys.VK_1, VirtualKeys.VK_2, VirtualKeys.VK_3, VirtualKeys.VK_4, VirtualKeys.VK_5, VirtualKeys.VK_6, - VirtualKeys.VK_7, VirtualKeys.VK_8, VirtualKeys.VK_9, VirtualKeys.VK_0, VirtualKeys.VK_OEM_MINUS, - VirtualKeys.VK_OEM_PLUS, VirtualKeys.VK_OEM_4, VirtualKeys.VK_OEM_6, VirtualKeys.VK_OEM_1, - VirtualKeys.VK_OEM_7, VirtualKeys.VK_OEM_3, VirtualKeys.VK_OEM_COMMA, VirtualKeys.VK_OEM_PERIOD, - VirtualKeys.VK_OEM_2, VirtualKeys.VK_OEM_5, VirtualKeys.VK_A, VirtualKeys.VK_B, VirtualKeys.VK_C, - VirtualKeys.VK_D, VirtualKeys.VK_E, VirtualKeys.VK_F, VirtualKeys.VK_G, VirtualKeys.VK_H, - VirtualKeys.VK_I, VirtualKeys.VK_J, VirtualKeys.VK_K, VirtualKeys.VK_L, VirtualKeys.VK_M, - VirtualKeys.VK_N, VirtualKeys.VK_O, VirtualKeys.VK_P, VirtualKeys.VK_Q, VirtualKeys.VK_R, - VirtualKeys.VK_S, VirtualKeys.VK_T, VirtualKeys.VK_U, VirtualKeys.VK_V, VirtualKeys.VK_W, - VirtualKeys.VK_X, VirtualKeys.VK_Y, VirtualKeys.VK_Z, VirtualKeys.VK_OEM_102 - }; + public KeyboardLayout [] Layouts { + get { return keyboard_layouts; } + } + } - private static readonly short [] main_key_scan_qwerty = new short [] - { - /* this is my (102-key) keyboard layout, sorry if it doesn't quite match yours */ - /* ` 1 2 3 4 5 6 7 8 9 0 - = */ - 0x29,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D, - /* q w e r t y u i o p [ ] */ - 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B, - /* a s d f g h j k l ; ' \ */ - 0x1E,0x1F,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x2B, - /* z x c v b n m , . / */ - 0x2C,0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35, - 0x56 /* the 102nd key (actually to the right of l-shift) */ - }; - private static readonly short [] main_key_scan_dvorak = new short [] - { - /* ` 1 2 3 4 5 6 7 8 9 0 [ ] */ - 0x29,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x1A,0x1B, - /* ' , . p y f g c r l / = */ - 0x28,0x33,0x34,0x19,0x15,0x21,0x22,0x2E,0x13,0x26,0x35,0x0D, - /* a o e u i d h t n s - \ */ - 0x1E,0x18,0x12,0x16,0x17,0x20,0x23,0x14,0x31,0x1F,0x0C,0x2B, - /* ; q j k x b m w v z */ - 0x27,0x10,0x24,0x25,0x2D,0x30,0x32,0x11,0x2F,0x2C, - 0x56 /* the 102nd key (actually to the right of l-shift) */ - }; - private static readonly VirtualKeys [] main_key_vkey_qwerty = new VirtualKeys [] - { - // NOTE: this layout must concur with the scan codes layout above - VirtualKeys.VK_OEM_3, VirtualKeys.VK_1, VirtualKeys.VK_2, VirtualKeys.VK_3, VirtualKeys.VK_4, - VirtualKeys.VK_5, VirtualKeys.VK_6, VirtualKeys.VK_7, VirtualKeys.VK_8, VirtualKeys.VK_9, - VirtualKeys.VK_0, VirtualKeys.VK_OEM_MINUS, VirtualKeys.VK_OEM_PLUS, VirtualKeys.VK_Q, - VirtualKeys.VK_W, VirtualKeys.VK_E, VirtualKeys.VK_R, VirtualKeys.VK_T, VirtualKeys.VK_Y, - VirtualKeys.VK_U, VirtualKeys.VK_I, VirtualKeys.VK_O, VirtualKeys.VK_P, VirtualKeys.VK_OEM_4, - VirtualKeys.VK_OEM_6, VirtualKeys.VK_A, VirtualKeys.VK_S, VirtualKeys.VK_D, VirtualKeys.VK_F, - VirtualKeys.VK_G, VirtualKeys.VK_H, VirtualKeys.VK_J, VirtualKeys.VK_K, VirtualKeys.VK_L, - VirtualKeys.VK_OEM_1, VirtualKeys.VK_OEM_7, VirtualKeys.VK_OEM_5, VirtualKeys.VK_Z, - VirtualKeys.VK_X, VirtualKeys.VK_C, VirtualKeys.VK_V, VirtualKeys.VK_B, VirtualKeys.VK_N, - VirtualKeys.VK_M, VirtualKeys.VK_OEM_COMMA, VirtualKeys.VK_OEM_PERIOD, VirtualKeys.VK_OEM_2, - VirtualKeys.VK_OEM_102 // the 102nd key (actually to the right of l-shift) - }; + [Serializable] + [CLSCompliant(false)] +#if GENERATING_RESOURCES + public +#else + internal +#endif + class KeyboardLayout { - private static readonly VirtualKeys [] main_key_vkey_qwertz = new VirtualKeys [] - { - VirtualKeys.VK_OEM_3, VirtualKeys.VK_1, VirtualKeys.VK_2, VirtualKeys.VK_3, VirtualKeys.VK_4, - VirtualKeys.VK_5, VirtualKeys.VK_6, VirtualKeys.VK_7, VirtualKeys.VK_8, VirtualKeys.VK_9, - VirtualKeys.VK_0, VirtualKeys.VK_OEM_MINUS, VirtualKeys.VK_OEM_PLUS, - VirtualKeys.VK_Q, VirtualKeys.VK_W, VirtualKeys.VK_E, VirtualKeys.VK_R, VirtualKeys.VK_T, VirtualKeys.VK_Z, - VirtualKeys.VK_U, VirtualKeys.VK_I, VirtualKeys.VK_O, VirtualKeys.VK_P, VirtualKeys.VK_OEM_4, - VirtualKeys.VK_OEM_6, VirtualKeys.VK_A, VirtualKeys.VK_S, VirtualKeys.VK_D, VirtualKeys.VK_F, - VirtualKeys.VK_G, VirtualKeys.VK_H, VirtualKeys.VK_J, VirtualKeys.VK_K, VirtualKeys.VK_L, - VirtualKeys.VK_OEM_1, VirtualKeys.VK_OEM_7, VirtualKeys.VK_OEM_5, VirtualKeys.VK_Y, - VirtualKeys.VK_X, VirtualKeys.VK_C, VirtualKeys.VK_V, VirtualKeys.VK_B, VirtualKeys.VK_N, - VirtualKeys.VK_M, VirtualKeys.VK_OEM_COMMA, VirtualKeys.VK_OEM_PERIOD, VirtualKeys.VK_OEM_2, - VirtualKeys.VK_OEM_102 // the 102nd key (actually to the right of l-shift) - }; + public int Lcid; + public string Name; + public ScanTableIndex ScanIndex; + public VKeyTableIndex VKeyIndex; + public uint [][] Keys; - private static readonly VirtualKeys [] main_key_vkey_dvorak = new VirtualKeys [] + public KeyboardLayout (int lcid, string name, ScanTableIndex scan_index, + VKeyTableIndex vkey_index, uint [][] keys) { - // NOTE: this layout must concur with the scan codes layout above - VirtualKeys.VK_OEM_3, VirtualKeys.VK_1, VirtualKeys.VK_2, VirtualKeys.VK_3, VirtualKeys.VK_4, - VirtualKeys.VK_5, VirtualKeys.VK_6, VirtualKeys.VK_7, VirtualKeys.VK_8, VirtualKeys.VK_9, - VirtualKeys.VK_0, VirtualKeys.VK_OEM_4, VirtualKeys.VK_OEM_6, VirtualKeys.VK_OEM_7, - VirtualKeys.VK_OEM_COMMA, VirtualKeys.VK_OEM_PERIOD, VirtualKeys.VK_P, VirtualKeys.VK_Y, - VirtualKeys.VK_F, VirtualKeys.VK_G, VirtualKeys.VK_C, VirtualKeys.VK_R, VirtualKeys.VK_L, - VirtualKeys.VK_OEM_2, VirtualKeys.VK_OEM_PLUS, VirtualKeys.VK_A, VirtualKeys.VK_O, - VirtualKeys.VK_E, VirtualKeys.VK_U, VirtualKeys.VK_I, VirtualKeys.VK_D, VirtualKeys.VK_H, - VirtualKeys.VK_T, VirtualKeys.VK_N, VirtualKeys.VK_S, VirtualKeys.VK_OEM_MINUS, VirtualKeys.VK_OEM_5, - VirtualKeys.VK_OEM_1, VirtualKeys.VK_Q, VirtualKeys.VK_J, VirtualKeys.VK_K, VirtualKeys.VK_X, - VirtualKeys.VK_B, VirtualKeys.VK_M, VirtualKeys.VK_W, VirtualKeys.VK_V, VirtualKeys.VK_Z, - VirtualKeys.VK_OEM_102 // the 102nd key (actually to the right of l-shift) - }; - - private static readonly VirtualKeys [] main_key_vkey_azerty = new VirtualKeys [] - { - // NOTE: this layout must concur with the scan codes layout above - VirtualKeys.VK_OEM_7, VirtualKeys.VK_1, VirtualKeys.VK_2, VirtualKeys.VK_3, VirtualKeys.VK_4, - VirtualKeys.VK_5, VirtualKeys.VK_6, VirtualKeys.VK_7, VirtualKeys.VK_8, VirtualKeys.VK_9, - VirtualKeys.VK_0, VirtualKeys.VK_OEM_4, VirtualKeys.VK_OEM_PLUS, VirtualKeys.VK_A, VirtualKeys.VK_Z, - VirtualKeys.VK_E, VirtualKeys.VK_R, VirtualKeys.VK_T, VirtualKeys.VK_Y, VirtualKeys.VK_U, - VirtualKeys.VK_I, VirtualKeys.VK_O, VirtualKeys.VK_P, VirtualKeys.VK_OEM_6, VirtualKeys.VK_OEM_1, - VirtualKeys.VK_Q, VirtualKeys.VK_S, VirtualKeys.VK_D, VirtualKeys.VK_F, VirtualKeys.VK_G, - VirtualKeys.VK_H, VirtualKeys.VK_J, VirtualKeys.VK_K, VirtualKeys.VK_L, VirtualKeys.VK_M, - VirtualKeys.VK_OEM_3, VirtualKeys.VK_OEM_5, VirtualKeys.VK_W, VirtualKeys.VK_X, VirtualKeys.VK_C, - VirtualKeys.VK_V, VirtualKeys.VK_B, VirtualKeys.VK_N, VirtualKeys.VK_OEM_COMMA, VirtualKeys.VK_OEM_PERIOD, - VirtualKeys.VK_OEM_2, VirtualKeys.VK_OEM_8, - VirtualKeys.VK_OEM_102 // the 102nd key (actually to the right of l-shift) - }; + Lcid = lcid; + Name = name; + ScanIndex = scan_index; + VKeyIndex = vkey_index; + Keys = keys; + } - public static int [] nonchar_key_vkey = new int [] + public KeyboardLayout (int lcid, string name, int scan_index, + int vkey_index, uint [][] keys) : this (lcid, name, (ScanTableIndex) scan_index, + (VKeyTableIndex) vkey_index, keys) { - /* unused */ - 0, 0, 0, 0, 0, 0, 0, 0, /* FF00 */ - /* special keys */ - (int) VirtualKeys.VK_BACK, (int) VirtualKeys.VK_TAB, 0, (int) VirtualKeys.VK_CLEAR, 0, (int) VirtualKeys.VK_RETURN, 0, 0, /* FF08 */ - 0, 0, 0, (int) VirtualKeys.VK_PAUSE, (int) VirtualKeys.VK_SCROLL, 0, 0, 0, /* FF10 */ - 0, 0, 0, (int) VirtualKeys.VK_ESCAPE, 0, 0, 0, 0, /* FF18 */ - /* unused */ - 0, 0, 0, 0, 0, 0, 0, 0, /* FF20 */ - 0, 0, 0, 0, 0, 0, 0, 0, /* FF28 */ - 0, 0, 0, 0, 0, 0, 0, 0, /* FF30 */ - 0, 0, 0, 0, 0, 0, 0, 0, /* FF38 */ - 0, 0, 0, 0, 0, 0, 0, 0, /* FF40 */ - 0, 0, 0, 0, 0, 0, 0, 0, /* FF48 */ - /* cursor keys */ - (int) VirtualKeys.VK_HOME, (int) VirtualKeys.VK_LEFT, (int) VirtualKeys.VK_UP, (int) VirtualKeys.VK_RIGHT, /* FF50 */ - (int) VirtualKeys.VK_DOWN, (int) VirtualKeys.VK_PRIOR, (int) VirtualKeys.VK_NEXT, (int) VirtualKeys.VK_END, - 0, 0, 0, 0, 0, 0, 0, 0, /* FF58 */ - /* misc keys */ - (int) VirtualKeys.VK_SELECT, (int) VirtualKeys.VK_SNAPSHOT, (int) VirtualKeys.VK_EXECUTE, (int) VirtualKeys.VK_INSERT, 0, 0, 0, 0, /* FF60 */ - (int) VirtualKeys.VK_CANCEL, (int) VirtualKeys.VK_HELP, (int) VirtualKeys.VK_CANCEL, (int) VirtualKeys.VK_CANCEL, 0, 0, 0, 0, /* FF68 */ - 0, 0, 0, 0, 0, 0, 0, 0, /* FF70 */ - /* keypad keys */ - 0, 0, 0, 0, 0, 0, 0, (int) VirtualKeys.VK_NUMLOCK, /* FF78 */ - 0, 0, 0, 0, 0, 0, 0, 0, /* FF80 */ - 0, 0, 0, 0, 0, (int) VirtualKeys.VK_RETURN, 0, 0, /* FF88 */ - 0, 0, 0, 0, 0, (int) VirtualKeys.VK_HOME, (int) VirtualKeys.VK_LEFT, (int) VirtualKeys.VK_UP, /* FF90 */ - (int) VirtualKeys.VK_RIGHT, (int) VirtualKeys.VK_DOWN, (int) VirtualKeys.VK_PRIOR, (int) VirtualKeys.VK_NEXT, /* FF98 */ - (int) VirtualKeys.VK_END, 0, (int) VirtualKeys.VK_INSERT, (int) VirtualKeys.VK_DELETE, - 0, 0, 0, 0, 0, 0, 0, 0, /* FFA0 */ - 0, 0, (int) VirtualKeys.VK_MULTIPLY, (int) VirtualKeys.VK_ADD, /* FFA8 */ - (int) VirtualKeys.VK_SEPARATOR, (int) VirtualKeys.VK_SUBTRACT, (int) VirtualKeys.VK_DECIMAL, (int) VirtualKeys.VK_DIVIDE, - (int) VirtualKeys.VK_NUMPAD0, (int) VirtualKeys.VK_NUMPAD1, (int) VirtualKeys.VK_NUMPAD2, (int) VirtualKeys.VK_NUMPAD3, /* FFB0 */ - (int) VirtualKeys.VK_NUMPAD4, (int) VirtualKeys.VK_NUMPAD5, (int) VirtualKeys.VK_NUMPAD6, (int) VirtualKeys.VK_NUMPAD7, - (int) VirtualKeys.VK_NUMPAD8, (int) VirtualKeys.VK_NUMPAD9, 0, 0, 0, 0, /* FFB8 */ - /* function keys */ - (int) VirtualKeys.VK_F1, (int) VirtualKeys.VK_F2, - (int) VirtualKeys.VK_F3, (int) VirtualKeys.VK_F4, (int) VirtualKeys.VK_F5, (int) VirtualKeys.VK_F6, (int) VirtualKeys.VK_F7, (int) VirtualKeys.VK_F8, (int) VirtualKeys.VK_F9, (int) VirtualKeys.VK_F10, /* FFC0 */ - (int) VirtualKeys.VK_F11, (int) VirtualKeys.VK_F12, (int) VirtualKeys.VK_F13, (int) VirtualKeys.VK_F14, (int) VirtualKeys.VK_F15, (int) VirtualKeys.VK_F16, 0, 0, /* FFC8 */ - 0, 0, 0, 0, 0, 0, 0, 0, /* FFD0 */ - 0, 0, 0, 0, 0, 0, 0, 0, /* FFD8 */ - /* modifier keys */ - 0, (int) VirtualKeys.VK_SHIFT, (int) VirtualKeys.VK_SHIFT, (int) VirtualKeys.VK_CONTROL, /* FFE0 */ - (int) VirtualKeys.VK_CONTROL, (int) VirtualKeys.VK_CAPITAL, 0, (int) VirtualKeys.VK_MENU, - (int) VirtualKeys.VK_MENU, (int) VirtualKeys.VK_MENU, (int) VirtualKeys.VK_MENU, 0, 0, 0, 0, 0, /* FFE8 */ - 0, 0, 0, 0, 0, 0, 0, 0, /* FFF0 */ - 0, 0, 0, 0, 0, 0, 0, (int) VirtualKeys.VK_DELETE /* FFF8 */ - }; + } + } - public static readonly int [] nonchar_key_scan = new int [] - { - /* unused */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF00 */ - /* special keys */ - 0x0E, 0x0F, 0x00, /*?*/ 0, 0x00, 0x1C, 0x00, 0x00, /* FF08 */ - 0x00, 0x00, 0x00, 0x45, 0x46, 0x00, 0x00, 0x00, /* FF10 */ - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* FF18 */ - /* unused */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF20 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF28 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF30 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF38 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF40 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF48 */ - /* cursor keys */ - 0x147, 0x14B, 0x148, 0x14D, 0x150, 0x149, 0x151, 0x14F, /* FF50 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF58 */ - /* misc keys */ - /*?*/ 0, 0x137, /*?*/ 0, 0x152, 0x00, 0x00, 0x00, 0x00, /* FF60 */ - /*?*/ 0, /*?*/ 0, 0x38, 0x146, 0x00, 0x00, 0x00, 0x00, /* FF68 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF70 */ - /* keypad keys */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x138, 0x145, /* FF78 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF80 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x11C, 0x00, 0x00, /* FF88 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x4B, 0x48, /* FF90 */ - 0x4D, 0x50, 0x49, 0x51, 0x4F, 0x4C, 0x52, 0x53, /* FF98 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFA0 */ - 0x00, 0x00, 0x37, 0x4E, /*?*/ 0, 0x4A, 0x53, 0x135, /* FFA8 */ - 0x52, 0x4F, 0x50, 0x51, 0x4B, 0x4C, 0x4D, 0x47, /* FFB0 */ - 0x48, 0x49, 0x00, 0x00, 0x00, 0x00, /* FFB8 */ - /* function keys */ - 0x3B, 0x3C, - 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, /* FFC0 */ - 0x57, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFC8 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFD0 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFD8 */ - /* modifier keys */ - 0x00, 0x2A, 0x36, 0x1D, 0x11D, 0x3A, 0x00, 0x38, /* FFE0 */ - 0x138, 0x38, 0x138, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFE8 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFF0 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x153 /* FFF8 */ - }; + internal enum VKeyTableIndex { + Qwerty, + Qwertz, + Dvorak, + Qwertz105, + Azerty, + QwertyV2, + AbntQwerty, + QwertyJp106, + Vnc + } - public static readonly KeyboardLayout US = new KeyboardLayout ("United States keyboard layout", 28591, - main_key_US, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout US_phantom = new KeyboardLayout ("United States keyboard layout (phantom key version)", 28591, - main_key_US_phantom, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout US_dvorak = new KeyboardLayout ("United States keyboard layout (dvorak)", 28591, - main_key_US_dvorak, main_key_scan_dvorak, main_key_vkey_dvorak); - public static readonly KeyboardLayout UK = new KeyboardLayout ("British keyboard layout", 28591, - main_key_UK, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout German = new KeyboardLayout ("German keyboard layout", 28591, - main_key_DE, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout German_nodead = new KeyboardLayout ("German keyboard layout without dead keys", 28591, - main_key_DE_nodead, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout SwissGerman = new KeyboardLayout ("Swiss German keyboard layout", 28591, - main_key_SG, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Se = new KeyboardLayout ("Swedish keyboard layout", 28591, - main_key_SE, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout No = new KeyboardLayout ("Norwegian keyboard layout", 28591, - main_key_NO, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Da = new KeyboardLayout ("Danish keyboard layout", 28591, - main_key_DA, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Fr = new KeyboardLayout ("French keyboard layout", 28591, - main_key_FR, main_key_scan_qwerty, main_key_vkey_azerty); - public static readonly KeyboardLayout CF = new KeyboardLayout ("Canadian French keyboard layout", 28591, - main_key_CF, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Be = new KeyboardLayout ("Belgian keyboard layout", 28591, - main_key_BE, main_key_scan_qwerty, main_key_vkey_azerty); - public static readonly KeyboardLayout SF = new KeyboardLayout ("Swiss French keyboard layout", 28591, - main_key_SF, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Pt = new KeyboardLayout ("Portuguese keyboard layout", 28591, - main_key_PT, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Pt_br = new KeyboardLayout ("Brazilian ABNT-2 keyboard layout", 28591, - main_key_PT_br, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout US_intl = new KeyboardLayout ("United States International keyboard layout", 28591, - main_key_US_intl, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Fi = new KeyboardLayout ("Finnish keyboard layout", 28591, - main_key_FI, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Ru = new KeyboardLayout ("Russian keyboard layout", 20866, - main_key_RU, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Ru_phantom = new KeyboardLayout ("Russian keyboard layout (phantom key version)", 20866, - main_key_RU_phantom, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Ru_koi8r = new KeyboardLayout ("Russian keyboard layout KOI8-R", 20866, - main_key_RU_koi8r, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Ua = new KeyboardLayout ("Ukrainian keyboard layout KOI8-U", 20866, - main_key_UA, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Es = new KeyboardLayout ("Spanish keyboard layout", 28591, - main_key_ES, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout It = new KeyboardLayout ("Italian keyboard layout", 28591, - main_key_IT, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Is = new KeyboardLayout ("Icelandic keyboard layout", 28591, - main_key_IS, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Hu = new KeyboardLayout ("Hungarian keyboard layout", 28592, - main_key_HU, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Pl = new KeyboardLayout ("Polish (programmer's) keyboard layout", 28592, - main_key_PL, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Hr = new KeyboardLayout ("Croatian keyboard layout", 28592, - main_key_HR, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Ja_jp106 = new KeyboardLayout ("Japanese 106 keyboard layout", 932, - main_key_JA_jp106, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Ja_pc98x1 = new KeyboardLayout ("Japanese pc98x1 keyboard layout", 932, - main_key_JA_pc98x1, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Sk = new KeyboardLayout ("Slovak keyboard layout", 28592, - main_key_SK, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Sk_prog = new KeyboardLayout ("Slovak and Czech keyboard layout without dead keys", 28592, - main_key_SK_prog, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Cs = new KeyboardLayout ("Czech keyboard layout", 28592, - main_key_CS, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Cz = new KeyboardLayout ("Czech keyboard layout cz", 28592, - main_key_CZ, main_key_scan_qwerty, main_key_vkey_qwertz); - public static readonly KeyboardLayout Cz_qwerty = new KeyboardLayout ("Czech keyboard layout cz_qwerty", 28592, - main_key_CZ_qwerty, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout LA = new KeyboardLayout ("Latin American keyboard layout", 28591, - main_key_LA, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout LT_B = new KeyboardLayout ("Lithuanian (Baltic) keyboard layout", 28603, - main_key_LT_B, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Tk = new KeyboardLayout ("Turkish keyboard layout", 28599, - main_key_TK, main_key_scan_qwerty, main_key_vkey_qwerty); - public static readonly KeyboardLayout Vnc = new KeyboardLayout ("VNC keyboard layout", 28591, - main_key_vnc, main_key_scan_vnc, main_key_vkey_vnc); - - - public static readonly KeyboardLayout [] layouts = new KeyboardLayout [] - { - US, US_phantom, US_dvorak, UK, German, German_nodead, SwissGerman, Se, No, Da, Fr, CF, Be, SF, Pt, - Pt_br, US_intl, Fi, Ru, Ru_phantom, Ru_koi8r, Ua, Es, It, Is, Hu, Pl, Hr, Ja_jp106, Ja_pc98x1, Sk, - Sk_prog, Cs, Cz, Cz_qwerty, LA, LT_B, Tk, Vnc - }; - - public static KeyboardLayout [] Layouts { - get { - return layouts; - } - } + internal enum ScanTableIndex { + Qwerty, + Dvorak, + AbntQwerty, + QwertyJp106, + Vnc } + } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Keyboard.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Keyboard.cs index b240ac8b46556..93f84a0091ef8 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Keyboard.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Keyboard.cs @@ -33,6 +33,7 @@ using System; using System.Collections; using System.Text; +using System.Globalization; using System.Runtime.InteropServices; namespace System.Windows.Forms { @@ -48,7 +49,7 @@ internal class X11Keyboard { private int [] keyc2scan = new int [256]; private byte [] key_state_table = new byte [256]; private bool num_state, cap_state; - private KeyboardLayout layout = KeyboardLayouts.Layouts [0]; + private KeyboardLayout layout; // TODO private int NumLockMask; @@ -59,8 +60,11 @@ public X11Keyboard (IntPtr display, IntPtr window) this.display = display; lookup_buffer = new StringBuilder (24); - DetectLayout (); - CreateConversionArray (layout); + KeyboardLayouts layouts = new KeyboardLayouts (); + layout = layouts.Layouts [0]; + DetectLayout (layouts); + CreateConversionArray (layouts, layout); + if (!XSupportsLocale ()) { Console.Error.WriteLine ("X does not support your locale"); } @@ -278,7 +282,7 @@ private int ToUnicode (int vkey, int scan, out string buffer) if (dead_char != 0) { byte [] bytes = new byte [1]; bytes [0] = (byte) dead_char; - Encoding encoding = Encoding.GetEncoding (layout.CodePage); + Encoding encoding = Encoding.GetEncoding (new CultureInfo (layout.Lcid).TextInfo.ANSICodePage); buffer = new string (encoding.GetChars (bytes)); res = -1; } @@ -413,16 +417,16 @@ public int EventToVkey (XEvent e) && ((e.KeyEvent.state & NumLockMask) !=0)) { // Only the Keypad keys 0-9 and . send different keysyms // depending on the NumLock state - return KeyboardLayouts.nonchar_key_vkey [keysym & 0xFF]; + return nonchar_key_vkey [keysym & 0xFF]; } return keyc2vkey [e.KeyEvent.keycode]; } - public void CreateConversionArray (KeyboardLayout layout) + public void CreateConversionArray (KeyboardLayouts layouts, KeyboardLayout layout) { XEvent e2 = new XEvent (); - int keysym = 0; + uint keysym = 0; int [] ckey = new int [] { 0, 0, 0, 0 }; e2.KeyEvent.display = display; @@ -438,11 +442,11 @@ public void CreateConversionArray (KeyboardLayout layout) IntPtr status; LookupString (ref e2, 0, out t, out status); - keysym = (int) t; + keysym = (uint) t; if (keysym != 0) { if ((keysym >> 8) == 0xFF) { - vkey = KeyboardLayouts.nonchar_key_vkey [keysym & 0xFF]; - scan = KeyboardLayouts.nonchar_key_scan [keysym & 0xFF]; + vkey = nonchar_key_vkey [keysym & 0xFF]; + scan = nonchar_key_scan [keysym & 0xFF]; // Set extended bit if ((scan & 0x100) != 0) vkey |= 0x100; @@ -453,21 +457,21 @@ public void CreateConversionArray (KeyboardLayout layout) // Search layout dependent scancodes int maxlen = 0; int maxval = -1;; - int ok; for (int i = 0; i < syms; i++) { - keysym = (int) XKeycodeToKeysym (display, keyc, i); + keysym = XKeycodeToKeysym (display, keyc, i); if ((keysym < 0x800) && (keysym != ' ')) - ckey [i] = keysym & 0xFF; + ckey [i] = (sbyte) (keysym & 0xFF); else - ckey [i] = MapDeadKeySym (keysym); + ckey [i] = (sbyte) MapDeadKeySym ((int) keysym); } - for (int keyn = 0; keyn < layout.Key.Length; keyn++) { - int i = 0; - int ml = (layout.Key [keyn].Length > 4 ? 4 : layout.Key [keyn].Length); - for (ok = layout.Key [keyn][i]; (ok != 0) && (i < ml); i++) { - if (layout.Key [keyn][i] != ckey [i]) + for (int keyn = 0; keyn < layout.Keys.Length; keyn++) { + int ml = Math.Min (layout.Keys [keyn].Length, 4); + int ok = -1; + for (int i = 0; (ok != 0) && (i < ml); i++) { + sbyte ck = (sbyte) layout.Keys [keyn][i]; + if (ck != ckey [i]) ok = 0; if ((ok != 0) || (i > maxlen)) { maxlen = i; @@ -478,76 +482,12 @@ public void CreateConversionArray (KeyboardLayout layout) } } if (maxval >= 0) { - scan = layout.Scan [maxval]; - vkey = (int) layout.VKey [maxval]; + /// XXX + scan = layouts.scan_table [(int) layout.ScanIndex][maxval]; + vkey = layouts.vkey_table [(int) layout.VKeyIndex][maxval]; } } - -#if NO - for (int i = 0; (i < keysyms_per_keycode) && (vkey == 0); i++) { - keysym = (int) XLookupKeysym (ref e2, i); - if ((keysym >= (int) VirtualKeys.VK_0 && keysym <= (int) VirtualKeys.VK_9) || - (keysym >= (int) VirtualKeys.VK_A && keysym <= (int) VirtualKeys.VK_Z)) { - vkey = keysym; - } - } - - for (int i = 0; (i < keysyms_per_keycode) && (vkey == 0); i++) { - keysym = (int) XLookupKeysym (ref e2, i); - switch ((char) keysym) { - case ';': - vkey = (int) VirtualKeys.VK_OEM_1; - break; - case '/': - vkey = (int) VirtualKeys.VK_OEM_2; - break; - case '`': - vkey = (int) VirtualKeys.VK_OEM_3; - break; - case '[': - vkey = (int) VirtualKeys.VK_OEM_4; - break; - case '\\': - vkey = (int) VirtualKeys.VK_OEM_5; - break; - case ']': - vkey = (int) VirtualKeys.VK_OEM_6; - break; - case '\'': - vkey = (int) VirtualKeys.VK_OEM_7; - break; - case ',': - vkey = (int) VirtualKeys.VK_OEM_COMMA; - break; - case '.': - vkey = (int) VirtualKeys.VK_OEM_PERIOD; - break; - case '-': - vkey = (int) VirtualKeys.VK_OEM_MINUS; - break; - case '+': - vkey = (int) VirtualKeys.VK_OEM_PLUS; - break; - - } - } - - if (vkey == 0) { - switch (++oem_vkey) { - case 0xc1: - oem_vkey = 0xDB; - break; - case 0xE5: - oem_vkey = 0xE9; - break; - case 0xF6: - oem_vkey = 0xF5; - break; - } - vkey = oem_vkey; - } -#endif } keyc2vkey [e2.KeyEvent.keycode] = vkey; keyc2scan [e2.KeyEvent.keycode] = scan; @@ -556,7 +496,7 @@ public void CreateConversionArray (KeyboardLayout layout) } - public void DetectLayout () + public void DetectLayout (KeyboardLayouts layouts) { XDisplayKeycodes (display, out min_keycode, out max_keycode); IntPtr ksp = XGetKeyboardMapping (display, (byte) min_keycode, @@ -594,52 +534,56 @@ public void DetectLayout () int max_score = 0; int max_seq = 0; - foreach (KeyboardLayout current in KeyboardLayouts.Layouts) { + foreach (KeyboardLayout current in layouts.Layouts) { int ok = 0; int score = 0; int match = 0; + int mismatch = 0; int seq = 0; int pkey = -1; int key = min_keycode; + int i; for (int keyc = min_keycode; keyc <= max_keycode; keyc++) { - for (int i = 0; i < syms; i++) { - int keysym = (int) XKeycodeToKeysym (display, keyc, i); + for (i = 0; i < syms; i++) { + uint keysym = XKeycodeToKeysym (display, keyc, i); - if ((keysym != 0xFF1B) && (keysym < 0x800) && (keysym != ' ')) { - ckey [i] = keysym & 0xFF; + if ((keysym < 0x800) && (keysym != ' ')) { + ckey [i] = (sbyte) (keysym & 0xFF); } else { - ckey [i] = MapDeadKeySym (keysym); + ckey [i] = (sbyte) MapDeadKeySym ((int) keysym); } } if (ckey [0] != 0) { - - for (key = 0; key < current.Key.Length; key++) { - ok = 0; - int ml = (current.Key [key].Length > syms ? syms : current.Key [key].Length); - for (int i = 0; (ok >= 0) && (i < ml); i++) { - if (ckey [i] != 0 && current.Key [key][i] == (char) ckey [i]) { + for (key = 0; key < current.Keys.Length; key++) { + int ml = Math.Min (syms, current.Keys [key].Length); + for (ok = 0, i = 0; (ok >= 0) && (i < ml); i++) { + sbyte ck = (sbyte) current.Keys [key][i]; + if (ck != 0 && ck == ckey[i]) ok++; - } - if (ckey [i] != 0 && current.Key [key][i] != (char) ckey [i]) + if (ck != 0 && ck != ckey[i]) ok = -1; } - if (ok >= 0) { + if (ok > 0) { score += ok; break; } } if (ok > 0) { match++; + /* and how much the keycode order matches */ if (key > pkey) seq++; pkey = key; } else { + /* print spaces instead of \0's */ + mismatch++; score -= syms; } } } + Console.WriteLine ("{0}: {1}", current.Name, score); if ((score > max_score) || ((score == max_score) && (seq > max_seq))) { // best match so far layout = current; @@ -650,9 +594,9 @@ public void DetectLayout () if (layout != null) { this.layout = layout; - Console.WriteLine (Locale.GetText("Keyboard") + ": " + layout.Comment); + Console.WriteLine (Locale.GetText("Keyboard") + ": " + layout.Name); } else { - Console.WriteLine (Locale.GetText("Keyboard layout not recognized, using default layout: " + this.layout.Comment)); + Console.WriteLine (Locale.GetText("Keyboard layout not recognized, using default layout: " + this.layout.Name)); } } @@ -780,10 +724,7 @@ private int LookupString (ref XEvent xevent, int len, out XKeySym keysym, out In private static extern void XDisplayKeycodes (IntPtr display, out int min, out int max); [DllImport ("libX11", EntryPoint="XKeycodeToKeysym")] - private static extern IntPtr XKeycodeToKeysymX11(IntPtr display, int keycode, int index); - private static XKeySym XKeycodeToKeysym(IntPtr display, int keycode, int index) { - return (XKeySym)XKeycodeToKeysymX11(display, keycode, index).ToInt32(); - } + private static extern uint XKeycodeToKeysym (IntPtr display, int keycode, int index); [DllImport ("libX11")] private static extern int XKeysymToKeycode (IntPtr display, IntPtr keysym); @@ -796,7 +737,102 @@ private int LookupString (ref XEvent xevent, int len, out XKeySym keysym, out In [DllImport ("libX11")] internal extern static int XFreeModifiermap (IntPtr modmap); - + + + public readonly static int [] nonchar_key_vkey = new int [] + { + /* unused */ + 0, 0, 0, 0, 0, 0, 0, 0, /* FF00 */ + /* special keys */ + (int) VirtualKeys.VK_BACK, (int) VirtualKeys.VK_TAB, 0, (int) VirtualKeys.VK_CLEAR, 0, (int) VirtualKeys.VK_RETURN, 0, 0, /* FF08 */ + 0, 0, 0, (int) VirtualKeys.VK_PAUSE, (int) VirtualKeys.VK_SCROLL, 0, 0, 0, /* FF10 */ + 0, 0, 0, (int) VirtualKeys.VK_ESCAPE, 0, 0, 0, 0, /* FF18 */ + /* unused */ + 0, 0, 0, 0, 0, 0, 0, 0, /* FF20 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* FF28 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* FF30 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* FF38 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* FF40 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* FF48 */ + /* cursor keys */ + (int) VirtualKeys.VK_HOME, (int) VirtualKeys.VK_LEFT, (int) VirtualKeys.VK_UP, (int) VirtualKeys.VK_RIGHT, /* FF50 */ + (int) VirtualKeys.VK_DOWN, (int) VirtualKeys.VK_PRIOR, (int) VirtualKeys.VK_NEXT, (int) VirtualKeys.VK_END, + 0, 0, 0, 0, 0, 0, 0, 0, /* FF58 */ + /* misc keys */ + (int) VirtualKeys.VK_SELECT, (int) VirtualKeys.VK_SNAPSHOT, (int) VirtualKeys.VK_EXECUTE, (int) VirtualKeys.VK_INSERT, 0, 0, 0, 0, /* FF60 */ + (int) VirtualKeys.VK_CANCEL, (int) VirtualKeys.VK_HELP, (int) VirtualKeys.VK_CANCEL, (int) VirtualKeys.VK_CANCEL, 0, 0, 0, 0, /* FF68 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* FF70 */ + /* keypad keys */ + 0, 0, 0, 0, 0, 0, 0, (int) VirtualKeys.VK_NUMLOCK, /* FF78 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* FF80 */ + 0, 0, 0, 0, 0, (int) VirtualKeys.VK_RETURN, 0, 0, /* FF88 */ + 0, 0, 0, 0, 0, (int) VirtualKeys.VK_HOME, (int) VirtualKeys.VK_LEFT, (int) VirtualKeys.VK_UP, /* FF90 */ + (int) VirtualKeys.VK_RIGHT, (int) VirtualKeys.VK_DOWN, (int) VirtualKeys.VK_PRIOR, (int) VirtualKeys.VK_NEXT, /* FF98 */ + (int) VirtualKeys.VK_END, 0, (int) VirtualKeys.VK_INSERT, (int) VirtualKeys.VK_DELETE, + 0, 0, 0, 0, 0, 0, 0, 0, /* FFA0 */ + 0, 0, (int) VirtualKeys.VK_MULTIPLY, (int) VirtualKeys.VK_ADD, /* FFA8 */ + (int) VirtualKeys.VK_SEPARATOR, (int) VirtualKeys.VK_SUBTRACT, (int) VirtualKeys.VK_DECIMAL, (int) VirtualKeys.VK_DIVIDE, + (int) VirtualKeys.VK_NUMPAD0, (int) VirtualKeys.VK_NUMPAD1, (int) VirtualKeys.VK_NUMPAD2, (int) VirtualKeys.VK_NUMPAD3, /* FFB0 */ + (int) VirtualKeys.VK_NUMPAD4, (int) VirtualKeys.VK_NUMPAD5, (int) VirtualKeys.VK_NUMPAD6, (int) VirtualKeys.VK_NUMPAD7, + (int) VirtualKeys.VK_NUMPAD8, (int) VirtualKeys.VK_NUMPAD9, 0, 0, 0, 0, /* FFB8 */ + /* function keys */ + (int) VirtualKeys.VK_F1, (int) VirtualKeys.VK_F2, + (int) VirtualKeys.VK_F3, (int) VirtualKeys.VK_F4, (int) VirtualKeys.VK_F5, (int) VirtualKeys.VK_F6, (int) VirtualKeys.VK_F7, (int) VirtualKeys.VK_F8, (int) VirtualKeys.VK_F9, (int) VirtualKeys.VK_F10, /* FFC0 */ + (int) VirtualKeys.VK_F11, (int) VirtualKeys.VK_F12, (int) VirtualKeys.VK_F13, (int) VirtualKeys.VK_F14, (int) VirtualKeys.VK_F15, (int) VirtualKeys.VK_F16, 0, 0, /* FFC8 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* FFD0 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* FFD8 */ + /* modifier keys */ + 0, (int) VirtualKeys.VK_SHIFT, (int) VirtualKeys.VK_SHIFT, (int) VirtualKeys.VK_CONTROL, /* FFE0 */ + (int) VirtualKeys.VK_CONTROL, (int) VirtualKeys.VK_CAPITAL, 0, (int) VirtualKeys.VK_MENU, + (int) VirtualKeys.VK_MENU, (int) VirtualKeys.VK_MENU, (int) VirtualKeys.VK_MENU, 0, 0, 0, 0, 0, /* FFE8 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* FFF0 */ + 0, 0, 0, 0, 0, 0, 0, (int) VirtualKeys.VK_DELETE /* FFF8 */ + }; + + public static readonly int [] nonchar_key_scan = new int [] + { + /* unused */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF00 */ + /* special keys */ + 0x0E, 0x0F, 0x00, /*?*/ 0, 0x00, 0x1C, 0x00, 0x00, /* FF08 */ + 0x00, 0x00, 0x00, 0x45, 0x46, 0x00, 0x00, 0x00, /* FF10 */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* FF18 */ + /* unused */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF20 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF28 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF30 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF38 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF40 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF48 */ + /* cursor keys */ + 0x147, 0x14B, 0x148, 0x14D, 0x150, 0x149, 0x151, 0x14F, /* FF50 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF58 */ + /* misc keys */ + /*?*/ 0, 0x137, /*?*/ 0, 0x152, 0x00, 0x00, 0x00, 0x00, /* FF60 */ + /*?*/ 0, /*?*/ 0, 0x38, 0x146, 0x00, 0x00, 0x00, 0x00, /* FF68 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF70 */ + /* keypad keys */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x138, 0x145, /* FF78 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF80 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x11C, 0x00, 0x00, /* FF88 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x4B, 0x48, /* FF90 */ + 0x4D, 0x50, 0x49, 0x51, 0x4F, 0x4C, 0x52, 0x53, /* FF98 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFA0 */ + 0x00, 0x00, 0x37, 0x4E, /*?*/ 0, 0x4A, 0x53, 0x135, /* FFA8 */ + 0x52, 0x4F, 0x50, 0x51, 0x4B, 0x4C, 0x4D, 0x47, /* FFB0 */ + 0x48, 0x49, 0x00, 0x00, 0x00, 0x00, /* FFB8 */ + /* function keys */ + 0x3B, 0x3C, + 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, /* FFC0 */ + 0x57, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFC8 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFD0 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFD8 */ + /* modifier keys */ + 0x00, 0x2A, 0x36, 0x1D, 0x11D, 0x3A, 0x00, 0x38, /* FFE0 */ + 0x138, 0x38, 0x138, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFE8 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFF0 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x153 /* FFF8 */ + }; } } From ba196dd31f8d5de2825d0c31c245aa350a2a7cf3 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 21 Mar 2006 22:20:45 +0000 Subject: [PATCH 018/117] Remove debug. svn path=/trunk/mcs/; revision=58264 --- .../Managed.Windows.Forms/System.Windows.Forms/X11Keyboard.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Keyboard.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Keyboard.cs index 93f84a0091ef8..f42d85061b630 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Keyboard.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Keyboard.cs @@ -583,7 +583,6 @@ public void DetectLayout (KeyboardLayouts layouts) } } - Console.WriteLine ("{0}: {1}", current.Name, score); if ((score > max_score) || ((score == max_score) && (seq > max_seq))) { // best match so far layout = current; From cd1e486cace10983cb348def4d46eb46a34bab0b Mon Sep 17 00:00:00 2001 From: Peter Dennis Bartok Date: Tue, 21 Mar 2006 22:38:21 +0000 Subject: [PATCH 019/117] 2006-03-21 Peter Dennis Bartok * XplatUI.cs, XplatUIDriver.cs, XplatUIX11.cs, XplatUIWin32.cs, XplatUIOSX.cs: - Added ResetMouseHover method to allow controls to retrigger hovering if they need it more than once - Implemented MouseHoverTime and MouseHoverSize properties * Timer.cs: Start() must reset the interval * SystemInformation.cs: Added 2.0 MouseHoverTime and MouseHoverSize properties svn path=/trunk/mcs/; revision=58265 --- .../System.Windows.Forms/ChangeLog | 11 +++ .../System.Windows.Forms/SystemInformation.cs | 14 ++++ .../System.Windows.Forms/Timer.cs | 2 + .../System.Windows.Forms/XplatUI.cs | 22 +++++- .../System.Windows.Forms/XplatUIDriver.cs | 13 ++++ .../System.Windows.Forms/XplatUIOSX.cs | 5 ++ .../System.Windows.Forms/XplatUIWin32.cs | 43 ++++++++++- .../System.Windows.Forms/XplatUIX11.cs | 76 ++++++++++++++----- 8 files changed, 165 insertions(+), 21 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index f125509207e99..3d2207a95d217 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,14 @@ +2006-03-21 Peter Dennis Bartok + + * XplatUI.cs, XplatUIDriver.cs, XplatUIX11.cs, XplatUIWin32.cs, + XplatUIOSX.cs: + - Added ResetMouseHover method to allow controls to retrigger + hovering if they need it more than once + - Implemented MouseHoverTime and MouseHoverSize properties + * Timer.cs: Start() must reset the interval + * SystemInformation.cs: Added 2.0 MouseHoverTime and MouseHoverSize + properties + 2006-03-21 Jackson Harper * X11Keyboard.cs: improved layout detection. Move the nonchar diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SystemInformation.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SystemInformation.cs index a5bef543a3877..d289d614bac89 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SystemInformation.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SystemInformation.cs @@ -265,6 +265,20 @@ public class SystemInformation { } } +#if NET_2_0 + public static Size MouseHoverSize { + get { + return XplatUI.MouseHoverSize; + } + } + + public static int MouseHoverTime { + get { + return XplatUI.MouseHoverTime; + } + } +#endif + public static bool MousePresent { get { return true; diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Timer.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Timer.cs index d0326df3e8394..8395e86df7290 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Timer.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Timer.cs @@ -59,6 +59,8 @@ public Timer (IContainer container) : this () if (value != enabled) { enabled = value; if (value) { + // Use AddTicks so we get some rounding + expires = DateTime.Now.AddMilliseconds (interval > Minimum ? interval : Minimum); XplatUI.SetTimer (this); } else { XplatUI.KillTimer (this); diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs index 3b80380971a90..2aa6e623a0761 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs @@ -77,9 +77,8 @@ public class State { #region Constructor & Destructor static XplatUI() { - Console.WriteLine("Mono System.Windows.Forms Assembly [Revision: 57713; built: 2006/03/09 03:26:24]"); + Console.WriteLine("Mono System.Windows.Forms Assembly [$auto_build_revision$]"); - // Don't forget to throw the mac in here somewhere, too default_class_name="SWFClass"; // check for Unix platforms - see FAQ for more details @@ -208,6 +207,18 @@ public class State { } } + static public Size MouseHoverSize { + get { + return driver.MouseHoverSize; + } + } + + static public int MouseHoverTime { + get { + return driver.MouseHoverTime; + } + } + static public bool MouseWheelPresent { get { return driver.MouseWheelPresent; @@ -601,6 +612,13 @@ internal static void KillTimer (Timer timer) driver.RequestNCRecalc(handle); } + internal static void ResetMouseHover(IntPtr handle) { + #if DriverDebug + Console.WriteLine("ResetMouseHover({0}): Called", Window(handle)); + #endif + driver.ResetMouseHover(handle); + } + internal static void ScreenToClient(IntPtr handle, ref int x, ref int y) { #if DriverDebug Console.WriteLine("ScreenToClient({0}, {1}, {2}): Called", Window(handle), x, y); diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs index 4722a7a27da25..4ae04fab6f90b 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs @@ -68,6 +68,18 @@ internal abstract class XplatUIDriver { } } + internal virtual Size MouseHoverSize { + get { + return new Size (1, 1); + } + } + + internal virtual int MouseHoverTime { + get { + return 500; + } + } + internal virtual Point MousePosition { get { return Point.Empty; @@ -234,6 +246,7 @@ internal virtual void SetAllowDrop (IntPtr handle, bool value) internal abstract void EndLoop(Thread thread); internal abstract void RequestNCRecalc(IntPtr hwnd); + internal abstract void ResetMouseHover(IntPtr hwnd); // System information internal abstract int KeyboardSpeed { get; } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIOSX.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIOSX.cs index 1b200f0c656e0..e638493cebccb 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIOSX.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIOSX.cs @@ -1391,6 +1391,11 @@ private void CheckTimers (DateTime now) throw new NotImplementedException(); } + [MonoTODO] + internal override void ResetMouseHover(IntPtr handle) { + throw new NotImplementedException(); + } + internal override void ScreenToClient(IntPtr handle, ref int x, ref int y) { CGPoint pt = new CGPoint (); Rect wBounds = new Rect (); diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs index c6127996e4a4b..f900f46ad6009 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs @@ -99,7 +99,10 @@ internal struct POINT { } internal enum SPIAction { - SPI_GETWORKAREA = 0x0030 + SPI_GETWORKAREA = 0x0030, + SPI_GETMOUSEHOVERWIDTH = 0x0062, + SPI_GETMOUSEHOVERHEIGHT = 0x0064, + SPI_GETMOUSEHOVERTIME = 0x0066, } internal enum WindowPlacementFlags { @@ -869,6 +872,27 @@ internal enum LayeredWindowAttributes : int { } } + internal override Size MouseHoverSize { + get { + int width = 4; + int height = 4; + + Win32SystemParametersInfo(SPIAction.SPI_GETMOUSEHOVERWIDTH, 0, ref width, 0); + Win32SystemParametersInfo(SPIAction.SPI_GETMOUSEHOVERWIDTH, 0, ref height, 0); + return new Size(width, height); + } + } + + internal override int MouseHoverTime { + get { + int time = 500; + + Win32SystemParametersInfo(SPIAction.SPI_GETMOUSEHOVERTIME, 0, ref time, 0); + return time; + } + } + + internal override bool DropTarget { get { return false; @@ -1322,6 +1346,17 @@ internal enum LayeredWindowAttributes : int { Win32SetWindowPos(handle, IntPtr.Zero, 0, 0, 0, 0, SetWindowPosFlags.SWP_FRAMECHANGED | SetWindowPosFlags.SWP_NOOWNERZORDER | SetWindowPosFlags.SWP_NOSIZE | SetWindowPosFlags.SWP_NOMOVE); } + internal override void ResetMouseHover(IntPtr handle) { + TRACKMOUSEEVENT tme; + + tme = new TRACKMOUSEEVENT(); + tme.size = Marshal.SizeOf(tme); + tme.hWnd = handle; + tme.dwFlags = TMEFlags.TME_LEAVE | TMEFlags.TME_HOVER; + Win32TrackMouseEvent(ref tme); + } + + internal override bool GetMessage(ref MSG msg, IntPtr hWnd, int wFilterMin, int wFilterMax) { return GetMessage(ref msg, hWnd, wFilterMin, wFilterMax, true); } @@ -2485,6 +2520,12 @@ private void SetMdiStyles (CreateParams cp) [DllImport ("user32.dll", EntryPoint="SystemParametersInfoW", CharSet=CharSet.Unicode, CallingConvention=CallingConvention.StdCall)] private extern static bool Win32SystemParametersInfo(SPIAction uiAction, uint uiParam, ref RECT rect, uint fWinIni); + [DllImport ("user32.dll", EntryPoint="SystemParametersInfoW", CharSet=CharSet.Unicode, CallingConvention=CallingConvention.StdCall)] + private extern static bool Win32SystemParametersInfo(SPIAction uiAction, uint uiParam, ref uint value, uint fWinIni); + + [DllImport ("user32.dll", EntryPoint="SystemParametersInfoW", CharSet=CharSet.Unicode, CallingConvention=CallingConvention.StdCall)] + private extern static bool Win32SystemParametersInfo(SPIAction uiAction, uint uiParam, ref int value, uint fWinIni); + [DllImport ("user32.dll", EntryPoint="OpenClipboard", CallingConvention=CallingConvention.StdCall)] private extern static bool Win32OpenClipboard(IntPtr hwnd); diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs index 1b27d892bd869..8804dffff6bc4 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs @@ -394,7 +394,8 @@ internal class XException : ApplicationException { HoverState.Timer = new Timer(); HoverState.Timer.Enabled = false; HoverState.Timer.Interval = HoverState.Interval; - HoverState.Timer.Tick +=new EventHandler(MouseHover); + HoverState.Timer.Tick += new EventHandler(MouseHover); + HoverState.Size = new Size(4, 4); HoverState.X = -1; HoverState.Y = -1; @@ -1421,25 +1422,22 @@ internal class XException : ApplicationException { #region Callbacks private void MouseHover(object sender, EventArgs e) { - if ((HoverState.X == MousePosition.X) && (HoverState.Y == MousePosition.Y)) { - XEvent xevent; + XEvent xevent; + HoverState.Timer.Enabled = false; - HoverState.Timer.Enabled = false; - - if (HoverState.Window != IntPtr.Zero) { - xevent = new XEvent (); + if (HoverState.Window != IntPtr.Zero) { + xevent = new XEvent (); - xevent.type = XEventName.ClientMessage; - xevent.ClientMessageEvent.display = DisplayHandle; - xevent.ClientMessageEvent.window = HoverState.Window; - xevent.ClientMessageEvent.message_type = HoverState.Atom; - xevent.ClientMessageEvent.format = 32; - xevent.ClientMessageEvent.ptr1 = (IntPtr) (HoverState.Y << 16 | HoverState.X); + xevent.type = XEventName.ClientMessage; + xevent.ClientMessageEvent.display = DisplayHandle; + xevent.ClientMessageEvent.window = HoverState.Window; + xevent.ClientMessageEvent.message_type = HoverState.Atom; + xevent.ClientMessageEvent.format = 32; + xevent.ClientMessageEvent.ptr1 = (IntPtr) (HoverState.Y << 16 | HoverState.X); - MessageQueue.EnqueueLocked (xevent); + MessageQueue.EnqueueLocked (xevent); - WakeupMain (); - } + WakeupMain (); } } @@ -1683,6 +1681,20 @@ internal class XException : ApplicationException { } } + internal override Size MouseHoverSize { + get { + return new Size (1, 1); + } + } + + internal override int MouseHoverTime { + get { + return HoverState.Interval; + } + } + + + internal override bool MouseWheelPresent { get { return true; // FIXME - how to detect? @@ -2907,8 +2919,19 @@ internal class XException : ApplicationException { msg.lParam = (IntPtr)(MousePosition.Y << 16 | MousePosition.X); } - HoverState.X = MousePosition.X = xevent.MotionEvent.x; - HoverState.Y = MousePosition.Y = xevent.MotionEvent.y; + MousePosition.X = xevent.MotionEvent.x; + MousePosition.Y = xevent.MotionEvent.y; + + if ((HoverState.Timer.Enabled) && + (((MousePosition.X + HoverState.Size.Width) < HoverState.X) || + ((MousePosition.X - HoverState.Size.Width) > HoverState.X) || + ((MousePosition.Y + HoverState.Size.Height) < HoverState.Y) || + ((MousePosition.Y - HoverState.Size.Height) > HoverState.Y))) { + HoverState.Timer.Stop(); + HoverState.Timer.Start(); + HoverState.X = MousePosition.X; + HoverState.Y = MousePosition.Y; + } break; } else { @@ -2953,6 +2976,8 @@ internal class XException : ApplicationException { goto ProcessNextMessage; } msg.message = Msg.WM_MOUSE_ENTER; + HoverState.X = xevent.CrossingEvent.x; + HoverState.Y = xevent.CrossingEvent.y; HoverState.Timer.Enabled = true; HoverState.Window = xevent.CrossingEvent.window; break; @@ -3556,6 +3581,21 @@ internal class XException : ApplicationException { InvalidateWholeWindow(handle); } + internal override void ResetMouseHover(IntPtr handle) { + Hwnd hwnd; + + hwnd = Hwnd.ObjectFromHandle(handle); + if (hwnd == null) { + return; + } + + HoverState.Timer.Enabled = true; + HoverState.X = MousePosition.X; + HoverState.Y = MousePosition.Y; + HoverState.Window = handle; + } + + internal override void ScreenToClient(IntPtr handle, ref int x, ref int y) { int dest_x_return; int dest_y_return; From 7a4048598ad26e3d8f76d1f74ad6b77fc3fbbabf Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Tue, 21 Mar 2006 22:40:25 +0000 Subject: [PATCH 020/117] manually synchronized with 56802 svn path=/trunk/mcs/; revision=58266 --- mcs/gmcs/class.cs | 57 +++++++------------------------------ mcs/gmcs/codegen.cs | 5 ---- mcs/gmcs/decl.cs | 8 ------ mcs/gmcs/namespace.cs | 4 +-- mcs/gmcs/parameter.cs | 4 ++- mcs/gmcs/typemanager.cs | 4 +++ mcs/tests/known-issues-gmcs | 1 - 7 files changed, 20 insertions(+), 63 deletions(-) diff --git a/mcs/gmcs/class.cs b/mcs/gmcs/class.cs index 2d7143e212836..09a3eb1c71fed 100644 --- a/mcs/gmcs/class.cs +++ b/mcs/gmcs/class.cs @@ -3404,10 +3404,6 @@ public Parameters ParameterInfo } } - public override EmitContext EmitContext { - get { return ds.EmitContext; } - } - public ToplevelBlock Block { get { return block; @@ -3692,21 +3688,12 @@ protected void Error_CannotChangeAccessModifiers (MemberInfo base_method, Method protected bool DoDefineParameters () { - EmitContext ec = ds.EmitContext; - if (ec == null) - throw new InternalErrorException ("DoDefineParameters invoked too early"); - - bool old_unsafe = ec.InUnsafe; - ec.InUnsafe = IsInUnsafeScope; - ec.ResolvingGenericMethod = GenericMethod != null; + IResolveContext rc = GenericMethod == null ? this : (IResolveContext)ds; // Check if arguments were correct - if (!Parameters.Resolve (ec)) + if (!Parameters.Resolve (rc)) return false; - ec.ResolvingGenericMethod = false; - ec.InUnsafe = old_unsafe; - return CheckParameters (ParameterTypes); } @@ -5320,13 +5307,8 @@ abstract public class MemberBase : MemberCore { public Type MemberType { get { if (member_type == null && Type != null) { - EmitContext ec = ds.EmitContext; - bool old_unsafe = ec.InUnsafe; - ec.InUnsafe = IsInUnsafeScope; - ec.ResolvingGenericMethod = GenericMethod != null; - Type = Type.ResolveAsTypeTerminal (ec, false); - ec.ResolvingGenericMethod = false; - ec.InUnsafe = old_unsafe; + IResolveContext rc = GenericMethod == null ? this : (IResolveContext)ds; + Type = Type.ResolveAsTypeTerminal (rc, false); if (Type != null) { member_type = Type.Type; } @@ -5386,10 +5368,6 @@ protected virtual bool CheckBase () protected virtual bool DoDefineBase () { - EmitContext ec = Parent.EmitContext; - if (ec == null) - throw new InternalErrorException ("MemberBase.DoDefine called too early"); - if (Name == null) throw new InternalErrorException (); @@ -5412,11 +5390,11 @@ protected virtual bool DoDefineBase () if (IsExplicitImpl) { Expression expr = MemberName.Left.GetTypeExpression (); - TypeExpr iface_texpr = expr.ResolveAsTypeTerminal (ec, false); + TypeExpr iface_texpr = expr.ResolveAsTypeTerminal (this, false); if (iface_texpr == null) return false; - InterfaceType = iface_texpr.ResolveType (ec); + InterfaceType = iface_texpr.ResolveType (this); if (!InterfaceType.IsInterface) { Report.Error (538, Location, "'{0}' in explicit interface declaration is not an interface", TypeManager.CSharpName (InterfaceType)); @@ -5434,10 +5412,6 @@ protected virtual bool DoDefineBase () protected virtual bool DoDefine () { - EmitContext ec = ds.EmitContext; - if (ec == null) - throw new InternalErrorException ("MemberBase.DoDefine called too early"); - if (MemberType == null) return false; @@ -5485,11 +5459,11 @@ protected virtual bool DoDefine () if (IsExplicitImpl) { Expression expr = MemberName.Left.GetTypeExpression (); - TypeExpr texpr = expr.ResolveAsTypeTerminal (ec, false); + TypeExpr texpr = expr.ResolveAsTypeTerminal (this, false); if (texpr == null) return false; - InterfaceType = texpr.ResolveType (ec); + InterfaceType = texpr.ResolveType (this); if (!InterfaceType.IsInterface) { Report.Error (538, Location, "`{0}' in explicit interface declaration is not an interface", TypeManager.CSharpName (InterfaceType)); @@ -5583,7 +5557,7 @@ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder public void EmitInitializer (EmitContext ec) { // Replace DeclSpace because of partial classes - ec.DeclContainer = EmitContext.DeclContainer; + ec.DeclContainer = DeclContainer; ec.IsFieldInitializer = true; initializer = initializer.Resolve (ec); @@ -5724,10 +5698,6 @@ public override void ApplyAttributeBuilder(Attribute a, CustomAttributeBuilder c public override bool Define() { - EmitContext ec = Parent.EmitContext; - if (ec == null) - throw new InternalErrorException ("FieldMember.Define called too early"); - if (MemberType == null || Type == null) return false; @@ -5862,7 +5832,8 @@ public override bool Define() return false; } - Constant c = size_expr.ResolveAsConstant (Parent.EmitContext, this); + EmitContext ec = new EmitContext (this, Parent, Location, null, null, ModFlags); + Constant c = size_expr.ResolveAsConstant (ec, this); if (c == null) return false; @@ -6380,9 +6351,6 @@ protected virtual void DefineParameters () public override MethodBuilder Define (TypeContainer container) { - if (container.EmitContext == null) - throw new InternalErrorException ("SetMethod.Define called too early"); - DefineParameters (); if (IsDummy) return null; @@ -7299,9 +7267,6 @@ public override bool Define () return false; } - EmitContext ec = Parent.EmitContext; - if (ec == null) - throw new InternalErrorException ("Event.Define called too early?"); Parameter [] parms = new Parameter [1]; parms [0] = new Parameter (MemberType, "value", Parameter.Modifier.NONE, null, Location); parameters = new Parameters (parms); diff --git a/mcs/gmcs/codegen.cs b/mcs/gmcs/codegen.cs index 080cf415d6b65..58d1e1679cf40 100644 --- a/mcs/gmcs/codegen.cs +++ b/mcs/gmcs/codegen.cs @@ -249,11 +249,6 @@ public class EmitContext : IResolveContext { /// public bool IsFieldInitializer; - /// - /// We are resolving a generic method's return type and parameters. - /// - public bool ResolvingGenericMethod; - /// /// The value that is allowed to be returned or NULL if there is no /// return type. diff --git a/mcs/gmcs/decl.cs b/mcs/gmcs/decl.cs index 9e4eba125f86a..5dc819eb95289 100644 --- a/mcs/gmcs/decl.cs +++ b/mcs/gmcs/decl.cs @@ -406,10 +406,6 @@ public virtual void Emit () VerifyClsCompliance (Parent); } - public virtual EmitContext EmitContext { - get { return Parent.EmitContext; } - } - public virtual bool IsUsed { get { return (caching_flags & Flags.IsUsed) != 0; } } @@ -681,10 +677,6 @@ public abstract class DeclSpace : MemberCore { // The emit context for toplevel objects. protected EmitContext ec; - public override EmitContext EmitContext { - get { return ec; } - } - // // Whether we are Generic // diff --git a/mcs/gmcs/namespace.cs b/mcs/gmcs/namespace.cs index 2e5c1a786241b..c547f64d598a3 100644 --- a/mcs/gmcs/namespace.cs +++ b/mcs/gmcs/namespace.cs @@ -460,7 +460,7 @@ public Namespace Resolve () DeclSpace root = RootContext.Tree.Types; root.NamespaceEntry = NamespaceEntry; - FullNamedExpression fne = Expr.ResolveAsTypeStep (root.EmitContext, false); + FullNamedExpression fne = Expr.ResolveAsTypeStep (root, false); root.NamespaceEntry = null; if (fne == null) { @@ -519,7 +519,7 @@ protected override FullNamedExpression DoResolve () { DeclSpace root = RootContext.Tree.Types; root.NamespaceEntry = NamespaceEntry; - resolved = Alias.ResolveAsTypeStep (root.EmitContext, false); + resolved = Alias.ResolveAsTypeStep (root, false); root.NamespaceEntry = null; if (resolved == null) diff --git a/mcs/gmcs/parameter.cs b/mcs/gmcs/parameter.cs index 745ca792bc420..0305681b5b14d 100644 --- a/mcs/gmcs/parameter.cs +++ b/mcs/gmcs/parameter.cs @@ -407,11 +407,13 @@ public void IsClsCompliant () public virtual void ApplyAttributes (MethodBuilder mb, ConstructorBuilder cb, int index) { + // TODO: It should use mb.DefineGenericParameters +#if !MS_COMPATIBLE if (mb == null) builder = cb.DefineParameter (index, Attributes, Name); else builder = mb.DefineParameter (index, Attributes, Name); - +#endif if (OptAttributes != null) OptAttributes.Emit (); } diff --git a/mcs/gmcs/typemanager.cs b/mcs/gmcs/typemanager.cs index 58f1c722cadbe..8cd99af71b63f 100644 --- a/mcs/gmcs/typemanager.cs +++ b/mcs/gmcs/typemanager.cs @@ -1480,6 +1480,10 @@ public static bool IsEnumType (Type t) if (builder_to_declspace [t] is Enum) return true; +#if MS_COMPATIBLE + if (t.IsGenericParameter) + return false; +#endif return t.IsEnum; } diff --git a/mcs/tests/known-issues-gmcs b/mcs/tests/known-issues-gmcs index 1dc3b635b3b49..871fa26550fa4 100644 --- a/mcs/tests/known-issues-gmcs +++ b/mcs/tests/known-issues-gmcs @@ -16,7 +16,6 @@ test-partial-11.cs test-partial-12.cs test-492.cs test-494.cs -test-473.cs test-495.cs test-anon-11.cs test-anon-36.cs From a91b0dc4ef72aa4fe10852e09e2489b412ee5a2f Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Wed, 22 Mar 2006 00:00:06 +0000 Subject: [PATCH 021/117] 2006-03-21 Sebastien Pouliot * PrintingServicesUnix.cs: cupsGetPrinters(char***) requires to free each individual string and (finally) the list. Note that this call is deprecated. svn path=/trunk/mcs/; revision=58270 --- mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog | 6 ++++++ .../System.Drawing.Printing/PrintingServicesUnix.cs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog b/mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog index 6ef03b58b4551..a79131080442f 100644 --- a/mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog +++ b/mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog @@ -1,3 +1,9 @@ +2006-03-21 Sebastien Pouliot + + * PrintingServicesUnix.cs: cupsGetPrinters(char***) requires to free + each individual string and (finally) the list. Note that this call is + deprecated. + 2006-03-13 Peter Dennis Bartok * PrintingServicesUnix.cs: Handle not having a printer diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs index e2164ca3bbfb7..b404ec48e9e42 100644 --- a/mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs +++ b/mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs @@ -164,12 +164,14 @@ internal override IntPtr CreateGraphicsContext (PrinterSettings settings) string str; PrinterSettings.StringCollection col = new PrinterSettings.StringCollection (new string[] {}); + /* FIXME: call is deprecated */ n_printers = cupsGetPrinters (ref printers); ptr_printers = printers; for (int i = 0; i < n_printers; i++) { ptr_printer = (IntPtr) Marshal.ReadInt32 (ptr_printers); str = Marshal.PtrToStringAnsi (ptr_printer); + Marshal.FreeHGlobal (ptr_printer); ptr_printers = new IntPtr (ptr_printers.ToInt64 () + 4); col.Add (str); } From 5fa1151e992d5665b59ef6741d6211820d40b635 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 22 Mar 2006 00:22:36 +0000 Subject: [PATCH 022/117] * DataGrid.cs: Create columns when the binding context has been changed. svn path=/trunk/mcs/; revision=58271 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 5 +++++ .../Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs | 3 +++ 2 files changed, 8 insertions(+) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 3d2207a95d217..e67241e68c8a4 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2006-03-21 Jackson Harper + + * DataGrid.cs: Create columns when the binding context has been + changed. + 2006-03-21 Peter Dennis Bartok * XplatUI.cs, XplatUIDriver.cs, XplatUIX11.cs, XplatUIWin32.cs, diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs index 208c8749474ec..019f6ee91ce96 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs @@ -1194,6 +1194,9 @@ protected virtual void OnBackgroundColorChanged (EventArgs e) protected override void OnBindingContextChanged( EventArgs e) { base.OnBindingContextChanged (e); + + current_style.CreateColumnsForTable (false); + CalcAreasAndInvalidate (); } protected virtual void OnBorderStyleChanged (EventArgs e) From c63bfc84019eb62cebe9bb9d136fd4503aedefad Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Wed, 22 Mar 2006 01:13:56 +0000 Subject: [PATCH 023/117] 2006-03-22 Martin Baulig * generic.cs (Nullable.NullableLiteral): Derive from `NullLiteral'. * convert.cs (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral' instead of the normal `NullLiteral'. svn path=/trunk/mcs/; revision=58273 --- mcs/gmcs/ChangeLog | 9 +++++++++ mcs/gmcs/convert.cs | 6 +++--- mcs/gmcs/generic.cs | 4 ++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/mcs/gmcs/ChangeLog b/mcs/gmcs/ChangeLog index b3380cbc7a60a..2f84a974ccde8 100644 --- a/mcs/gmcs/ChangeLog +++ b/mcs/gmcs/ChangeLog @@ -1,3 +1,12 @@ +2006-03-22 Martin Baulig + + * generic.cs + (Nullable.NullableLiteral): Derive from `NullLiteral'. + + * convert.cs + (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral' + instead of the normal `NullLiteral'. + 2006-03-21 Martin Baulig Fix #77583. diff --git a/mcs/gmcs/convert.cs b/mcs/gmcs/convert.cs index 4f5bb5b1d7d17..ebd7862465dad 100644 --- a/mcs/gmcs/convert.cs +++ b/mcs/gmcs/convert.cs @@ -29,8 +29,7 @@ public class Convert { // public static EmitContext ConstantEC = null; - static Expression TypeParameter_to_Null (Constant expr, Type target_type, - Location loc) + static Expression TypeParameter_to_Null (Type target_type, Location loc) { if (!TypeParameter_to_Null (target_type)) { Report.Error (403, loc, "Cannot convert null to the type " + @@ -40,6 +39,7 @@ public class Convert { return null; } + Constant expr = new Nullable.NullableLiteral (target_type, loc); return new NullCast (expr, target_type); } @@ -1206,7 +1206,7 @@ static MethodInfo GetConversionOperator (EmitContext ec, Expression source, Type if (expr is NullLiteral) { if (target_type.IsGenericParameter) - return TypeParameter_to_Null ((Constant) expr, target_type, loc); + return TypeParameter_to_Null (target_type, loc); if (TypeManager.IsNullableType (target_type)) return new Nullable.NullableLiteral (target_type, loc); diff --git a/mcs/gmcs/generic.cs b/mcs/gmcs/generic.cs index 608f6aae71820..9b53ff9c90d51 100644 --- a/mcs/gmcs/generic.cs +++ b/mcs/gmcs/generic.cs @@ -2824,11 +2824,11 @@ public override void Emit (EmitContext ec) } } - public class NullableLiteral : Expression, IMemoryLocation { + public class NullableLiteral : NullLiteral, IMemoryLocation { public NullableLiteral (Type target_type, Location loc) + : base (loc) { this.type = target_type; - this.loc = loc; eclass = ExprClass.Value; } From 3276bc3d5d9a9d380f03789ee9fb4ae5f5c59d5f Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Wed, 22 Mar 2006 01:15:34 +0000 Subject: [PATCH 024/117] 2006-03-21 Miguel de Icaza * AuthenticatedStream.cs: Implement Dispose method, remove Close method, the Close to fix the API. * NegotiateStream.cs: Implement Dispose method as well, kill Close, rename the various methods to the new ones. svn path=/trunk/mcs/; revision=58274 --- .../AuthenticatedStream.cs | 18 ++++++-- .../System/System.Net.Security/ChangeLog | 8 ++++ .../System.Net.Security/NegotiateStream.cs | 46 ++++++++++--------- 3 files changed, 45 insertions(+), 27 deletions(-) diff --git a/mcs/class/System/System.Net.Security/AuthenticatedStream.cs b/mcs/class/System/System.Net.Security/AuthenticatedStream.cs index 7a90c6102f995..9f113e4f9661c 100644 --- a/mcs/class/System/System.Net.Security/AuthenticatedStream.cs +++ b/mcs/class/System/System.Net.Security/AuthenticatedStream.cs @@ -46,7 +46,7 @@ public abstract class AuthenticatedStream : Stream #region Constructors - public AuthenticatedStream (Stream innerStream, bool leaveInnerStreamOpen) + protected AuthenticatedStream (Stream innerStream, bool leaveInnerStreamOpen) { this.innerStream = innerStream; this.leaveStreamOpen = leaveInnerStreamOpen; @@ -66,15 +66,23 @@ public AuthenticatedStream (Stream innerStream, bool leaveInnerStreamOpen) public abstract bool IsServer { get; } public abstract bool IsSigned { get; } + public bool LeaveInnerStreamOpen { + get { + return leaveStreamOpen; + } + } + #endregion // Properties #region Methods - public override void Close () + protected override void Dispose (bool disposing) { - if (leaveStreamOpen) - return; - innerStream.Close (); + if (disposing && innerStream != null){ + if (!leaveStreamOpen) + innerStream.Close (); + innerStream = null; + } } #endregion // Methods diff --git a/mcs/class/System/System.Net.Security/ChangeLog b/mcs/class/System/System.Net.Security/ChangeLog index dae8d08eb6d9b..a41a4c705d182 100644 --- a/mcs/class/System/System.Net.Security/ChangeLog +++ b/mcs/class/System/System.Net.Security/ChangeLog @@ -1,3 +1,11 @@ +2006-03-21 Miguel de Icaza + + * AuthenticatedStream.cs: Implement Dispose method, remove Close + method, the Close to fix the API. + + * NegotiateStream.cs: Implement Dispose method as well, kill + Close, rename the various methods to the new ones. + 2006-03-11 Miguel de Icaza * AuthenticatedStream.cs: Fixed normative parameter names (yes, we diff --git a/mcs/class/System/System.Net.Security/NegotiateStream.cs b/mcs/class/System/System.Net.Security/NegotiateStream.cs index 5aeda04993f72..f32d885b2cbf5 100644 --- a/mcs/class/System/System.Net.Security/NegotiateStream.cs +++ b/mcs/class/System/System.Net.Security/NegotiateStream.cs @@ -141,19 +141,19 @@ public NegotiateStream (Stream innerStream, bool leaveStreamOpen) #region Methods [MonoTODO] - public virtual IAsyncResult BeginClientAuthenticate (AsyncCallback callback, object asyncState) + public virtual IAsyncResult BeginAuthenticateAsClient (AsyncCallback callback, object asyncState) { throw new NotImplementedException (); } [MonoTODO] - public virtual IAsyncResult BeginClientAuthenticate (NetworkCredential credential, string targetName, AsyncCallback asyncCallback, object asyncState) + public virtual IAsyncResult BeginAuthenticateAsClient (NetworkCredential credential, string targetName, AsyncCallback asyncCallback, object asyncState) { throw new NotImplementedException (); } [MonoTODO] - public virtual IAsyncResult BeginClientAuthenticate (NetworkCredential credential, string targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback asyncCallback, object asyncState) + public virtual IAsyncResult BeginAuthenticateAsClient (NetworkCredential credential, string targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback asyncCallback, object asyncState) { throw new NotImplementedException (); } @@ -165,13 +165,13 @@ public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, As } [MonoTODO] - public virtual IAsyncResult BeginServerAuthenticate (AsyncCallback callback, object asyncState) + public virtual IAsyncResult BeginAuthenticateAsServer (AsyncCallback callback, object asyncState) { throw new NotImplementedException (); } [MonoTODO] - public virtual IAsyncResult BeginServerAuthenticate (NetworkCredential credential, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel, AsyncCallback asyncCallback, object asyncState) + public virtual IAsyncResult BeginAuthenticateAsServer (NetworkCredential credential, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel, AsyncCallback asyncCallback, object asyncState) { throw new NotImplementedException (); } @@ -183,27 +183,41 @@ public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, A } [MonoTODO] - public virtual void ClientAuthenticate () + public virtual void AuthenticateAsClient () { throw new NotImplementedException (); } [MonoTODO] - public virtual void ClientAuthenticate (NetworkCredential credential, string targetName) + public virtual void AuthenticateAsClient (NetworkCredential credential, string targetName) { throw new NotImplementedException (); } [MonoTODO] - public virtual void ClientAuthenticate (NetworkCredential credential, string targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel) + public virtual void AuthenticateAsClient (NetworkCredential credential, string targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel) { throw new NotImplementedException (); } [MonoTODO] - public override void Close () + public virtual void AuthenticateAsServer () { - InnerStream.Close (); + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual void AuthenticateAsServer (NetworkCredential credential, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel) + { + throw new NotImplementedException (); + } + + [MonoTODO] + protected override void Dispose (bool disposing) + { + if (disposing){ + // TODO + } } [MonoTODO] @@ -248,18 +262,6 @@ public override long Seek (long offset, SeekOrigin origin) throw new NotImplementedException (); } - [MonoTODO] - public virtual void ServerAuthenticate () - { - throw new NotImplementedException (); - } - - [MonoTODO] - public virtual void ServerAuthenticate (NetworkCredential credential, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel) - { - throw new NotImplementedException (); - } - [MonoTODO] public override void SetLength (long value) { From dd113bd188937f87db2c15841f70302b9899b855 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Wed, 22 Mar 2006 01:17:14 +0000 Subject: [PATCH 025/117] 2006-03-21 Miguel de Icaza * Stream.cs: In 2.0 make Close call Dispose(true). svn path=/trunk/mcs/; revision=58275 --- mcs/class/corlib/System.IO/ChangeLog | 4 ++++ mcs/class/corlib/System.IO/Stream.cs | 32 +++++++++++++++++++--------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/mcs/class/corlib/System.IO/ChangeLog b/mcs/class/corlib/System.IO/ChangeLog index 12f5a624006c1..5c4a86bc98219 100644 --- a/mcs/class/corlib/System.IO/ChangeLog +++ b/mcs/class/corlib/System.IO/ChangeLog @@ -1,3 +1,7 @@ +2006-03-21 Miguel de Icaza + + * Stream.cs: In 2.0 make Close call Dispose(true). + 2006-03-21 Gonzalo Paniagua Javier * FileStream.cs: Seek() should flush the buffer, if any. Fixes bug diff --git a/mcs/class/corlib/System.IO/Stream.cs b/mcs/class/corlib/System.IO/Stream.cs index 6053f36060115..6c1fa4c01800f 100644 --- a/mcs/class/corlib/System.IO/Stream.cs +++ b/mcs/class/corlib/System.IO/Stream.cs @@ -83,24 +83,25 @@ protected Stream () } - public virtual void Close () - { - } - - void IDisposable.Dispose () +#if NET_2_0 + // 2.0 version of Dispose. + public void Dispose () { Close (); } -#if NET_2_0 - public void Dispose () + // 2.0 version of Dispose. + protected virtual void Dispose (bool disposing) { - Dispose (true); + // nothing. } - protected virtual void Dispose (bool disposing) + // + // 2.0 version of Close (): calls Dispose (true) + // + public virtual void Close () { - Close (); + Dispose (true); } public virtual int ReadTimeout { @@ -120,7 +121,18 @@ protected virtual void Dispose (bool disposing) throw new InvalidOperationException ("Timeouts are not supported on this stream."); } } +#else + // 1.1 version of Close + public virtual void Close () + { + // nothing + } + #endif + void IDisposable.Dispose () + { + Close (); + } protected virtual WaitHandle CreateWaitHandle() { From 0dfb62fbf5b608cd483e3c4fdd28bdf61259d46c Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 22 Mar 2006 02:17:41 +0000 Subject: [PATCH 026/117] * X11Structs.cs: Keysyms are uints. - Add size to fix build. svn path=/trunk/mcs/; revision=58276 --- mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 2 ++ .../Managed.Windows.Forms/System.Windows.Forms/X11Structs.cs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index e67241e68c8a4..9c66ba42b6b8a 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -2,6 +2,8 @@ * DataGrid.cs: Create columns when the binding context has been changed. + * X11Structs.cs: Keysyms are uints. + - Add size to fix build. 2006-03-21 Peter Dennis Bartok diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Structs.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Structs.cs index 7169424f8e08f..0f7b30325b3d6 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Structs.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Structs.cs @@ -701,7 +701,7 @@ internal enum Gravity { StaticGravity = 10 } - internal enum XKeySym { + internal enum XKeySym : uint { XK_BackSpace = 0xFF08, XK_Tab = 0xFF09, XK_Clear = 0xFF0B, @@ -1435,6 +1435,7 @@ internal struct HoverStruct { internal int Y; // Last MouseMove Y coordinate; used to generate WM_MOUSEHOVER internal int Interval; // in milliseconds, how long to hold before hover is generated internal IntPtr Atom; // X Atom + internal Size Size; } internal struct ClickStruct { From 6cbdefd3cd00d569226c3c2da320fda7da984e75 Mon Sep 17 00:00:00 2001 From: Peter Dennis Bartok Date: Wed, 22 Mar 2006 03:24:46 +0000 Subject: [PATCH 027/117] - Added explanation svn path=/trunk/mcs/; revision=58277 --- .../Managed.Windows.Forms/System.Windows.Forms/X11Structs.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Structs.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Structs.cs index 0f7b30325b3d6..75cfb8f85b36d 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Structs.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Structs.cs @@ -1433,9 +1433,9 @@ internal struct HoverStruct { internal IntPtr Window; // Last window we entered; used to generate WM_MOUSEHOVER (handle is X11 handle) internal int X; // Last MouseMove X coordinate; used to generate WM_MOUSEHOVER internal int Y; // Last MouseMove Y coordinate; used to generate WM_MOUSEHOVER + internal Size Size; // Size of the rectangle the mouse has to stay in to generate hover internal int Interval; // in milliseconds, how long to hold before hover is generated internal IntPtr Atom; // X Atom - internal Size Size; } internal struct ClickStruct { From 6b353c76860b80feed42a53b08d1cb0c3aee2687 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 22 Mar 2006 03:40:32 +0000 Subject: [PATCH 028/117] * TabControl.cs: Remove the call to ProcessKeyEventArgs and let control handle this. svn path=/trunk/mcs/; revision=58278 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 5 +++++ .../Managed.Windows.Forms/System.Windows.Forms/TabControl.cs | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 9c66ba42b6b8a..7b03019ccc085 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2006-03-21 Jackson Harper + + * TabControl.cs: Remove the call to ProcessKeyEventArgs and let + control handle this. + 2006-03-21 Jackson Harper * DataGrid.cs: Create columns when the binding context has been diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs index 97164ee65e5bd..de6c042cc490e 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs @@ -460,8 +460,6 @@ protected override void OnStyleChanged (EventArgs e) protected override bool ProcessKeyPreview (ref Message m) { - if (ProcessKeyEventArgs (ref m)) - return true; return base.ProcessKeyPreview (ref m); } From ab8c96da7ed85e268bb5a2b9f891cc92afecdfdd Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 22 Mar 2006 04:22:08 +0000 Subject: [PATCH 029/117] * TreeNodeCollection.cs: If we are clearing the root node we * need to reset top_node so calcs can still happen. svn path=/trunk/mcs/; revision=58279 --- mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 2 ++ .../System.Windows.Forms/TreeNodeCollection.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 7b03019ccc085..f3d516dbe85bd 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -2,6 +2,8 @@ * TabControl.cs: Remove the call to ProcessKeyEventArgs and let control handle this. + * TreeNodeCollection.cs: If we are clearing the root node we need + to reset top_node so calcs can still happen. 2006-03-21 Jackson Harper diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs index 89b3bf75f1c4e..09a29fb7af643 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs @@ -161,6 +161,8 @@ public virtual void Clear () TreeView tree_view = null; if (owner != null) { tree_view = owner.TreeView; + if (owner.IsRoot) + tree_view.top_node = null; if (tree_view != null) tree_view.UpdateBelow (owner); } From 8289c21b36d90903f90ae170787096e163157016 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 22 Mar 2006 05:05:06 +0000 Subject: [PATCH 030/117] * ThemeWin32Classic.cs: This is a Flags so we need to check properly. svn path=/trunk/mcs/; revision=58281 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 4 +++- .../System.Windows.Forms/ThemeWin32Classic.cs | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index f3d516dbe85bd..751926e29489b 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -4,7 +4,9 @@ control handle this. * TreeNodeCollection.cs: If we are clearing the root node we need to reset top_node so calcs can still happen. - + * ThemeWin32Classic.cs: This is a Flags so we need to check + properly. + 2006-03-21 Jackson Harper * DataGrid.cs: Create columns when the binding context has been diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs index b4da2611af4cf..c8f0c8e76ae75 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs @@ -108,7 +108,7 @@ public ThemeWin32Classic () #region OwnerDraw Support public override void DrawOwnerDrawBackground (DrawItemEventArgs e) { - if (e.State == DrawItemState.Selected) { + if ((e.State & DrawItemState.Selected) == DrawItemState.Selected) { e.Graphics.FillRectangle (SystemBrushes.Highlight, e.Bounds); return; } @@ -1394,7 +1394,7 @@ public override void DrawListBoxItem (ListBox ctrl, DrawItemEventArgs e) back_color = e.BackColor; fore_color = e.ForeColor; } - + e.Graphics.FillRectangle (ResPool.GetSolidBrush (back_color), e.Bounds); From b73cc06c4b12adbcaa50004de2c27af7cfc797fc Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Wed, 22 Mar 2006 05:45:56 +0000 Subject: [PATCH 031/117] 2006-03-21 Mike Kestner * ContextMenu.cs (Show): use the position parameter instead of just showing at the MousePosition. svn path=/trunk/mcs/; revision=58282 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 5 +++++ .../System.Windows.Forms/ContextMenu.cs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 751926e29489b..91dadd28d5b1b 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2006-03-21 Mike Kestner + + * ContextMenu.cs (Show): use the position parameter instead of just + showing at the MousePosition. + 2006-03-21 Jackson Harper * TabControl.cs: Remove the call to ProcessKeyEventArgs and let diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContextMenu.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContextMenu.cs index 84ae092b4ac45..cb78a9fb6d00e 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContextMenu.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContextMenu.cs @@ -85,7 +85,8 @@ public void Show (Control control, Point pos) src_control = control; OnPopup (EventArgs.Empty); - MenuTracker.TrackPopupMenu (this, Control.MousePosition); + pos = control.PointToScreen (pos); + MenuTracker.TrackPopupMenu (this, pos); } #endregion Public Methods From 6c34ca2f44045802b50861a1e55b5100fa6be41b Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Wed, 22 Mar 2006 06:07:22 +0000 Subject: [PATCH 032/117] 2006-03-21 Mike Kestner * ThemeWin32Classic.cs: major refactoring of the ToolBar rendering methods. Removed a ton of redundant code. Still not really happy with the border rendering, but I think that's mainly because of the ControlDarkDark being black instead of a dark grey. Depending on how close we want to be, we might want to revisit those color choices. Among the new features added during the refactor were DropDownArrow pressed rendering, Disabled image rendering. Proper flat appearance boundary rendering. Removed the Divider and Wrapping dividers since I can't figure out any combination of themes and conditions to make the MS control draw a horizontal line on a toolbar despite what the Divider property docs indicate. * ToolBar.cs: rewrite the layout engine. Fixes numerous flicker conditions and incorrect layout. Updated to coding standard. * ToolBarButton.cs: refactored layout and positioning code from ToolBar to here. Invalidate wherever possible instead of forcing redraws of the whole toolbar. (Known remaining issues: explicit ButtonSize smaller than provided images.) svn path=/trunk/mcs/; revision=58283 --- .../System.Windows.Forms/ChangeLog | 21 + .../System.Windows.Forms/ThemeWin32Classic.cs | 351 +++++--------- .../System.Windows.Forms/ToolBar.cs | 445 +++++++----------- .../System.Windows.Forms/ToolBarButton.cs | 194 ++++++-- 4 files changed, 458 insertions(+), 553 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 91dadd28d5b1b..7661f2312b900 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,24 @@ +2006-03-21 Mike Kestner + + * ThemeWin32Classic.cs: major refactoring of the ToolBar rendering + methods. Removed a ton of redundant code. Still not really happy with + the border rendering, but I think that's mainly because of the + ControlDarkDark being black instead of a dark grey. Depending on how + close we want to be, we might want to revisit those color choices. + Among the new features added during the refactor were DropDownArrow + pressed rendering, Disabled image rendering. Proper flat appearance + boundary rendering. Removed the Divider and Wrapping dividers since I + can't figure out any combination of themes and conditions to make the + MS control draw a horizontal line on a toolbar despite what the + Divider property docs indicate. + * ToolBar.cs: rewrite the layout engine. Fixes numerous flicker + conditions and incorrect layout. Updated to coding standard. + * ToolBarButton.cs: refactored layout and positioning code from + ToolBar to here. Invalidate wherever possible instead of forcing + redraws of the whole toolbar. + (Known remaining issues: explicit ButtonSize smaller than provided + images.) + 2006-03-21 Mike Kestner * ContextMenu.cs (Show): use the position parameter instead of just diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs index c8f0c8e76ae75..7209db15412ed 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs @@ -3534,255 +3534,148 @@ protected virtual int DrawTab (Graphics dc, TabPage page, TabControl tab, Rectan } #region ToolBar - public override void DrawToolBar (Graphics dc, Rectangle clip_rectangle, ToolBar control) { - StringFormat format = new StringFormat (); + public override void DrawToolBar (Graphics dc, Rectangle clip_rectangle, ToolBar control) + { + StringFormat format = new StringFormat (); format.Trimming = StringTrimming.EllipsisWord; - if (control.textAlignment == ToolBarTextAlign.Underneath) { - format.LineAlignment = StringAlignment.Center; + format.LineAlignment = StringAlignment.Center; + if (control.TextAlign == ToolBarTextAlign.Underneath) format.Alignment = StringAlignment.Center; - } else { - format.LineAlignment = StringAlignment.Center; + else format.Alignment = StringAlignment.Near; - } - // Exclude the area for divider - Rectangle paint_area = new Rectangle (0, ToolBarGripWidth / 2, - control.Width, control.Height - ToolBarGripWidth / 2); - bool flat = (control.Appearance == ToolBarAppearance.Flat); - dc.FillRectangle (ResPool.GetSolidBrush( DefaultControlBackColor ), paint_area); - if (control.Divider) - dc.DrawLine (ResPool.GetPen (ColorControlLight), 0, 0, paint_area.Width, 0); - - foreach (ToolBarButton button in control.Buttons) { - - Image image = null; - Rectangle buttonArea = button.Rectangle; - Rectangle imgRect = Rectangle.Empty; // rect to draw the image - Rectangle txtRect = buttonArea; // rect to draw the text - Rectangle ddRect = Rectangle.Empty; // rect for the drop down arrow - - // calculate different rects and draw the frame if its not separator button - if (button.Style != ToolBarButtonStyle.Separator) { - /* Adjustment for drop down arrow */ - if (button.Style == ToolBarButtonStyle.DropDownButton && control.DropDownArrows) { - ddRect.X = buttonArea.X + buttonArea.Width - this.ToolBarDropDownWidth; - ddRect.Y = buttonArea.Y; - ddRect.Width = this.ToolBarDropDownWidth; - ddRect.Height = buttonArea.Height; - } + dc.FillRectangle (ResPool.GetSolidBrush( DefaultControlBackColor ), clip_rectangle); + + foreach (ToolBarButton button in control.Buttons) + if (button.Visible && clip_rectangle.IntersectsWith (button.Rectangle)) + DrawToolBarButton (dc, control, button, format); - // calculate txtRect and imgRect, if imageIndex and imageList are present - if (button.ImageIndex > -1 && control.ImageList != null) { - if (button.ImageIndex < control.ImageList.Images.Count) - image = control.ImageList.Images [button.ImageIndex]; - // draw the image at the centre if textalignment is underneath - if (control.TextAlign == ToolBarTextAlign.Underneath) { - imgRect.X = buttonArea.X + ((buttonArea.Width - ddRect.Width - - control.ImageSize.Width) / 2) - + this.ToolBarImageGripWidth; - imgRect.Y = buttonArea.Y + this.ToolBarImageGripWidth; - imgRect.Width = control.ImageSize.Width; - imgRect.Height = control.ImageSize.Height; - - txtRect.X = buttonArea.X; - txtRect.Y = buttonArea.Y + imgRect.Height + 2 * this.ToolBarImageGripWidth; - txtRect.Width = buttonArea.Width - ddRect.Width; - txtRect.Height = buttonArea.Height - imgRect.Height - - 2 * this.ToolBarImageGripWidth; - } - else { - imgRect.X = buttonArea.X + this.ToolBarImageGripWidth; - imgRect.Y = buttonArea.Y + this.ToolBarImageGripWidth; - imgRect.Width = control.ImageSize.Width; - imgRect.Height = control.ImageSize.Height; - - txtRect.X = buttonArea.X + imgRect.Width + 2 * this.ToolBarImageGripWidth; - txtRect.Y = buttonArea.Y; - txtRect.Width = buttonArea.Width - imgRect.Width - - 2 * this.ToolBarImageGripWidth - ddRect.Width; - txtRect.Height = buttonArea.Height; - } - } - /* Draw the button frame, only if it is not a separator */ - if (flat) { - if (button.Pushed || button.Pressed) { - CPDrawBorder3D (dc, buttonArea, Border3DStyle.SunkenOuter, Border3DSide.Left | Border3DSide.Right | Border3DSide.Top | Border3DSide.Bottom, ColorControl); - } else if (button.Hilight) { - dc.DrawRectangle (ResPool.GetPen (ColorControlText), buttonArea); - if (! ddRect.IsEmpty) { - dc.DrawLine (ResPool.GetPen (ColorControlText), ddRect.X, ddRect.Y, ddRect.X, - ddRect.Y + ddRect.Height); - buttonArea.Width -= this.ToolBarDropDownWidth; - } - } - } - else { // normal toolbar - if (button.Pushed || button.Pressed) { - CPDrawBorder3D (dc, buttonArea, Border3DStyle.SunkenInner, - Border3DSide.Left | Border3DSide.Right | Border3DSide.Top | Border3DSide.Bottom, ColorControl); - if (! ddRect.IsEmpty) { - CPDrawBorder3D (dc, ddRect, Border3DStyle.SunkenInner, - Border3DSide.Left, ColorControl); - buttonArea.Width -= this.ToolBarDropDownWidth; - } - } - else { - CPDrawBorder3D (dc, buttonArea, Border3DStyle.RaisedInner, - Border3DSide.Left | Border3DSide.Right | Border3DSide.Top | Border3DSide.Bottom, ColorControl); - if (! ddRect.IsEmpty) { - CPDrawBorder3D (dc, ddRect, Border3DStyle.RaisedInner, - Border3DSide.Left, ColorControl); - buttonArea.Width -= this.ToolBarDropDownWidth; - } - } - } - } - DrawToolBarButton (dc, button, control.Font, format, paint_area, buttonArea, - imgRect, image, txtRect, ddRect, flat); - } format.Dispose (); } - private void DrawToolBarButton (Graphics dc, ToolBarButton button, Font font, StringFormat format, - Rectangle controlArea, Rectangle buttonArea, Rectangle imgRect, - Image image, Rectangle txtRect, Rectangle ddRect, bool flat) { - if (! button.Visible) - return; + void DrawToolBarButton (Graphics dc, ToolBar control, ToolBarButton button, StringFormat format) + { + bool is_flat = control.Appearance == ToolBarAppearance.Flat; + + DrawToolBarButtonBorder (dc, button, is_flat); switch (button.Style) { + case ToolBarButtonStyle.DropDownButton: + if (control.DropDownArrows) + DrawToolBarDropDownArrow (dc, button, is_flat); + DrawToolBarButtonContents (dc, control, button, format); + break; case ToolBarButtonStyle.Separator: - // separator is drawn only in the case of flat appearance - if (flat) { - dc.DrawLine (ResPool.GetPen (ColorControlDark), buttonArea.X + 1, buttonArea.Y, - buttonArea.X + 1, buttonArea.Height); - dc.DrawLine (ResPool.GetPen (ColorControlLight), buttonArea.X + 1 + (int) ResPool.GetPen (ColorControl).Width, - buttonArea.Y, buttonArea.X + 1 + (int) ResPool.GetPen (ColorControl).Width, buttonArea.Height); - /* draw a horizontal separator */ - if (button.Wrapper) { - int y = buttonArea.Height + this.ToolBarSeparatorWidth / 2; - dc.DrawLine (ResPool.GetPen (ColorControlDark), 0, y, controlArea.Width, y); - dc.DrawLine (ResPool.GetPen (ColorControlLight), 0, y + 1 + (int) ResPool.GetPen (ColorControl).Width, controlArea.Width, - y + 1 + (int) ResPool.GetPen (ColorControl).Width); - } - } + if (is_flat) + DrawToolBarSeparator (dc, button); break; case ToolBarButtonStyle.ToggleButton: - Rectangle toggleArea = Rectangle.Empty; - toggleArea.X = buttonArea.X + this.ToolBarImageGripWidth; - toggleArea.Y = buttonArea.Y + this.ToolBarImageGripWidth; - toggleArea.Width = buttonArea.Width - 2 * this.ToolBarImageGripWidth; - toggleArea.Height = buttonArea.Height - 2 * this.ToolBarImageGripWidth; - if (button.PartialPush && button.Pushed) { - dc.FillRectangle (SystemBrushes.ControlLightLight, toggleArea); - if (! imgRect.IsEmpty) { - if (button.Enabled && image != null) - button.Parent.ImageList.Draw (dc, imgRect.X, imgRect.Y, imgRect.Width, - imgRect.Height, button.ImageIndex); - else { - dc.FillRectangle (ResPool.GetSolidBrush (ColorGrayText), imgRect); - ControlPaint.DrawBorder3D (dc, imgRect, Border3DStyle.SunkenOuter, - Border3DSide.Right | Border3DSide.Bottom); - } - } - if (button.Enabled) - dc.DrawString (button.Text, font, SystemBrushes.ControlText, txtRect, format); - else - CPDrawStringDisabled (dc, button.Text, font, ColorControlLight, txtRect, format); - } - - else if (button.PartialPush) { - dc.FillRectangle (SystemBrushes.ControlLight, toggleArea); - if (! imgRect.IsEmpty) { - if (button.Enabled && image != null) - button.Parent.ImageList.Draw (dc, imgRect.X, imgRect.Y, imgRect.Width, - imgRect.Height, button.ImageIndex); - else { - dc.FillRectangle (ResPool.GetSolidBrush (ColorGrayText), imgRect); - ControlPaint.DrawBorder3D (dc, imgRect, Border3DStyle.SunkenOuter, - Border3DSide.Right | Border3DSide.Bottom); - } - } - if (button.Enabled) - dc.DrawString (button.Text, font, SystemBrushes.ControlText, txtRect, format); - else - CPDrawStringDisabled (dc, button.Text, font, ColorControlLight, - txtRect, format); - } - - else if (button.Pushed) { - dc.FillRectangle (SystemBrushes.ControlLightLight, toggleArea); - if (! imgRect.IsEmpty) { - if (button.Enabled && image != null) - button.Parent.ImageList.Draw (dc, imgRect.X, imgRect.Y, imgRect.Width, - imgRect.Height, button.ImageIndex); - else { - dc.FillRectangle (ResPool.GetSolidBrush (ColorGrayText), imgRect); - CPDrawBorder3D (dc, imgRect, Border3DStyle.SunkenOuter, - Border3DSide.Right | Border3DSide.Bottom, ColorControl); - } - } - if (button.Enabled) - dc.DrawString (button.Text, font, SystemBrushes.ControlText, txtRect, format); - else - CPDrawStringDisabled (dc, button.Text, font, ColorControlLight, - txtRect, format); - } + DrawToolBarToggleButtonBackground (dc, button); + DrawToolBarButtonContents (dc, control, button, format); + break; - else { - dc.FillRectangle (SystemBrushes.Control, toggleArea); - if (! imgRect.IsEmpty) { - if (button.Enabled && image != null) - button.Parent.ImageList.Draw (dc, imgRect.X, imgRect.Y, imgRect.Width, - imgRect.Height, button.ImageIndex); - else { - dc.FillRectangle (ResPool.GetSolidBrush (ColorGrayText), imgRect); - CPDrawBorder3D (dc, imgRect, Border3DStyle.SunkenOuter, - Border3DSide.Right | Border3DSide.Bottom, ColorControl); - } - } - if (button.Enabled) - dc.DrawString (button.Text, font, SystemBrushes.ControlText, txtRect, format); - else - CPDrawStringDisabled (dc, button.Text, font, ColorControlLight, - txtRect, format); - } + default: + DrawToolBarButtonContents (dc, control, button, format); break; + } + } - case ToolBarButtonStyle.DropDownButton: - // draw the dropdown arrow - if (! ddRect.IsEmpty) { - PointF [] vertices = new PointF [3]; - PointF ddCenter = new PointF (ddRect.X + (ddRect.Width/2.0f), ddRect.Y + (ddRect.Height/2.0f)); - vertices [0].X = ddCenter.X - this.ToolBarDropDownArrowWidth / 2.0f + 0.5f; - vertices [0].Y = ddCenter.Y; - vertices [1].X = ddCenter.X + this.ToolBarDropDownArrowWidth / 2.0f + 0.5f; - vertices [1].Y = ddCenter.Y; - vertices [2].X = ddCenter.X + 0.5f; // 0.5 is added for adjustment - vertices [2].Y = ddCenter.Y + this.ToolBarDropDownArrowHeight; - dc.FillPolygon (SystemBrushes.ControlText, vertices); - } - goto case ToolBarButtonStyle.PushButton; - - case ToolBarButtonStyle.PushButton: - if (! imgRect.IsEmpty){ - if (button.Enabled && image != null) - button.Parent.ImageList.Draw (dc, imgRect.X, imgRect.Y, imgRect.Width, imgRect.Height, - button.ImageIndex); - else { - dc.FillRectangle (ResPool.GetSolidBrush (ColorGrayText), imgRect); - CPDrawBorder3D (dc, imgRect, Border3DStyle.SunkenOuter, - Border3DSide.Right | Border3DSide.Bottom, ColorControl); - } - } - if (button.Enabled) - dc.DrawString (button.Text, font, SystemBrushes.ControlText, txtRect, format); + const Border3DSide all_sides = Border3DSide.Left | Border3DSide.Top | Border3DSide.Right | Border3DSide.Bottom; + + void DrawToolBarButtonBorder (Graphics dc, ToolBarButton button, bool is_flat) + { + if (button.Style == ToolBarButtonStyle.Separator) + return; + + Border3DStyle style; + + if (is_flat) { + if (button.Pushed || button.Pressed) + style = Border3DStyle.SunkenOuter; + else if (button.Hilight) + style = Border3DStyle.RaisedOuter; else - CPDrawStringDisabled (dc, button.Text, font, ColorControlLight, - txtRect, format); - break; + return; + + } else { + if (button.Pushed || button.Pressed) + style = Border3DStyle.Sunken; + else + style = Border3DStyle.Raised; } + + CPDrawBorder3D (dc, button.Rectangle, style, all_sides); + } + + void DrawToolBarSeparator (Graphics dc, ToolBarButton button) + { + Rectangle area = button.Rectangle; + int offset = (int) ResPool.GetPen (ColorControl).Width + 1; + dc.DrawLine (ResPool.GetPen (ColorControlDark), area.X + 1, area.Y, area.X + 1, area.Bottom); + dc.DrawLine (ResPool.GetPen (ColorControlLight), area.X + offset, area.Y, area.X + offset, area.Bottom); + } + + void DrawToolBarToggleButtonBackground (Graphics dc, ToolBarButton button) + { + Rectangle area = button.Rectangle; + area.X += ToolBarImageGripWidth; + area.Y += ToolBarImageGripWidth; + area.Width -= 2 * ToolBarImageGripWidth; + area.Height -= 2 * ToolBarImageGripWidth; + + if (button.Pushed) + dc.FillRectangle (SystemBrushes.ControlLightLight, area); + else if (button.PartialPush) + dc.FillRectangle (SystemBrushes.ControlLight, area); + else + dc.FillRectangle (SystemBrushes.Control, area); + } + + void DrawToolBarDropDownArrow (Graphics dc, ToolBarButton button, bool is_flat) + { + Rectangle rect = button.Rectangle; + rect.X = button.Rectangle.Right - ToolBarDropDownWidth; + rect.Width = ToolBarDropDownWidth; + + if (button.dd_pressed) { + CPDrawBorder3D (dc, rect, Border3DStyle.SunkenOuter, all_sides); + CPDrawBorder3D (dc, rect, Border3DStyle.SunkenInner, Border3DSide.Bottom | Border3DSide.Right); + } else if (button.Pushed || button.Pressed) + CPDrawBorder3D (dc, rect, Border3DStyle.Sunken, all_sides); + else if (is_flat) { + if (button.Hilight) + CPDrawBorder3D (dc, rect, Border3DStyle.RaisedOuter, all_sides); + } else + CPDrawBorder3D (dc, rect, Border3DStyle.Raised, all_sides); + + PointF [] vertices = new PointF [3]; + PointF ddCenter = new PointF (rect.X + (rect.Width/2.0f), rect.Y + (rect.Height/2.0f)); + vertices [0].X = ddCenter.X - ToolBarDropDownArrowWidth / 2.0f + 0.5f; + vertices [0].Y = ddCenter.Y; + vertices [1].X = ddCenter.X + ToolBarDropDownArrowWidth / 2.0f + 0.5f; + vertices [1].Y = ddCenter.Y; + vertices [2].X = ddCenter.X + 0.5f; // 0.5 is added for adjustment + vertices [2].Y = ddCenter.Y + ToolBarDropDownArrowHeight; + dc.FillPolygon (SystemBrushes.ControlText, vertices); + } + + void DrawToolBarButtonContents (Graphics dc, ToolBar control, ToolBarButton button, StringFormat format) + { + if (button.Image != null) { + int x = button.ImageRectangle.X + ToolBarImageGripWidth; + int y = button.ImageRectangle.Y + ToolBarImageGripWidth; + if (button.Enabled) + dc.DrawImage (button.Image, x, y); + else + CPDrawImageDisabled (dc, button.Image, x, y, ColorControl); + } + + if (button.Enabled) + dc.DrawString (button.Text, control.Font, ResPool.GetSolidBrush (ColorControlText), button.TextRectangle, format); + else + CPDrawStringDisabled (dc, button.Text, control.Font, ColorControlLight, button.TextRectangle, format); } // Grip width for the ToolBar diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs index 7a4b725818a83..aa5b1abbf2dd9 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs @@ -1,4 +1,3 @@ -// // System.Windows.Forms.ToolBar.cs // // Permission is hereby granted, free of charge, to any person obtaining @@ -22,11 +21,12 @@ // // Author: // Ravindra (rkumar@novell.com) +// Mike Kestner // // TODO: // - Tooltip // -// Copyright (C) Novell, Inc. 2004 (http://www.novell.com) +// Copyright (C) 2004-2006 Novell, Inc. (http://www.novell.com) // @@ -47,20 +47,8 @@ namespace System.Windows.Forms public class ToolBar : Control { #region Instance Variables - internal ToolBarAppearance appearance; - internal bool autosize; - internal ToolBarButtonCollection buttons; - internal Size buttonSize; - internal bool divider; - internal bool dropDownArrows; - internal ImageList imageList; - internal ImeMode imeMode; - internal bool showToolTips; - internal ToolBarTextAlign textAlignment; - internal bool wrappable; // flag to make the toolbar wrappable - internal bool redraw; // flag to force redrawing the control - private bool size_specified; // flag to know if button size is fixed. - internal ToolBarButton currentButton; // the highlighted button + bool size_specified = false; + ToolBarButton current_button; #endregion Instance Variables #region Events @@ -120,27 +108,15 @@ public class ToolBar : Control #region Constructor public ToolBar () { - appearance = ToolBarAppearance.Normal; - autosize = true; background_color = ThemeEngine.Current.DefaultControlBackColor; - border_style = BorderStyle.None; - buttons = new ToolBarButtonCollection (this); - buttonSize = Size.Empty; - divider = true; - dropDownArrows = false; foreground_color = ThemeEngine.Current.DefaultControlForeColor; - showToolTips = false; - textAlignment = ToolBarTextAlign.Underneath; - wrappable = true; + buttons = new ToolBarButtonCollection (this); dock_style = DockStyle.Top; - redraw = true; - size_specified = false; - // event handlers - this.MouseDown += new MouseEventHandler (ToolBar_MouseDown); - this.MouseLeave += new EventHandler (ToolBar_MouseLeave); - this.MouseMove += new MouseEventHandler (ToolBar_MouseMove); - this.MouseUp += new MouseEventHandler (ToolBar_MouseUp); + MouseDown += new MouseEventHandler (ToolBar_MouseDown); + MouseLeave += new EventHandler (ToolBar_MouseLeave); + MouseMove += new MouseEventHandler (ToolBar_MouseMove); + MouseUp += new MouseEventHandler (ToolBar_MouseUp); Paint += new PaintEventHandler (ToolBar_Paint); SetStyle (ControlStyles.UserPaint, false); @@ -163,6 +139,8 @@ protected override CreateParams CreateParams } #endregion + ToolBarAppearance appearance = ToolBarAppearance.Normal; + #region Public Properties [DefaultValue (ToolBarAppearance.Normal)] [Localizable (true)] @@ -177,6 +155,8 @@ protected override CreateParams CreateParams } } + bool autosize = true; + [DefaultValue (true)] [Localizable (true)] public bool AutoSize { @@ -225,6 +205,8 @@ protected override CreateParams CreateParams set { InternalBorderStyle = value; } } + ToolBarButtonCollection buttons; + [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)] [Localizable (true)] [MergableProperty (false)] @@ -232,28 +214,32 @@ protected override CreateParams CreateParams get { return buttons; } } + Size button_size; + [Localizable (true)] [RefreshProperties (RefreshProperties.All)] public Size ButtonSize { get { - if (buttonSize.IsEmpty) { + if (button_size.IsEmpty) { if (buttons.Count == 0) return new Size (39, 36); else return CalcButtonSize (); } - return buttonSize; + return button_size; } set { - if (buttonSize.Width == value.Width && buttonSize.Height == value.Height) + size_specified = true; + if (button_size == value) return; - buttonSize = value; - size_specified = true; - Redraw (true); + button_size = value; + Redraw (true); } } + bool divider = true; + [DefaultValue (true)] public bool Divider { get { return divider; } @@ -273,15 +259,17 @@ protected override CreateParams CreateParams set { base.Dock = value; } } + bool drop_down_arrows = false; + [DefaultValue (false)] [Localizable (true)] public bool DropDownArrows { - get { return dropDownArrows; } + get { return drop_down_arrows; } set { - if (value == dropDownArrows) + if (value == drop_down_arrows) return; - dropDownArrows = value; + drop_down_arrows = value; Redraw (true); } } @@ -300,10 +288,12 @@ protected override CreateParams CreateParams } } + ImageList image_list; + [DefaultValue (null)] public ImageList ImageList { - get { return imageList; } - set { imageList = value; } + get { return image_list; } + set { image_list = value; } } [Browsable (false)] @@ -311,22 +301,24 @@ protected override CreateParams CreateParams [EditorBrowsable (EditorBrowsableState.Advanced)] public Size ImageSize { get { - if (imageList == null) + if (ImageList == null) return Size.Empty; - return imageList.ImageSize; + return ImageList.ImageSize; } } + ImeMode ime_mode; + [Browsable (false)] [EditorBrowsable (EditorBrowsableState.Never)] public new ImeMode ImeMode { - get { return imeMode; } + get { return ime_mode; } set { - if (value == imeMode) + if (value == ime_mode) return; - imeMode = value; + ime_mode = value; OnImeModeChanged (EventArgs.Empty); } } @@ -344,11 +336,13 @@ protected override CreateParams CreateParams } } + bool show_tooltips = false; + [DefaultValue (false)] [Localizable (true)] public bool ShowToolTips { - get { return showToolTips; } - set { showToolTips = value; } + get { return show_tooltips; } + set { show_tooltips = value; } } [DefaultValue (false)] @@ -373,19 +367,23 @@ protected override CreateParams CreateParams } } + ToolBarTextAlign text_alignment = ToolBarTextAlign.Underneath; + [DefaultValue (ToolBarTextAlign.Underneath)] [Localizable (true)] public ToolBarTextAlign TextAlign { - get { return textAlignment; } + get { return text_alignment; } set { - if (value == textAlignment) + if (value == text_alignment) return; - textAlignment = value; + text_alignment = value; Redraw (true); } } + bool wrappable = true; + [DefaultValue (true)] [Localizable (true)] public bool Wrappable { @@ -413,40 +411,6 @@ public override string ToString () } #endregion Public Methods - #region Internal Methods - internal Rectangle GetChildBounds (ToolBarButton button) - { - if (button.Style == ToolBarButtonStyle.Separator) - return new Rectangle (button.Location.X, button.Location.Y, - ThemeEngine.Current.ToolBarSeparatorWidth, this.ButtonSize.Height); - - if (size_specified) - return new Rectangle (button.Location, this.ButtonSize); - - SizeF sz = this.DeviceContext.MeasureString (button.Text, this.Font); - Size size = new Size ((int) Math.Ceiling (sz.Width), (int) Math.Ceiling (sz.Height)); - - if (imageList != null) { - // adjustment for the image grip - int imgWidth = this.ImageSize.Width + 2 * ThemeEngine.Current.ToolBarImageGripWidth; - int imgHeight = this.ImageSize.Height + 2 * ThemeEngine.Current.ToolBarImageGripWidth; - - if (textAlignment == ToolBarTextAlign.Right) { - size.Width = imgWidth + size.Width; - size.Height = (size.Height > imgHeight) ? size.Height : imgHeight; - } - else { - size.Height = imgHeight + size.Height; - size.Width = (size.Width > imgWidth) ? size.Width : imgWidth; - } - } - if (button.Style == ToolBarButtonStyle.DropDownButton && this.dropDownArrows) - size.Width += ThemeEngine.Current.ToolBarDropDownWidth; - - return new Rectangle (button.Location, size); - } - #endregion Internal Methods - #region Protected Methods protected override void CreateHandle () { @@ -456,7 +420,7 @@ protected override void CreateHandle () protected override void Dispose (bool disposing) { if (disposing) - imageList = null; + ImageList = null; base.Dispose (disposing); } @@ -476,24 +440,21 @@ protected virtual void OnButtonClick (ToolBarButtonClickEventArgs e) if (ButtonClick != null) ButtonClick (this, e); - else - return; } protected virtual void OnButtonDropDown (ToolBarButtonClickEventArgs e) { - // Reset the flag set on DropDown - e.Button.dd_pressed = false; - if (ButtonDropDown != null) ButtonDropDown (this, e); if (e.Button.DropDownMenu == null) return; - Point loc = new Point (e.Button.Location.X + 1, - e.Button.Rectangle.Bottom + 2); + Point loc = new Point (e.Button.Rectangle.X + 1, e.Button.Rectangle.Bottom + 1); ((ContextMenu) e.Button.DropDownMenu).Show (this, loc); + + e.Button.dd_pressed = false; + Invalidate (e.Button.Rectangle); } protected override void OnFontChanged (EventArgs e) @@ -511,7 +472,7 @@ protected override void OnResize (EventArgs e) { base.OnResize (e); - if (this.Width <= 0 || this.Height <= 0 || this.Visible == false) + if (Width <= 0 || Height <= 0 || !Visible) return; Redraw (true); @@ -532,34 +493,31 @@ protected override void WndProc (ref Message m) #region Private Methods private void ToolBar_MouseDown (object sender, MouseEventArgs me) { - if (! this.Enabled) return; + if (!Enabled) + return; - Point hit = new Point (me.X, me.Y); - this.Capture = true; + Point loc = new Point (me.X, me.Y); // draw the pushed button foreach (ToolBarButton button in buttons) { - if (button.Enabled && button.Rectangle.Contains (hit)) { + if (button.Enabled && button.Rectangle.Contains (loc)) { // Mark the DropDown rect as pressed. // We don't redraw the dropdown rect. if (button.Style == ToolBarButtonStyle.DropDownButton) { - Rectangle ddRect = Rectangle.Empty; Rectangle rect = button.Rectangle; - ddRect.Height = rect.Height; - ddRect.Width = ThemeEngine.Current.ToolBarDropDownWidth; - ddRect.X = rect.X + rect.Width - ddRect.Width; - ddRect.Y = rect.Y; - if (ddRect.Contains (hit)) { - button.dd_pressed = true; + rect.Width = ThemeEngine.Current.ToolBarDropDownWidth; + rect.X = button.Rectangle.Right - rect.Width; + if (rect.Contains (loc)) { + if (button.DropDownMenu != null) { + button.dd_pressed = true; + Invalidate (rect); + } break; } } - // If it is not dropdown then we treat it as a normal - // button press. button.pressed = true; button.inside = true; Invalidate (button.Rectangle); - Redraw (false); break; } } @@ -567,66 +525,61 @@ private void ToolBar_MouseDown (object sender, MouseEventArgs me) private void ToolBar_MouseUp (object sender, MouseEventArgs me) { - if (! this.Enabled) return; + if (!Enabled) + return; - Point hit = new Point (me.X, me.Y); - this.Capture = false; + Point loc = new Point (me.X, me.Y); // draw the normal button foreach (ToolBarButton button in buttons) { - if (button.Enabled && button.Rectangle.Contains (hit)) { + if (button.Enabled && button.Rectangle.Contains (loc)) { if (button.Style == ToolBarButtonStyle.DropDownButton) { - Rectangle ddRect = Rectangle.Empty; - Rectangle rect = button.Rectangle; - ddRect.Height = rect.Height; + Rectangle ddRect = button.Rectangle; ddRect.Width = ThemeEngine.Current.ToolBarDropDownWidth; - ddRect.X = rect.X + rect.Width - ddRect.Width; - ddRect.Y = rect.Y; - // Fire a ButtonDropDown event - if (ddRect.Contains (hit)) { + ddRect.X = button.Rectangle.Right - ddRect.Width; + if (ddRect.Contains (loc)) { if (button.dd_pressed) - this.OnButtonDropDown (new ToolBarButtonClickEventArgs (button)); + OnButtonDropDown (new ToolBarButtonClickEventArgs (button)); continue; } } // Fire a ButtonClick if (button.pressed) - this.OnButtonClick (new ToolBarButtonClickEventArgs (button)); - } - // Clear the button press flags, if any - else if (button.pressed) { + OnButtonClick (new ToolBarButtonClickEventArgs (button)); + } else if (button.pressed) { button.pressed = false; Invalidate (button.Rectangle); - Redraw (false); } } } private void ToolBar_MouseLeave (object sender, EventArgs e) { - if (! this.Enabled || appearance != ToolBarAppearance.Flat) return; + if (!Enabled || appearance != ToolBarAppearance.Flat || current_button == null) + return; - if (currentButton != null && currentButton.Hilight) { - currentButton.Hilight = false; - Invalidate (currentButton.Rectangle); + if (current_button.Hilight) { + current_button.Hilight = false; + Invalidate (current_button.Rectangle); Redraw (false); } - currentButton = null; + current_button = null; } private void ToolBar_MouseMove (object sender, MouseEventArgs me) { - if (! this.Enabled) return; + if (!Enabled) + return; - Point hit = new Point (me.X, me.Y); + Point loc = new Point (me.X, me.Y); if (this.Capture) { // If the button was pressed and we leave, release the // button press and vice versa foreach (ToolBarButton button in buttons) { if (button.pressed && - (button.inside != button.Rectangle.Contains (hit))) { - button.inside = button.Rectangle.Contains (hit); + (button.inside != button.Rectangle.Contains (loc))) { + button.inside = button.Rectangle.Contains (loc); button.Hilight = false; Invalidate (button.Rectangle); Redraw (false); @@ -636,21 +589,21 @@ private void ToolBar_MouseMove (object sender, MouseEventArgs me) } // following is only for flat style toolbar else if (appearance == ToolBarAppearance.Flat) { - if (currentButton != null && currentButton.Rectangle.Contains (hit)) { - if (currentButton.Hilight || currentButton.Pushed) + if (current_button != null && current_button.Rectangle.Contains (loc)) { + if (current_button.Hilight || current_button.Pushed) return; - currentButton.Hilight = true; - Invalidate (currentButton.Rectangle); + current_button.Hilight = true; + Invalidate (current_button.Rectangle); Redraw (false); } else { foreach (ToolBarButton button in buttons) { - if (button.Rectangle.Contains (hit) && button.Enabled) { - currentButton = button; - if (currentButton.Hilight || currentButton.Pushed) + if (button.Rectangle.Contains (loc) && button.Enabled) { + current_button = button; + if (current_button.Hilight || current_button.Pushed) continue; - currentButton.Hilight = true; - Invalidate (currentButton.Rectangle); + current_button.Hilight = true; + Invalidate (current_button.Rectangle); Redraw (false); } else if (button.Hilight) { @@ -670,11 +623,9 @@ private void ToolBar_Paint (object sender, PaintEventArgs pevent) internal void Redraw (bool recalculate) { - // if (recalculate) { - CalcToolBar (); - // } + if (recalculate) + Layout (); - redraw = true; Refresh (); } @@ -689,12 +640,12 @@ private Size CalcButtonSize () SizeF sz = this.DeviceContext.MeasureString (longestText, this.Font); Size size = new Size ((int) Math.Ceiling (sz.Width), (int) Math.Ceiling (sz.Height)); - if (imageList != null) { + if (ImageList != null) { // adjustment for the image grip int imgWidth = this.ImageSize.Width + 2 * ThemeEngine.Current.ToolBarImageGripWidth; int imgHeight = this.ImageSize.Height + 2 * ThemeEngine.Current.ToolBarImageGripWidth; - if (textAlignment == ToolBarTextAlign.Right) { + if (text_alignment == ToolBarTextAlign.Right) { size.Width = imgWidth + size.Width; size.Height = (size.Height > imgHeight) ? size.Height : imgHeight; } @@ -706,115 +657,61 @@ private Size CalcButtonSize () return size; } - /* Checks for the separators and sets the location of a button and its wrapper flag */ - private void CalcToolBar () + void Layout () { - int wd = this.Width; // the amount of space we have for rest of the buttons - int ht = this.ButtonSize.Height; // all buttons are displayed with the same height - Point loc; // the location to place the next button, leave the space for border - loc = new Point (ThemeEngine.Current.ToolBarGripWidth, ThemeEngine.Current.ToolBarGripWidth); - - // clear all the wrappers if toolbar is not wrappable - if (! wrappable && ! autosize) { - if (this.Height != this.DefaultSize.Height) - this.Height = this.DefaultSize.Height; - foreach (ToolBarButton button in buttons) { - button.Location = loc; - button.Wrapper = false; - loc.X = loc.X + button.Rectangle.Width; - } - } - else if (! wrappable) { // autosizeable - if (ht != this.Height) - this.Height = ht; - foreach (ToolBarButton button in buttons) { - button.Location = loc; - button.Wrapper = false; - loc.X = loc.X + button.Rectangle.Width; - } - } - else { // wrappable - bool seenSeparator = false; - int separatorIndex = -1; - ToolBarButton button; + Theme theme = ThemeEngine.Current; + int ht = ButtonSize.Height + theme.ToolBarGripWidth; + int x = theme.ToolBarGripWidth; + int y = theme.ToolBarGripWidth; + + if (Wrappable) { + int separator_index = -1; for (int i = 0; i < buttons.Count; i++) { - button = buttons [i]; - if (button.Visible) { - if (button.Style == ToolBarButtonStyle.Separator) { - wd -= ThemeEngine.Current.ToolBarSeparatorWidth; - if (wd > 0) { - button.Wrapper = false; // clear the old flag in case it was set - button.Location = loc; - loc.X = loc.X + ThemeEngine.Current.ToolBarSeparatorWidth; - } - else { - button.Wrapper = true; - button.Location = loc; - loc.X = ThemeEngine.Current.ToolBarGripWidth; - wd = this.Width; - // we need space to draw horizontal separator - loc.Y = loc.Y + ThemeEngine.Current.ToolBarSeparatorWidth + ht; - } - seenSeparator = true; - separatorIndex = i; - } - else { - Rectangle rect = button.Rectangle; - wd -= rect.Width; - if (wd > 0) { - button.Wrapper = false; - button.Location = loc; - loc.X = loc.X + rect.Width; - } - else if (seenSeparator) { - // wrap at the separator and reassign the locations - i = separatorIndex; // for loop is going to increment it - buttons [separatorIndex].Wrapper = true; - seenSeparator = false; - separatorIndex = -1; - loc.X = ThemeEngine.Current.ToolBarGripWidth; - // we need space to draw horizontal separator - loc.Y = loc.Y + ht + ThemeEngine.Current.ToolBarSeparatorWidth; - wd = this.Width; - continue; - } - else { - button.Wrapper = true; - wd = this.Width; - loc.X = 0; - loc.Y += ht; - button.Location = loc; - loc.X = loc.X + rect.Width; - } - } - } - else // don't consider invisible buttons + ToolBarButton button = buttons [i]; + + if (!button.Visible) continue; - } - /* adjust the control height, if we are autosizeable */ - if (autosize) // wrappable - if (this.Height != (loc.Y + ht + ThemeEngine.Current.ToolBarGripWidth)) - this.Height = loc.Y + ht + ThemeEngine.Current.ToolBarGripWidth; - } - } - private void DumpToolBar (string msg) - { - Console.WriteLine (msg); - Console.WriteLine ("ToolBar: name: " + this.Text); - Console.WriteLine ("ToolBar: wd, ht: " + this.Size); - Console.WriteLine ("ToolBar: img size: " + this.ImageSize); - Console.WriteLine ("ToolBar: button sz: " + this.buttonSize); - Console.WriteLine ("ToolBar: textalignment: "+ this.TextAlign); - Console.WriteLine ("ToolBar: appearance: "+ this.Appearance); - Console.WriteLine ("ToolBar: wrappable: "+ this.Wrappable); - Console.WriteLine ("ToolBar: buttons count: " + this.Buttons.Count); - - int i= 0; - foreach (ToolBarButton b in buttons) { - Console.WriteLine ("ToolBar: button [{0}]:",i++); - b.Dump (); + if (size_specified) + button.Layout (ButtonSize); + else + button.Layout (); + + bool is_separator = button.Style == ToolBarButtonStyle.Separator; + + if (x + button.Rectangle.Width < Width || is_separator) { + button.Location = new Point (x, y); + x += button.Rectangle.Width; + if (is_separator) + separator_index = i; + } else if (separator_index > 0) { + i = separator_index; + separator_index = -1; + x = theme.ToolBarGripWidth; + y += ht; + } else { + x = theme.ToolBarGripWidth; + y += ht; + button.Location = new Point (x, y); + x += button.Rectangle.Width; + } + } + if (AutoSize) + Height = y + ht; + } else { + if (AutoSize) + Height = ht; + else + Height = DefaultSize.Height; + foreach (ToolBarButton button in buttons) { + if (size_specified) + button.Layout (ButtonSize); + else + button.Layout (); + button.Location = new Point (x, y); + x += button.Rectangle.Width; + } } } #endregion Private Methods @@ -823,7 +720,7 @@ private void DumpToolBar (string msg) public class ToolBarButtonCollection : IList, ICollection, IEnumerable { #region instance variables - private ArrayList buttonsList; + private ArrayList list; private ToolBar owner; #endregion @@ -831,39 +728,39 @@ public class ToolBarButtonCollection : IList, ICollection, IEnumerable public ToolBarButtonCollection (ToolBar owner) { this.owner = owner; - this.buttonsList = new ArrayList (); + list = new ArrayList (); } #endregion #region properties [Browsable (false)] public virtual int Count { - get { return buttonsList.Count; } + get { return list.Count; } } public virtual bool IsReadOnly { - get { return buttonsList.IsReadOnly; } + get { return list.IsReadOnly; } } public virtual ToolBarButton this [int index] { - get { return (ToolBarButton) buttonsList [index]; } + get { return (ToolBarButton) list [index]; } set { value.SetParent (owner); - buttonsList [index] = value; + list [index] = value; owner.Redraw (true); } } bool ICollection.IsSynchronized { - get { return buttonsList.IsSynchronized; } + get { return list.IsSynchronized; } } object ICollection.SyncRoot { - get { return buttonsList.SyncRoot; } + get { return list.SyncRoot; } } bool IList.IsFixedSize { - get { return buttonsList.IsFixedSize; } + get { return list.IsFixedSize; } } object IList.this [int index] { @@ -887,7 +784,7 @@ public int Add (ToolBarButton button) { int result; button.SetParent (owner); - result = buttonsList.Add (button); + result = list.Add (button); owner.Redraw (true); return result; } @@ -900,23 +797,23 @@ public void AddRange (ToolBarButton [] buttons) public virtual void Clear () { - buttonsList.Clear (); + list.Clear (); owner.Redraw (false); } public bool Contains (ToolBarButton button) { - return buttonsList.Contains (button); + return list.Contains (button); } public virtual IEnumerator GetEnumerator () { - return buttonsList.GetEnumerator (); + return list.GetEnumerator (); } void ICollection.CopyTo (Array dest, int index) { - buttonsList.CopyTo (dest, index); + list.CopyTo (dest, index); } int IList.Add (object button) @@ -966,24 +863,24 @@ void IList.Remove (object button) public int IndexOf (ToolBarButton button) { - return buttonsList.IndexOf (button); + return list.IndexOf (button); } public void Insert (int index, ToolBarButton button) { - buttonsList.Insert (index, button); + list.Insert (index, button); owner.Redraw (true); } public void Remove (ToolBarButton button) { - buttonsList.Remove (button); + list.Remove (button); owner.Redraw (true); } public virtual void RemoveAt (int index) { - buttonsList.RemoveAt (index); + list.RemoveAt (index); owner.Redraw (true); } #endregion methods diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButton.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButton.cs index 34c6ee3da2e53..3ac8ab90bae82 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButton.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButton.cs @@ -1,4 +1,3 @@ -// // System.Windows.Forms.ToolBarButton.cs // // Permission is hereby granted, free of charge, to any person obtaining @@ -20,17 +19,12 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -// Copyright (C) 2004 Novell, Inc. (http://www.novell.com) +// Copyright (C) 2004-2006 Novell, Inc. (http://www.novell.com) // // Authors: // Ravindra (rkumar@novell.com) -// -// TODO: -// - Adding a button to two toolbars -// - +// Mike Kestner -// NOT COMPLETE using System.ComponentModel; using System.ComponentModel.Design; @@ -57,12 +51,9 @@ public class ToolBarButton : Component private string text = ""; private string tooltip = ""; private bool visible = true; - private Point location = new Point (ThemeEngine.Current.ToolBarGripWidth, - ThemeEngine.Current.ToolBarGripWidth); internal bool dd_pressed = false; // to check for a mouse down on dropdown rect internal bool hilight = false; // to hilight buttons in flat style internal bool inside = false; // to handle the mouse move event with mouse pressed - internal bool wrapper = false; // to mark a wrapping button internal bool pressed = false; // this is to check for mouse down on a button #endregion @@ -86,9 +77,52 @@ public ToolBarButton (string text) } } + internal Image Image { + get { + if (Parent == null || Parent.ImageList == null) + return null; + + ImageList list = Parent.ImageList; + if (ImageIndex > -1 && ImageIndex < list.Images.Count) + return list.Images [ImageIndex]; + + return null; + } + } + + Rectangle image_rect; + internal Rectangle ImageRectangle { + get { + Rectangle result = image_rect; + result.X += bounds.X; + result.Y += bounds.Y; + return result; + } + } + + Rectangle text_rect; + internal Rectangle TextRectangle { + get { + Rectangle result = text_rect; + result.X += bounds.X; + result.Y += bounds.Y; + return result; + } + } + + Rectangle bounds; internal Point Location { - get { return location; } - set { location = value; } + //get { return location; } + set { + if (bounds.Location == value) + return; + + if (bounds != Rectangle.Empty) + Invalidate (); + + bounds.Location = value; + Invalidate (); + } } internal bool Pressed { @@ -100,11 +134,6 @@ public ToolBarButton (string text) } set { pressed = value; } } - - internal bool Wrapper { - get { return wrapper; } - set { wrapper = value; } - } #endregion internal properties #region properties @@ -130,8 +159,7 @@ public ToolBarButton (string text) return; enabled = value; - if (parent != null) - parent.Redraw (false); + Invalidate (); } } @@ -149,8 +177,7 @@ public ToolBarButton (string text) return; image_index = value; - if (parent != null) - parent.Redraw (true); + Invalidate (); } } @@ -167,8 +194,7 @@ public ToolBarButton (string text) return; partial_push = value; - if (parent != null) - parent.Redraw (false); + Invalidate (); } } @@ -182,18 +208,18 @@ public ToolBarButton (string text) pushed = value; if (pushed) hilight = false; - if (parent != null) - parent.Redraw (false); + Invalidate (); } } public Rectangle Rectangle { get { - if (parent == null) - return Rectangle.Empty; - else if (visible && parent.Visible) - return parent.GetChildBounds (this); - else + if (Visible && Parent != null && Parent.Visible) { + Rectangle result = bounds; + if (Style == ToolBarButtonStyle.DropDownButton && Parent.DropDownArrows) + result.Width += ThemeEngine.Current.ToolBarDropDownWidth; + return result; + } else return Rectangle.Empty; } } @@ -207,8 +233,7 @@ public ToolBarButton (string text) return; style = value; - if (parent != null) - parent.Redraw (true); + Invalidate (); } } @@ -230,8 +255,7 @@ public ToolBarButton (string text) return; text = value; - if (parent != null) - parent.Redraw (true); + Invalidate (); } } @@ -251,8 +275,8 @@ public ToolBarButton (string text) return; visible = value; - if (parent != null) - parent.Redraw (true); + if (Parent != null) + Parent.Redraw (true); } } #endregion @@ -260,24 +284,94 @@ public ToolBarButton (string text) #region internal methods internal void SetParent (ToolBar parent) { + if (Parent == parent) + return; + + if (Parent != null) + Parent.Buttons.Remove (this); + this.parent = parent; } - internal void Dump () + internal void Layout () { - Console.WriteLine ("TBButton: style: " + this.Style); - Console.WriteLine ("TBButton: wrapper: " + this.Wrapper); - Console.WriteLine ("TBButton: hilight: " + this.Hilight); - Console.WriteLine ("TBButton: loc: " + this.Location); - Console.WriteLine ("TBButton: rect: " + this.Rectangle); - Console.WriteLine ("TBButton: txt: " + this.Text); - Console.WriteLine ("TBButton: visible " + this.Visible); - Console.WriteLine ("TBButton: enabled: " + this.Enabled); - Console.WriteLine ("TBButton: image index: " + this.ImageIndex); - Console.WriteLine ("TBButton: pushed: " + this.Pushed); - Console.WriteLine ("TBButton: partial push: " + this.PartialPush); + if (Parent == null || !Visible) + return; + + Size sz = CalculateSize (); + Layout (sz); } - #endregion + + internal void Layout (Size size) + { + if (Parent == null || !Visible) + return; + + bounds.Size = size; + + Image image = Image; + if (image == null) { + text_rect = new Rectangle (Point.Empty, size); + image_rect = Rectangle.Empty; + return; + } + + int grip = ThemeEngine.Current.ToolBarImageGripWidth; + + if (Parent.TextAlign == ToolBarTextAlign.Underneath) { + image_rect = new Rectangle ((size.Width - image.Width) / 2 - grip, 0, image.Width + 2 + grip, image.Height + 2 * grip); + + text_rect = new Rectangle (0, image_rect.Bottom, size.Width, size.Height - image_rect.Height); + } else { + image_rect = new Rectangle (0, 0, image.Width + 2 * grip, image.Height + 2 * grip); + + text_rect = new Rectangle (image_rect.Right, 0, size.Width - image_rect.Width, size.Height); + } + } + + const int text_padding = 3; + + Size CalculateSize () + { + Theme theme = ThemeEngine.Current; + + int ht = Parent.ButtonSize.Height + 2 * theme.ToolBarGripWidth; + + if (Style == ToolBarButtonStyle.Separator) + return new Size (theme.ToolBarSeparatorWidth, ht); + + SizeF sz = Parent.DeviceContext.MeasureString (Text, Parent.Font); + Size size = new Size ((int) Math.Ceiling (sz.Width) + 2 * text_padding, + (int) Math.Ceiling (sz.Height)); + + Image image = Image; + + if (image == null) + return size; + + int image_width = image.Width + 2 * theme.ToolBarImageGripWidth; + int image_height = image.Height + 2 * theme.ToolBarImageGripWidth; + + if (Parent.TextAlign == ToolBarTextAlign.Right) { + size.Width = image_width + size.Width; + size.Height = (size.Height > image_height) ? size.Height : image_height; + } else { + size.Height = image_height + size.Height; + size.Width = (size.Width > image_width) ? size.Width : image_width; + } + + size.Width += theme.ToolBarGripWidth; + size.Height += theme.ToolBarGripWidth; + return size; + } + + void Invalidate () + { + if (Parent != null) + Parent.Invalidate (Rectangle); + } + + #endregion Internal Methods #region methods protected override void Dispose (bool disposing) From 3cb64b8e8205be80bf49a52dd44b94a6cfeb45d8 Mon Sep 17 00:00:00 2001 From: Peter Dennis Bartok Date: Wed, 22 Mar 2006 09:05:34 +0000 Subject: [PATCH 033/117] 2006-03-22 Peter Dennis Bartok * XplatUIX11.cs: - DeriveWindowStyles: Fixed typo in borderstyle generation (#77828) - SetVisible: Sending WINDOWPOSCHANGED for all controls when made visible (to allow them to recalculate their sizes) svn path=/trunk/mcs/; revision=58287 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 7 +++++++ .../System.Windows.Forms/XplatUIX11.cs | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 7661f2312b900..fa6a16498b34a 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,10 @@ +2006-03-22 Peter Dennis Bartok + + * XplatUIX11.cs: + - DeriveWindowStyles: Fixed typo in borderstyle generation (#77828) + - SetVisible: Sending WINDOWPOSCHANGED for all controls when made + visible (to allow them to recalculate their sizes) + 2006-03-21 Mike Kestner * ThemeWin32Classic.cs: major refactoring of the ToolBar rendering diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs index 8804dffff6bc4..78c004a9da98f 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs @@ -586,7 +586,7 @@ internal class XException : ApplicationException { tool_caption_height = 19; if ((Style & (int) WindowStyles.WS_CHILD) != 0) { - if ((Style & (int) WindowStyles.WS_BORDER) == 0) { + if ((Style & (int) WindowStyles.WS_BORDER) != 0) { border_style = FormBorderStyle.None; } else if ((ExStyle & (int) WindowExStyles.WS_EX_CLIENTEDGE) != 0) { border_style = FormBorderStyle.Fixed3D; @@ -3915,11 +3915,11 @@ internal override void SetAllowDrop (IntPtr handle, bool value) case FormWindowState.Maximized: SetWindowState(handle, FormWindowState.Maximized); break; } - SendMessage(handle, Msg.WM_WINDOWPOSCHANGED, IntPtr.Zero, IntPtr.Zero); } else { XMapWindow(DisplayHandle, hwnd.whole_window); XMapWindow(DisplayHandle, hwnd.client_window); } + SendMessage(handle, Msg.WM_WINDOWPOSCHANGED, IntPtr.Zero, IntPtr.Zero); } else { XUnmapWindow(DisplayHandle, hwnd.whole_window); } From 1f97e02525bd3088ceead8432f773d474e7e432c Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Wed, 22 Mar 2006 09:40:27 +0000 Subject: [PATCH 034/117] 2006-03-22 Carlos Alberto Cortez * serial.c: Add get_signal_code, get_signal, and set_signal functions to access serial signals. Also add a MonoSerialSignal enum, which is a copy of System.IO.Ports.SerialSignal. svn path=/trunk/mono/; revision=58288 --- support/ChangeLog | 5 ++++ support/serial.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/support/ChangeLog b/support/ChangeLog index 7587977faca4f..eb7179cfe5db4 100644 --- a/support/ChangeLog +++ b/support/ChangeLog @@ -1,3 +1,8 @@ +2006-03-22 Carlos Alberto Cortez + + * serial.c: Add get_signal_code, get_signal, and set_signal + functions to access serial signals. Also add a MonoSerialSignal + enum, which is a copy of System.IO.Ports.SerialSignal. Thu Mar 16 17:27:46 CET 2006 Paolo Molaro diff --git a/support/serial.c b/support/serial.c index 4a363370254e6..e4dfcc0a4c826 100644 --- a/support/serial.c +++ b/support/serial.c @@ -10,6 +10,7 @@ #include #include #include +#include #include @@ -38,6 +39,15 @@ typedef enum { OnePointFive = 3 } MonoStopBits; +/* This is a copy of System.IO.Ports.SerialSignal */ +typedef enum { + Cd = 0, /* Carrier detect */ + Cts = 1, /* Clear to send */ + Dsr = 2, /* Data set ready */ + Dtr = 3, /* Data terminal ready */ + Rts = 4 /* Request to send */ +} MonoSerialSignal; + int open_serial (char* devfile) { @@ -225,6 +235,62 @@ set_attributes (int fd, int baud_rate, MonoParity parity, int dataBits, MonoStop return TRUE; } +static gint32 +get_signal_code (MonoSerialSignal signal) +{ + switch (signal) { + case Cd: + return TIOCM_CAR; + case Cts: + return TIOCM_CTS; + case Dsr: + return TIOCM_DSR; + case Dtr: + return TIOCM_DTR; + case Rts: + return TIOCM_RTS; + } + + /* Not reached */ + return 0; +} + +gint32 +get_signal (int fd, MonoSerialSignal signal) +{ + int signals, expected; + + expected = get_signal_code (signal); + if (ioctl (fd, TIOCMGET, &signals) == -1) + return -1; + + return (expected & signals) != 0; +} + +gint32 +set_signal (int fd, MonoSerialSignal signal, gboolean value) +{ + int signals, expected, activated; + + expected = get_signal_code (signal); + if (ioctl (fd, TIOCMGET, &signals) == -1) + return -1; + + activated = (signals & expected) != 0; + if (activated == value) /* Already set */ + return 1; + + if (value) + signals |= expected; + else + signals &= ~expected; + + if (ioctl (fd, TIOCMSET, &signals) == -1) + return -1; + + return 1; +} + /* * mono internals should not be used here. * this serial stuff needs to be implemented with icalls. From c777377028d0128ecbe4beb8a6431527b2f8de1a Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 22 Mar 2006 09:50:49 +0000 Subject: [PATCH 035/117] * XplatUIX11.cs: Don't handle configurenotifys if PostQuitState * is true. svn path=/trunk/mcs/; revision=58289 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 6 ++++++ .../System.Windows.Forms/XplatUIX11.cs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index fa6a16498b34a..e5c79912ee1b8 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2006-03-22 Jackson Harper + + * XplatUIX11.cs: Don't handle configurenotifys if PostQuitState is + true. + 2006-03-22 Peter Dennis Bartok * XplatUIX11.cs: @@ -31,6 +36,7 @@ * ContextMenu.cs (Show): use the position parameter instead of just showing at the MousePosition. +>>>>>>> .r58288 2006-03-21 Jackson Harper * TabControl.cs: Remove the call to ProcessKeyEventArgs and let diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs index 78c004a9da98f..fa5015711cb0c 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs @@ -3050,7 +3050,7 @@ internal class XException : ApplicationException { } case XEventName.ConfigureNotify: { - if (!client && (xevent.ConfigureEvent.xevent == xevent.ConfigureEvent.window)) { // Ignore events for children (SubstructureNotify) and client areas + if (PostQuitState || !client && (xevent.ConfigureEvent.xevent == xevent.ConfigureEvent.window)) { // Ignore events for children (SubstructureNotify) and client areas #if DriverDebugExtra Console.WriteLine("GetMessage(): Window {0:X} ConfigureNotify x={1} y={2} width={3} height={4}", hwnd.client_window.ToInt32(), xevent.ConfigureEvent.x, xevent.ConfigureEvent.y, xevent.ConfigureEvent.width, xevent.ConfigureEvent.height); #endif From 4989aa15d26b37120a0433ee8b3487040b1bc8a4 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 22 Mar 2006 09:54:43 +0000 Subject: [PATCH 036/117] * ScrollBar.cs: When doing increments and decrements we need to set the Value property so that ValueChanged gets raised. A possible optimization here would be to make an internal SetValue that doesn't invalidate immediately. svn path=/trunk/mcs/; revision=58290 --- .../System.Windows.Forms/ChangeLog | 4 ++ .../System.Windows.Forms/ScrollBar.cs | 37 +++++++------------ 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index e5c79912ee1b8..103285c8661c1 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -2,6 +2,10 @@ * XplatUIX11.cs: Don't handle configurenotifys if PostQuitState is true. + * ScrollBar.cs: When doing increments and decrements we need to + set the Value property so that ValueChanged gets raised. A + possible optimization here would be to make an internal SetValue + that doesn't invalidate immediately. 2006-03-22 Peter Dennis Bartok diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollBar.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollBar.cs index 7c60fd79cdf9c..0c62db184872b 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollBar.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollBar.cs @@ -571,16 +571,14 @@ private void LargeIncrement () { ScrollEventArgs event_args; int pos = position + large_change; - + event_args = new ScrollEventArgs (ScrollEventType.LargeIncrement, pos); OnScroll (event_args); - pos = event_args.NewValue; - - event_args = new ScrollEventArgs (ScrollEventType.EndScroll, pos); - OnScroll (event_args); - pos = event_args.NewValue; + Value = event_args.NewValue; - UpdatePos (pos, true); + event_args = new ScrollEventArgs (ScrollEventType.EndScroll, Value); + OnScroll (event_args); + Value = event_args.NewValue; } private void LargeDecrement () @@ -590,14 +588,11 @@ private void LargeDecrement () event_args = new ScrollEventArgs (ScrollEventType.LargeDecrement, pos); OnScroll (event_args); - pos = event_args.NewValue; + Value = event_args.NewValue; - event_args = new ScrollEventArgs (ScrollEventType.EndScroll, pos); + event_args = new ScrollEventArgs (ScrollEventType.EndScroll, Value); OnScroll (event_args); - pos = event_args.NewValue; - - - UpdatePos (pos, true); + Value = event_args.NewValue; } private void OnResizeSB (Object o, EventArgs e) @@ -1038,13 +1033,11 @@ private void SmallIncrement () event_args = new ScrollEventArgs (ScrollEventType.SmallIncrement, pos); OnScroll (event_args); - pos = event_args.NewValue; + Value = event_args.NewValue; - event_args = new ScrollEventArgs (ScrollEventType.EndScroll, pos); + event_args = new ScrollEventArgs (ScrollEventType.EndScroll, Value); OnScroll (event_args); - pos = event_args.NewValue; - - UpdatePos (pos, true); + Value = event_args.NewValue; } private void SmallDecrement () @@ -1054,13 +1047,11 @@ private void SmallDecrement () event_args = new ScrollEventArgs (ScrollEventType.SmallDecrement, pos); OnScroll (event_args); - pos = event_args.NewValue; + Value = event_args.NewValue; - event_args = new ScrollEventArgs (ScrollEventType.EndScroll, pos); + event_args = new ScrollEventArgs (ScrollEventType.EndScroll, Value); OnScroll (event_args); - pos = event_args.NewValue; - - UpdatePos (pos, true); + Value = event_args.NewValue; } private void SetHoldButtonClickTimer () From 77764349b5b11d69f5b67c9f9436bc6d1d28856e Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 22 Mar 2006 10:31:46 +0000 Subject: [PATCH 037/117] * ToolTip.cs: Tooltips get added to their container (when supplied) so they get disposed when the container is disposed. svn path=/trunk/mcs/; revision=58291 --- mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 2 ++ mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 103285c8661c1..e78ea130ec001 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -6,6 +6,8 @@ set the Value property so that ValueChanged gets raised. A possible optimization here would be to make an internal SetValue that doesn't invalidate immediately. + * ToolTip.cs: Tooltips get added to their container (when + supplied) so they get disposed when the container is disposed. 2006-03-22 Peter Dennis Bartok diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs index c7db4e7607338..3d8f64b36a517 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs @@ -168,7 +168,7 @@ internal class ToolTipWindow : Control { } public ToolTip(System.ComponentModel.IContainer cont) : this() { - // Dunno why I'd need the container + cont.Add (this); } ~ToolTip() { From 36cfed0dd5bd7d48dd5861f8c77c81a2cc1e7c58 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 22 Mar 2006 11:24:56 +0000 Subject: [PATCH 038/117] * Form.cs: Don't set topmost when setting the owner if the * handles haven't been created yet. The topmost set will happen when the handles are created. svn path=/trunk/mcs/; revision=58293 --- .../System.Windows.Forms/ChangeLog | 3 +++ .../Managed.Windows.Forms/System.Windows.Forms/Form.cs | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index e78ea130ec001..4a18184b49f99 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -8,6 +8,9 @@ that doesn't invalidate immediately. * ToolTip.cs: Tooltips get added to their container (when supplied) so they get disposed when the container is disposed. + * Form.cs: Don't set topmost when setting the owner if the handles + haven't been created yet. The topmost set will happen when the + handles are created. 2006-03-22 Peter Dennis Bartok diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs index 5564714e2ffb0..e53572e54ebc1 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs @@ -701,10 +701,12 @@ public Form () } owner = value; owner.AddOwnedForm(this); - if (owner != null) { - XplatUI.SetTopmost(this.window.Handle, owner.window.Handle, true); - } else { - XplatUI.SetTopmost(this.window.Handle, IntPtr.Zero, false); + if (IsHandleCreated) { + if (owner != null && owner.IsHandleCreated) { + XplatUI.SetTopmost(this.window.Handle, owner.window.Handle, true); + } else { + XplatUI.SetTopmost(this.window.Handle, IntPtr.Zero, false); + } } } } From b400394c1f6f9e72975b2be3bad329ed2c916ca0 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 22 Mar 2006 11:37:36 +0000 Subject: [PATCH 039/117] - Don't create tooltips for String.Empty. This prevents all these little 2-3 pixel windows from showing up when running nunit-gui and driving me mad. svn path=/trunk/mcs/; revision=58294 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 3 +++ .../Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 4a18184b49f99..d3b70685870ba 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -8,6 +8,9 @@ that doesn't invalidate immediately. * ToolTip.cs: Tooltips get added to their container (when supplied) so they get disposed when the container is disposed. + - Don't create tooltips for String.Empty. This prevents all these + little 2-3 pixel windows from showing up when running nunit-gui + and driving me mad. * Form.cs: Don't set topmost when setting the owner if the handles haven't been created yet. The topmost set will happen when the handles are created. diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs index 3d8f64b36a517..02ed0aa8b5f13 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs @@ -285,7 +285,7 @@ internal class ToolTipWindow : Control { public void SetToolTip(Control control, string caption) { tooltip_strings[control] = caption; - + // no need for duplicates if (!controls.Contains(control)) { control.MouseEnter += new EventHandler(control_MouseEnter); @@ -348,7 +348,7 @@ internal class ToolTipWindow : Control { } text = (string)tooltip_strings[sender]; - if (text != null) { + if (text != null && text.Length > 0) { Size size; size = ThemeEngine.Current.ToolTipSize(tooltip_window, text); From faeb69cda632060c54c62431e8ab2888e10422c1 Mon Sep 17 00:00:00 2001 From: Vladimir Krasnov Date: Wed, 22 Mar 2006 12:50:17 +0000 Subject: [PATCH 040/117] * DataList.cs: fixed RepeatColumns property, added value validation in PrepareControlHierarchy method fixed style applying for AlternatingItem, EditItem and Separator item fixed RenderContents method, if no items exist, no nned to render emty table strructure. svn path=/trunk/mcs/; revision=58295 --- .../System.Web.UI.WebControls/ChangeLog | 8 +++++ .../System.Web.UI.WebControls/DataList.cs | 30 +++++++++++++++---- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog index 7400bcd482686..09179bf4848e8 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog +++ b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog @@ -1,3 +1,11 @@ +2006-03-22 Vladimir Krasnov + + * DataList.cs: fixed RepeatColumns property, added value validation + in PrepareControlHierarchy method fixed style applying for + AlternatingItem, EditItem and Separator item + fixed RenderContents method, if no items exist, no nned to + render emty table strructure. + 2006-03-15 Gonzalo Paniagua Javier * CompareValidator.cs: when searching for the control to compare, use diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataList.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataList.cs index 4a1bf9bb92b76..4767efdc6a58d 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataList.cs +++ b/mcs/class/System.Web/System.Web.UI.WebControls/DataList.cs @@ -310,7 +310,12 @@ public DataList () object o = ViewState ["RepeatColumns"]; return (o == null) ? 0 : (int) o; } - set { ViewState ["RepeatColumns"] = value; } + set { + if (value < 0) + throw new ArgumentOutOfRangeException ("value", "RepeatColumns value has to be 0 for 'not set' or > 0."); + + ViewState ["RepeatColumns"] = value; + } } #if ONLY_1_1 @@ -771,7 +776,7 @@ protected override void PrepareControlHierarchy () case ListItemType.AlternatingItem: if (alt == null) { if (alternatingItemStyle != null) { - alt = new Style (); + alt = new TableItemStyle (); alt.CopyFrom (itemStyle); alt.CopyFrom (alternatingItemStyle); } else { @@ -783,8 +788,13 @@ protected override void PrepareControlHierarchy () ApplyControlStyle (item, alt); break; case ListItemType.EditItem: - item.MergeStyle (editItemStyle); - ApplyControlStyle (item, editItemStyle); + if (editItemStyle != null) { + item.MergeStyle (editItemStyle); + ApplyControlStyle (item, editItemStyle); + } else { + item.MergeStyle (itemStyle); + ApplyControlStyle (item, itemStyle); + } break; case ListItemType.Footer: if (!ShowFooter) { @@ -816,7 +826,14 @@ protected override void PrepareControlHierarchy () } break; case ListItemType.Separator: - ApplyControlStyle (item, separatorStyle); + if (separatorStyle != null) { + item.MergeStyle(separatorStyle); + ApplyControlStyle (item, separatorStyle); + } + else { + item.MergeStyle (itemStyle); + ApplyControlStyle (item, itemStyle); + } break; } } @@ -829,6 +846,9 @@ protected internal #endif override void RenderContents (HtmlTextWriter writer) { + if (Items.Count == 0) + return; + RepeatInfo ri = new RepeatInfo (); ri.RepeatColumns = RepeatColumns; ri.RepeatDirection = RepeatDirection; From 67597881bd4731b3f1c848fc9f8f13e63e7d2c0f Mon Sep 17 00:00:00 2001 From: Raja R Harinath Date: Wed, 22 Mar 2006 13:56:52 +0000 Subject: [PATCH 041/117] In gmcs: Support ParameterDefaultValueAttribute in gmcs. Also applied to mcs to keep code differences small. * attribute.cs (Attribute.GetParameterDefaultValue): New. * typemanager.cs (parameter_default_value_attribute_type): New. * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add CS1908 check. In mcs: Support ParameterDefaultValueAttribute in gmcs. Also applied to mcs to keep code differences small. * attribute.cs (Attribute.GetParameterDefaultValue): New. * typemanager.cs (parameter_default_value_attribute_type): New. * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add CS1908 check. In errors: * gcs1908.cs, gcs1908-2.cs, gcs1908-3.cs, gcs1908-4.cs: New tests for DefaultParameterValueAttribute. In tests: * gtest-262.cs: New test for DefaultParameterValueAttribute. svn path=/trunk/mcs/; revision=58300 --- mcs/errors/ChangeLog | 5 +++++ mcs/errors/gcs1908-2.cs | 8 ++++++++ mcs/errors/gcs1908-3.cs | 8 ++++++++ mcs/errors/gcs1908-4.cs | 8 ++++++++ mcs/errors/gcs1908.cs | 8 ++++++++ mcs/gmcs/ChangeLog | 9 +++++++++ mcs/gmcs/attribute.cs | 5 +++++ mcs/gmcs/parameter.cs | 12 ++++++++++++ mcs/gmcs/typemanager.cs | 5 +++++ mcs/mcs/ChangeLog | 9 +++++++++ mcs/mcs/attribute.cs | 5 +++++ mcs/mcs/parameter.cs | 12 ++++++++++++ mcs/mcs/typemanager.cs | 5 +++++ mcs/tests/ChangeLog | 4 ++++ mcs/tests/gtest-262.cs | 25 +++++++++++++++++++++++++ 15 files changed, 128 insertions(+) create mode 100644 mcs/errors/gcs1908-2.cs create mode 100644 mcs/errors/gcs1908-3.cs create mode 100644 mcs/errors/gcs1908-4.cs create mode 100644 mcs/errors/gcs1908.cs create mode 100644 mcs/tests/gtest-262.cs diff --git a/mcs/errors/ChangeLog b/mcs/errors/ChangeLog index 117e05157bb1a..0597af5db1998 100644 --- a/mcs/errors/ChangeLog +++ b/mcs/errors/ChangeLog @@ -1,3 +1,8 @@ +2006-03-22 Raja R Harinath + + * gcs1908.cs, gcs1908-2.cs, gcs1908-3.cs, gcs1908-4.cs: New tests + for DefaultParameterValueAttribute. + 2006-03-01 Raja R Harinath * cs1540-8.cs: New test from #77627. diff --git a/mcs/errors/gcs1908-2.cs b/mcs/errors/gcs1908-2.cs new file mode 100644 index 0000000000000..92b17e9f08ac3 --- /dev/null +++ b/mcs/errors/gcs1908-2.cs @@ -0,0 +1,8 @@ +// gcs1908.cs: The type of the default value should match the type of the parameter +// Line: + +class Test { + internal void f ([System.Runtime.InteropServices.DefaultParameterValue (null)] short x) + { + } +} diff --git a/mcs/errors/gcs1908-3.cs b/mcs/errors/gcs1908-3.cs new file mode 100644 index 0000000000000..68b1357d52fbe --- /dev/null +++ b/mcs/errors/gcs1908-3.cs @@ -0,0 +1,8 @@ +// gcs1908.cs: The type of the default value should match the type of the parameter +// Line: + +class Test where T : class { + internal void f ([System.Runtime.InteropServices.DefaultParameterValue (null)] T x) + { + } +} diff --git a/mcs/errors/gcs1908-4.cs b/mcs/errors/gcs1908-4.cs new file mode 100644 index 0000000000000..83f39e14ad5f8 --- /dev/null +++ b/mcs/errors/gcs1908-4.cs @@ -0,0 +1,8 @@ +// gcs1908.cs: The type of the default value should match the type of the parameter +// Line: + +class Test { + internal void f ([System.Runtime.InteropServices.DefaultParameterValue ((short) 1)] int x) + { + } +} diff --git a/mcs/errors/gcs1908.cs b/mcs/errors/gcs1908.cs new file mode 100644 index 0000000000000..fa5d731dfee22 --- /dev/null +++ b/mcs/errors/gcs1908.cs @@ -0,0 +1,8 @@ +// gcs1908.cs: The type of the default value should match the type of the parameter +// Line: 5 + +class Test { + internal void f ([System.Runtime.InteropServices.DefaultParameterValue (1)] short x) + { + } +} diff --git a/mcs/gmcs/ChangeLog b/mcs/gmcs/ChangeLog index 2f84a974ccde8..ddbdb26d11a2a 100644 --- a/mcs/gmcs/ChangeLog +++ b/mcs/gmcs/ChangeLog @@ -1,3 +1,12 @@ +2006-03-22 Raja R Harinath + + Support ParameterDefaultValueAttribute in gmcs. Also applied to + mcs to keep code differences small. + * attribute.cs (Attribute.GetParameterDefaultValue): New. + * typemanager.cs (parameter_default_value_attribute_type): New. + * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add + CS1908 check. + 2006-03-22 Martin Baulig * generic.cs diff --git a/mcs/gmcs/attribute.cs b/mcs/gmcs/attribute.cs index adb91ab65b258..97210ed2a737b 100644 --- a/mcs/gmcs/attribute.cs +++ b/mcs/gmcs/attribute.cs @@ -1149,6 +1149,11 @@ public LayoutKind GetLayoutKindValue () return (LayoutKind)pos_values [0]; } + public object GetParameterDefaultValue () + { + return pos_values [0]; + } + /// /// Emit attribute for Attributable symbol /// diff --git a/mcs/gmcs/parameter.cs b/mcs/gmcs/parameter.cs index 0305681b5b14d..93d7da083c518 100644 --- a/mcs/gmcs/parameter.cs +++ b/mcs/gmcs/parameter.cs @@ -255,6 +255,18 @@ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder Report.Warning (3022, 1, a.Location, "CLSCompliant attribute has no meaning when applied to parameters. Try putting it on the method instead"); } + // TypeManager.default_parameter_value_attribute_type is null if !NET_2_0 + if (a.Type == TypeManager.default_parameter_value_attribute_type) { + object val = a.GetParameterDefaultValue (); + if (parameter_type == TypeManager.object_type || + (val == null && !TypeManager.IsValueType (parameter_type)) || + (val != null && TypeManager.TypeToCoreType (val.GetType ()) == parameter_type)) + builder.SetConstant (val); + else + Report.Error (1908, a.Location, "The type of the default value should match the type of the parameter"); + return; + } + base.ApplyAttributeBuilder (a, cb); } diff --git a/mcs/gmcs/typemanager.cs b/mcs/gmcs/typemanager.cs index 8cd99af71b63f..6d13970cc1bd0 100644 --- a/mcs/gmcs/typemanager.cs +++ b/mcs/gmcs/typemanager.cs @@ -90,6 +90,8 @@ public partial class TypeManager { static public Type conditional_attribute_type; static public Type in_attribute_type; static public Type out_attribute_type; + static public Type default_parameter_value_attribute_type; + static public Type anonymous_method_type; static public Type cls_compliant_attribute_type; static public Type typed_reference_type; @@ -978,6 +980,9 @@ public static void InitCoreTypes () param_array_type = CoreLookupType ("System", "ParamArrayAttribute"); in_attribute_type = CoreLookupType ("System.Runtime.InteropServices", "InAttribute"); out_attribute_type = CoreLookupType ("System.Runtime.InteropServices", "OutAttribute"); +#if NET_2_0 + default_parameter_value_attribute_type = CoreLookupType ("System.Runtime.InteropServices", "DefaultParameterValueAttribute"); +#endif typed_reference_type = CoreLookupType ("System", "TypedReference"); arg_iterator_type = CoreLookupType ("System", "ArgIterator"); mbr_type = CoreLookupType ("System", "MarshalByRefObject"); diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog index 188a436f9abfe..859ea30efbcde 100644 --- a/mcs/mcs/ChangeLog +++ b/mcs/mcs/ChangeLog @@ -1,3 +1,12 @@ +2006-03-22 Raja R Harinath + + Support ParameterDefaultValueAttribute in gmcs. Also applied to + mcs to keep code differences small. + * attribute.cs (Attribute.GetParameterDefaultValue): New. + * typemanager.cs (parameter_default_value_attribute_type): New. + * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add + CS1908 check. + 2006-03-21 Marek Safar * expression.cs (StringConcat.Append): Reverted back to no warning state. diff --git a/mcs/mcs/attribute.cs b/mcs/mcs/attribute.cs index 8cb2499e6f965..3bb3a3f01d847 100644 --- a/mcs/mcs/attribute.cs +++ b/mcs/mcs/attribute.cs @@ -1073,6 +1073,11 @@ public override int GetHashCode () return base.GetHashCode (); } + public object GetParameterDefaultValue () + { + return pos_values [0]; + } + /// /// Emit attribute for Attributable symbol /// diff --git a/mcs/mcs/parameter.cs b/mcs/mcs/parameter.cs index c70f27021636e..ff1a60a077b1d 100644 --- a/mcs/mcs/parameter.cs +++ b/mcs/mcs/parameter.cs @@ -254,6 +254,18 @@ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder Report.Warning (3022, 1, a.Location, "CLSCompliant attribute has no meaning when applied to parameters. Try putting it on the method instead"); } + // TypeManager.default_parameter_value_attribute_type is null if !NET_2_0 + if (a.Type == TypeManager.default_parameter_value_attribute_type) { + object val = a.GetParameterDefaultValue (); + if (parameter_type == TypeManager.object_type || + (val == null && !TypeManager.IsValueType (parameter_type)) || + (val != null && TypeManager.TypeToCoreType (val.GetType ()) == parameter_type)) + builder.SetConstant (val); + else + Report.Error (1908, a.Location, "The type of the default value should match the type of the parameter"); + return; + } + base.ApplyAttributeBuilder (a, cb); } diff --git a/mcs/mcs/typemanager.cs b/mcs/mcs/typemanager.cs index f51526486621f..47d7e25bfacf4 100644 --- a/mcs/mcs/typemanager.cs +++ b/mcs/mcs/typemanager.cs @@ -90,6 +90,8 @@ public class TypeManager { static public Type conditional_attribute_type; static public Type in_attribute_type; static public Type out_attribute_type; + static public Type default_parameter_value_attribute_type; + static public Type anonymous_method_type; static public Type cls_compliant_attribute_type; static public Type typed_reference_type; @@ -840,6 +842,9 @@ public static void InitCoreTypes () param_array_type = CoreLookupType ("System", "ParamArrayAttribute"); in_attribute_type = CoreLookupType ("System.Runtime.InteropServices", "InAttribute"); out_attribute_type = CoreLookupType ("System.Runtime.InteropServices", "OutAttribute"); +#if NET_2_0 + default_parameter_value_attribute_type = CoreLookupType ("System.Runtime.InteropServices", "DefaultParameterValueAttribute"); +#endif typed_reference_type = CoreLookupType ("System", "TypedReference"); arg_iterator_type = CoreLookupType ("System", "ArgIterator"); mbr_type = CoreLookupType ("System", "MarshalByRefObject"); diff --git a/mcs/tests/ChangeLog b/mcs/tests/ChangeLog index 9f9717ec49b5c..5ad159e6d9ac7 100644 --- a/mcs/tests/ChangeLog +++ b/mcs/tests/ChangeLog @@ -1,3 +1,7 @@ +2006-03-22 Raja R Harinath + + * gtest-262.cs: New test for DefaultParameterValueAttribute. + 2006-03-20 Raja R Harinath * gtest-260.cs: New test based on #77852. diff --git a/mcs/tests/gtest-262.cs b/mcs/tests/gtest-262.cs new file mode 100644 index 0000000000000..51a31a954bbe7 --- /dev/null +++ b/mcs/tests/gtest-262.cs @@ -0,0 +1,25 @@ +using System; +using System.Reflection; +using System.Runtime.InteropServices; + +public class Test { + public void f1 ([System.Runtime.InteropServices.DefaultParameterValue (null)] object x) {} + public void f2 ([System.Runtime.InteropServices.DefaultParameterValue (null)] string x) {} + public void f3 ([System.Runtime.InteropServices.DefaultParameterValue (null)] Test x) {} + public void f4 ([System.Runtime.InteropServices.DefaultParameterValue (1)] int x) {} + public void f5 ([System.Runtime.InteropServices.DefaultParameterValue ((short) 1)] short x) {} + + static void Main () + { + string problems = ""; + Type t = typeof (Test); + foreach (MethodInfo m in t.GetMethods (BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)) { + ParameterInfo p = m.GetParameters () [0]; + Console.WriteLine (m.Name + " parameter attributes: " + p.Attributes); + if ((p.Attributes & ParameterAttributes.HasDefault) == 0) + problems = problems + " " + m.Name; + if (problems.Length != 0) + throw new Exception ("these functions don't have default values: " + problems); + } + } +} From a4f28e24b6cfa58cebdb51b7514d7bdd1eb3a79c Mon Sep 17 00:00:00 2001 From: Senganal T Date: Wed, 22 Mar 2006 14:40:41 +0000 Subject: [PATCH 042/117] 2006-03-22 Senganal T * Test/System.Data/DataColumnTest2.cs : * Test/System.Data/ConstraintCollectionTest2.cs : - Ensure Constraints are correctly added/removed when Unique property is modified. - Ensure PrimaryKeyConstraint cannot be removed using Remove () - Ensure DataColumn's Unique Propery is modifed when adding/removing constraint * System.Data/DataTable.cs : - PrimaryKey : Set the IsPrimaryKey attribute before Removing from collection. - RemoveUniqueConstraints : Removed. dead code. * System.Data/DataColumn.cs : - Unique : - If adding/removing constraint fails, retain Unique value - Remove redundant code * System.Data/UniqueConstraint.cs : - SetIsPrimaryKey : Added. Sets the value of IsPrimaryKey. - RemoveFromConstraintCollectionCleanup : If constraint is on a single column, then set Unique for that column to false. - CanRemoveFromCollection : Do not remove constraint, if its a PrimaryKey svn path=/trunk/mcs/; revision=58301 --- mcs/class/System.Data/System.Data/ChangeLog | 15 +++++ .../System.Data/System.Data/DataColumn.cs | 56 +++++++------------ .../System.Data/System.Data/DataTable.cs | 26 ++------- .../System.Data/UniqueConstraint.cs | 10 +++- .../System.Data/Test/System.Data/ChangeLog | 9 +++ .../System.Data/ConstraintCollectionTest2.cs | 23 ++++++++ .../Test/System.Data/DataColumnTest2.cs | 17 ++++++ 7 files changed, 100 insertions(+), 56 deletions(-) diff --git a/mcs/class/System.Data/System.Data/ChangeLog b/mcs/class/System.Data/System.Data/ChangeLog index 5f560e6f76907..7d66770d6b047 100644 --- a/mcs/class/System.Data/System.Data/ChangeLog +++ b/mcs/class/System.Data/System.Data/ChangeLog @@ -1,3 +1,18 @@ +2006-03-22 Senganal T + + * DataTable.cs : + - PrimaryKey : Set the IsPrimaryKey attribute before Removing from collection. + - RemoveUniqueConstraints : Removed. dead code. + * DataColumn.cs : + - Unique : + - If adding/removing constraint fails, retain Unique value + - Remove redundant code + * UniqueConstraint.cs : + - SetIsPrimaryKey : Added. Sets the value of IsPrimaryKey. + - RemoveFromConstraintCollectionCleanup : If constraint is on a single column, then + set Unique for that column to false. + - CanRemoveFromCollection : Do not remove constraint, if its a PrimaryKey + 2006-03-20 Senganal T * DataSet.cs : diff --git a/mcs/class/System.Data/System.Data/DataColumn.cs b/mcs/class/System.Data/System.Data/DataColumn.cs index 214f802c8bed4..a6e9ad51c5303 100644 --- a/mcs/class/System.Data/System.Data/DataColumn.cs +++ b/mcs/class/System.Data/System.Data/DataColumn.cs @@ -684,46 +684,32 @@ public bool Unique return _unique; } set { - //NOTE: In .NET 1.1 the Unique property - //is left unchanged when it is added - //to a UniqueConstraint - if(_unique != value) - { - _unique = value; + if (_unique == value) + return; - if( value ) - { + // Set the property value, so that when adding/removing the constraint + // we dont run into recursive issues. + _unique = value; + + if (_table == null) + return; + + try { + if (value) { if (Expression != null && Expression != String.Empty) throw new ArgumentException("Cannot change Unique property for the expression column."); - if( _table != null ) - { - UniqueConstraint uc = new UniqueConstraint(this); - _table.Constraints.Add(uc); - } - } - else - { - if( _table != null ) - { - ConstraintCollection cc = _table.Constraints; - //foreach (Constraint c in cc) - for (int i = 0; i < cc.Count; i++) - { - Constraint c = cc[i]; - if (c is UniqueConstraint) - { - DataColumn[] cols = ((UniqueConstraint)c).Columns; - - if (cols.Length == 1 && cols[0] == this) - { - cc.Remove(c); - } - } - } - } - } + _table.Constraints.Add(null, this, false); + } else { + + UniqueConstraint uc = UniqueConstraint.GetUniqueConstraintForColumnSet (_table.Constraints, + new DataColumn[] {this}); + _table.Constraints.Remove (uc); + } + } catch (Exception e) { + _unique = !value; + throw e; } } } diff --git a/mcs/class/System.Data/System.Data/DataTable.cs b/mcs/class/System.Data/System.Data/DataTable.cs index c6bd79c67d6a1..22784a2cdefa2 100644 --- a/mcs/class/System.Data/System.Data/DataTable.cs +++ b/mcs/class/System.Data/System.Data/DataTable.cs @@ -493,6 +493,7 @@ internal void ChangingDataRow (DataRow dr, DataRowAction action) set { if (value == null || value.Length == 0) { if (_primaryKeyConstraint != null) { + _primaryKeyConstraint.SetIsPrimaryKey (false); Constraints.Remove(_primaryKeyConstraint); _primaryKeyConstraint = null; } @@ -529,14 +530,15 @@ internal void ChangingDataRow (DataRow dr, DataRowAction action) //Remove the existing primary key if (_primaryKeyConstraint != null) { - Constraints.Remove(_primaryKeyConstraint); + _primaryKeyConstraint.SetIsPrimaryKey (false); + Constraints.Remove (_primaryKeyConstraint); _primaryKeyConstraint = null; } - + //set the constraint as the new primary key - UniqueConstraint.SetAsPrimaryKey(this.Constraints, uc); + UniqueConstraint.SetAsPrimaryKey (Constraints, uc); _primaryKeyConstraint = uc; - + for (int j=0; j < uc.Columns.Length; ++j) uc.Columns[j].AllowDBNull = false; } @@ -1964,22 +1966,6 @@ public void WriteXmlSchema (string fileName) #endregion // Events - /// - /// Removes all UniqueConstraints - /// - private void RemoveUniqueConstraints () - { - foreach (Constraint Cons in Constraints) { - - if (Cons is UniqueConstraint) { - Constraints.Remove (Cons); - break; - } - } - - UniqueConstraint.SetAsPrimaryKey(this.Constraints, null); - } - internal static DataColumn[] ParseSortString (DataTable table, string sort, out ListSortDirection[] sortDirections, bool rejectNoResult) { DataColumn[] sortColumns = _emptyColumnArray; diff --git a/mcs/class/System.Data/System.Data/UniqueConstraint.cs b/mcs/class/System.Data/System.Data/UniqueConstraint.cs index 480cbe100e0ff..03466efd2f6d2 100644 --- a/mcs/class/System.Data/System.Data/UniqueConstraint.cs +++ b/mcs/class/System.Data/System.Data/UniqueConstraint.cs @@ -330,6 +330,11 @@ internal override void FinishInit (DataTable _setTable) #region Methods + internal void SetIsPrimaryKey (bool value) + { + _isPrimaryKey = value; + } + public override bool Equals(object key2) { UniqueConstraint cst = key2 as UniqueConstraint; @@ -401,6 +406,9 @@ public override int GetHashCode() internal override void RemoveFromConstraintCollectionCleanup( ConstraintCollection collection) { + if (Columns.Length == 1) + Columns [0].Unique = false; + _belongsToCollection = false; Index index = Index; Index = null; @@ -466,7 +474,7 @@ internal override bool IsColumnContained(DataColumn column) } internal override bool CanRemoveFromCollection(ConstraintCollection col, bool shouldThrow){ - if (Equals(col.Table.PrimaryKey)){ + if (IsPrimaryKey) { if (shouldThrow) throw new ArgumentException("Cannot remove unique constraint since it's the primary key of a table."); diff --git a/mcs/class/System.Data/Test/System.Data/ChangeLog b/mcs/class/System.Data/Test/System.Data/ChangeLog index d7eb2b870723f..713828e5211b8 100644 --- a/mcs/class/System.Data/Test/System.Data/ChangeLog +++ b/mcs/class/System.Data/Test/System.Data/ChangeLog @@ -1,3 +1,12 @@ +2006-03-22 Senganal T + + * DataColumnTest2.cs : + * ConstraintCollectionTest2.cs : + - Ensure Constraints are correctly added/removed when Unique + property is modified. + - Ensure PrimaryKeyConstraint cannot be removed using Remove () + - Ensure DataColumn's Unique Propery is modifed when adding/removing constraint + 2006-03-20 Senganal T * DataSetTest2.cs diff --git a/mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest2.cs b/mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest2.cs index 78cba0b2cfec5..c9f8064935d57 100644 --- a/mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest2.cs +++ b/mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest2.cs @@ -282,6 +282,29 @@ public void Add_ConstraintFirst_RelationNext () Assert.AreEqual(0, dt.Constraints.Count, "CN27"); } + [Test] public void Remove_CheckUnique () + { + DataTable table = new DataTable (); + DataColumn col1 = table.Columns.Add ("col1"); + DataColumn col2 = table.Columns.Add ("col2"); + + Assert.IsFalse (col1.Unique, "#1"); + + Constraint uc = table.Constraints.Add ("", col1, false); + Assert.IsTrue (col1.Unique, "#2 col shud be set to unique"); + + table.Constraints.Remove (uc); + Assert.IsFalse (col1.Unique, "#3 col should no longer be unique"); + + table.PrimaryKey = new DataColumn[] {col2}; + + try { + table.Constraints.Remove (table.Constraints [0]); + Assert.Fail ("#4 Cannot Remove PrimaryKey"); + } catch (ArgumentException) { + } + } + [Test] public void Remove_ByNameSimple() { DataTable dt = DataProvider.CreateUniqueConstraint(); diff --git a/mcs/class/System.Data/Test/System.Data/DataColumnTest2.cs b/mcs/class/System.Data/Test/System.Data/DataColumnTest2.cs index 76186b2a27b37..8b189c05a53e1 100644 --- a/mcs/class/System.Data/Test/System.Data/DataColumnTest2.cs +++ b/mcs/class/System.Data/Test/System.Data/DataColumnTest2.cs @@ -398,6 +398,23 @@ namespace MonoTests.System.Data Assert.AreEqual(true, dc.Unique, "DC45"); } + [Test] public void Unique_PrimaryKey() + { + DataTable table = new DataTable ("Table1"); + DataColumn col = table.Columns.Add ("col1"); + table.PrimaryKey = new DataColumn [] {col}; + + Assert.IsTrue (col.Unique, "#1"); + + try { + col.Unique = false; + Assert.Fail ("#2 cannot remove uniqueness of a primarykey"); + } catch (ArgumentException e) { + } + + Assert.IsTrue (col.Unique, "#3"); + } + [Test] public void ctor() { DataColumn dc; From 9f742fa493c1f2400151475910e6762f477e8d84 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Wed, 22 Mar 2006 15:06:24 +0000 Subject: [PATCH 043/117] 2006-03-22 Mike Kestner * FileDialog.cs: bugfixes for the toolbar. Use PushButtons instead of ToggleButtons. (De)Sensitize the Back button around a stack count of 1, not 0. Update ButtonSize based on a pixel count of the win32 control. Adjust the toolbar size/location for new button size. svn path=/trunk/mcs/; revision=58303 --- .../System.Windows.Forms/ChangeLog | 7 +++++++ .../System.Windows.Forms/FileDialog.cs | 17 ++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index d3b70685870ba..88ab74028ec48 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,10 @@ +2006-03-22 Mike Kestner + + * FileDialog.cs: bugfixes for the toolbar. Use PushButtons instead of + ToggleButtons. (De)Sensitize the Back button around a stack count of + 1, not 0. Update ButtonSize based on a pixel count of the win32 + control. Adjust the toolbar size/location for new button size. + 2006-03-22 Jackson Harper * XplatUIX11.cs: Don't handle configurenotifys if PostQuitState is diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs index d4e6d225ed6a0..c9dd85700a571 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs @@ -175,14 +175,14 @@ internal FileDialog () upToolBarButton, newdirToolBarButton, menueToolBarButton}); - smallButtonToolBar.ButtonSize = new Size (21, 16); // 21, 16 + smallButtonToolBar.ButtonSize = new Size (24, 24); // 21, 16 smallButtonToolBar.Divider = false; smallButtonToolBar.Dock = DockStyle.None; smallButtonToolBar.DropDownArrows = true; smallButtonToolBar.ImageList = imageListTopToolbar; - smallButtonToolBar.Location = new Point (372, 8); + smallButtonToolBar.Location = new Point (372, 6); smallButtonToolBar.ShowToolTips = true; - smallButtonToolBar.Size = new Size (110, 20); + smallButtonToolBar.Size = new Size (140, 28); smallButtonToolBar.TabIndex = 2; smallButtonToolBar.TextAlign = ToolBarTextAlign.Right; @@ -238,15 +238,15 @@ internal FileDialog () // backToolBarButton backToolBarButton.ImageIndex = 0; backToolBarButton.Enabled = false; - backToolBarButton.Style = ToolBarButtonStyle.ToggleButton; + backToolBarButton.Style = ToolBarButtonStyle.PushButton; // upToolBarButton upToolBarButton.ImageIndex = 1; - upToolBarButton.Style = ToolBarButtonStyle.ToggleButton; + upToolBarButton.Style = ToolBarButtonStyle.PushButton; // newdirToolBarButton newdirToolBarButton.ImageIndex = 2; - newdirToolBarButton.Style = ToolBarButtonStyle.ToggleButton; + newdirToolBarButton.Style = ToolBarButtonStyle.PushButton; // menueToolBarButton menueToolBarButton.ImageIndex = 3; @@ -1087,7 +1087,7 @@ private void ForceDialogEnd () private void PushDirectory (object directoryInfo_or_string) { directoryStack.Push (directoryInfo_or_string); - backToolBarButton.Enabled = true; + backToolBarButton.Enabled = (directoryStack.Count > 1); } private void PopDirectory () @@ -1113,8 +1113,7 @@ private void PopDirectory () current_special_case = directoryInfo_or_string as string; } - if (directoryStack.Count == 0) - backToolBarButton.Enabled = false; + backToolBarButton.Enabled = (directoryStack.Count > 1); dirComboBox.CurrentPath = currentDirectoryName_or_special_case; From accabe5fe8d84132906b75a5e19597764f6ad098 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Wed, 22 Mar 2006 15:41:41 +0000 Subject: [PATCH 044/117] 2006-03-22 Mike Kestner * ListView.cs: hook into Peter's new ResetMouseHover capability to fix HoverSelection. Fixes #77836. svn path=/trunk/mcs/; revision=58304 --- .../System.Windows.Forms/ChangeLog | 5 +++++ .../System.Windows.Forms/ListView.cs | 20 ++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 88ab74028ec48..7f50392adb63d 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2006-03-22 Mike Kestner + + * ListView.cs: hook into Peter's new ResetMouseHover capability to fix + HoverSelection. Fixes #77836. + 2006-03-22 Mike Kestner * FileDialog.cs: bugfixes for the toolbar. Use PushButtons instead of diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs index f2f5a086b51a3..50e94608ca94f 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs @@ -1159,6 +1159,7 @@ internal class ItemControl : Control { ListView owner; ListViewItem clicked_item; ListViewItem last_clicked_item; + bool hover_processed = false; public ItemControl (ListView owner) { @@ -1167,6 +1168,7 @@ public ItemControl (ListView owner) KeyDown += new KeyEventHandler (ItemsKeyDown); KeyUp += new KeyEventHandler (ItemsKeyUp); MouseDown += new MouseEventHandler(ItemsMouseDown); + MouseMove += new MouseEventHandler(ItemsMouseMove); MouseHover += new EventHandler(ItemsMouseHover); MouseUp += new MouseEventHandler(ItemsMouseUp); Paint += new PaintEventHandler (ItemsPaint); @@ -1247,11 +1249,27 @@ private void ItemsMouseDown (object sender, MouseEventArgs me) } } + private void ItemsMouseMove (object sender, MouseEventArgs me) + { + if (owner.HoverSelection && hover_processed) { + + Point pt = PointToClient (Control.MousePosition); + ListViewItem item = owner.GetItemAt (pt.X, pt.Y); + if (item == null || item.Selected) + return; + + hover_processed = false; + XplatUI.ResetMouseHover (Handle); + } + } + + private void ItemsMouseHover (object sender, EventArgs e) { - if (Capture || !owner.hover_selection) + if (Capture || !owner.HoverSelection) return; + hover_processed = true; Point pt = PointToClient (Control.MousePosition); ListViewItem item = owner.GetItemAt (pt.X, pt.Y); From ee71c42d5a9f1c7d70e921cf5f4151b89272736c Mon Sep 17 00:00:00 2001 From: Paolo Molaro Date: Wed, 22 Mar 2006 17:26:14 +0000 Subject: [PATCH 045/117] Wed Mar 22 18:25:18 CET 2006 Paolo Molaro * mini.c: fixed issue with mismatch when an icall is registered with multiple names but same address. svn path=/trunk/mono/; revision=58305 --- mono/mini/ChangeLog | 5 +++++ mono/mini/mini.c | 11 +++++++++-- mono/tests/Makefile.am | 1 + mono/tests/test-arr.cs | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 mono/tests/test-arr.cs diff --git a/mono/mini/ChangeLog b/mono/mini/ChangeLog index 9ac566da03aad..1a7b4d0f4e9f8 100644 --- a/mono/mini/ChangeLog +++ b/mono/mini/ChangeLog @@ -1,4 +1,9 @@ +Wed Mar 22 18:25:18 CET 2006 Paolo Molaro + + * mini.c: fixed issue with mismatch when an icall is registered + with multiple names but same address. + Tue Mar 21 15:59:57 CET 2006 Paolo Molaro * declsec.c, mini-exceptions.c: use write barrier to set reference diff --git a/mono/mini/mini.c b/mono/mini/mini.c index 9b057b35fdb50..7eebe56decc2c 100644 --- a/mono/mini/mini.c +++ b/mono/mini/mini.c @@ -9378,8 +9378,15 @@ mono_codegen (MonoCompile *cfg) */ ; else { - patch_info->type = MONO_PATCH_INFO_INTERNAL_METHOD; - patch_info->data.name = info->name; + /* for these array methods we currently register the same function pointer + * since it's a vararg function. But this means that mono_find_jit_icall_by_addr () + * will return the incorrect one depending on the order they are registered. + * See tests/test-arr.cs + */ + if (strstr (info->name, "ves_array_new_va_") == NULL && strstr (info->name, "ves_array_element_address_") == NULL) { + patch_info->type = MONO_PATCH_INFO_INTERNAL_METHOD; + patch_info->data.name = info->name; + } } } else { diff --git a/mono/tests/Makefile.am b/mono/tests/Makefile.am index 2377e12871743..fa7cfa1cefaa2 100644 --- a/mono/tests/Makefile.am +++ b/mono/tests/Makefile.am @@ -161,6 +161,7 @@ TEST_CS_SRC= \ inctest.cs \ bound.cs \ array-invoke.cs \ + test-arr.cs \ decimal.cs \ decimal-array.cs \ marshal.cs \ diff --git a/mono/tests/test-arr.cs b/mono/tests/test-arr.cs new file mode 100644 index 0000000000000..60123a21b800a --- /dev/null +++ b/mono/tests/test-arr.cs @@ -0,0 +1,32 @@ +using System; + +class T { + + private static int[,,] bitrateTable = new int[,,] + { //table + { //V1 + {0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, -1}, //LI + {0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, -1}, //LII + {0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1} //LIII + }, + { //V2 + {0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, -1}, //LI + {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, -1}, //LII + {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, -1} //LIII + } + }; + + private static int[,] samplingRateTable =new int[,] + { //table + {44100, 48000, 32000, 0}, //V1 + {22050, 24000, 16000, 0}, //V2 + {11025, 12000, 8000, 0} //V3 + }; + + static int Main () { + if (bitrateTable [0, 1, 2] == 48 && samplingRateTable [1, 2] == 16000) + return 0; + return 1; + } +} + From 2e24181496a3e3727f402d6a005990d50531d68a Mon Sep 17 00:00:00 2001 From: Alexander Olk Date: Wed, 22 Mar 2006 18:13:26 +0000 Subject: [PATCH 046/117] 2006-03-22 Alexander Olk * ColorDialog.cs: - Corrected behaviour of Color, AllowFullOpen, FullOpen, CustomColors and ShowHelp properties - Some internal rewrites to get better results when using the ColorMatrix svn path=/trunk/mcs/; revision=58306 --- .../System.Windows.Forms/ChangeLog | 8 + .../System.Windows.Forms/ColorDialog.cs | 272 ++++++++++-------- 2 files changed, 165 insertions(+), 115 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 7f50392adb63d..dd7d6c13a89b3 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,11 @@ +2006-03-22 Alexander Olk + + * ColorDialog.cs: + - Corrected behaviour of Color, AllowFullOpen, FullOpen, + CustomColors and ShowHelp properties + - Some internal rewrites to get better results when using the + ColorMatrix + 2006-03-22 Mike Kestner * ListView.cs: hook into Peter's new ResetMouseHover capability to fix diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColorDialog.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColorDialog.cs index e2bcd2c4f9208..53a0ef554a2a9 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColorDialog.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColorDialog.cs @@ -37,7 +37,7 @@ public class ColorDialog : CommonDialog { #region Local Variables private bool allowFullOpen = true; private bool anyColor = false; - private Color color = Color.Black; + private Color color; private int[] customColors = null; private bool fullOpen = false; private bool showHelp = false; @@ -283,27 +283,11 @@ public ColorDialog () : base() form.ResumeLayout (false); - brightnessControl.ColorToShow = selectedColorPanel.BackColor; - - redTextBox.Text = selectedColorPanel.BackColor.R.ToString (); - greenTextBox.Text = selectedColorPanel.BackColor.G.ToString (); - blueTextBox.Text = selectedColorPanel.BackColor.B.ToString (); - - HSB hsb = HSB.RGB2HSB (selectedColorPanel.BackColor); - hueTextBox.Text = hsb.hue.ToString (); - satTextBox.Text = hsb.sat.ToString (); - briTextBox.Text = hsb.bri.ToString (); - - if (!allowFullOpen) - defineColoursButton.Enabled = false; - - if (fullOpen) - DoButtonDefineColours (); + Color = Color.Black; defineColoursButton.Click += new EventHandler (OnClickButtonDefineColours); addColoursButton.Click += new EventHandler (OnClickButtonAddColours); - if (showHelp) - helpButton.Click += new EventHandler (OnClickHelpButton); + helpButton.Click += new EventHandler (OnClickHelpButton); cancelButton.Click += new EventHandler (OnClickCancelButton); okButton.Click += new EventHandler (OnClickOkButton); @@ -323,7 +307,11 @@ public ColorDialog () : base() } set { - color = value; + if (color != value) { + color = value; + + baseColorControl.SetColor (color); + } } } @@ -334,7 +322,14 @@ public ColorDialog () : base() } set { - allowFullOpen = value; + if (allowFullOpen != value) { + allowFullOpen = value; + + if (!allowFullOpen) + defineColoursButton.Enabled = false; + else + defineColoursButton.Enabled = true; + } } } @@ -359,7 +354,22 @@ public ColorDialog () : base() } set { - fullOpen = value; + if (fullOpen != value) { + fullOpen = value; + + if (fullOpen && allowFullOpen) { + defineColoursButton.Enabled = false; + + colorMatrixControl.ColorToShow = baseColorControl.ColorToShow; + + form.Size = new Size (448, 332); + } else { + if (allowFullOpen) + defineColoursButton.Enabled = true; + + form.Size = new Size (221, 332); // 300 + } + } } } @@ -371,7 +381,11 @@ public ColorDialog () : base() } set { - customColors = value; + if (allowFullOpen) { + customColors = value; + + baseColorControl.SetCustomColors (); + } } } @@ -382,11 +396,13 @@ public ColorDialog () : base() } set { - showHelp = value; - if (showHelp) - helpButton.Show (); - else - helpButton.Hide (); + if (showHelp != value) { + showHelp = value; + if (showHelp) + helpButton.Show (); + else + helpButton.Hide (); + } } } @@ -405,12 +421,12 @@ public ColorDialog () : base() #region Public Instance Methods public override void Reset () { - allowFullOpen = true; + AllowFullOpen = true; anyColor = false; - color = Color.Black; - customColors = null; - fullOpen = false; - showHelp = false; + Color = Color.Black; + CustomColors = null; + FullOpen = false; + ShowHelp = false; solidColorOnly = false; } @@ -442,9 +458,6 @@ protected override bool RunDialog (IntPtr hwndOwner) // currently needed, otherwise there are a lot of drawing artefacts/transparent controls if the same dialog gets opened again form.Refresh (); - if (customColors != null) - baseColorControl.SetCustomColors (); - return true; } #endregion // Protected Instance Methods @@ -460,25 +473,20 @@ void OnClickOkButton (object sender, EventArgs e) form.DialogResult = DialogResult.OK; } - void OnClickButtonDefineColours (object sender, EventArgs e) - { - DoButtonDefineColours (); - } - - void DoButtonDefineColours () + void OnClickButtonAddColours (object sender, EventArgs e) { - defineColoursButton.Enabled = false; - - fullOpen = true; - - colorMatrixControl.ColorToShow = baseColorControl.ColorToShow; - - form.ClientSize = new Size (448, 332); + baseColorControl.SetUserColor (selectedColorPanel.BackColor); } - void OnClickButtonAddColours (object sender, EventArgs e) + void OnClickButtonDefineColours (object sender, EventArgs e) { - baseColorControl.SetUserColor (selectedColorPanel.BackColor); + if (allowFullOpen) { + defineColoursButton.Enabled = false; + + colorMatrixControl.ColorToShow = baseColorControl.ColorToShow; + + form.Size = new Size (448, 332); + } } // FIXME: Is this correct ? @@ -598,32 +606,31 @@ void TextChangedTextBoxes (object sender) } } - private void UpdateControls (Color acolor) + internal void UpdateControls (Color acolor) { - color = acolor; selectedColorPanel.BackColor = acolor; colorMatrixControl.ColorToShow = acolor; brightnessControl.ColorToShow = acolor; triangleControl.ColorToShow = acolor; } - private void UpdateRGBTextBoxes (Color color) + internal void UpdateRGBTextBoxes (Color acolor) { - redTextBox.Text = color.R.ToString (); - greenTextBox.Text = color.G.ToString (); - blueTextBox.Text = color.B.ToString (); + redTextBox.Text = acolor.R.ToString (); + greenTextBox.Text = acolor.G.ToString (); + blueTextBox.Text = acolor.B.ToString (); } - private void UpdateHSBTextBoxes (Color color) + internal void UpdateHSBTextBoxes (Color acolor) { - HSB hsb = HSB.RGB2HSB (color); + HSB hsb = HSB.RGB2HSB (acolor); hueTextBox.Text = hsb.hue.ToString (); satTextBox.Text = hsb.sat.ToString (); briTextBox.Text = hsb.bri.ToString (); } - private void UpdateFromHSBTextBoxes () + internal void UpdateFromHSBTextBoxes () { Color col = HSB.HSB2RGB (System.Convert.ToInt32 (hueTextBox.Text), System.Convert.ToInt32 (satTextBox.Text), @@ -633,7 +640,7 @@ private void UpdateFromHSBTextBoxes () UpdateRGBTextBoxes (col); } - private void UpdateFromRGBTextBoxes () + internal void UpdateFromRGBTextBoxes () { Color col = Color.FromArgb (System.Convert.ToInt32 (redTextBox.Text), System.Convert.ToInt32 (greenTextBox.Text), @@ -707,8 +714,8 @@ public static Color HSB2RGB (int hue, int saturation, int brightness) d2 = (L <= 0.5f) ? L * (1.0f + S) : L + S - (L * S); d1 = 2.0f * L - d2; - float[] d3 = new float [] { H + 1.0f / 3.0f , H, H - 1.0f / 3.0f }; - float[] rgb = new float [] { 0,0,0 }; + float[] d3 = new float [] { H + 1.0f / 3.0f , H, H - 1.0f / 3.0f }; + float[] rgb = new float [] { 0,0,0 }; for (int i = 0; i < 3; i++) { if (d3 [i] < 0) @@ -784,7 +791,7 @@ public static void TestColor (Color color) internal class BaseColorControl : Control { internal class SmallColorControl : Control { - private Color color; + private Color internalcolor; private bool isSelected = false; @@ -792,7 +799,7 @@ public SmallColorControl (Color color) { SuspendLayout (); - this.color = color; + this.internalcolor = color; Size = new Size (25, 23); @@ -811,14 +818,14 @@ public SmallColorControl (Color color) } } - public Color Color { + public Color InternalColor { set { - color = value; + internalcolor = value; Invalidate (); } get { - return color; + return internalcolor; } } @@ -826,9 +833,9 @@ protected override void OnPaint (PaintEventArgs pe) { base.OnPaint (pe); - pe.Graphics.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (BackColor), 0, 0, 26, 23); +// pe.Graphics.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (BackColor), 0, 0, 26, 23); - pe.Graphics.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (color), + pe.Graphics.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (internalcolor), new Rectangle (4, 4, 17, 15)); DrawBorder (pe.Graphics, new Rectangle (4, 4, 17, 15)); @@ -1302,22 +1309,16 @@ public BaseColorControl (ColorDialog colorDialog) Size = new Size (212, 238); ResumeLayout (false); - - selectedSmallColorControl = smallColorControl [46]; // default, Black - selectedSmallColorControl.IsSelected = true; - - CheckIfColorIsInPanel (); } - private void CheckIfColorIsInPanel () + private void CheckIfColorIsInPanel (Color color) { - if (colorDialog.Color != Color.Black) { - // check if we have a panel with a BackColor = ColorDialog.Color... - for (int i = 0; i < smallColorControl.Length; i++) { - if (smallColorControl [i].BackColor == colorDialog.Color) { - selectedSmallColorControl = smallColorControl [i]; - break; - } + // check if we have a panel with a BackColor = color... + for (int i = 0; i < smallColorControl.Length; i++) { + if (smallColorControl [i].InternalColor == color) { + selectedSmallColorControl = smallColorControl [i]; + selectedSmallColorControl.IsSelected = true; + break; } } } @@ -1330,22 +1331,37 @@ void OnSmallColorControlClick (object sender, EventArgs e) selectedSmallColorControl = (SmallColorControl)sender; - TriangleControl.CurrentBrightness = HSB.Brightness (selectedSmallColorControl.Color); + TriangleControl.CurrentBrightness = HSB.Brightness (selectedSmallColorControl.InternalColor); - colorDialog.UpdateControls (selectedSmallColorControl.Color); - colorDialog.UpdateRGBTextBoxes (selectedSmallColorControl.Color); - colorDialog.UpdateHSBTextBoxes (selectedSmallColorControl.Color); + colorDialog.UpdateControls (selectedSmallColorControl.InternalColor); + colorDialog.UpdateRGBTextBoxes (selectedSmallColorControl.InternalColor); + colorDialog.UpdateHSBTextBoxes (selectedSmallColorControl.InternalColor); } public Color ColorToShow { get { - return selectedSmallColorControl.Color; + return selectedSmallColorControl.InternalColor; } } + + public void SetColor (Color acolor) + { + if (selectedSmallColorControl != null) + selectedSmallColorControl.IsSelected = false; + + CheckIfColorIsInPanel (acolor); + + TriangleControl.CurrentBrightness = HSB.Brightness (acolor); + + colorDialog.UpdateControls (acolor); + colorDialog.UpdateRGBTextBoxes (acolor); + colorDialog.UpdateHSBTextBoxes (acolor); + } + public void SetUserColor (Color col) { - userSmallColorControl [currentlyUsedUserSmallColorControl].Color = col; + userSmallColorControl [currentlyUsedUserSmallColorControl].InternalColor = col; // check if this.customColors already exists if (customColors == null) { @@ -1370,8 +1386,14 @@ public void SetCustomColors () { int[] customColors = colorDialog.CustomColors; - for (int i = 0; i < customColors.Length; i++) { - userSmallColorControl [i].Color = Color.FromArgb (customColors [i]); + if (customColors != null) { + for (int i = 0; i < customColors.Length; i++) { + userSmallColorControl [i].InternalColor = Color.FromArgb (customColors [i]); + } + } else { + for (int i = 0; i < userSmallColorControl.Length; i++) { + userSmallColorControl [i].InternalColor = Color.White; + } } } } @@ -1380,19 +1402,19 @@ internal class ColorMatrixControl : Panel { internal class DrawingBitmap { private Bitmap bitmap; - public DrawingBitmap () + public DrawingBitmap (Size size) { - bitmap = new Bitmap (180, 191); + bitmap = new Bitmap (size.Width, size.Height); - float hueadd = 241.0f / 178.0f; - float satsub = 241.0f / 189.0f; + float hueadd = 241.0f / (size.Width - 1); + float satsub = 241.0f / (size.Height - 1); float satpos = 240.0f; // paint the matrix to the bitmap - for (int height = 0; height < 191; height++) { + for (int height = 0; height < size.Height; height++) { float huepos = 0.0f; - for (int width = 0; width < 180; width++) { + for (int width = 0; width < size.Width; width++) { HSB hsb = new HSB (); hsb.hue = (int)huepos; @@ -1466,7 +1488,7 @@ public void Draw () } } - private DrawingBitmap drawingBitmap = new DrawingBitmap( ); + private DrawingBitmap drawingBitmap = null; private CrossCursor crossCursor = new CrossCursor(); @@ -1479,8 +1501,8 @@ public void Draw () private int currentXPos; private int currentYPos; - private const float xstep = 240.0f/178.0f; - private const float ystep = 240.0f/189.0f; + private float xstep; + private float ystep; private ColorDialog colorDialog; @@ -1495,11 +1517,12 @@ public ColorMatrixControl (ColorDialog colorDialog) Size = new Size (179, 190); TabIndex = 0; TabStop = false; - //BackColor = SystemColors.Control; - Size = new Size (179, 190); ResumeLayout (false); + xstep = 241.0f / (ClientSize.Width - 1); + ystep = 241.0f / (ClientSize.Height - 1); + SetStyle (ControlStyles.DoubleBuffer, true); SetStyle (ControlStyles.AllPaintingInWmPaint, true); SetStyle (ControlStyles.UserPaint, true); @@ -1507,6 +1530,9 @@ public ColorMatrixControl (ColorDialog colorDialog) protected override void OnPaint (PaintEventArgs e) { + if (drawingBitmap == null) + drawingBitmap = new DrawingBitmap (ClientSize); + Draw (e); base.OnPaint (e); @@ -1514,7 +1540,7 @@ protected override void OnPaint (PaintEventArgs e) private void Draw (PaintEventArgs e) { - e.Graphics.DrawImage (drawingBitmap.Bitmap, 0, 0); + e.Graphics.DrawImage (drawingBitmap.Bitmap, ClientRectangle.X, ClientRectangle.Y); // drawCross is false if the mouse gets moved... if (drawCross) { @@ -1541,7 +1567,7 @@ protected override void OnMouseDown (MouseEventArgs e) protected override void OnMouseMove (MouseEventArgs e) { if (mouseButtonDown) - if ((e.X < 178 && e.X >= 0) && (e.Y < 189 && e.Y >= 0)) { + if ((e.X < ClientSize.Width && e.X >= 0) && (e.Y < ClientSize.Height && e.Y >= 0)) { currentXPos = e.X; currentYPos = e.Y; UpdateControls (); @@ -1560,12 +1586,19 @@ protected override void OnMouseUp (MouseEventArgs e) public Color ColorToShow { set { - color = value; + ComputePos (value); + } + } + + private void ComputePos (Color acolor) + { + if (acolor != color) { + color = acolor; HSB hsb = HSB.RGB2HSB (color); currentXPos = (int)((float)hsb.hue / xstep); - currentYPos = 189 - (int)((float)hsb.sat / ystep); + currentYPos = ClientSize.Height - 1 - (int)((float)hsb.sat / ystep); if (currentXPos < 0) currentXPos = 0; @@ -1574,8 +1607,6 @@ protected override void OnMouseUp (MouseEventArgs e) Invalidate (); Update (); - - UpdateControls (); } } @@ -1597,7 +1628,6 @@ private void UpdateControls () // update saturation text box int satvalue = (240 - ((int)((float)currentYPos * ystep))); - satvalue = satvalue == 240 ? 239 : satvalue; colorDialog.satTextBox.Text = satvalue.ToString (); // update hue text box @@ -1652,13 +1682,11 @@ public void Draw (int hue, int sat) private DrawingBitmap bitmap; - private Color color; - - private ColorDialog colorDialog; + private ColorDialog colorDialog = null; - public BrightnessControl (ColorDialog colorDialogPanel) + public BrightnessControl (ColorDialog colorDialog) { - this.colorDialog = colorDialogPanel; + this.colorDialog = colorDialog; bitmap = new DrawingBitmap (); @@ -1670,6 +1698,7 @@ public BrightnessControl (ColorDialog colorDialogPanel) TabIndex = 0; TabStop = false; Size = new Size (14, 190); + ResumeLayout (false); SetStyle (ControlStyles.DoubleBuffer, true); @@ -1837,6 +1866,7 @@ protected override void OnMouseUp (MouseEventArgs e) currentTrianglePosition = 186 - (int)tmp + 9; colorDialog.briTextBox.Text = TrianglePosition.ToString (); + colorDialog.UpdateFromHSBTextBoxes (); Invalidate (); @@ -1846,9 +1876,21 @@ protected override void OnMouseUp (MouseEventArgs e) public Color ColorToShow { set { - TrianglePosition = HSB.Brightness (value); + SetColor (value); } } + + public void SetColor (Color color) + { + int pos_raw = HSB.Brightness (color); + + float tmp = (float)pos_raw / briStep; + currentTrianglePosition = 186 - (int)tmp + 9; + + colorDialog.briTextBox.Text = TrianglePosition.ToString (); + + Invalidate (); + } } #endregion } From 45cbbab76f2b8f2bd9ddfe4c1830afe71df47adb Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Wed, 22 Mar 2006 18:40:21 +0000 Subject: [PATCH 047/117] 2006-03-22 Martin Baulig * reflection.c (fieldbuilder_to_mono_class_field): Don't store the allocated `MonoClassField *' in `fb->handle'. svn path=/trunk/mono/; revision=58307 --- mono/metadata/ChangeLog | 4 ++++ mono/metadata/reflection.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mono/metadata/ChangeLog b/mono/metadata/ChangeLog index 6df8761a8d388..b517b56e0f44a 100644 --- a/mono/metadata/ChangeLog +++ b/mono/metadata/ChangeLog @@ -1,3 +1,7 @@ +2006-03-22 Martin Baulig + + * reflection.c (fieldbuilder_to_mono_class_field): Don't store the + allocated `MonoClassField *' in `fb->handle'. Tue Mar 21 17:19:37 CET 2006 Paolo Molaro diff --git a/mono/metadata/reflection.c b/mono/metadata/reflection.c index 75fcf1ad0a191..83e51d6cb6dd0 100644 --- a/mono/metadata/reflection.c +++ b/mono/metadata/reflection.c @@ -8520,9 +8520,6 @@ fieldbuilder_to_mono_class_field (MonoClass *klass, MonoReflectionFieldBuilder* const char *p, *p2; guint32 len, idx; - if (fb->handle) - return fb->handle; - field = g_new0 (MonoClassField, 1); field->name = mono_string_to_utf8 (fb->name); @@ -8538,7 +8535,6 @@ fieldbuilder_to_mono_class_field (MonoClass *klass, MonoReflectionFieldBuilder* if (fb->offset != -1) field->offset = fb->offset; field->parent = klass; - fb->handle = field; mono_save_custom_attrs (klass->image, field, fb->cattrs); if (fb->def_value) { From 95644e1d27a5089e968b69b6e0e861714ce3cf8e Mon Sep 17 00:00:00 2001 From: Alexander Olk Date: Wed, 22 Mar 2006 18:56:48 +0000 Subject: [PATCH 048/117] * FileDialog.cs: Corrected TabIndex order and set fileNameComboBox to be focused/selected after startup 2006-03-22 Alexander Olk svn path=/trunk/mcs/; revision=58310 --- .../System.Windows.Forms/ChangeLog | 5 ++++ .../System.Windows.Forms/FileDialog.cs | 26 +++++++++---------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index dd7d6c13a89b3..b025af76c67fd 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2006-03-22 Alexander Olk + + * FileDialog.cs: Corrected TabIndex order and set fileNameComboBox + to be focused/selected after startup + 2006-03-22 Alexander Olk * ColorDialog.cs: diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs index c9dd85700a571..300f5defbba3a 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs @@ -156,7 +156,6 @@ internal FileDialog () searchSaveLabel.FlatStyle = FlatStyle.System; searchSaveLabel.Location = new Point (7, 8); searchSaveLabel.Size = new Size (72, 21); - searchSaveLabel.TabIndex = 0; searchSaveLabel.TextAlign = ContentAlignment.MiddleRight; // dirComboBox @@ -164,7 +163,7 @@ internal FileDialog () dirComboBox.DropDownStyle = ComboBoxStyle.DropDownList; dirComboBox.Location = new Point (99, 8); dirComboBox.Size = new Size (260, 21); - dirComboBox.TabIndex = 1; + dirComboBox.TabIndex = 0; // smallButtonToolBar smallButtonToolBar.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right))); @@ -183,13 +182,13 @@ internal FileDialog () smallButtonToolBar.Location = new Point (372, 6); smallButtonToolBar.ShowToolTips = true; smallButtonToolBar.Size = new Size (140, 28); - smallButtonToolBar.TabIndex = 2; + smallButtonToolBar.TabIndex = 1; smallButtonToolBar.TextAlign = ToolBarTextAlign.Right; // buttonPanel popupButtonPanel.Dock = DockStyle.None; popupButtonPanel.Location = new Point (7, 37); - popupButtonPanel.TabIndex = 3; + popupButtonPanel.TabIndex = 2; // mwfFileView mwfFileView.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right))); @@ -201,7 +200,7 @@ internal FileDialog () mwfFileView.Columns.Add (" Last Access", 150, HorizontalAlignment.Left); mwfFileView.AllowColumnReorder = true; mwfFileView.MultiSelect = false; - mwfFileView.TabIndex = 4; + mwfFileView.TabIndex = 3; mwfFileView.FilterIndex = FilterIndex; // fileNameLabel @@ -209,7 +208,6 @@ internal FileDialog () fileNameLabel.FlatStyle = FlatStyle.System; fileNameLabel.Location = new Point (102, 330); fileNameLabel.Size = new Size (70, 21); - fileNameLabel.TabIndex = 5; fileNameLabel.Text = "Filename:"; fileNameLabel.TextAlign = ContentAlignment.MiddleLeft; @@ -217,7 +215,7 @@ internal FileDialog () fileNameComboBox.Anchor = ((AnchorStyles)(((AnchorStyles.Bottom | AnchorStyles.Left) | AnchorStyles.Right))); fileNameComboBox.Location = new Point (195, 330); fileNameComboBox.Size = new Size (245, 21); - fileNameComboBox.TabIndex = 6; + fileNameComboBox.TabIndex = 4; fileNameComboBox.Items.Add (" "); // fileTypeLabel @@ -225,7 +223,6 @@ internal FileDialog () fileTypeLabel.FlatStyle = FlatStyle.System; fileTypeLabel.Location = new Point (102, 356); fileTypeLabel.Size = new Size (70, 21); - fileTypeLabel.TabIndex = 7; fileTypeLabel.Text = "Filetype:"; fileTypeLabel.TextAlign = ContentAlignment.MiddleLeft; @@ -233,7 +230,7 @@ internal FileDialog () fileTypeComboBox.Anchor = ((AnchorStyles)(((AnchorStyles.Bottom | AnchorStyles.Left) | AnchorStyles.Right))); fileTypeComboBox.Location = new Point (195, 356); fileTypeComboBox.Size = new Size (245, 21); - fileTypeComboBox.TabIndex = 8; + fileTypeComboBox.TabIndex = 5; // backToolBarButton backToolBarButton.ImageIndex = 0; @@ -278,7 +275,7 @@ internal FileDialog () openSaveButton.FlatStyle = FlatStyle.System; openSaveButton.Location = new Point (475, 330); openSaveButton.Size = new Size (72, 21); - openSaveButton.TabIndex = 9; + openSaveButton.TabIndex = 7; openSaveButton.FlatStyle = FlatStyle.System; // cancelButton @@ -286,7 +283,7 @@ internal FileDialog () cancelButton.FlatStyle = FlatStyle.System; cancelButton.Location = new Point (475, 356); cancelButton.Size = new Size (72, 21); - cancelButton.TabIndex = 10; + cancelButton.TabIndex = 8; cancelButton.Text = "Cancel"; cancelButton.FlatStyle = FlatStyle.System; @@ -295,7 +292,7 @@ internal FileDialog () helpButton.FlatStyle = FlatStyle.System; helpButton.Location = new Point (475, 350); helpButton.Size = new Size (72, 21); - helpButton.TabIndex = 11; + helpButton.TabIndex = 9; helpButton.Text = "Help"; helpButton.FlatStyle = FlatStyle.System; @@ -304,8 +301,8 @@ internal FileDialog () readonlyCheckBox.Text = "Open Readonly"; readonlyCheckBox.Location = new Point (195, 350); readonlyCheckBox.Size = new Size (245, 21); + readonlyCheckBox.TabIndex = 6; readonlyCheckBox.FlatStyle = FlatStyle.System; - readonlyCheckBox.TabIndex = 12; form.ContextMenu = contextMenu; @@ -620,6 +617,9 @@ protected void OnFileOk (CancelEventArgs e) protected override bool RunDialog (IntPtr hWndOwner) { form.Refresh (); + + fileNameComboBox.Select (); + return true; } From c30257b17dd958335f1e7029e520213cc08f6011 Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Wed, 22 Mar 2006 20:22:00 +0000 Subject: [PATCH 049/117] 2006-03-22 Sebastien Pouliot * GraphicsPath.cs: Call [libgdiplus|GDI+] for AddString (even if it is not yet implemented in libgdiplus). * LinearGradientBrush.cs: Update the rectangle when using the internal ctor. Fix a few missing validations. svn path=/trunk/mcs/; revision=58311 --- .../System.Drawing.Drawing2D/ChangeLog | 7 ++ .../System.Drawing.Drawing2D/GraphicsPath.cs | 66 ++++++++++++------- .../LinearGradientBrush.cs | 27 +++++--- 3 files changed, 67 insertions(+), 33 deletions(-) diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog b/mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog index dfcaa158eb40a..3b33bc8de774b 100644 --- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog +++ b/mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog @@ -1,3 +1,10 @@ +2006-03-22 Sebastien Pouliot + + * GraphicsPath.cs: Call [libgdiplus|GDI+] for AddString (even if it + is not yet implemented in libgdiplus). + * LinearGradientBrush.cs: Update the rectangle when using the internal + ctor. Fix a few missing validations. + 2006-03-17 Sebastien Pouliot * Matrix.cs: Add missing checks to methods (and fix unit tests). diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.cs index 0da90f4e7de19..d8832e2e0aac4 100644 --- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.cs +++ b/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.cs @@ -610,30 +610,50 @@ public void Transform (Matrix matrix) GDIPlus.CheckStatus (status); } - [MonoTODO] - public void AddString (string s, FontFamily family, int style, float emSize, Point origin, StringFormat format) - { - throw new NotImplementedException (); - } - - [MonoTODO] - public void AddString (string s, FontFamily family, int style, float emSize, PointF origin, StringFormat format) - { - throw new NotImplementedException (); - } - - [MonoTODO] - public void AddString (string s, FontFamily family, int style, float emSize, Rectangle layoutRect, StringFormat format) - { - throw new NotImplementedException (); - } - - [MonoTODO] - public void AddString (string s, FontFamily family, int style, float emSize, RectangleF layoutRect, StringFormat format) + [MonoTODO ("GdipAddStringI isn't implemented in libgdiplus")] + public void AddString (string s, FontFamily family, int style, float emSize, Point origin, StringFormat format) + { + Rectangle layout; + layout.X = origin.X; + layout.Y = origin.Y; + AddString (s, family, style, emSize, layout, format); + } + + [MonoTODO ("GdipAddString isn't implemented in libgdiplus")] + public void AddString (string s, FontFamily family, int style, float emSize, PointF origin, StringFormat format) { - throw new NotImplementedException (); - } - + RectangleF layout; + layout.X = origin.X; + layout.Y = origin.Y; + AddString (s, family, style, emSize, layout, format); + } + + [MonoTODO ("GdipAddStringI isn't implemented in libgdiplus")] + public void AddString (string s, FontFamily family, int style, float emSize, Rectangle layoutRect, StringFormat format) + { + if (s == null) + throw new ArgumentNullException ("s"); + + IntPtr ffamily = (family == null) ? IntPtr.Zero : family.NativeObject; + IntPtr sformat = (format == null) ? IntPtr.Zero : format.NativeObject; + + Status status = GDIPlus.GdipAddStringI (nativePath, s, s.Length, ffamily, style, emSize, ref layoutRect, sformat); + GDIPlus.CheckStatus (status); + } + + [MonoTODO ("GdipAddString isn't implemented in libgdiplus")] + public void AddString (string s, FontFamily family, int style, float emSize, RectangleF layoutRect, StringFormat format) + { + if (s == null) + throw new ArgumentNullException ("s"); + + IntPtr ffamily = (family == null) ? IntPtr.Zero : family.NativeObject; + IntPtr sformat = (format == null) ? IntPtr.Zero : format.NativeObject; + + Status status = GDIPlus.GdipAddString (nativePath, s, s.Length, ffamily, style, emSize, ref layoutRect, sformat); + GDIPlus.CheckStatus (status); + } + public void ClearMarkers() { Status s = GDIPlus.GdipClearPathMarkers (nativePath); diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/LinearGradientBrush.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/LinearGradientBrush.cs index 88bfcc8744f47..abdc54637b5b7 100644 --- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/LinearGradientBrush.cs +++ b/mcs/class/System.Drawing/System.Drawing.Drawing2D/LinearGradientBrush.cs @@ -6,8 +6,7 @@ // 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,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 @@ -29,19 +28,18 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -using System.Drawing; +using System.ComponentModel; + +namespace System.Drawing.Drawing2D { -namespace System.Drawing.Drawing2D -{ - /// - /// Summary description for LinearGradientBrush. - /// public sealed class LinearGradientBrush : Brush { RectangleF rectangle; internal LinearGradientBrush (IntPtr native) : base (native) { + Status status = GDIPlus.GdipGetLineRect (native, out rectangle); + GDIPlus.CheckStatus (status); } public LinearGradientBrush (Point point1, Point point2, Color color1, Color color2) @@ -236,6 +234,9 @@ public LinearGradientBrush (RectangleF rect, Color color1, Color color2, float a return matrix; } set { + if (value == null) + throw new ArgumentNullException ("Transform"); + Status status = GDIPlus.GdipSetLineTransform (nativeObject, value.nativeMatrix); GDIPlus.CheckStatus (status); } @@ -250,6 +251,10 @@ public LinearGradientBrush (RectangleF rect, Color color1, Color color2, float a return wrapMode; } set { + // note: Clamp isn't valid (context wise) but it is checked in libgdiplus + if ((value < WrapMode.Tile) || (value > WrapMode.Clamp)) + throw new InvalidEnumArgumentException ("WrapMode"); + Status status = GDIPlus.GdipSetLineWrapMode (nativeObject, value); GDIPlus.CheckStatus (status); } @@ -264,6 +269,9 @@ public void MultiplyTransform (Matrix matrix) public void MultiplyTransform (Matrix matrix, MatrixOrder order) { + if (matrix == null) + throw new ArgumentNullException ("matrix"); + Status status = GDIPlus.GdipMultiplyLineTransform (nativeObject, matrix.nativeMatrix, order); GDIPlus.CheckStatus (status); } @@ -341,8 +349,7 @@ public override object Clone () Status status = GDIPlus.GdipCloneBrush (nativeObject, out clonePtr); GDIPlus.CheckStatus (status); - LinearGradientBrush clone = new LinearGradientBrush (clonePtr); - return clone; + return new LinearGradientBrush (clonePtr); } } } From ffbc686025500f03035997581c06bc6945bb89fb Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Wed, 22 Mar 2006 20:23:17 +0000 Subject: [PATCH 050/117] 2006-03-22 Sebastien Pouliot * LinearGradientBrushTest.cs: New. Some unit tests (moslty failing). svn path=/trunk/mcs/; revision=58312 --- .../Test/System.Drawing.Drawing2D/ChangeLog | 4 + .../LinearGradientBrushTest.cs | 494 ++++++++++++++++++ 2 files changed, 498 insertions(+) create mode 100644 mcs/class/System.Drawing/Test/System.Drawing.Drawing2D/LinearGradientBrushTest.cs diff --git a/mcs/class/System.Drawing/Test/System.Drawing.Drawing2D/ChangeLog b/mcs/class/System.Drawing/Test/System.Drawing.Drawing2D/ChangeLog index 7e8303da00816..16c895e47c266 100644 --- a/mcs/class/System.Drawing/Test/System.Drawing.Drawing2D/ChangeLog +++ b/mcs/class/System.Drawing/Test/System.Drawing.Drawing2D/ChangeLog @@ -1,3 +1,7 @@ +2006-03-22 Sebastien Pouliot + + * LinearGradientBrushTest.cs: New. Some unit tests (moslty failing). + 2006-03-14 Sebastien Pouliot * TestMatrix.cs: Added new test cases to test libgdiplus validations. diff --git a/mcs/class/System.Drawing/Test/System.Drawing.Drawing2D/LinearGradientBrushTest.cs b/mcs/class/System.Drawing/Test/System.Drawing.Drawing2D/LinearGradientBrushTest.cs new file mode 100644 index 0000000000000..1bdf83350dc88 --- /dev/null +++ b/mcs/class/System.Drawing/Test/System.Drawing.Drawing2D/LinearGradientBrushTest.cs @@ -0,0 +1,494 @@ +// +// System.Drawing.Drawing2D.LinearGradientBrush unit tests +// +// Authors: +// Sebastien Pouliot +// +// Copyright (C) 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. +// + +using System; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Security.Permissions; +using NUnit.Framework; + +namespace MonoTests.System.Drawing.Drawing2D { + + [TestFixture] + [SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)] + public class LinearGradientBrushTest { + + private Point pt1; + private Point pt2; + private Color c1; + private Color c2; + private LinearGradientBrush default_brush; + private Matrix empty_matrix; + + [TestFixtureSetUp] + public void FixtureSetUp () + { + pt1 = new Point (0, 0); + pt2 = new Point (32, 32); + c1 = Color.Blue; + c2 = Color.Red; + default_brush = new LinearGradientBrush (pt1, pt2, c1, c2); + empty_matrix = new Matrix (); + } + + private void CheckDefaultRectangle (string msg, RectangleF rect) + { + Assert.AreEqual (pt1.X, rect.X, msg + ".Rectangle.X"); + Assert.AreEqual (pt1.Y, rect.Y, msg + ".Rectangle.Y"); + Assert.AreEqual (pt2.X, rect.Width, msg + ".Rectangle.Width"); + Assert.AreEqual (pt2.Y, rect.Height, msg + ".Rectangle.Height"); + } + + private void CheckEmptyMatrix (Matrix matrix) + { + float[] elements = matrix.Elements; + Assert.AreEqual (1, elements[0], "matrix.0"); + Assert.AreEqual (0, elements[1], "matrix.1"); + Assert.AreEqual (0, elements[2], "matrix.2"); + Assert.AreEqual (1, elements[3], 0.1, "matrix.3"); + Assert.AreEqual (0, elements[4], "matrix.4"); + Assert.AreEqual (0, elements[5], "matrix.5"); + } + + private void CheckDefaultMatrix (Matrix matrix) + { + float[] elements = matrix.Elements; + Assert.AreEqual (1, elements[0], 0.1, "matrix.0"); + Assert.AreEqual (1, elements[1], 0.1, "matrix.1"); + Assert.AreEqual (-1, elements[2], 0.1, "matrix.2"); + Assert.AreEqual (1, elements[3], 0.1, "matrix.3"); + Assert.AreEqual (16, elements[4], "matrix.4"); + Assert.AreEqual (-16, elements[5], "matrix.5"); + } + + [Test] + [NUnit.Framework.Category ("NotWorking")] + public void Constructor4 () + { + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + CheckDefaultRectangle ("4", lgb.Rectangle); + Assert.AreEqual (1, lgb.Blend.Factors.Length, "Blend.Factors"); + Assert.AreEqual (1, lgb.Blend.Factors [0], "Blend.Factors [0]"); + Assert.AreEqual (1, lgb.Blend.Positions.Length, "Blend.Positions"); + Assert.IsFalse (lgb.GammaCorrection, "GammaCorrection"); + Assert.AreEqual (2, lgb.LinearColors.Length, "LinearColors"); + Assert.IsNotNull (lgb.Transform, "Transform"); + CheckDefaultMatrix (lgb.Transform); + + Assert.AreEqual (WrapMode.Tile, lgb.WrapMode, "WrapMode.Tile"); + lgb.WrapMode = WrapMode.TileFlipX; + Assert.AreEqual (WrapMode.TileFlipX, lgb.WrapMode, "WrapMode.TileFlipX"); + lgb.WrapMode = WrapMode.TileFlipY; + Assert.AreEqual (WrapMode.TileFlipY, lgb.WrapMode, "WrapMode.TileFlipY"); + lgb.WrapMode = WrapMode.TileFlipXY; + Assert.AreEqual (WrapMode.TileFlipXY, lgb.WrapMode, "WrapMode.TileFlipXY"); + // can't set WrapMode.Clamp + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void InterpolationColors_Colors_InvalidBlend () + { + // default Blend doesn't allow getting this property + Assert.IsNotNull (default_brush.InterpolationColors.Colors); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void InterpolationColors_Positions_InvalidBlend () + { + // default Blend doesn't allow getting this property + Assert.IsNotNull (default_brush.InterpolationColors.Positions); + } + + [Test] + [ExpectedException (typeof (IndexOutOfRangeException))] + public void LinearColors_Empty () + { + default_brush.LinearColors = new Color[0]; + } + + [Test] + [ExpectedException (typeof (IndexOutOfRangeException))] + public void LinearColors_One () + { + default_brush.LinearColors = new Color[1]; + } + + [Test] + public void LinearColors_Two () + { + Assert.AreEqual (Color.FromArgb (255, 0, 0, 255), default_brush.LinearColors[0], "0"); + Assert.AreEqual (Color.FromArgb (255, 255, 0, 0), default_brush.LinearColors[1], "1"); + + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + lgb.LinearColors = new Color[2] { Color.Black, Color.White }; + // not the same, the alpha is changed to 255 so they can't compare + Assert.AreEqual (Color.FromArgb (255, 0, 0, 0), lgb.LinearColors[0], "0"); + Assert.AreEqual (Color.FromArgb (255, 255, 255, 255), lgb.LinearColors[1], "1"); + } + + [Test] + public void LinearColors_Three () + { + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + lgb.LinearColors = new Color[3] { Color.Red, Color.Green, Color.Blue }; + // not the same, the alpha is changed to 255 so they can't compare + Assert.AreEqual (Color.FromArgb (255, 255, 0, 0), lgb.LinearColors[0], "0"); + Assert.AreEqual (Color.FromArgb (255, 0, 128, 0), lgb.LinearColors[1], "1"); + } + + [Test] + [ExpectedException (typeof (ArgumentNullException))] + public void Transform_Null () + { + default_brush.Transform = null; + } + + [Test] + public void Transform_Empty () + { + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + lgb.Transform = new Matrix (); + CheckEmptyMatrix (lgb.Transform); + } + + [Test] + public void WrapMode_AllValid () + { + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + lgb.WrapMode = WrapMode.Tile; + Assert.AreEqual (WrapMode.Tile, lgb.WrapMode, "WrapMode.Tile"); + lgb.WrapMode = WrapMode.TileFlipX; + Assert.AreEqual (WrapMode.TileFlipX, lgb.WrapMode, "WrapMode.TileFlipX"); + lgb.WrapMode = WrapMode.TileFlipY; + Assert.AreEqual (WrapMode.TileFlipY, lgb.WrapMode, "WrapMode.TileFlipY"); + lgb.WrapMode = WrapMode.TileFlipXY; + Assert.AreEqual (WrapMode.TileFlipXY, lgb.WrapMode, "WrapMode.TileFlipXY"); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void WrapMode_Clamp () + { + default_brush.WrapMode = WrapMode.Clamp; + } + + [Test] + [ExpectedException (typeof (InvalidEnumArgumentException))] + public void WrapMode_Invalid () + { + default_brush.WrapMode = (WrapMode) Int32.MinValue; + } + + + [Test] + public void Clone () + { + CheckDefaultRectangle ("default", default_brush.Rectangle); + LinearGradientBrush clone = (LinearGradientBrush) default_brush.Clone (); + CheckDefaultRectangle ("clone", clone.Rectangle); + } + + [Test] + [ExpectedException (typeof (ArgumentNullException))] + public void MultiplyTransform1_Null () + { + default_brush.MultiplyTransform (null); + } + + [Test] + [ExpectedException (typeof (ArgumentNullException))] + public void MultiplyTransform2_Null () + { + default_brush.MultiplyTransform (null, MatrixOrder.Append); + } + + [Test] + public void MultiplyTransform2_Invalid () + { + default_brush.MultiplyTransform (empty_matrix, (MatrixOrder) Int32.MinValue); + } + + [Test] + public void ResetTransform () + { + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + lgb.ResetTransform (); + CheckEmptyMatrix (lgb.Transform); + } + + [Test] + [NUnit.Framework.Category ("NotWorking")] + public void RotateTransform () + { + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + lgb.RotateTransform (90); + float[] elements = lgb.Transform.Elements; + Assert.AreEqual (-1, elements[0], 0.1, "matrix.0"); + Assert.AreEqual (1, elements[1], 0.1, "matrix.1"); + Assert.AreEqual (-1, elements[2], 0.1, "matrix.2"); + Assert.AreEqual (-1, elements[3], 0.1, "matrix.3"); + Assert.AreEqual (16, elements[4], 0.1, "matrix.4"); + Assert.AreEqual (-16, elements[5], 0.1, "matrix.5"); + + lgb.RotateTransform (270); + CheckDefaultMatrix (lgb.Transform); + } + + [Test] + [NUnit.Framework.Category ("NotWorking")] + public void RotateTransform_Max () + { + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + lgb.RotateTransform (Single.MaxValue); + float[] elements = lgb.Transform.Elements; + Assert.AreEqual (-1.69580966E+30, elements[0], 1e25, "matrix.0"); + Assert.AreEqual (1.18780928E+37, elements[1], 1e32, "matrix.1"); + Assert.AreEqual (-1.18780953E+37, elements[2], 1e32, "matrix.2"); + Assert.AreEqual (-2.79830475E+29, elements[3], 1e24, "matrix.3"); + Assert.AreEqual (16, elements[4], 0.1, "matrix.4"); + Assert.AreEqual (-16, elements[5], 0.1, "matrix.5"); + } + + [Test] + [NUnit.Framework.Category ("NotWorking")] + public void RotateTransform_Min () + { + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + lgb.RotateTransform (Single.MinValue); + float[] elements = lgb.Transform.Elements; + Assert.AreEqual (1.06198436E+30, elements[0], 1e25, "matrix.0"); + Assert.AreEqual (-1.18780953E+37, elements[1], 1e32, "matrix.1"); + Assert.AreEqual (1.1878094E+37, elements[2], 1e32, "matrix.2"); + Assert.AreEqual (-3.53994825E+29, elements[3], 1e24, "matrix.3"); + Assert.AreEqual (16, elements[4], 0.1, "matrix.4"); + Assert.AreEqual (-16, elements[5], 0.1, "matrix.5"); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void RotateTransform_InvalidOrder () + { + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + lgb.RotateTransform (720, (MatrixOrder) Int32.MinValue); + } + + [Test] + [NUnit.Framework.Category ("NotWorking")] + public void ScaleTransform () + { + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + lgb.ScaleTransform (2, 4); + float[] elements = lgb.Transform.Elements; + Assert.AreEqual (2, elements[0], 0.1, "matrix.0"); + Assert.AreEqual (2, elements[1], 0.1, "matrix.1"); + Assert.AreEqual (-4, elements[2], 0.1, "matrix.2"); + Assert.AreEqual (4, elements[3], 0.1, "matrix.3"); + Assert.AreEqual (16, elements[4], 0.1, "matrix.4"); + Assert.AreEqual (-16, elements[5], 0.1, "matrix.5"); + + lgb.ScaleTransform (0.5f, 0.25f); + CheckDefaultMatrix (lgb.Transform); + } + + [Test] + [NUnit.Framework.Category ("NotWorking")] + public void ScaleTransform_MaxMin () + { + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + lgb.ScaleTransform (Single.MaxValue, Single.MinValue); + float[] elements = lgb.Transform.Elements; + Assert.AreEqual (Single.MaxValue, elements[0], 1e33, "matrix.0"); + Assert.AreEqual (Single.MaxValue, elements[1], 1e33, "matrix.1"); + Assert.AreEqual (Single.MaxValue, elements[2], 1e33, "matrix.2"); + Assert.AreEqual (Single.MinValue, elements[3], 1e33, "matrix.3"); + Assert.AreEqual (16, elements[4], 0.1, "matrix.4"); + Assert.AreEqual (-16, elements[5], 0.1, "matrix.5"); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void ScaleTransform_InvalidOrder () + { + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + lgb.ScaleTransform (1, 1, (MatrixOrder) Int32.MinValue); + } + + [Test] + [NUnit.Framework.Category ("NotWorking")] + public void SetBlendTriangularShape_Focus () + { + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + // max valid + lgb.SetBlendTriangularShape (1); + CheckDefaultMatrix (lgb.Transform); + // min valid + lgb.SetBlendTriangularShape (0); + CheckDefaultMatrix (lgb.Transform); + // middle + lgb.SetBlendTriangularShape (0.5f); + CheckDefaultMatrix (lgb.Transform); + // no impact on matrix + } + + [Test] + [NUnit.Framework.Category ("NotWorking")] + public void SetBlendTriangularShape_Scale () + { + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + // max valid + lgb.SetBlendTriangularShape (0, 1); + CheckDefaultMatrix (lgb.Transform); + // min valid + lgb.SetBlendTriangularShape (1, 0); + CheckDefaultMatrix (lgb.Transform); + // middle + lgb.SetBlendTriangularShape (0.5f, 0.5f); + CheckDefaultMatrix (lgb.Transform); + // no impact on matrix + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void SetBlendTriangularShape_FocusTooSmall () + { + default_brush.SetBlendTriangularShape (-1); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void SetBlendTriangularShape_FocusTooBig () + { + default_brush.SetBlendTriangularShape (1.01f); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void SetBlendTriangularShape_ScaleTooSmall () + { + default_brush.SetBlendTriangularShape (1, -1); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void SetBlendTriangularShape_ScaleTooBig () + { + default_brush.SetBlendTriangularShape (1, 1.01f); + } + + [Test] + [NUnit.Framework.Category ("NotWorking")] + public void SetSigmaBellShape_Focus () + { + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + // max valid + lgb.SetSigmaBellShape (1); + CheckDefaultMatrix (lgb.Transform); + // min valid + lgb.SetSigmaBellShape (0); + CheckDefaultMatrix (lgb.Transform); + // middle + lgb.SetSigmaBellShape (0.5f); + CheckDefaultMatrix (lgb.Transform); + // no impact on matrix + } + + [Test] + [NUnit.Framework.Category ("NotWorking")] + public void SetSigmaBellShape_Scale () + { + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + // max valid + lgb.SetSigmaBellShape (0, 1); + CheckDefaultMatrix (lgb.Transform); + // min valid + lgb.SetSigmaBellShape (1, 0); + CheckDefaultMatrix (lgb.Transform); + // middle + lgb.SetSigmaBellShape (0.5f, 0.5f); + CheckDefaultMatrix (lgb.Transform); + // no impact on matrix + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void SetSigmaBellShape_FocusTooSmall () + { + default_brush.SetSigmaBellShape (-1); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void SetSigmaBellShape_FocusTooBig () + { + default_brush.SetSigmaBellShape (1.01f); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void SetSigmaBellShape_ScaleTooSmall () + { + default_brush.SetSigmaBellShape (1, -1); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void SetSigmaBellShape_ScaleTooBig () + { + default_brush.SetSigmaBellShape (1, 1.01f); + } + + [Test] + [NUnit.Framework.Category ("NotWorking")] + public void TranslateTransform () + { + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + lgb.TranslateTransform (1, 1); + float[] elements = lgb.Transform.Elements; + Assert.AreEqual (1, elements[0], 0.1, "matrix.0"); + Assert.AreEqual (1, elements[1], 0.1, "matrix.1"); + Assert.AreEqual (-1, elements[2], 0.1, "matrix.2"); + Assert.AreEqual (1, elements[3], 0.1, "matrix.3"); + Assert.AreEqual (16, elements[4], 0.1, "matrix.4"); + Assert.AreEqual (-14, elements[5], 0.1, "matrix.5"); + + lgb.TranslateTransform (-1, -1); + CheckDefaultMatrix (lgb.Transform); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void TranslateTransform_InvalidOrder () + { + LinearGradientBrush lgb = new LinearGradientBrush (pt1, pt2, c1, c2); + lgb.TranslateTransform (1, 1, (MatrixOrder) Int32.MinValue); + } + } +} From 30e664a3c9a93c2d543d4ff95014d830e20a0d67 Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Wed, 22 Mar 2006 20:23:49 +0000 Subject: [PATCH 051/117] Add LinearGradientBrush unit tests to the build svn path=/trunk/mcs/; revision=58313 --- mcs/class/System.Drawing/System.Drawing_test.dll.sources | 1 + 1 file changed, 1 insertion(+) diff --git a/mcs/class/System.Drawing/System.Drawing_test.dll.sources b/mcs/class/System.Drawing/System.Drawing_test.dll.sources index 3e3807a06afe9..12d76b8d4789e 100644 --- a/mcs/class/System.Drawing/System.Drawing_test.dll.sources +++ b/mcs/class/System.Drawing/System.Drawing_test.dll.sources @@ -27,6 +27,7 @@ System.Drawing/TestImageFormatConverter.cs System.Drawing/TestIconConverter.cs System.Drawing/TestIcon.cs System.Drawing.Drawing2D/GraphicsPathTest.cs +System.Drawing.Drawing2D/LinearGradientBrushTest.cs System.Drawing.Drawing2D/PathDataTest.cs System.Drawing.Drawing2D/TestBlend.cs System.Drawing.Drawing2D/TestColorBlend.cs From 4262df8c458c08c861aae02f6b07d87d32cd127f Mon Sep 17 00:00:00 2001 From: Gert Driesen Date: Wed, 22 Mar 2006 20:25:21 +0000 Subject: [PATCH 052/117] * XmlReflectionImporterTests.cs: Added ImportTypeMapping tests for void and null type argument. Improved WrongChoices test to make sure the exception(s) we throw match those of MSFT. Added test for bug #77591. * XmlReflectionImporter.cs: Throw NotSupportException instead of InvalidOperationException (IOE) if void is specified as type in ImportTypeMapping. To match MS.NET, surround importing of type in try/catch block, and wrap any IOE in another IOE adding information on the type that was being reflected. In CreateTypeMapping, surround creating of map member in try/catch block, and wrap any IOE in another IOE adding information on the member that was being reflected. Modified exception message for missing enumeration value to match MS.NET. In ImportTextElementInfo, throw IOE if Type is set in XmlTextAttribute, and it differs from type of reflected member when schema type of member is primitive or enum. Fixed bug #77591. svn path=/trunk/mcs/; revision=58314 --- .../System.Xml.Serialization/ChangeLog | 14 +++ .../XmlReflectionImporter.cs | 87 ++++++++------ .../Test/System.Xml.Serialization/ChangeLog | 7 ++ .../XmlReflectionImporterTests.cs | 108 +++++++++++++++++- 4 files changed, 175 insertions(+), 41 deletions(-) diff --git a/mcs/class/System.XML/System.Xml.Serialization/ChangeLog b/mcs/class/System.XML/System.Xml.Serialization/ChangeLog index c1f81aad45707..33457094d147a 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/ChangeLog +++ b/mcs/class/System.XML/System.Xml.Serialization/ChangeLog @@ -1,3 +1,17 @@ +2006-03-22 Gert Driesen + + * XmlReflectionImporter.cs: Throw NotSupportException instead of + InvalidOperationException (IOE) if void is specified as type in + ImportTypeMapping. To match MS.NET, surround importing of type in + try/catch block, and wrap any IOE in another IOE adding information + on the type that was being reflected. In CreateTypeMapping, surround + creating of map member in try/catch block, and wrap any IOE in another + IOE adding information on the member that was being reflected. + Modified exception message for missing enumeration value to match + MS.NET. In ImportTextElementInfo, throw IOE if Type is set in + XmlTextAttribute, and it differs from type of reflected member when + schema type of member is primitive or enum. Fixed bug #77591. + 2006-03-10 Gert Driesen * XmlSchemaExporter.cs: Import namespace of schema generated for diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs index 8335ae66f9d7d..2ab269849293a 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs @@ -168,30 +168,34 @@ public XmlTypeMapping ImportTypeMapping (Type type, XmlRootAttribute root, strin throw new ArgumentNullException ("type"); if (type == typeof (void)) - throw new InvalidOperationException ("Type " + type.Name + " may not be serialized."); + throw new NotSupportedException ("The type " + type.FullName + " may not be serialized."); if (defaultNamespace == null) defaultNamespace = initialDefaultNamespace; if (defaultNamespace == null) defaultNamespace = string.Empty; - XmlTypeMapping map; + try { + XmlTypeMapping map; + + switch (TypeTranslator.GetTypeData (type).SchemaType) { + case SchemaTypes.Class: map = ImportClassMapping (type, root, defaultNamespace); break; + case SchemaTypes.Array: map = ImportListMapping (type, root, defaultNamespace, null, 0); break; + case SchemaTypes.XmlNode: map = ImportXmlNodeMapping (type, root, defaultNamespace); break; + case SchemaTypes.Primitive: map = ImportPrimitiveMapping (type, root, defaultNamespace); break; + case SchemaTypes.Enum: map = ImportEnumMapping (type, root, defaultNamespace); break; + case SchemaTypes.XmlSerializable: map = ImportXmlSerializableMapping (type, root, defaultNamespace); break; + default: throw new NotSupportedException ("Type " + type.FullName + " not supported for XML stialization"); + } - switch (TypeTranslator.GetTypeData(type).SchemaType) - { - case SchemaTypes.Class: map = ImportClassMapping (type, root, defaultNamespace); break; - case SchemaTypes.Array: map = ImportListMapping (type, root, defaultNamespace, null, 0); break; - case SchemaTypes.XmlNode: map = ImportXmlNodeMapping (type, root, defaultNamespace); break; - case SchemaTypes.Primitive: map = ImportPrimitiveMapping (type, root, defaultNamespace); break; - case SchemaTypes.Enum: map = ImportEnumMapping (type, root, defaultNamespace); break; - case SchemaTypes.XmlSerializable: map = ImportXmlSerializableMapping (type, root, defaultNamespace); break; - default: throw new NotSupportedException ("Type " + type.FullName + " not supported for XML stialization"); + map.RelatedMaps = relatedMaps; + map.Format = SerializationFormat.Literal; + Type[] extraTypes = includedTypes != null ? (Type[]) includedTypes.ToArray (typeof (Type)) : null; + map.Source = new XmlTypeSerializationSource (type, root, attributeOverrides, defaultNamespace, extraTypes); + if (allowPrivateTypes) map.Source.CanBeGenerated = false; + return map; + } catch (InvalidOperationException ex) { + throw new InvalidOperationException (string.Format (CultureInfo.InvariantCulture, + "There was an error reflecting type '{0}'.", type.FullName), ex); } - - map.RelatedMaps = relatedMaps; - map.Format = SerializationFormat.Literal; - Type[] extraTypes = includedTypes != null ? (Type[])includedTypes.ToArray(typeof(Type)) : null; - map.Source = new XmlTypeSerializationSource (type, root, attributeOverrides, defaultNamespace, extraTypes); - if (allowPrivateTypes) map.Source.CanBeGenerated = false; - return map; } XmlTypeMapping CreateTypeMapping (TypeData typeData, XmlRootAttribute root, string defaultXmlType, string defaultNamespace) @@ -288,26 +292,26 @@ XmlTypeMapping ImportClassMapping (Type type, XmlRootAttribute root, string defa ClassMap classMap = new ClassMap (); map.ObjectMap = classMap; -// try -// { - ICollection members = GetReflectionMembers (type); - foreach (XmlReflectionMember rmember in members) - { - string ns = map.XmlTypeNamespace; - if (rmember.XmlAttributes.XmlIgnore) continue; - if (rmember.DeclaringType != null && rmember.DeclaringType != type) { - XmlTypeMapping bmap = ImportClassMapping (rmember.DeclaringType, root, defaultNamespace); - ns = bmap.XmlTypeNamespace; - } - + ICollection members = GetReflectionMembers (type); + foreach (XmlReflectionMember rmember in members) + { + string ns = map.XmlTypeNamespace; + if (rmember.XmlAttributes.XmlIgnore) continue; + if (rmember.DeclaringType != null && rmember.DeclaringType != type) { + XmlTypeMapping bmap = ImportClassMapping (rmember.DeclaringType, root, defaultNamespace); + ns = bmap.XmlTypeNamespace; + } + + try { XmlTypeMapMember mem = CreateMapMember (type, rmember, ns); mem.CheckOptionalValueType (type); classMap.AddMember (mem); + } catch (InvalidOperationException ex) { + throw new InvalidOperationException (string.Format ( + CultureInfo.InvariantCulture, "There was an error" + + " reflecting field '{0}'.", rmember.MemberName), ex); } -// } -// catch (Exception ex) { -// throw helper.CreateError (map, ex.Message); -// } + } // Import extra classes @@ -927,7 +931,12 @@ XmlTypeMapElementInfoList ImportElementInfo (Type cls, string defaultName, strin if (choiceEnumMap != null) { string cname = choiceEnumMap.GetEnumName (choiceEnumType.FullName, elem.ElementName); - if (cname == null) throw new InvalidOperationException ("The '" + choiceEnumType + "' enumeration does not have a value for the element '" + elem.ElementName + "'"); + if (cname == null) + throw new InvalidOperationException (string.Format ( + CultureInfo.InvariantCulture, "Type {0} is missing" + + " enumeration value '{1}' for element '{1} from" + + " namespace '{2}'.", choiceEnumType, elem.ElementName, + elem.Namespace)); elem.ChoiceValue = Enum.Parse (choiceEnumType, cname); } @@ -967,7 +976,13 @@ void ImportTextElementInfo (XmlTypeMapElementInfoList list, Type defaultType, Xm if (atts.XmlText != null) { member.IsXmlTextCollector = true; - if (atts.XmlText.Type != null) defaultType = atts.XmlText.Type; + if (atts.XmlText.Type != null) { + TypeData td = TypeTranslator.GetTypeData (defaultType); + if ((td.SchemaType == SchemaTypes.Primitive || td.SchemaType == SchemaTypes.Enum) && atts.XmlText.Type != defaultType) { + throw new InvalidOperationException ("The type for XmlText may not be specified for primitive types."); + } + defaultType = atts.XmlText.Type; + } if (defaultType == typeof(XmlNode)) defaultType = typeof(XmlText); // Nodes must be text nodes XmlTypeMapElementInfo elem = new XmlTypeMapElementInfo (member, TypeTranslator.GetTypeData(defaultType, atts.XmlText.DataType)); diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog b/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog index d92c33d5fff91..a29d4fcd926fb 100644 --- a/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog +++ b/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog @@ -1,3 +1,10 @@ +2006-03-22 Gert Driesen + + * XmlReflectionImporterTests.cs: Added ImportTypeMapping tests for + void and null type argument. Improved WrongChoices test to make sure + the exception(s) we throw match those of MSFT. Added test for bug + #77591. + 2006-03-10 Gert Driesen * XmlSchemaExporterTests.cs: Enabled tests for bug #77111. diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlReflectionImporterTests.cs b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlReflectionImporterTests.cs index 27239a28785a8..8cdfe16f81937 100644 --- a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlReflectionImporterTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlReflectionImporterTests.cs @@ -1237,13 +1237,111 @@ public void TypeMapping_ICollection_SimpleClass_NoIntIndexer_Array () } [Test] - [ExpectedException (typeof (InvalidOperationException))] + [ExpectedException (typeof (ArgumentNullException))] + public void TypeMapping_Null () + { + Map ((Type) null); + } + + [Test] + [ExpectedException (typeof (NotSupportedException))] + public void TypeMapping_Void () + { + Map (typeof (void)); + } + + [Test] public void TypeMapping_WrongChoices () { - // Type MonoTests.System.Xml.TestClasses.ItemChoiceType is missing - // enumeration value 'StrangeOne' for element 'StrangeOne' from - // namespace ''. - Map (typeof (WrongChoices)); + try { + Map (typeof (WrongChoices)); + Assert.Fail ("#1"); + } catch (InvalidOperationException ex) { + // There was an error reflecting type 'MonoTests.System.Xml.TestClasses.WrongChoices' + Assert.IsNotNull (ex.Message, "#2"); + Assert.IsTrue (ex.Message.IndexOf ("'" + typeof (WrongChoices).FullName + "'") != -1, "#3"); + Assert.IsNotNull (ex.InnerException, "#4"); + + // There was an error reflecting field 'MyChoice' + Assert.IsNotNull (ex.InnerException.Message, "#5"); + Assert.IsTrue (ex.InnerException.Message.IndexOf ("'MyChoice'") != -1, "#6"); + Assert.IsNotNull (ex.InnerException.InnerException, "#7"); + + // Type MonoTests.System.Xml.TestClasses.ItemChoiceType is missing + // enumeration value 'StrangeOne' for element 'StrangeOne' from + // namespace ''. + Assert.IsNotNull (ex.InnerException.InnerException.Message, "#8"); + Assert.IsTrue (ex.InnerException.InnerException.Message.IndexOf (typeof (ItemChoiceType).FullName) != -1, "#9"); + Assert.IsTrue (ex.InnerException.InnerException.Message.IndexOf ("'StrangeOne'") != -1, "#10"); + Assert.IsTrue (ex.InnerException.InnerException.Message.IndexOf ("''") != -1, "#11"); + } + } + + [Test] // bug #77591 + public void TypeMapping_XmlText_PrimitiveTypes () + { + XmlAttributeOverrides overrides = null; + XmlAttributes attrs = null; + + overrides = new XmlAttributeOverrides (); + attrs = new XmlAttributes (); + attrs.XmlText = new XmlTextAttribute (typeof (int)); + overrides.Add (typeof (Field), "Modifiers", attrs); + + try { + Map (typeof (Field), overrides); + Assert.Fail ("#A1"); + } catch (InvalidOperationException ex) { + // There was an error reflecting type 'MonoTests.System.Xml.TestClasses.Field' + Assert.IsNotNull (ex.Message, "#A2"); + Assert.IsTrue (ex.Message.IndexOf ("'" + typeof (Field).FullName + "'") != -1, "#A3"); + Assert.IsNotNull (ex.InnerException, "#A4"); + + // There was an error reflecting field 'Modifiers' + Assert.IsNotNull (ex.InnerException.Message, "#A5"); + Assert.IsTrue (ex.InnerException.Message.IndexOf ("'Modifiers'") != -1, "#A6"); + Assert.IsNotNull (ex.InnerException.InnerException, "#A7"); + + // The type for XmlText may not be specified for primitive types + Assert.IsNotNull (ex.InnerException.InnerException.Message, "#A8"); + Assert.IsTrue (ex.InnerException.InnerException.Message.IndexOf ("XmlText") != -1, "#A9"); + } + + overrides = new XmlAttributeOverrides (); + attrs = new XmlAttributes (); + attrs.XmlText = new XmlTextAttribute (typeof (int)); + overrides.Add (typeof (Field), "Street", attrs); + + try { + Map (typeof (Field), overrides); + Assert.Fail ("#B1"); + } catch (InvalidOperationException ex) { + // There was an error reflecting type 'MonoTests.System.Xml.TestClasses.Field' + Assert.IsNotNull (ex.Message, "#B2"); + Assert.IsTrue (ex.Message.IndexOf ("'" + typeof (Field).FullName + "'") != -1, "#B3"); + Assert.IsNotNull (ex.InnerException, "#B4"); + + // There was an error reflecting field 'Street' + Assert.IsNotNull (ex.InnerException.Message, "#B5"); + Assert.IsTrue (ex.InnerException.Message.IndexOf ("'Street'") != -1, "#B6"); + Assert.IsNotNull (ex.InnerException.InnerException, "#B7"); + + // The type for XmlText may not be specified for primitive types + Assert.IsNotNull (ex.InnerException.InnerException.Message, "#B8"); + Assert.IsTrue (ex.InnerException.InnerException.Message.IndexOf ("XmlText") != -1, "#B9"); + } + + overrides = new XmlAttributeOverrides (); + attrs = new XmlAttributes (); + attrs.XmlText = new XmlTextAttribute (typeof (MapModifiers)); + overrides.Add (typeof (Field), "Modifiers", attrs); + Map (typeof (Field), overrides); + + overrides = new XmlAttributeOverrides (); + attrs = new XmlAttributes (); + attrs.XmlText = new XmlTextAttribute (typeof (string)); + overrides.Add (typeof (Field), "Street", attrs); + Map (typeof (Field), overrides); } [Test] From 70840b51eb0267cfa8c49d5281d51880b9c87912 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Wed, 22 Mar 2006 20:31:45 +0000 Subject: [PATCH 053/117] 2006-03-22 Mike Kestner * MenuAPI.cs: only process Enter and arrow keypresses if the tracker is active. Fixes #77870. svn path=/trunk/mcs/; revision=58316 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 5 +++++ .../Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs | 2 ++ 2 files changed, 7 insertions(+) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index b025af76c67fd..208d1f0e60bc8 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2006-03-22 Mike Kestner + + * MenuAPI.cs: only process Enter and arrow keypresses if the tracker + is active. Fixes #77870. + 2006-03-22 Alexander Olk * FileDialog.cs: Corrected TabIndex order and set fileNameComboBox diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs index 560156a12df18..119525025bb8f 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs @@ -625,6 +625,8 @@ public bool ProcessKeys (ref Message msg, Keys keyData) return ProcessMnemonic (msg, keyData); else if ((Msg)msg.Msg == Msg.WM_SYSKEYUP || keynav_state == KeyNavState.Idle) return false; + else if (!active) + return false; switch (keyData) { case Keys.Up: From d68d0a65984cd5cc2a6ee141565ee0e36a65bcf3 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Wed, 22 Mar 2006 20:32:03 +0000 Subject: [PATCH 054/117] 2006-03-22 Chris Toshok * HttpApplication.cs: fix typo - AuthenticateRequest => PostAuthenticateRequest. svn path=/trunk/mcs/; revision=58317 --- mcs/class/System.Web/System.Web/ChangeLog | 5 +++++ mcs/class/System.Web/System.Web/HttpApplication.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mcs/class/System.Web/System.Web/ChangeLog b/mcs/class/System.Web/System.Web/ChangeLog index 3ac431dcbf9b8..2e114cb52d937 100644 --- a/mcs/class/System.Web/System.Web/ChangeLog +++ b/mcs/class/System.Web/System.Web/ChangeLog @@ -1,3 +1,8 @@ +2006-03-22 Chris Toshok + + * HttpApplication.cs: fix typo - AuthenticateRequest => + PostAuthenticateRequest. + 2006-03-21 Gonzalo Paniagua Javier * ChangeLog: diff --git a/mcs/class/System.Web/System.Web/HttpApplication.cs b/mcs/class/System.Web/System.Web/HttpApplication.cs index ea629af7e1970..b8274ff6878e4 100644 --- a/mcs/class/System.Web/System.Web/HttpApplication.cs +++ b/mcs/class/System.Web/System.Web/HttpApplication.cs @@ -843,7 +843,7 @@ IEnumerator Pipeline () #if NET_2_0 if (PostAuthenticateRequest != null) - foreach (bool stop in RunHooks (AuthenticateRequest)) + foreach (bool stop in RunHooks (PostAuthenticateRequest)) yield return stop; #endif if (AuthorizeRequest != null) From d7f68f2310f2f74be7a9505a12107586c9f2d9de Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Wed, 22 Mar 2006 20:34:58 +0000 Subject: [PATCH 055/117] 2006-03-22 Chris Toshok * RoleManagerModule.cs: implement using info in Shackow's book. * RolePrincipal.cs: flesh this out a bit more. * DefaultAuthenticationModule.cs (OnDefaultAuthentication): according to Shackow's book, this sets Thread.CurrentPrincipal as well as HttpContext.Current.User. svn path=/trunk/mcs/; revision=58318 --- .../System.Web/System.Web.Security/ChangeLog | 10 ++ .../DefaultAuthenticationModule.cs | 7 +- .../System.Web.Security/RoleManagerModule.cs | 116 +++++++++++++++++- .../System.Web.Security/RolePrincipal.cs | 49 +++++--- 4 files changed, 160 insertions(+), 22 deletions(-) diff --git a/mcs/class/System.Web/System.Web.Security/ChangeLog b/mcs/class/System.Web/System.Web.Security/ChangeLog index 827caa46d97c4..d3765bcd347d2 100644 --- a/mcs/class/System.Web/System.Web.Security/ChangeLog +++ b/mcs/class/System.Web/System.Web.Security/ChangeLog @@ -1,3 +1,13 @@ +2006-03-22 Chris Toshok + + * RoleManagerModule.cs: implement using info in Shackow's book. + + * RolePrincipal.cs: flesh this out a bit more. + + * DefaultAuthenticationModule.cs (OnDefaultAuthentication): + according to Shackow's book, this sets Thread.CurrentPrincipal as + well as HttpContext.Current.User. + 2006-02-28 Chris Toshok * FormsAuthentication.cs: corcompare work. diff --git a/mcs/class/System.Web/System.Web.Security/DefaultAuthenticationModule.cs b/mcs/class/System.Web/System.Web.Security/DefaultAuthenticationModule.cs index 16093083e340b..8e0e5c5e1d510 100644 --- a/mcs/class/System.Web/System.Web.Security/DefaultAuthenticationModule.cs +++ b/mcs/class/System.Web/System.Web.Security/DefaultAuthenticationModule.cs @@ -29,7 +29,10 @@ using System.Security.Permissions; using System.Security.Principal; +using System.Threading; +// more info on the workings of this class can be found in Shackow, p. 55 +// namespace System.Web.Security { // CAS - no InheritanceDemand here as the class is sealed @@ -62,8 +65,10 @@ void OnDefaultAuthentication (object sender, EventArgs args) if (context.User == null && Authenticate != null) Authenticate (this, new DefaultAuthenticationEventArgs (context)); - if (context.User == null) + if (context.User == null) { context.User = new GenericPrincipal (defaultIdentity, new string [0]); + Thread.CurrentPrincipal = context.User; + } } } } diff --git a/mcs/class/System.Web/System.Web.Security/RoleManagerModule.cs b/mcs/class/System.Web/System.Web.Security/RoleManagerModule.cs index 42a8ca1311a39..6510b7d192336 100644 --- a/mcs/class/System.Web/System.Web.Security/RoleManagerModule.cs +++ b/mcs/class/System.Web/System.Web.Security/RoleManagerModule.cs @@ -31,22 +31,128 @@ #if NET_2_0 using System.Collections; using System.Collections.Specialized; +using System.Security.Principal; using System.Text; +using System.Threading; +using System.Web.Configuration; namespace System.Web.Security { public sealed class RoleManagerModule : IHttpModule { public event RoleManagerEventHandler GetRoles; - [MonoTODO] public void Dispose () { - throw new NotImplementedException (); } - - [MonoTODO] + + void ClearCookie (HttpApplication app, string cookieName) + { + new HttpCookie (cookieName, "", "", DateTime.MinValue); + } + + void OnPostAuthenticateRequest (object sender, EventArgs args) + { + HttpApplication app = (HttpApplication)sender; + RoleManagerSection config = (RoleManagerSection)WebConfigurationManager.GetSection ("system.web/roleManager"); + + /* if we're disabled, bail out early */ + if (!config.Enabled) + return; + + /* allow the user to populate the Role */ + if (GetRoles != null) { + RoleManagerEventArgs role_args = new RoleManagerEventArgs (app.Context); + + GetRoles (this, role_args); + + if (role_args.RolesPopulated) + return; + } + + RolePrincipal principal; + + HttpCookie cookie = app.Request.Cookies[config.CookieName]; + + IIdentity currentIdentity = app.Context.User.Identity; + if (app.Request.IsAuthenticated) { + if (cookie != null) { + if (config.CacheRolesInCookie) + cookie = null; + else if (config.CookieRequireSSL && !app.Request.IsSecureConnection) { + cookie = null; + ClearCookie (app, config.CookieName); + } + + } + + if (cookie == null) + principal = new RolePrincipal (currentIdentity); + else + principal = new RolePrincipal (currentIdentity, cookie.Value); + } + else { + /* anonymous request */ + + if (cookie != null) { + ClearCookie (app, config.CookieName); + } + + principal = new RolePrincipal (currentIdentity); + } + + app.Context.User = principal; + Thread.CurrentPrincipal = principal; + } + + void OnEndRequest (object sender, EventArgs args) + { + HttpApplication app = (HttpApplication)sender; + RoleManagerSection config = (RoleManagerSection)WebConfigurationManager.GetSection ("system.web/roleManager"); + + /* if we're not enabled or configured to cache + * cookies, bail out */ + if (!config.Enabled || !config.CacheRolesInCookie) + return; + + /* if the user isn't authenticated, bail + * out */ + if (!app.Request.IsAuthenticated) + return; + + /* if the configuration requires ssl for + * cookies and we're not on an ssl connection, + * bail out */ + if (config.CookieRequireSSL && !app.Request.IsSecureConnection) + return; + + RolePrincipal principal = app.Context.User as RolePrincipal; + if (principal == null) /* just for my sanity */ + return; + + if (!principal.CachedListChanged) + return; + + string ticket = principal.ToEncryptedTicket (); + if (ticket == null || ticket.Length > 4096) { + ClearCookie (app, config.CookieName); + return; + } + + HttpCookie cookie = new HttpCookie (config.CookieName, + ticket, + config.CookiePath, + DateTime.Now + config.CookieTimeout); + + cookie.Domain = config.Domain; + cookie.HttpOnly = true; + if (config.CookieRequireSSL) + cookie.Secure = true; + app.Response.SetCookie (cookie); + } + public void Init (HttpApplication app) { - throw new NotImplementedException (); + app.PostAuthenticateRequest += OnPostAuthenticateRequest; + app.EndRequest += OnEndRequest; } } } diff --git a/mcs/class/System.Web/System.Web.Security/RolePrincipal.cs b/mcs/class/System.Web/System.Web.Security/RolePrincipal.cs index e36cfac3be91a..18639ad551e9b 100644 --- a/mcs/class/System.Web/System.Web.Security/RolePrincipal.cs +++ b/mcs/class/System.Web/System.Web.Security/RolePrincipal.cs @@ -30,6 +30,7 @@ #if NET_2_0 +using System.Collections.Specialized; using System.Security.Permissions; using System.Security.Principal; @@ -40,15 +41,17 @@ namespace System.Web.Security { public sealed class RolePrincipal : IPrincipal { private IIdentity identity; - private string providerName; private bool listChanged; - private bool listCached; - + string[] cachedArray; + private HybridDictionary cachedRoles; + private RoleProvider provider; + public RolePrincipal (IIdentity identity) { if (identity == null) throw new ArgumentNullException ("identity"); this.identity = identity; + this.provider = Roles.Provider; } [MonoTODO] @@ -58,14 +61,13 @@ public RolePrincipal (IIdentity identity, string encryptedTicket) throw new NotImplementedException (); } - [MonoTODO] public RolePrincipal (string providerName, IIdentity identity) : this (identity) { if (providerName == null) throw new ArgumentNullException ("providerName"); - throw new NotImplementedException (); + this.provider = Roles.Providers[providerName]; } [MonoTODO] @@ -75,20 +77,35 @@ public RolePrincipal (string providerName, IIdentity identity, string encryptedT if (providerName == null) throw new ArgumentNullException ("providerName"); + this.provider = Roles.Providers[providerName]; + throw new NotImplementedException (); } - - - [MonoTODO] + public string [] GetRoles () { - throw new NotImplementedException (); + if (!identity.IsAuthenticated) + return new string[0]; + + if (cachedRoles == null) { + cachedArray = provider.GetRolesForUser (identity.Name); + cachedRoles = new HybridDictionary (true); + + foreach (string r in cachedArray) + cachedRoles.Add(r, r); + } + + return cachedArray; } - [MonoTODO] public bool IsInRole (string role) { - throw new NotImplementedException (); + if (!identity.IsAuthenticated) + return false; + + GetRoles (); + + return cachedRoles[role] != null; } [MonoTODO] @@ -121,7 +138,7 @@ public string ToEncryptedTicket () } public bool IsRoleListCached { - get { return listCached; } + get { return cachedRoles != null; } } [MonoTODO] @@ -130,18 +147,18 @@ public string ToEncryptedTicket () } public string ProviderName { - get { return providerName; } + get { return provider.Name; } } - [MonoTODO] public int Version { - get { throw new NotImplementedException (); } + get { return 1; } } public void SetDirty () { listChanged = true; - listCached = false; + cachedRoles = null; + cachedArray = null; } } } From d16737b720382723bc3a4e79c287d08ee7311769 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Wed, 22 Mar 2006 20:38:04 +0000 Subject: [PATCH 056/117] **** Merged r56802 from MCS **** svn path=/trunk/mcs/; revision=58319 --- mcs/gmcs/ChangeLog | 19 +++++++++++++++++++ mcs/gmcs/class.cs | 31 ++++++++----------------------- mcs/gmcs/const.cs | 1 + mcs/gmcs/decl.cs | 3 --- mcs/gmcs/delegate.cs | 19 +++++++------------ mcs/gmcs/expression.cs | 22 +++++++++++----------- mcs/gmcs/generic.cs | 32 +++++++++++++++----------------- mcs/gmcs/iterators.cs | 1 + mcs/gmcs/tree.cs | 1 - 9 files changed, 62 insertions(+), 67 deletions(-) diff --git a/mcs/gmcs/ChangeLog b/mcs/gmcs/ChangeLog index ddbdb26d11a2a..6a0c13e513c88 100644 --- a/mcs/gmcs/ChangeLog +++ b/mcs/gmcs/ChangeLog @@ -137,6 +137,25 @@ (ConstraintChecker.CheckConstraints): If a type parameter has the `struct' constraint, the type must be a non-nullable valuetype. +2006-02-11 Marek Safar + + First of prerequisites for new partial classs implemention. + + * attribute.cs (Attributable): Extended by ResolveContext; + Attributes finally have correct context for resolving in all cases. + (AttachTo): Attribute owner is assigned here. + + * codegen.cs (IResolveContext): Introduce new interface to hold + all information needed in resolving phase. + (EmitContext): Implements IResolveContext; more clean-up needed here. + + * decl.cs (MemberCore): Implemented IResolveContext. + + * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs, + decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs, + parameter.cs, statement.cs, tree.cs, typemanager.cs: + Refactored to use new IResolveContext instead of EmitContext; cleanup + 2006-02-10 Martin Baulig * typemanager.cs diff --git a/mcs/gmcs/class.cs b/mcs/gmcs/class.cs index 09a3eb1c71fed..e59ab5c3c7328 100644 --- a/mcs/gmcs/class.cs +++ b/mcs/gmcs/class.cs @@ -1233,21 +1233,9 @@ public override TypeBuilder DefineType () TypeManager.AddUserType (this); if (Parts != null) { - ec = null; foreach (ClassPart part in Parts) { part.TypeBuilder = TypeBuilder; - part.ec = new EmitContext (this, part, Mono.CSharp.Location.Null, null, null, ModFlags); - part.ec.ContainerType = TypeBuilder; } - } else { - // - // Normally, we create the EmitContext here. - // The only exception is if we're an Iterator - in this case, - // we already have the `ec', so we don't want to create a new one. - // - if (ec == null) - ec = new EmitContext (this, this, Mono.CSharp.Location.Null, null, null, ModFlags); - ec.ContainerType = TypeBuilder; } if (IsGeneric) { @@ -1394,7 +1382,7 @@ public bool ResolveType () } foreach (TypeParameter type_param in TypeParameters) { - if (!type_param.DefineType (ec)) { + if (!type_param.DefineType (this)) { error = true; return false; } @@ -1405,19 +1393,19 @@ public bool ResolveType () } foreach (TypeParameter type_param in TypeParameters) - if (!type_param.CheckDependencies (ec)) { + if (!type_param.CheckDependencies ()) { error = true; return false; } if (current_type != null) { - current_type = current_type.ResolveAsTypeTerminal (ec, false); + current_type = current_type.ResolveAsTypeTerminal (this, false); if (current_type == null) { error = true; return false; } - CurrentType = current_type.ResolveType (ec); + CurrentType = current_type.ResolveType (this); } return true; @@ -1521,14 +1509,14 @@ protected virtual bool DoDefineMembers () if (iface_exprs != null) { foreach (TypeExpr iface in iface_exprs) { ConstructedType ct = iface as ConstructedType; - if ((ct != null) && !ct.CheckConstraints (ec)) + if ((ct != null) && !ct.CheckConstraints (this)) return false; } } if (base_type != null) { ConstructedType ct = base_type as ConstructedType; - if ((ct != null) && !ct.CheckConstraints (ec)) + if ((ct != null) && !ct.CheckConstraints (this)) return false; } @@ -1601,8 +1589,6 @@ protected virtual bool DoDefineMembers () if (CurrentType != null) { GenericType = CurrentType; - - ec.ContainerType = GenericType; } @@ -2415,7 +2401,6 @@ public override void CloseType () indexers = null; operators = null; iterators = null; - ec = null; default_constructor = null; default_static_constructor = null; type_bases = null; @@ -2942,7 +2927,7 @@ public bool DefineTypeParameters () if (new_constraints == null) continue; - if (!current_params [i].UpdateConstraints (ec, new_constraints)) { + if (!current_params [i].UpdateConstraints (this, new_constraints)) { Report.Error (265, Location, "Partial declarations of `{0}' have " + "inconsistent constraints for type parameter `{1}'.", MemberName.GetTypeName (), current_params [i].Name); @@ -2956,7 +2941,7 @@ public bool DefineTypeParameters () } foreach (TypeParameter type_param in PartialContainer.TypeParameters) { - if (!type_param.DefineType (ec)) + if (!type_param.DefineType (this)) return false; } diff --git a/mcs/gmcs/const.cs b/mcs/gmcs/const.cs index 7bff36905e80a..5f90e75170deb 100644 --- a/mcs/gmcs/const.cs +++ b/mcs/gmcs/const.cs @@ -135,6 +135,7 @@ public bool ResolveValue () } in_transit = true; + // TODO: IResolveContext here EmitContext ec = new EmitContext (this, Parent, Location, null, MemberType, ModFlags); value = initializer.ResolveAsConstant (ec, this); in_transit = false; diff --git a/mcs/gmcs/decl.cs b/mcs/gmcs/decl.cs index 5dc819eb95289..4a047de8ad442 100644 --- a/mcs/gmcs/decl.cs +++ b/mcs/gmcs/decl.cs @@ -674,9 +674,6 @@ public abstract class DeclSpace : MemberCore { readonly int count_type_params; readonly int count_current_type_params; - // The emit context for toplevel objects. - protected EmitContext ec; - // // Whether we are Generic // diff --git a/mcs/gmcs/delegate.cs b/mcs/gmcs/delegate.cs index 1eb4ff8b3193d..284b1da98d7cb 100644 --- a/mcs/gmcs/delegate.cs +++ b/mcs/gmcs/delegate.cs @@ -78,8 +78,6 @@ public override TypeBuilder DefineType () if (TypeBuilder != null) return TypeBuilder; - ec = new EmitContext (this, this, this, Location, null, null, ModFlags, false); - if (IsGeneric) { foreach (TypeParameter type_param in TypeParameters) if (!type_param.Resolve (this)) @@ -89,7 +87,7 @@ public override TypeBuilder DefineType () if (TypeManager.multicast_delegate_type == null && !RootContext.StdLib) { Namespace system = RootNamespace.Global.GetNamespace ("System", true); TypeExpr expr = system.Lookup (this, "MulticastDelegate", Location) as TypeExpr; - TypeManager.multicast_delegate_type = expr.ResolveType (ec); + TypeManager.multicast_delegate_type = expr.ResolveType (this); } if (TypeManager.multicast_delegate_type == null) @@ -135,7 +133,7 @@ public override TypeBuilder DefineType () Expression current = new SimpleName ( MemberName.Basename, TypeParameters, Location); - current = current.ResolveAsTypeTerminal (ec, false); + current = current.ResolveAsTypeTerminal (this, false); if (current == null) return null; @@ -152,12 +150,9 @@ public override bool Define () if (IsGeneric) { foreach (TypeParameter type_param in TypeParameters) - type_param.DefineType (ec); + type_param.DefineType (this); } - if (ec == null) - throw new InternalErrorException ("Define called before DefineType?"); - // FIXME: POSSIBLY make this static, as it is always constant // Type [] const_arg_types = new Type [2]; @@ -195,7 +190,7 @@ public override bool Define () // First, call the `out of band' special method for // defining recursively any types we need: - if (!Parameters.Resolve (ec)) + if (!Parameters.Resolve (this)) return false; // @@ -213,7 +208,7 @@ public override bool Define () } } - ReturnType = ReturnType.ResolveAsTypeTerminal (ec, false); + ReturnType = ReturnType.ResolveAsTypeTerminal (this, false); if (ReturnType == null) return false; @@ -302,7 +297,7 @@ public override bool Define () Parameter.Modifier.NONE, null, Location); Parameters async_parameters = new Parameters (async_params); - async_parameters.Resolve (ec); + async_parameters.Resolve (this); async_parameters.ApplyAttributes (BeginInvokeBuilder); TypeManager.RegisterMethod (BeginInvokeBuilder, async_parameters); @@ -345,7 +340,7 @@ public override bool Define () } Parameters end_parameters = new Parameters (end_params); - end_parameters.Resolve (ec); + end_parameters.Resolve (this); TypeManager.RegisterMethod (EndInvokeBuilder, end_parameters); diff --git a/mcs/gmcs/expression.cs b/mcs/gmcs/expression.cs index d8e82d247fd39..3a510c725d0c2 100644 --- a/mcs/gmcs/expression.cs +++ b/mcs/gmcs/expression.cs @@ -7460,9 +7460,9 @@ public override FullNamedExpression ResolveAsTypeStep (IResolveContext ec, bool return ResolveNamespaceOrType (ec, silent); } - public FullNamedExpression ResolveNamespaceOrType (IResolveContext ec, bool silent) + public FullNamedExpression ResolveNamespaceOrType (IResolveContext rc, bool silent) { - FullNamedExpression new_expr = expr.ResolveAsTypeStep (ec, silent); + FullNamedExpression new_expr = expr.ResolveAsTypeStep (rc, silent); if (new_expr == null) return null; @@ -7471,20 +7471,20 @@ public FullNamedExpression ResolveNamespaceOrType (IResolveContext ec, bool sile if (new_expr is Namespace) { Namespace ns = (Namespace) new_expr; - FullNamedExpression retval = ns.Lookup (ec.DeclContainer, lookup_id, loc); + FullNamedExpression retval = ns.Lookup (rc.DeclContainer, lookup_id, loc); if ((retval != null) && (args != null)) - retval = new ConstructedType (retval, args, loc).ResolveAsTypeStep (ec, false); + retval = new ConstructedType (retval, args, loc).ResolveAsTypeStep (rc, false); if (!silent && retval == null) Report.Error (234, loc, "The type or namespace name `{0}' does not exist in the namespace `{1}'. Are you missing an assembly reference?", Identifier, ns.FullName); return retval; } - TypeExpr tnew_expr = new_expr.ResolveAsTypeTerminal (ec, false); + TypeExpr tnew_expr = new_expr.ResolveAsTypeTerminal (rc, false); if (tnew_expr == null) return null; - Type expr_type = tnew_expr.ResolveType (ec); + Type expr_type = tnew_expr.ResolveType (rc); if (expr_type.IsPointer){ Error (23, "The `.' operator can not be applied to pointer operands (" + @@ -7493,11 +7493,11 @@ public FullNamedExpression ResolveNamespaceOrType (IResolveContext ec, bool sile } Expression member_lookup = MemberLookup ( - ec.DeclContainer.TypeBuilder, expr_type, expr_type, lookup_id, + rc.DeclContainer.TypeBuilder, expr_type, expr_type, lookup_id, MemberTypes.NestedType, BindingFlags.Public | BindingFlags.NonPublic, loc); if (member_lookup == null) { int errors = Report.Errors; - MemberLookupFailed (ec.DeclContainer.TypeBuilder, expr_type, expr_type, lookup_id, null, false, loc); + MemberLookupFailed (rc.DeclContainer.TypeBuilder, expr_type, expr_type, lookup_id, null, false, loc); if (!silent && errors == Report.Errors) { Report.Error (426, loc, "The nested type `{0}' does not exist in the type `{1}'", @@ -7507,11 +7507,11 @@ public FullNamedExpression ResolveNamespaceOrType (IResolveContext ec, bool sile } if (!(member_lookup is TypeExpr)) { - new_expr.Error_UnexpectedKind (ec.DeclContainer, "type", loc); + new_expr.Error_UnexpectedKind (rc.DeclContainer, "type", loc); return null; } - TypeExpr texpr = member_lookup.ResolveAsTypeTerminal (ec, false); + TypeExpr texpr = member_lookup.ResolveAsTypeTerminal (rc, false); if (texpr == null) return null; @@ -7531,7 +7531,7 @@ public FullNamedExpression ResolveNamespaceOrType (IResolveContext ec, bool sile if (the_args != null) { ConstructedType ctype = new ConstructedType (texpr.Type, the_args, loc); - return ctype.ResolveAsTypeStep (ec, false); + return ctype.ResolveAsTypeStep (rc, false); } return texpr; diff --git a/mcs/gmcs/generic.cs b/mcs/gmcs/generic.cs index 9b53ff9c90d51..0e18f4b4b0867 100644 --- a/mcs/gmcs/generic.cs +++ b/mcs/gmcs/generic.cs @@ -368,7 +368,7 @@ bool CheckTypeParameterConstraints (TypeParameter tparam, Hashtable seen) /// /// Resolve the constraints into actual types. /// - public bool ResolveTypes (EmitContext ec) + public bool ResolveTypes (IResolveContext ec) { if (resolved_types) return true; @@ -412,17 +412,17 @@ public bool ResolveTypes (EmitContext ec) /// where T : class /// where U : T, struct /// - public bool CheckDependencies (EmitContext ec) + public bool CheckDependencies () { foreach (TypeParameterExpr expr in type_param_constraints) { - if (!CheckDependencies (expr.TypeParameter, ec)) + if (!CheckDependencies (expr.TypeParameter)) return false; } return true; } - bool CheckDependencies (TypeParameter tparam, EmitContext ec) + bool CheckDependencies (TypeParameter tparam) { Constraints constraints = tparam.Constraints; if (constraints == null) @@ -456,7 +456,7 @@ bool CheckDependencies (TypeParameter tparam, EmitContext ec) return true; foreach (TypeParameterExpr expr in constraints.type_param_constraints) { - if (!CheckDependencies (expr.TypeParameter, ec)) + if (!CheckDependencies (expr.TypeParameter)) return false; } @@ -507,7 +507,7 @@ public bool IsSubclassOf (Type t) /// method. To do that, we're called on each of the implementing method's /// type parameters. /// - public bool CheckInterfaceMethod (EmitContext ec, GenericConstraints gc) + public bool CheckInterfaceMethod (GenericConstraints gc) { if (gc.Attributes != attrs) return false; @@ -649,7 +649,7 @@ public bool Resolve (DeclSpace ds) /// Note that we may have circular dependencies on type parameters - this /// is why Resolve() and ResolveType() are separate. /// - public bool ResolveType (EmitContext ec) + public bool ResolveType (IResolveContext ec) { if (constraints != null) { if (!constraints.ResolveTypes (ec)) { @@ -666,7 +666,7 @@ public bool ResolveType (EmitContext ec) /// process. We're called after everything is fully resolved and actually /// register the constraints with SRE and the TypeManager. /// - public bool DefineType (EmitContext ec) + public bool DefineType (IResolveContext ec) { return DefineType (ec, null, null, false); } @@ -679,7 +679,7 @@ public bool DefineType (EmitContext ec) /// The `builder', `implementing' and `is_override' arguments are only /// applicable to method type parameters. /// - public bool DefineType (EmitContext ec, MethodBuilder builder, + public bool DefineType (IResolveContext ec, MethodBuilder builder, MethodInfo implementing, bool is_override) { if (!ResolveType (ec)) @@ -710,7 +710,7 @@ public bool DefineType (EmitContext ec) if (constraints != null) { if (temp_gc == null) ok = false; - else if (!constraints.CheckInterfaceMethod (ec, gc)) + else if (!constraints.CheckInterfaceMethod (gc)) ok = false; } else { if (!is_override && (temp_gc != null)) @@ -764,10 +764,10 @@ public bool DefineType (EmitContext ec) /// where T : class /// where U : T, struct /// - public bool CheckDependencies (EmitContext ec) + public bool CheckDependencies () { if (constraints != null) - return constraints.CheckDependencies (ec); + return constraints.CheckDependencies (); return true; } @@ -780,7 +780,7 @@ public bool CheckDependencies (EmitContext ec) /// check that they're the same. /// con /// - public bool UpdateConstraints (EmitContext ec, Constraints new_constraints) + public bool UpdateConstraints (IResolveContext ec, Constraints new_constraints) { if (type == null) throw new InvalidOperationException (); @@ -796,7 +796,7 @@ public bool UpdateConstraints (EmitContext ec, Constraints new_constraints) if (!new_constraints.ResolveTypes (ec)) return false; - return constraints.CheckInterfaceMethod (ec, new_constraints); + return constraints.CheckInterfaceMethod (new_constraints); } public void EmitAttributes () @@ -1750,8 +1750,6 @@ public override TypeBuilder DefineType () public override bool Define () { - ec = new EmitContext (this, this, this, Location, null, null, ModFlags, false); - for (int i = 0; i < TypeParameters.Length; i++) if (!TypeParameters [i].Resolve (this)) return false; @@ -1778,7 +1776,7 @@ public bool Define (MethodBuilder mb) return false; for (int i = 0; i < TypeParameters.Length; i++) { - if (!TypeParameters [i].ResolveType (ec)) + if (!TypeParameters [i].ResolveType (this)) return false; } diff --git a/mcs/gmcs/iterators.cs b/mcs/gmcs/iterators.cs index 729017a3bc280..4e19463512ec2 100644 --- a/mcs/gmcs/iterators.cs +++ b/mcs/gmcs/iterators.cs @@ -156,6 +156,7 @@ public class Iterator : Class { Expression generic_enumerator_type; Expression generic_enumerable_type; TypeArguments generic_args; + EmitContext ec; protected enum State { Uninitialized = -2, diff --git a/mcs/gmcs/tree.cs b/mcs/gmcs/tree.cs index c66f17a9979bf..cb2ab7f61de9d 100644 --- a/mcs/gmcs/tree.cs +++ b/mcs/gmcs/tree.cs @@ -76,7 +76,6 @@ public sealed class RootTypes : TypeContainer public RootTypes () : base (null, null, MemberName.Null, null, Kind.Root) { - ec = new EmitContext (this, null, this, Location.Null, null, null, 0, false); } public override PendingImplementation GetPendingImplementations () From 724724bcf50875adefa085f20f180aec72246621 Mon Sep 17 00:00:00 2001 From: Robert Jordan Date: Wed, 22 Mar 2006 21:26:40 +0000 Subject: [PATCH 057/117] 2006-03-22 Robert Jordan * HttpCachePolicy.cs: fix the Cache-control header. Fixes bug #77826. svn path=/trunk/mcs/; revision=58322 --- mcs/class/System.Web/System.Web/ChangeLog | 4 ++ .../System.Web/System.Web/HttpCachePolicy.cs | 45 ++++++++++++------- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/mcs/class/System.Web/System.Web/ChangeLog b/mcs/class/System.Web/System.Web/ChangeLog index 2e114cb52d937..b411f50c16c31 100644 --- a/mcs/class/System.Web/System.Web/ChangeLog +++ b/mcs/class/System.Web/System.Web/ChangeLog @@ -1,3 +1,7 @@ +2006-03-22 Robert Jordan + + * HttpCachePolicy.cs: fix the Cache-control header. Fixes bug #77826. + 2006-03-22 Chris Toshok * HttpApplication.cs: fix typo - AuthenticateRequest => diff --git a/mcs/class/System.Web/System.Web/HttpCachePolicy.cs b/mcs/class/System.Web/System.Web/HttpCachePolicy.cs index 81ab93106fc55..8ac166e9b0172 100644 --- a/mcs/class/System.Web/System.Web/HttpCachePolicy.cs +++ b/mcs/class/System.Web/System.Web/HttpCachePolicy.cs @@ -317,26 +317,41 @@ public void SetAllowResponseInBrowserHistory (bool allow) internal void SetHeaders (HttpResponse response, ArrayList headers) { - string cc, expires; - if (Cacheability > HttpCacheability.NoCache) { - string c = Cacheability.ToString ().ToLower (CultureInfo.InvariantCulture); - - if (MaxAge.TotalSeconds != 0) - cc = String.Format ("{0}, max-age={1}", c, (long) MaxAge.TotalSeconds); - else - cc = c; - - expires = TimeUtil.ToUtcTimeString (expire_date); - headers.Add (new UnknownResponseHeader ("Expires", expires)); - } else { + bool noCache = false; + string cc = null; + + switch (Cacheability) { + case HttpCacheability.Public: + cc = "public"; + break; + + case HttpCacheability.Private: + case HttpCacheability.ServerAndPrivate: + cc = "private"; + break; + + case HttpCacheability.NoCache: + case HttpCacheability.ServerAndNoCache: + default: + noCache = true; cc = "no-cache"; + break; + } + + if (noCache) { response.CacheControl = cc; if (!allow_response_in_browser_history) { - expires = "-1"; - headers.Add (new UnknownResponseHeader ("Expires", expires)); + headers.Add (new UnknownResponseHeader ("Expires", "-1")); + headers.Add (new UnknownResponseHeader ("Pragma", "no-cache")); } + } else { + if (MaxAge.TotalSeconds != 0) + cc = String.Format ("{0}, max-age={1}", cc, (long) MaxAge.TotalSeconds); + + string expires = TimeUtil.ToUtcTimeString (expire_date); + headers.Add (new UnknownResponseHeader ("Expires", expires)); } - + headers.Add (new UnknownResponseHeader ("Cache-Control", cc)); if (etag != null) From 54d4ec5752488382dccdf4fa2d4e924d07392814 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Wed, 22 Mar 2006 21:59:32 +0000 Subject: [PATCH 058/117] 2006-03-22 Chris Toshok * data/net_2_0/web.config: add RoleManagerModule to httpModules. * data/net_2_0/machine.config: add system.web/roleManager section handler. svn path=/trunk/mono/; revision=58324 --- ChangeLog | 7 +++++++ data/net_2_0/machine.config | 1 + data/net_2_0/web.config | 5 +++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41ead10b21dcc..c5f7bacc95ff8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-03-22 Chris Toshok + + * data/net_2_0/web.config: add RoleManagerModule to httpModules. + + * data/net_2_0/machine.config: add system.web/roleManager section + handler. + 2006-03-20 Zoltan Varga * libmono.vcproj: Add some newly added source files. diff --git a/data/net_2_0/machine.config b/data/net_2_0/machine.config index caeab23caedab..119a250e6216c 100644 --- a/data/net_2_0/machine.config +++ b/data/net_2_0/machine.config @@ -25,6 +25,7 @@
+
diff --git a/data/net_2_0/web.config b/data/net_2_0/web.config index 8afa2229fc868..4ad70bd68cea2 100644 --- a/data/net_2_0/web.config +++ b/data/net_2_0/web.config @@ -36,9 +36,10 @@ - - + + + From 6f4a0334983a0fb3b4113b008181dfa31e10b646 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Wed, 22 Mar 2006 22:07:27 +0000 Subject: [PATCH 059/117] 2006-03-22 Mike Kestner * Theme.cs: add Color param to CPDrawMenuGlyph. * ThemeWin32Classic.cs: do color specific menu glyph rendering so that checks and radio marks and arrows are visible on highlighted items. * ControlPaint.cs: update to use new Theme signature. svn path=/trunk/mcs/; revision=58325 --- .../System.Windows.Forms/ChangeLog | 7 +++ .../System.Windows.Forms/ControlPaint.cs | 2 +- .../System.Windows.Forms/Theme.cs | 2 +- .../System.Windows.Forms/ThemeWin32Classic.cs | 50 ++++++++++--------- 4 files changed, 36 insertions(+), 25 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 208d1f0e60bc8..5fe5fc6dbedd3 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,10 @@ +2006-03-22 Mike Kestner + + * Theme.cs: add Color param to CPDrawMenuGlyph. + * ThemeWin32Classic.cs: do color specific menu glyph rendering so that + checks and radio marks and arrows are visible on highlighted items. + * ControlPaint.cs: update to use new Theme signature. + 2006-03-22 Mike Kestner * MenuAPI.cs: only process Enter and arrow keypresses if the tracker diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlPaint.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlPaint.cs index 028bf52bfbc23..634c3b1d53f74 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlPaint.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlPaint.cs @@ -374,7 +374,7 @@ public sealed class ControlPaint { public static void DrawMenuGlyph(Graphics graphics, Rectangle rectangle, MenuGlyph glyph) { - ThemeEngine.Current.CPDrawMenuGlyph (graphics, rectangle, glyph); + ThemeEngine.Current.CPDrawMenuGlyph (graphics, rectangle, glyph, ThemeEngine.Current.ColorMenuText); } public static void DrawMenuGlyph(Graphics graphics, int x, int y, int width, int height, MenuGlyph glyph) { diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs index f24b03d9bbf4a..30914006e1bcc 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs @@ -835,7 +835,7 @@ public virtual void SetColor (XplatUIWin32.GetSysColorIndex idx, Color color) public abstract void CPDrawGrid (Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor); public abstract void CPDrawImageDisabled (Graphics graphics, Image image, int x, int y, Color background); public abstract void CPDrawLockedFrame (Graphics graphics, Rectangle rectangle, bool primary); - public abstract void CPDrawMenuGlyph (Graphics graphics, Rectangle rectangle, MenuGlyph glyph); + public abstract void CPDrawMenuGlyph (Graphics graphics, Rectangle rectangle, MenuGlyph glyph, Color color); public abstract void CPDrawRadioButton (Graphics graphics, Rectangle rectangle, ButtonState state); public abstract void CPDrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style); public abstract void CPDrawReversibleLine (Point start, Point end, Color backColor); diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs index 7209db15412ed..89857effb09bd 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs @@ -1894,6 +1894,24 @@ public override void DrawMenuBar (Graphics dc, Menu menu, Rectangle rect) } } + Bitmap CreateGlyphBitmap (Size size, MenuGlyph glyph, Color color) + { + Color bg_color; + if (color.R == 0 && color.G == 0 && color.B == 0) + bg_color = Color.White; + else + bg_color = Color.Black; + Console.WriteLine (color + " " + bg_color); + Bitmap bmp = new Bitmap (size.Width, size.Height); + Graphics gr = Graphics.FromImage (bmp); + Rectangle rect = new Rectangle (Point.Empty, size); + gr.FillRectangle (ResPool.GetSolidBrush (bg_color), rect); + CPDrawMenuGlyph (gr, rect, glyph, color); + bmp.MakeTransparent (bg_color); + gr.Dispose (); + return bmp; + } + public override void DrawMenuItem (MenuItem item, DrawItemEventArgs e) { StringFormat string_format; @@ -1974,11 +1992,7 @@ public override void DrawMenuItem (MenuItem item, DrawItemEventArgs e) int cx = MenuCheckSize.Width; int cy = MenuCheckSize.Height; - Bitmap bmp = new Bitmap (cx, cy); - Graphics gr = Graphics.FromImage (bmp); - Rectangle rect_arrow = new Rectangle (0, 0, cx, cy); - ControlPaint.DrawMenuGlyph (gr, rect_arrow, MenuGlyph.Arrow); - bmp.MakeTransparent (); + Bitmap bmp = CreateGlyphBitmap (new Size (cx, cy), MenuGlyph.Arrow, color_text); if (item.Enabled) { e.Graphics.DrawImage (bmp, e.Bounds.X + e.Bounds.Width - cx, @@ -1988,7 +2002,6 @@ public override void DrawMenuItem (MenuItem item, DrawItemEventArgs e) e.Bounds.Y + ((e.Bounds.Height - cy) /2), color_back); } - gr.Dispose (); bmp.Dispose (); } @@ -1998,19 +2011,10 @@ public override void DrawMenuItem (MenuItem item, DrawItemEventArgs e) Rectangle area = e.Bounds; int cx = MenuCheckSize.Width; int cy = MenuCheckSize.Height; - Bitmap bmp = new Bitmap (cx, cy); - Graphics gr = Graphics.FromImage (bmp); - Rectangle rect_arrow = new Rectangle (0, 0, cx, cy); + Bitmap bmp = CreateGlyphBitmap (new Size (cx, cy), item.RadioCheck ? MenuGlyph.Bullet : MenuGlyph.Checkmark, color_text); - if (item.RadioCheck) - ControlPaint.DrawMenuGlyph (gr, rect_arrow, MenuGlyph.Bullet); - else - ControlPaint.DrawMenuGlyph (gr, rect_arrow, MenuGlyph.Checkmark); - - bmp.MakeTransparent (); e.Graphics.DrawImage (bmp, area.X, e.Bounds.Y + ((e.Bounds.Height - cy) / 2)); - gr.Dispose (); bmp.Dispose (); } } @@ -4760,12 +4764,11 @@ the display. } - public override void CPDrawMenuGlyph (Graphics graphics, Rectangle rectangle, MenuGlyph glyph) { + public override void CPDrawMenuGlyph (Graphics graphics, Rectangle rectangle, MenuGlyph glyph, Color color) { Rectangle rect; int lineWidth; - // MS draws always the background white - graphics.FillRectangle(ResPool.GetSolidBrush (Color.White), rectangle); + Brush brush = ResPool.GetSolidBrush (color); switch(glyph) { case MenuGlyph.Arrow: { @@ -4793,7 +4796,7 @@ the display. arrow[1]=P2; arrow[2]=P3; - graphics.FillPolygon(SystemBrushes.ControlText, arrow, FillMode.Winding); + graphics.FillPolygon(brush, arrow, FillMode.Winding); return; } @@ -4803,13 +4806,14 @@ the display. lineWidth=Math.Max(2, rectangle.Width/3); rect=new Rectangle(rectangle.X+lineWidth, rectangle.Y+lineWidth, rectangle.Width-lineWidth*2, rectangle.Height-lineWidth*2); - graphics.FillEllipse(ResPool.GetSolidBrush (ColorControlText), rect); + graphics.FillEllipse(brush, rect); return; } case MenuGlyph.Checkmark: { int Scale; + Pen pen = ResPool.GetPen (color); lineWidth=Math.Max(2, rectangle.Width/6); Scale=Math.Max(1, rectangle.Width/12); @@ -4817,8 +4821,8 @@ the display. rect=new Rectangle(rectangle.X+lineWidth, rectangle.Y+lineWidth, rectangle.Width-lineWidth*2, rectangle.Height-lineWidth*2); for (int i=0; i Date: Wed, 22 Mar 2006 22:29:53 +0000 Subject: [PATCH 060/117] 2006-03-22 Marek Safar * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs, expression.cs, typemanager.cs: Minor changes from gmcs to make merging easier. svn path=/trunk/mcs/; revision=58326 --- mcs/mcs/ChangeLog | 6 +++++ mcs/mcs/assign.cs | 2 -- mcs/mcs/class.cs | 19 +++++++-------- mcs/mcs/codegen.cs | 9 ------- mcs/mcs/convert.cs | 2 +- mcs/mcs/decl.cs | 13 ++++++----- mcs/mcs/ecore.cs | 24 +++++++++---------- mcs/mcs/expression.cs | 53 ++++++++++++++++++++++-------------------- mcs/mcs/typemanager.cs | 5 ++-- 9 files changed, 64 insertions(+), 69 deletions(-) diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog index 859ea30efbcde..5331c072e0d9b 100644 --- a/mcs/mcs/ChangeLog +++ b/mcs/mcs/ChangeLog @@ -1,3 +1,9 @@ +2006-03-22 Marek Safar + + * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs, + expression.cs, typemanager.cs: Minor changes from gmcs to make merging + easier. + 2006-03-22 Raja R Harinath Support ParameterDefaultValueAttribute in gmcs. Also applied to diff --git a/mcs/mcs/assign.cs b/mcs/mcs/assign.cs index b7fe470fea51b..621b3be258b2a 100644 --- a/mcs/mcs/assign.cs +++ b/mcs/mcs/assign.cs @@ -373,7 +373,6 @@ public override Expression DoResolve (EmitContext ec) type = target_type; eclass = ExprClass.Value; - if (target is EventExpr) { EventInfo ei = ((EventExpr) target).EventInfo; @@ -480,7 +479,6 @@ public override Expression DoResolve (EmitContext ec) } source = Convert.ImplicitConversionRequired (ec, source, target_type, loc); - if (source == null) return null; diff --git a/mcs/mcs/class.cs b/mcs/mcs/class.cs index cf50d34a40f17..74544a5c9162a 100644 --- a/mcs/mcs/class.cs +++ b/mcs/mcs/class.cs @@ -889,7 +889,7 @@ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder return delegates; } } - + protected override TypeAttributes TypeAttr { get { return Modifiers.TypeAttr (ModFlags, this) | base.TypeAttr; @@ -4385,13 +4385,13 @@ public bool Define (DeclSpace parent) if (implementing == null){ if (member is PropertyBase) { Report.Error (550, method.Location, "`{0}' is an accessor not found in interface member `{1}{2}'", - method.GetSignatureForError (), TypeManager.CSharpName (member.InterfaceType), - member.GetSignatureForError ().Substring (member.GetSignatureForError ().LastIndexOf ('.'))); + method.GetSignatureForError (), TypeManager.CSharpName (member.InterfaceType), + member.GetSignatureForError ().Substring (member.GetSignatureForError ().LastIndexOf ('.'))); } else { Report.Error (539, method.Location, - "`{0}.{1}' in explicit interface declaration is not a member of interface", - TypeManager.CSharpName (member.InterfaceType), member.ShortName); + "`{0}.{1}' in explicit interface declaration is not a member of interface", + TypeManager.CSharpName (member.InterfaceType), member.ShortName); } return false; } @@ -4737,7 +4737,6 @@ protected virtual bool CheckBase () return true; } - protected virtual bool DoDefine () { if (Name == null) @@ -6007,7 +6006,7 @@ protected override MethodInfo FindOutBaseMethod (ref Type base_ret_type) // Get the less restrictive access // return get_accessor_access > set_accessor_access ? get_accessor : set_accessor; - } + } public override void Emit () { @@ -6453,7 +6452,7 @@ protected override void ApplyToExtraTarget(Attribute a, CustomAttributeBuilder c } } - public override bool IsClsComplianceRequired() + public override bool IsClsComplianceRequired () { return method.IsClsComplianceRequired (); } @@ -6597,8 +6596,8 @@ public override bool Define () if (!DoDefine ()) return false; - - if (!MemberType.IsSubclassOf (TypeManager.delegate_type)) { + + if (!TypeManager.IsDelegateType (MemberType)) { Report.Error (66, Location, "`{0}': event must be of a delegate type", GetSignatureForError ()); return false; } diff --git a/mcs/mcs/codegen.cs b/mcs/mcs/codegen.cs index 372f29a87acf0..da0ee9f340eb3 100644 --- a/mcs/mcs/codegen.cs +++ b/mcs/mcs/codegen.cs @@ -1300,15 +1300,6 @@ public override void Emit (TypeContainer tc) Report.RuntimeMissingSupport (Location.Null, "assembly permission setting"); } } - -#if NET_2_0 - if (!OptAttributes.Contains (TypeManager.runtime_compatibility_attr_type, null)) { - ConstructorInfo ci = TypeManager.runtime_compatibility_attr_type.GetConstructor (Type.EmptyTypes); - PropertyInfo pi = TypeManager.runtime_compatibility_attr_type.GetProperty ("WrapNonExceptionThrows"); - Builder.SetCustomAttribute (new CustomAttributeBuilder (ci, new object [0], - new PropertyInfo [] { pi }, new object[] { true } )); - } -#endif } public override string[] ValidAttributeTargets { diff --git a/mcs/mcs/convert.cs b/mcs/mcs/convert.cs index 05810a9803f43..ac7abc7c59edc 100644 --- a/mcs/mcs/convert.cs +++ b/mcs/mcs/convert.cs @@ -1637,7 +1637,7 @@ static Expression ExplicitReferenceConversion (Expression source, Type target_ty // From System delegate to any delegate-type // if (source_type == TypeManager.delegate_type && - target_type.IsSubclassOf (TypeManager.delegate_type)) + TypeManager.IsDelegateType (target_type)) return new ClassCast (source, target_type); // diff --git a/mcs/mcs/decl.cs b/mcs/mcs/decl.cs index a57aa3553f37e..19303919f871f 100644 --- a/mcs/mcs/decl.cs +++ b/mcs/mcs/decl.cs @@ -625,9 +625,11 @@ protected virtual bool AddToContainer (MemberCore symbol, string name) "The namespace `{0}' already contains a definition for `{1}'", ((DeclSpace)symbol).NamespaceEntry.GetSignatureForError (), symbol.MemberName.Name); } else { - Report.Error (102, symbol.Location, "The type `{0}' already contains a definition for `{1}'", - GetSignatureForError (), symbol.MemberName.Name); + Report.Error (102, symbol.Location, + "The type `{0}' already contains a definition for `{1}'", + GetSignatureForError (), symbol.MemberName.Name); } + return false; } @@ -779,7 +781,7 @@ protected bool FamilyAccessible (Type check_type) // Access level of a type. const int X = 1; enum AccessLevel { // Each column represents `is this scope larger or equal to Blah scope' - // Public Assembly Protected + // Public Assembly Protected Protected = (0 << 0) | (0 << 1) | (X << 2), Public = (X << 0) | (X << 1) | (X << 2), Private = (0 << 0) | (0 << 1) | (0 << 2), @@ -813,8 +815,7 @@ static AccessLevel GetAccessLevelFromModifiers (int flags) AccessLevel myAccess = GetAccessLevelFromModifiers (ModFlags); if (!IsTopLevel && (Parent != null)) return myAccess & Parent.EffectiveAccessLevel; - else - return myAccess; + return myAccess; } } @@ -822,7 +823,7 @@ static AccessLevel GetAccessLevelFromModifiers (int flags) static AccessLevel TypeEffectiveAccessLevel (Type t) { if (t.IsPublic) - return AccessLevel.Public; + return AccessLevel.Public; if (t.IsNestedPrivate) return AccessLevel.Private; if (t.IsNotPublic) diff --git a/mcs/mcs/ecore.cs b/mcs/mcs/ecore.cs index 5966502089a55..bea2f75f5b744 100644 --- a/mcs/mcs/ecore.cs +++ b/mcs/mcs/ecore.cs @@ -2172,7 +2172,7 @@ public virtual bool CanInheritFrom () return true; } - public abstract TypeExpr DoResolveAsTypeStep (IResolveContext ec); + protected abstract TypeExpr DoResolveAsTypeStep (IResolveContext ec); public abstract string Name { get; @@ -2209,7 +2209,7 @@ public TypeExpression (Type t, Location l) loc = l; } - public override TypeExpr DoResolveAsTypeStep (IResolveContext ec) + protected override TypeExpr DoResolveAsTypeStep (IResolveContext ec) { return this; } @@ -2252,7 +2252,7 @@ public override TypeExpr ResolveAsTypeTerminal (IResolveContext ec, bool silent) } static readonly char [] dot_array = { '.' }; - public override TypeExpr DoResolveAsTypeStep (IResolveContext ec) + protected override TypeExpr DoResolveAsTypeStep (IResolveContext ec) { // If name is of the form `N.I', first lookup `N', then search a member `I' in it. string rest = null; @@ -2337,7 +2337,7 @@ public TypeAliasExpression (TypeExpr texpr, Location l) get { return texpr.FullName; } } - public override TypeExpr DoResolveAsTypeStep (IResolveContext ec) + protected override TypeExpr DoResolveAsTypeStep (IResolveContext ec) { return texpr; } @@ -2952,15 +2952,13 @@ public void Emit (EmitContext ec, bool leave_copy) ILGenerator ig = ec.ig; bool is_volatile = false; - if (FieldInfo is FieldBuilder){ - FieldBase f = TypeManager.GetField (FieldInfo); - if (f != null){ - if ((f.ModFlags & Modifiers.VOLATILE) != 0) - is_volatile = true; - - f.SetMemberIsUsed (); - } - } + FieldBase f = TypeManager.GetField (FieldInfo); + if (f != null){ + if ((f.ModFlags & Modifiers.VOLATILE) != 0) + is_volatile = true; + + f.SetMemberIsUsed (); + } if (FieldInfo.IsStatic){ if (is_volatile) diff --git a/mcs/mcs/expression.cs b/mcs/mcs/expression.cs index a3a35126bfe1e..afb6734945bb7 100644 --- a/mcs/mcs/expression.cs +++ b/mcs/mcs/expression.cs @@ -990,7 +990,6 @@ void EmitCode (EmitContext ec, bool is_expr) this.is_expr = is_expr; ((IAssignMethod) expr).EmitAssign (ec, this, is_expr && (mode == Mode.PreIncrement || mode == Mode.PreDecrement), true); } - public override void Emit (EmitContext ec) { @@ -1187,7 +1186,7 @@ public override Expression DoResolve (EmitContext ec) } return this; - } + } } /// @@ -2029,7 +2028,7 @@ Expression ResolveOperator (EmitContext ec) // +, -, *, /, %, &, |, ^, ==, !=, <, >, <=, >= // if (oper == Operator.Addition || oper == Operator.Subtraction) { - if (l.IsSubclassOf (TypeManager.delegate_type)){ + if (TypeManager.IsDelegateType (l)){ if (((right.eclass == ExprClass.MethodGroup) || (r == TypeManager.anonymous_method_type))){ if ((RootContext.Version != LanguageVersion.ISO_1)){ @@ -2040,15 +2039,15 @@ Expression ResolveOperator (EmitContext ec) r = right.Type; } } - - if (r.IsSubclassOf (TypeManager.delegate_type)){ + + if (TypeManager.IsDelegateType (r)){ MethodInfo method; ArrayList args = new ArrayList (2); - + args = new ArrayList (2); args.Add (new Argument (left, Argument.AType.Expression)); args.Add (new Argument (right, Argument.AType.Expression)); - + if (oper == Operator.Addition) method = TypeManager.delegate_combine_delegate_delegate; else @@ -2058,11 +2057,11 @@ Expression ResolveOperator (EmitContext ec) Error_OperatorCannotBeApplied (); return null; } - + return new BinaryDelegate (l, method, args); } } - + // // Pointer arithmetic: // @@ -3471,7 +3470,7 @@ protected Expression DoResolveBase (EmitContext ec, Expression lvalue_right_side if (variable_info != null) variable_info.SetAssigned (ec); } - + Expression e = Block.GetConstantExpression (Name); if (e != null) { local_info.Used = true; @@ -3698,7 +3697,7 @@ public void SetAssigned (EmitContext ec) ec.CurrentBranching.SetAssigned (vi); } - public void SetFieldAssigned (EmitContext ec, string field_name) + public void SetFieldAssigned (EmitContext ec, string field_name) { if (is_out && ec.DoFlowAnalysis) ec.CurrentBranching.SetFieldAssigned (vi, field_name); @@ -4240,9 +4239,9 @@ static Type BetterConversion (EmitContext ec, Argument a, Type p, Type q) /// and the current best match /// /// - /// Returns an integer indicating : + /// Returns a boolean indicating : /// false if candidate ain't better - /// true if candidate is better than the current best match + /// true if candidate is better than the current best match /// static bool BetterFunction (EmitContext ec, ArrayList args, int argument_count, MethodBase candidate, bool candidate_params, @@ -4538,7 +4537,7 @@ public static MethodGroupExpr MakeUnionSet (Expression mg1, Expression mg2, Loca static internal bool IsAncestralType (Type first_type, Type second_type) { return first_type != second_type && - (second_type.IsSubclassOf (first_type) || + (TypeManager.IsSubclassOf (second_type, first_type) || TypeManager.ImplementsInterface (second_type, first_type)); } @@ -4559,7 +4558,7 @@ static internal bool IsAncestralType (Type first_type, Type second_type) /// /// public static MethodBase OverloadResolve (EmitContext ec, MethodGroupExpr me, - ArrayList Arguments, bool may_fail, + ArrayList Arguments, bool may_fail, Location loc) { MethodBase method = null; @@ -4825,11 +4824,13 @@ static internal bool IsAncestralType (Type first_type, Type second_type) method_params, null, may_fail, loc)) return null; - if (method != null) { - IMethodData data = TypeManager.GetMethod (method); - if (data != null) - data.SetMemberIsUsed (); - } + if (method == null) + return null; + + IMethodData data = TypeManager.GetMethod (method); + if (data != null) + data.SetMemberIsUsed (); + return method; } @@ -5286,7 +5287,6 @@ static bool IsMethodExcluded (MethodBase method) if (oa != null) AttributeTester.Report_ObsoleteMessage (oa, TypeManager.CSharpSignature (method), loc); - oa = AttributeTester.GetObsoleteAttribute (method.DeclaringType); if (oa != null) { AttributeTester.Report_ObsoleteMessage (oa, method.DeclaringType.FullName, loc); @@ -5305,13 +5305,16 @@ static bool IsMethodExcluded (MethodBase method) this_call = instance_expr is This; if (decl_type.IsValueType || (!this_call && instance_expr.Type.IsValueType)) struct_call = true; - + + // + // If this is ourselves, push "this" + // if (!omit_args) { Type t = null; // // Push the instance expression // - if (instance_expr.Type.IsValueType) { + if (TypeManager.IsValueType (instance_expr.Type)) { // // Special case: calls to a function declared in a // reference-type with a value-type argument need @@ -5767,7 +5770,7 @@ public override Expression DoResolve (EmitContext ec) // bool DoEmit (EmitContext ec, bool need_value_on_stack) { - bool is_value_type = type.IsValueType; + bool is_value_type = TypeManager.IsValueType (type); ILGenerator ig = ec.ig; if (is_value_type){ @@ -8371,7 +8374,7 @@ public ComposedCast (Expression left, string dim, Location l) loc = l; } - public override TypeExpr DoResolveAsTypeStep (IResolveContext ec) + protected override TypeExpr DoResolveAsTypeStep (IResolveContext ec) { TypeExpr lexpr = left.ResolveAsTypeTerminal (ec, false); if (lexpr == null) diff --git a/mcs/mcs/typemanager.cs b/mcs/mcs/typemanager.cs index 47d7e25bfacf4..c65cf80ef1085 100644 --- a/mcs/mcs/typemanager.cs +++ b/mcs/mcs/typemanager.cs @@ -1749,7 +1749,6 @@ public static Type[] ExpandInterfaces (TypeExpr [] base_interfaces) /// public static Type [] GetInterfaces (Type t) { - Type [] cached = iface_cache [t] as Type []; if (cached != null) return cached; @@ -2453,9 +2452,9 @@ internal bool Filter (MemberInfo m, object filter_criteria) return (MemberInfo []) first_members_list; } - if (method_list != null && method_list.Count > 0) + if (method_list != null && method_list.Count > 0) { return (MemberInfo []) method_list.ToArray (typeof (MemberInfo)); - + } // // This happens if we already used the cache in the first iteration, in this case // the cache already looked in all interfaces. From 30611a18eaad8250fba41c97bb16de27ca747902 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Wed, 22 Mar 2006 22:36:54 +0000 Subject: [PATCH 061/117] 2006-03-22 Mike Kestner * FileDialog.cs: make the DropDownMenu on the toolbar display RadioChecks since they are mutually exclusive and that's what MS does. svn path=/trunk/mcs/; revision=58327 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 5 +++++ .../Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 5fe5fc6dbedd3..c0e662a09b982 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2006-03-22 Mike Kestner + + * FileDialog.cs: make the DropDownMenu on the toolbar display + RadioChecks since they are mutually exclusive and that's what MS does. + 2006-03-22 Mike Kestner * Theme.cs: add Color param to CPDrawMenuGlyph. diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs index 300f5defbba3a..771e9bc39c8e8 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs @@ -252,16 +252,21 @@ internal FileDialog () // menueToolBarButtonContextMenu MenuItem mi = new MenuItem ("Small Icon", new EventHandler (OnClickMenuToolBarContextMenu)); + mi.RadioCheck = true; menueToolBarButtonContextMenu.MenuItems.Add (mi); mi = new MenuItem ("Tiles", new EventHandler (OnClickMenuToolBarContextMenu)); + mi.RadioCheck = true; menueToolBarButtonContextMenu.MenuItems.Add (mi); mi = new MenuItem ("Large Icon", new EventHandler (OnClickMenuToolBarContextMenu)); + mi.RadioCheck = true; menueToolBarButtonContextMenu.MenuItems.Add (mi); mi = new MenuItem ("List", new EventHandler (OnClickMenuToolBarContextMenu)); + mi.RadioCheck = true; mi.Checked = true; previousCheckedMenuItem = mi; menueToolBarButtonContextMenu.MenuItems.Add (mi); mi = new MenuItem ("Details", new EventHandler (OnClickMenuToolBarContextMenu)); + mi.RadioCheck = true; menueToolBarButtonContextMenu.MenuItems.Add (mi); // contextMenu From 8a53f609ac6f22b916ca87299b1d983d9385366c Mon Sep 17 00:00:00 2001 From: Gonzalo Paniagua Javier Date: Wed, 22 Mar 2006 22:58:21 +0000 Subject: [PATCH 062/117] 2006-03-22 Gonzalo Paniagua Javier * icall.c: CodeBase returns '/' instead of '\\' on windows. Fixes bug #77877. svn path=/trunk/mono/; revision=58328 --- mono/metadata/ChangeLog | 5 +++++ mono/metadata/icall.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/mono/metadata/ChangeLog b/mono/metadata/ChangeLog index b517b56e0f44a..a5f1d9241f2bc 100644 --- a/mono/metadata/ChangeLog +++ b/mono/metadata/ChangeLog @@ -1,3 +1,8 @@ +2006-03-22 Gonzalo Paniagua Javier + + * icall.c: CodeBase returns '/' instead of '\\' on windows. Fixes + bug #77877. + 2006-03-22 Martin Baulig * reflection.c (fieldbuilder_to_mono_class_field): Don't store the diff --git a/mono/metadata/icall.c b/mono/metadata/icall.c index 40a7dbd61e0f2..e03b67fc82599 100644 --- a/mono/metadata/icall.c +++ b/mono/metadata/icall.c @@ -3704,6 +3704,14 @@ ves_icall_System_Reflection_Assembly_get_code_base (MonoReflectionAssembly *asse MONO_ARCH_SAVE_REGS; absolute = g_build_filename (mass->basedir, mass->image->module_name, NULL); +#if PLATFORM_WIN32 + { + gint i; + for (i = strlen (absolute) - 1; i >= 0; i--) + if (absolute [i] == '\\') + absolute [i] = '/'; + } +#endif if (escaped) { uri = g_filename_to_uri (absolute, NULL, NULL); } else { From 34cde6d4d8578a0e6a29e43587ca657fe2b838f0 Mon Sep 17 00:00:00 2001 From: Peter Dennis Bartok Date: Thu, 23 Mar 2006 07:34:16 +0000 Subject: [PATCH 063/117] 2006-03-23 Peter Dennis Bartok * gdipFunctions.cs: - GdipGetFontCollectionFamilyList: No need for complicated GlobalAlloc stuff, .Net marshals the IntPtr[] array just fine - GdipDeletePrivateFontCollection: We need to pass a ref to the structure. This was causing nasty crashes. - GdipGetFamilyName: Switched to use StringBuilder instead of manual marshalling * FontFamily.cs: Simplified the refreshName method, less error-prone now 2006-03-23 Peter Dennis Bartok * FontCollection.cs (get_Families): Now letting the runtime do the marshalling work for us. Easier to maintain and cleaner code. * PrivateFontCollection.cs: - AddFontFile: Fixed weird english in error message - Dispose: Need to pass ref to the native object, we were crashing badly svn path=/trunk/mcs/; revision=58338 --- .../System.Drawing.Text/ChangeLog | 9 ++++++++ .../System.Drawing.Text/FontCollection.cs | 18 ++++++++-------- .../PrivateFontCollection.cs | 10 ++++----- .../System.Drawing/System.Drawing/ChangeLog | 11 ++++++++++ .../System.Drawing/FontFamily.cs | 21 +++++++------------ .../System.Drawing/gdipFunctions.cs | 11 +++++----- 6 files changed, 48 insertions(+), 32 deletions(-) diff --git a/mcs/class/System.Drawing/System.Drawing.Text/ChangeLog b/mcs/class/System.Drawing/System.Drawing.Text/ChangeLog index 7066c72ca510c..c362e6019f88b 100644 --- a/mcs/class/System.Drawing/System.Drawing.Text/ChangeLog +++ b/mcs/class/System.Drawing/System.Drawing.Text/ChangeLog @@ -1,3 +1,12 @@ +2006-03-23 Peter Dennis Bartok + + * FontCollection.cs (get_Families): Now letting the runtime do the + marshalling work for us. Easier to maintain and cleaner code. + * PrivateFontCollection.cs: + - AddFontFile: Fixed weird english in error message + - Dispose: Need to pass ref to the native object, we were crashing + badly + 2006-02-09 Peter Dennis Bartok * ChangeLog: Created, contents from deleted 'changelog' file diff --git a/mcs/class/System.Drawing/System.Drawing.Text/FontCollection.cs b/mcs/class/System.Drawing/System.Drawing.Text/FontCollection.cs index 4c8782926e431..b01d65d540575 100644 --- a/mcs/class/System.Drawing/System.Drawing.Text/FontCollection.cs +++ b/mcs/class/System.Drawing/System.Drawing.Text/FontCollection.cs @@ -3,11 +3,11 @@ // // (C) 2002 Ximian, Inc. http://www.ximian.com // Author: Everaldo Canuto everaldo.canuto@bol.com.br -// Sanjay Gupta (gsanjay@novell.com) +// Sanjay Gupta (gsanjay@novell.com) +// Peter Dennis Bartok (pbartok@novell.com) // - // -// Copyright (C) 2004 Novell, Inc (http://www.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 @@ -66,19 +66,19 @@ public FontFamily[] Families int returned; Status status; FontFamily[] families; + IntPtr[] result; status = GDIPlus.GdipGetFontCollectionFamilyCount (nativeFontCollection, out found); GDIPlus.CheckStatus (status); - IntPtr dest = Marshal.AllocHGlobal (IntPtr.Size * found); - - status = GDIPlus.GdipGetFontCollectionFamilyList(nativeFontCollection, found, dest, out returned); + 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(Marshal.ReadIntPtr (dest, i * IntPtr.Size)); + for ( int i = 0; i < returned ; i++) { + families[i] = new FontFamily(result[i]); + } - Marshal.FreeHGlobal (dest); return families; } } diff --git a/mcs/class/System.Drawing/System.Drawing.Text/PrivateFontCollection.cs b/mcs/class/System.Drawing/System.Drawing.Text/PrivateFontCollection.cs index 919a5dde5c188..e332fe4c89cf5 100644 --- a/mcs/class/System.Drawing/System.Drawing.Text/PrivateFontCollection.cs +++ b/mcs/class/System.Drawing/System.Drawing.Text/PrivateFontCollection.cs @@ -4,10 +4,10 @@ // (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 Novell, Inc (http://www.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 @@ -57,7 +57,7 @@ public void AddFontFile(string filename) throw new Exception ("Value cannot be null, Parameter name : filename"); bool exists = File.Exists(filename); if (!exists) - throw new Exception ("The path is not of a legal form"); + throw new Exception ("The specified file does not exist"); Status status = GDIPlus.GdipPrivateAddFontFile (nativeFontCollection, filename); GDIPlus.CheckStatus (status); @@ -72,8 +72,8 @@ public void AddMemoryFont(IntPtr memory, int length) // methods protected override void Dispose(bool disposing) { - if (nativeFontCollection!=IntPtr.Zero){ - GDIPlus.GdipDeletePrivateFontCollection (nativeFontCollection); + if (nativeFontCollection!=IntPtr.Zero){ + GDIPlus.GdipDeletePrivateFontCollection (ref nativeFontCollection); nativeFontCollection = IntPtr.Zero; } diff --git a/mcs/class/System.Drawing/System.Drawing/ChangeLog b/mcs/class/System.Drawing/System.Drawing/ChangeLog index ebc7fe1eafc0f..6ebfd20de5f6b 100644 --- a/mcs/class/System.Drawing/System.Drawing/ChangeLog +++ b/mcs/class/System.Drawing/System.Drawing/ChangeLog @@ -1,3 +1,14 @@ +2006-03-23 Peter Dennis Bartok + + * gdipFunctions.cs: + - GdipGetFontCollectionFamilyList: No need for complicated + GlobalAlloc stuff, .Net marshals the IntPtr[] array just fine + - GdipDeletePrivateFontCollection: We need to pass a ref to the + structure. This was causing nasty crashes. + - GdipGetFamilyName: Switched to use StringBuilder instead of + manual marshalling + * FontFamily.cs: Simplified the refreshName method, less error-prone now + 2006-03-21 Sebastien Pouliot * Brush.cs: Remove unused code. diff --git a/mcs/class/System.Drawing/System.Drawing/FontFamily.cs b/mcs/class/System.Drawing/System.Drawing/FontFamily.cs index b164e38bbe28d..fc9704ad80a5e 100644 --- a/mcs/class/System.Drawing/System.Drawing/FontFamily.cs +++ b/mcs/class/System.Drawing/System.Drawing/FontFamily.cs @@ -4,9 +4,10 @@ // Author: // Dennis Hayes (dennish@Raytek.com) // Alexandre Pigolkine (pigolkine@gmx.de) +// Peter Dennis Bartok (pbartok@novell.com) // // Copyright (C) 2002/2004 Ximian, Inc http://www.ximian.com -// Copyright (C) 2004, 2006 Novell, Inc (http://www.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 @@ -51,21 +52,15 @@ internal FontFamily(IntPtr fntfamily) internal void refreshName() { + StringBuilder sb; + if (nativeFontFamily == IntPtr.Zero) return; - int language = 0; - IntPtr buffer = IntPtr.Zero; - try { - buffer = Marshal.AllocHGlobal(GDIPlus.FACESIZE * UnicodeEncoding.CharSize); - Status status = GDIPlus.GdipGetFamilyName (nativeFontFamily, buffer, language); - GDIPlus.CheckStatus (status); - name = Marshal.PtrToStringUni(buffer); - } - finally { - if (buffer != IntPtr.Zero) - Marshal.FreeHGlobal (buffer); - } + sb = new StringBuilder(GDIPlus.FACESIZE); + Status status = GDIPlus.GdipGetFamilyName (nativeFontFamily, sb, 0); + GDIPlus.CheckStatus (status); + name = sb.ToString(); } //Need to come back here, is Arial the right thing to do diff --git a/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs b/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs index 0994898308071..0236a5223b193 100644 --- a/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs +++ b/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs @@ -6,8 +6,9 @@ // Jordi Mas i Hernandez (jordi@ximian.com) // Sanjay Gupta (gsanjay@novell.com) // Ravindra (rkumar@novell.com) +// Peter Dennis Bartok (pbartok@novell.com) // -// Copyright (C) 2004 Novell, Inc (http://www.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 @@ -1455,7 +1456,7 @@ static internal void CheckStatus (Status status) internal static extern Status GdipGetFontCollectionFamilyCount (IntPtr collection, out int found); [DllImport ("gdiplus.dll")] - internal static extern Status GdipGetFontCollectionFamilyList (IntPtr collection, int getCount, IntPtr dest, out int retCount); + internal static extern Status GdipGetFontCollectionFamilyList (IntPtr collection, int getCount, IntPtr[] dest, out int retCount); //internal static extern Status GdipGetFontCollectionFamilyList( IntPtr collection, int getCount, [Out] FontFamily [] familyList, out int retCount ); [DllImport ("gdiplus.dll")] @@ -1465,7 +1466,7 @@ static internal void CheckStatus (Status status) internal static extern Status GdipNewPrivateFontCollection (out IntPtr collection); [DllImport ("gdiplus.dll")] - internal static extern Status GdipDeletePrivateFontCollection (IntPtr collection); + internal static extern Status GdipDeletePrivateFontCollection (ref IntPtr collection); [DllImport ("gdiplus.dll", CharSet=CharSet.Auto)] internal static extern Status GdipPrivateAddFontFile (IntPtr collection, @@ -1479,8 +1480,8 @@ static internal void CheckStatus (Status status) internal static extern Status GdipCreateFontFamilyFromName ( [MarshalAs(UnmanagedType.LPWStr)] string fName, IntPtr collection, out IntPtr fontFamily); - [DllImport ("gdiplus.dll")] - internal static extern Status GdipGetFamilyName(IntPtr family, IntPtr fName, int language); + [DllImport ("gdiplus.dll", CharSet=CharSet.Unicode)] + internal static extern Status GdipGetFamilyName(IntPtr family, StringBuilder name, int language); [DllImport ("gdiplus.dll")] internal static extern Status GdipGetGenericFontFamilySansSerif (out IntPtr fontFamily); From 78a255b6534438540b3b409dee8c2aa5c543970f Mon Sep 17 00:00:00 2001 From: Raja R Harinath Date: Thu, 23 Mar 2006 07:51:21 +0000 Subject: [PATCH 064/117] *** merged revisions 56810, 56816 from mcs/ svn path=/trunk/mcs/; revision=58339 --- mcs/gmcs/ChangeLog | 49 ++++++++++++++++++++++++++++------------------ mcs/gmcs/class.cs | 49 ++++++++++++++++++++-------------------------- mcs/gmcs/decl.cs | 2 +- 3 files changed, 52 insertions(+), 48 deletions(-) diff --git a/mcs/gmcs/ChangeLog b/mcs/gmcs/ChangeLog index 6a0c13e513c88..eb8a0b7b9d552 100644 --- a/mcs/gmcs/ChangeLog +++ b/mcs/gmcs/ChangeLog @@ -1,3 +1,33 @@ +2006-02-11 Marek Safar + + A fix for #77485 + + * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it + contains obsolete attribute check which can in some cases look for base + type of current class which is not initialized yet. + (TypeContainer.BaseType): Replacement of ptype. + + * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code. + +2006-02-11 Marek Safar + + First of prerequisites for new partial classs implemention. + + * attribute.cs (Attributable): Extended by ResolveContext; + Attributes finally have correct context for resolving in all cases. + (AttachTo): Attribute owner is assigned here. + + * codegen.cs (IResolveContext): Introduce new interface to hold + all information needed in resolving phase. + (EmitContext): Implements IResolveContext; more clean-up needed here. + + * decl.cs (MemberCore): Implemented IResolveContext. + + * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs, + decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs, + parameter.cs, statement.cs, tree.cs, typemanager.cs: + Refactored to use new IResolveContext instead of EmitContext; cleanup + 2006-03-22 Raja R Harinath Support ParameterDefaultValueAttribute in gmcs. Also applied to @@ -137,25 +167,6 @@ (ConstraintChecker.CheckConstraints): If a type parameter has the `struct' constraint, the type must be a non-nullable valuetype. -2006-02-11 Marek Safar - - First of prerequisites for new partial classs implemention. - - * attribute.cs (Attributable): Extended by ResolveContext; - Attributes finally have correct context for resolving in all cases. - (AttachTo): Attribute owner is assigned here. - - * codegen.cs (IResolveContext): Introduce new interface to hold - all information needed in resolving phase. - (EmitContext): Implements IResolveContext; more clean-up needed here. - - * decl.cs (MemberCore): Implemented IResolveContext. - - * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs, - decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs, - parameter.cs, statement.cs, tree.cs, typemanager.cs: - Refactored to use new IResolveContext instead of EmitContext; cleanup - 2006-02-10 Martin Baulig * typemanager.cs diff --git a/mcs/gmcs/class.cs b/mcs/gmcs/class.cs index e59ab5c3c7328..cc61fe6c4b164 100644 --- a/mcs/gmcs/class.cs +++ b/mcs/gmcs/class.cs @@ -459,7 +459,6 @@ public override void DefineContainerMembers () // The interfaces we implement. protected Type[] ifaces; - protected Type ptype; // The base member cache and our member cache MemberCache base_cache; @@ -788,6 +787,12 @@ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder return base_class_name; } } + + protected Type BaseType { + get { + return TypeBuilder.BaseType; + } + } public ArrayList Bases { get { @@ -1222,7 +1227,7 @@ public override TypeBuilder DefineType () } TypeBuilder = builder.DefineNestedType ( - Basename, type_attributes, ptype, null); + Basename, type_attributes, null, null); } } catch (ArgumentException) { Report.RuntimeMissingSupport (Location, "static classes"); @@ -1290,22 +1295,20 @@ public override TypeBuilder DefineType () if (base_type != null) { - FullNamedExpression fne = base_type.ResolveAsTypeStep (this, false); - if ((fne == null) || (fne.Type == null)) { - error = true; + base_type = base_type.ResolveAsTypeTerminal (this, false); + if (base_type == null) return null; - } - - ptype = fne.Type; - if (IsGeneric && TypeManager.IsAttributeType (ptype)) { + if (IsGeneric && TypeManager.IsAttributeType (base_type.Type)) { Report.Error (698, base_type.Location, "A generic type cannot derive from `{0}' " + "because it is an attribute class", base_type.Name); - error = true; return null; } + + TypeBuilder.SetParent (base_type.Type); + CheckObsoleteType (base_type); } if (!CheckRecursiveDefinition (this)) { @@ -1313,15 +1316,6 @@ public override TypeBuilder DefineType () return null; } - if (ptype != null) { - TypeBuilder.SetParent (ptype); - } - - // Attribute is undefined at the begining of corlib compilation - if (TypeManager.obsolete_attribute_type != null && ptype != null) { - CheckObsoleteType (base_type); - } - // add interfaces that were not added at type creation if (iface_exprs != null) { ifaces = TypeManager.ExpandInterfaces (this, iface_exprs); @@ -1461,10 +1455,9 @@ protected bool CheckRecursiveDefinition (TypeContainer tc) InTransit = tc; - Type parent = ptype; - if (parent != null) { - parent = TypeManager.DropGenericTypeArguments (parent); - TypeContainer ptc = TypeManager.LookupTypeContainer (parent); + if (BaseType != null) { + Type t = TypeManager.DropGenericTypeArguments (BaseType); + TypeContainer ptc = TypeManager.LookupTypeContainer (t); if ((ptc != null) && !ptc.CheckRecursiveDefinition (this)) return false; } @@ -3117,8 +3110,9 @@ public override TypeBuilder DefineType() if (tb == null) return null; - if (ptype != TypeManager.object_type) { - Report.Error (713, Location, "Static class `{0}' cannot derive from type `{1}'. Static classes must derive from object", GetSignatureForError (), TypeManager.CSharpName (ptype)); + if (BaseType != TypeManager.object_type) { + Report.Error (713, Location, "Static class `{0}' cannot derive from type `{1}'. Static classes must derive from object", + GetSignatureForError (), TypeManager.CSharpName (BaseType)); return null; } @@ -3165,15 +3159,14 @@ public class Class : ClassOrStruct { public override void ApplyAttributeBuilder(Attribute a, CustomAttributeBuilder cb) { if (a.Type == TypeManager.attribute_usage_type) { - if (ptype != TypeManager.attribute_type && - !ptype.IsSubclassOf (TypeManager.attribute_type) && + if (BaseType != TypeManager.attribute_type && !BaseType.IsSubclassOf (TypeManager.attribute_type) && TypeBuilder.FullName != "System.Attribute") { Report.Error (641, a.Location, "Attribute `{0}' is only valid on classes derived from System.Attribute", a.GetSignatureForError ()); } } if (a.Type == TypeManager.conditional_attribute_type && - !(ptype == TypeManager.attribute_type || ptype.IsSubclassOf (TypeManager.attribute_type))) { + !(BaseType == TypeManager.attribute_type || BaseType.IsSubclassOf (TypeManager.attribute_type))) { Report.Error (1689, a.Location, "Attribute 'System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes"); return; } diff --git a/mcs/gmcs/decl.cs b/mcs/gmcs/decl.cs index 4a047de8ad442..5ddf637b01701 100644 --- a/mcs/gmcs/decl.cs +++ b/mcs/gmcs/decl.cs @@ -465,7 +465,7 @@ protected void CheckObsoleteType (Expression type) if (obsolete_attr == null) return; - if (GetObsoleteAttribute () != null || Parent.GetObsoleteAttribute () != null) + if (IsInObsoleteScope) return; AttributeTester.Report_ObsoleteMessage (obsolete_attr, TypeManager.CSharpName (type.Type), type.Location); From f8e511f9e9c530283e4ae4d715247112cfc584a0 Mon Sep 17 00:00:00 2001 From: Raja R Harinath Date: Thu, 23 Mar 2006 08:51:31 +0000 Subject: [PATCH 065/117] *** merged revisions from mcs: 57172, 57177 svn path=/trunk/mcs/; revision=58341 --- mcs/errors/known-issues-gmcs | 20 -------- mcs/gmcs/ChangeLog | 18 +++++++ mcs/gmcs/attribute.cs | 58 ++++++++++++++++++----- mcs/gmcs/class.cs | 91 ++++++++++++++++-------------------- mcs/gmcs/decl.cs | 20 ++++---- mcs/gmcs/delegate.cs | 4 +- mcs/gmcs/doc.cs | 2 +- mcs/gmcs/enum.cs | 11 +---- 8 files changed, 119 insertions(+), 105 deletions(-) diff --git a/mcs/errors/known-issues-gmcs b/mcs/errors/known-issues-gmcs index d617f26a9def4..0e8be33dbcefd 100644 --- a/mcs/errors/known-issues-gmcs +++ b/mcs/errors/known-issues-gmcs @@ -14,7 +14,6 @@ cs0102-16.cs cs0111-16.cs NO ERROR cs0111-17.cs -cs0144-3.cs NO ERROR cs0221-5.cs NO ERROR cs0229-2.cs cs0229.cs NO ERROR @@ -28,23 +27,6 @@ cs0548.cs cs0560.cs cs0567.cs cs0579-10.cs NO ERROR -cs0579-2.cs -cs0579-3.cs -cs0579-4.cs -cs0579-5.cs -cs0579-6.cs -cs0579-7.cs -cs0579-8.cs -cs0579.cs -cs0592-2.cs -cs0592-3.cs -cs0592-4.cs -cs0592-5.cs -cs0592-6.cs -cs0592-7.cs -cs0592-8.cs -cs0592-9.cs -cs0592.cs cs0612-2.cs NO ERROR cs0619-42.cs cs0619-47.cs NO ERROR @@ -53,9 +35,7 @@ cs0619-49.cs cs0625-2.cs NO ERROR cs0625-3.cs NO ERROR cs0631-2.cs -cs0641.cs cs0647-3.cs -cs0653.cs cs0713-2.cs NO ERROR cs0714-2.cs cs1035.cs diff --git a/mcs/gmcs/ChangeLog b/mcs/gmcs/ChangeLog index eb8a0b7b9d552..bfe23489d454b 100644 --- a/mcs/gmcs/ChangeLog +++ b/mcs/gmcs/ChangeLog @@ -1,3 +1,21 @@ +2006-02-22 Marek Safar + + A fix for #77615 + + * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when + external interface does not have an attribute. + +2006-02-22 Marek Safar + + Another prerequisites for new partial classs implementation. + + * attribute.cs (Attribute.Equal): Implemented. + (Attribute.Emit): Changed as attributes can be applied more than twice. + (Attributes.Emit): Check for duplicate attributes here. + + * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace + as a parameter, clean-up. + 2006-02-11 Marek Safar A fix for #77485 diff --git a/mcs/gmcs/attribute.cs b/mcs/gmcs/attribute.cs index 97210ed2a737b..941aa60500fec 100644 --- a/mcs/gmcs/attribute.cs +++ b/mcs/gmcs/attribute.cs @@ -260,6 +260,9 @@ public virtual Type ResolveType () public string GetSignatureForError () { + if (Type != null) + return TypeManager.CSharpName (Type); + return LeftExpr == null ? Identifier : LeftExpr.GetSignatureForError () + "." + Identifier; } @@ -1154,10 +1157,24 @@ public object GetParameterDefaultValue () return pos_values [0]; } + public override bool Equals (object obj) + { + Attribute a = obj as Attribute; + if (a == null) + return false; + + return Type == a.Type && Target == a.Target; + } + + public override int GetHashCode () + { + return base.GetHashCode (); + } + /// /// Emit attribute for Attributable symbol /// - public void Emit (ListDictionary emitted_attr) + public void Emit (ListDictionary allEmitted) { CustomAttributeBuilder cb = Resolve (); if (cb == null) @@ -1165,7 +1182,7 @@ public void Emit (ListDictionary emitted_attr) AttributeUsageAttribute usage_attr = GetAttributeUsage (); if ((usage_attr.ValidOn & Target) == 0) { - Report.Error (592, Location, "Attribute `{0}' is not valid on this declaration type. " + + Report.Error (592, Location, "The attribute `{0}' is not valid on this declaration type. " + "It is valid on `{1}' declarations only", GetSignatureForError (), GetValidTargets ()); return; @@ -1179,16 +1196,17 @@ public void Emit (ListDictionary emitted_attr) return; } - if (!usage_attr.AllowMultiple) { - ArrayList emitted_targets = (ArrayList)emitted_attr [Type]; - if (emitted_targets == null) { - emitted_targets = new ArrayList (); - emitted_attr.Add (Type, emitted_targets); - } else if (emitted_targets.Contains (Target)) { - Report.Error (579, Location, "Duplicate `{0}' attribute", GetSignatureForError ()); - return; + if (!usage_attr.AllowMultiple && allEmitted != null) { + if (allEmitted.Contains (this)) { + ArrayList a = allEmitted [this] as ArrayList; + if (a == null) { + a = new ArrayList (2); + allEmitted [this] = a; + } + a.Add (this); + } else { + allEmitted.Add (this, null); } - emitted_targets.Add (Target); } if (!RootContext.VerifyClsCompliance) @@ -1516,10 +1534,24 @@ public void Emit () { CheckTargets (); - ListDictionary ld = new ListDictionary (); + ListDictionary ld = Attrs.Count > 1 ? new ListDictionary () : null; foreach (Attribute a in Attrs) a.Emit (ld); + + if (ld == null || ld.Count == 0) + return; + + foreach (DictionaryEntry d in ld) { + if (d.Value == null) + continue; + + foreach (Attribute collision in (ArrayList)d.Value) + Report.SymbolRelatedToPreviousError (collision.Location, ""); + + Attribute a = (Attribute)d.Key; + Report.Error (579, a.Location, "The attribute `{0}' cannot be applied multiple times", a.GetSignatureForError ()); + } } public bool Contains (Type t) @@ -1877,6 +1909,8 @@ public static Type GetCoClassAttribute (Type type) TypeContainer tc = TypeManager.LookupInterface (type); if (tc == null) { object[] o = type.GetCustomAttributes (TypeManager.coclass_attr_type, false); + if (o.Length < 1) + return null; return ((System.Runtime.InteropServices.CoClassAttribute)o[0]).CoClass; } diff --git a/mcs/gmcs/class.cs b/mcs/gmcs/class.cs index cc61fe6c4b164..dcf3472c4f363 100644 --- a/mcs/gmcs/class.cs +++ b/mcs/gmcs/class.cs @@ -448,7 +448,6 @@ public override void DefineContainerMembers () // This one is computed after we can distinguish interfaces // from classes from the arraylist `type_bases' // - string base_class_name; TypeExpr base_type; TypeExpr[] iface_exprs; @@ -479,8 +478,6 @@ public override void DefineContainerMembers () this.Kind = kind; types = new ArrayList (); - - base_class_name = null; } public bool AddToMemberContainer (MemberCore symbol) @@ -782,12 +779,6 @@ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder } } - public string Base { - get { - return base_class_name; - } - } - protected Type BaseType { get { return TypeBuilder.BaseType; @@ -1110,9 +1101,6 @@ TypeExpr[] GetNormalBases (out TypeExpr base_class) } } - if (base_class != null) - base_class_name = base_class.Name; - if (ifaces == null) return null; @@ -2493,9 +2481,9 @@ public bool MethodModifiersValid (MemberCore mc) get { return default_static_constructor; } } - protected override bool VerifyClsCompliance (DeclSpace ds) + protected override bool VerifyClsCompliance () { - if (!base.VerifyClsCompliance (ds)) + if (!base.VerifyClsCompliance ()) return false; VerifyClsName (); @@ -3322,9 +3310,9 @@ public override PendingImplementation GetPendingImplementations () } } - protected override bool VerifyClsCompliance (DeclSpace ds) + protected override bool VerifyClsCompliance () { - if (!base.VerifyClsCompliance (ds)) + if (!base.VerifyClsCompliance ()) return false; if (ifaces != null) { @@ -3421,7 +3409,7 @@ protected override bool CheckBase () } Type base_ret_type = null; - base_method = FindOutBaseMethod (Parent, ref base_ret_type); + base_method = FindOutBaseMethod (ref base_ret_type); // method is override if (base_method != null) { @@ -3662,7 +3650,7 @@ protected void Error_CannotChangeAccessModifiers (MemberInfo base_method, Method /// /// Gets base method and its return type /// - protected abstract MethodInfo FindOutBaseMethod (TypeContainer container, ref Type base_ret_type); + protected abstract MethodInfo FindOutBaseMethod (ref Type base_ret_type); protected bool DoDefineParameters () { @@ -3722,10 +3710,10 @@ bool CheckParameters (Type [] parameters) } } - protected override bool VerifyClsCompliance (DeclSpace ds) + protected override bool VerifyClsCompliance () { - if (!base.VerifyClsCompliance (ds)) { - if ((ModFlags & Modifiers.ABSTRACT) != 0 && IsExposedFromAssembly (ds) && ds.IsClsComplianceRequired ()) { + if (!base.VerifyClsCompliance ()) { + if ((ModFlags & Modifiers.ABSTRACT) != 0 && IsExposedFromAssembly () && Parent.IsClsComplianceRequired ()) { Report.Error (3011, Location, "`{0}': only CLS-compliant members can be abstract", GetSignatureForError ()); } return false; @@ -4233,10 +4221,10 @@ public static void Error1599 (Location loc, Type t) Report.Error (1599, loc, "Method or delegate cannot return type `{0}'", TypeManager.CSharpName (t)); } - protected override MethodInfo FindOutBaseMethod (TypeContainer container, ref Type base_ret_type) + protected override MethodInfo FindOutBaseMethod (ref Type base_ret_type) { - MethodInfo mi = (MethodInfo) container.BaseCache.FindMemberToOverride ( - container.TypeBuilder, Name, ParameterTypes, GenericMethod, false); + MethodInfo mi = (MethodInfo) Parent.BaseCache.FindMemberToOverride ( + Parent.TypeBuilder, Name, ParameterTypes, GenericMethod, false); if (mi == null) return null; @@ -4251,15 +4239,15 @@ public override bool MarkForDuplicationCheck () return true; } - protected override bool VerifyClsCompliance(DeclSpace ds) + protected override bool VerifyClsCompliance () { - if (!base.VerifyClsCompliance (ds)) + if (!base.VerifyClsCompliance ()) return false; if (ParameterInfo.Count > 0) { - ArrayList al = (ArrayList)ds.MemberCache.Members [Name]; + ArrayList al = (ArrayList)Parent.MemberCache.Members [Name]; if (al.Count > 1) - ds.MemberCache.VerifyClsParameterConflict (al, this, MethodBuilder); + Parent.MemberCache.VerifyClsParameterConflict (al, this, MethodBuilder); } return true; @@ -4449,7 +4437,7 @@ public bool Resolve (ConstructorBuilder caller_builder, Block block, EmitContext if (base_constructor == null) { if (errors == Report.Errors) Invocation.Error_WrongNumArguments (loc, TypeManager.CSharpSignature (caller_builder), - argument_list.Count); + argument_list == null ? 0 : argument_list.Count); return false; } @@ -4766,7 +4754,7 @@ public override void Emit () } // Is never override - protected override MethodInfo FindOutBaseMethod (TypeContainer container, ref Type base_ret_type) + protected override MethodInfo FindOutBaseMethod (ref Type base_ret_type) { return null; } @@ -4776,18 +4764,18 @@ public override string GetSignatureForError() return base.GetSignatureForError () + Parameters.GetSignatureForError (); } - protected override bool VerifyClsCompliance (DeclSpace ds) + protected override bool VerifyClsCompliance () { - if (!base.VerifyClsCompliance (ds) || !IsExposedFromAssembly (ds)) { + if (!base.VerifyClsCompliance () || !IsExposedFromAssembly ()) { return false; } if (ParameterInfo.Count > 0) { - ArrayList al = (ArrayList)ds.MemberCache.Members [".ctor"]; + ArrayList al = (ArrayList)Parent.MemberCache.Members [".ctor"]; if (al.Count > 3) - ds.MemberCache.VerifyClsParameterConflict (al, this, ConstructorBuilder); + Parent.MemberCache.VerifyClsParameterConflict (al, this, ConstructorBuilder); - if (ds.TypeBuilder.IsSubclassOf (TypeManager.attribute_type)) { + if (Parent.TypeBuilder.IsSubclassOf (TypeManager.attribute_type)) { foreach (Type param in ParameterTypes) { if (param.IsArray) { return true; @@ -4938,12 +4926,13 @@ public bool Define (TypeContainer container) string name = method.MethodName.Basename; string method_name = method.MethodName.FullName; - if (container.Pending != null){ + PendingImplementation pending = container.Pending; + if (pending != null){ if (member is Indexer) // TODO: test it, but it should work without this IF - implementing = container.Pending.IsInterfaceIndexer ( + implementing = pending.IsInterfaceIndexer ( member.InterfaceType, method.ReturnType, method.ParameterInfo); else - implementing = container.Pending.IsInterfaceMethod ( + implementing = pending.IsInterfaceMethod ( member.InterfaceType, name, method.ReturnType, method.ParameterInfo); if (member.InterfaceType != null){ @@ -5075,11 +5064,11 @@ public bool Define (TypeContainer container) // clear the pending implemntation flag // if (member is Indexer) { - container.Pending.ImplementIndexer ( + pending.ImplementIndexer ( member.InterfaceType, builder, method.ReturnType, method.ParameterInfo, member.IsExplicitImpl); } else - container.Pending.ImplementMethod ( + pending.ImplementMethod ( member.InterfaceType, name, method.ReturnType, method.ParameterInfo, member.IsExplicitImpl); @@ -5466,13 +5455,13 @@ protected bool IsTypePermitted () return true; } - protected override bool VerifyClsCompliance(DeclSpace ds) + protected override bool VerifyClsCompliance() { - if (base.VerifyClsCompliance (ds)) { + if (base.VerifyClsCompliance ()) { return true; } - if (IsInterface && HasClsCompliantAttribute && ds.IsClsComplianceRequired ()) { + if (IsInterface && HasClsCompliantAttribute && Parent.IsClsComplianceRequired ()) { Report.Error (3010, Location, "`{0}': CLS-compliant interfaces must have only CLS-compliant members", GetSignatureForError ()); } return false; @@ -5620,9 +5609,9 @@ protected override bool CheckBase () } } - protected override bool VerifyClsCompliance (DeclSpace ds) + protected override bool VerifyClsCompliance () { - if (!base.VerifyClsCompliance (ds)) + if (!base.VerifyClsCompliance ()) return false; if (!IsFieldClsCompliant) { @@ -5988,9 +5977,9 @@ public override bool Define () return true; } - protected override bool VerifyClsCompliance (DeclSpace ds) + protected override bool VerifyClsCompliance () { - if (!base.VerifyClsCompliance (ds)) + if (!base.VerifyClsCompliance ()) return false; if ((ModFlags & Modifiers.VOLATILE) != 0) { @@ -6590,10 +6579,10 @@ protected override bool CheckForDuplications () } // TODO: rename to Resolve...... - protected override MethodInfo FindOutBaseMethod (TypeContainer container, ref Type base_ret_type) + protected override MethodInfo FindOutBaseMethod (ref Type base_ret_type) { - PropertyInfo base_property = container.BaseCache.FindMemberToOverride ( - container.TypeBuilder, Name, ParameterTypes, null, true) as PropertyInfo; + PropertyInfo base_property = Parent.BaseCache.FindMemberToOverride ( + Parent.TypeBuilder, Name, ParameterTypes, null, true) as PropertyInfo; if (base_property == null) return null; @@ -7787,7 +7776,7 @@ public override void Emit () } // Operator cannot be override - protected override MethodInfo FindOutBaseMethod (TypeContainer container, ref Type base_ret_type) + protected override MethodInfo FindOutBaseMethod (ref Type base_ret_type) { return null; } diff --git a/mcs/gmcs/decl.cs b/mcs/gmcs/decl.cs index 5ddf637b01701..f8f38fbf52f5f 100644 --- a/mcs/gmcs/decl.cs +++ b/mcs/gmcs/decl.cs @@ -403,7 +403,7 @@ public virtual void Emit () if (!RootContext.VerifyClsCompliance) return; - VerifyClsCompliance (Parent); + VerifyClsCompliance (); } public virtual bool IsUsed { @@ -479,7 +479,7 @@ public override bool IsClsComplianceRequired () if ((caching_flags & Flags.ClsCompliance_Undetected) == 0) return (caching_flags & Flags.ClsCompliant) != 0; - if (GetClsCompliantAttributeValue (Parent) && IsExposedFromAssembly (Parent)) { + if (GetClsCompliantAttributeValue () && IsExposedFromAssembly ()) { caching_flags &= ~Flags.ClsCompliance_Undetected; caching_flags |= Flags.ClsCompliant; return true; @@ -492,12 +492,12 @@ public override bool IsClsComplianceRequired () /// /// Returns true when MemberCore is exposed from assembly. /// - public bool IsExposedFromAssembly (DeclSpace ds) + public bool IsExposedFromAssembly () { if ((ModFlags & (Modifiers.PUBLIC | Modifiers.PROTECTED)) == 0) return false; - DeclSpace parentContainer = ds; + DeclSpace parentContainer = Parent; while (parentContainer != null && parentContainer.ModFlags != 0) { if ((parentContainer.ModFlags & (Modifiers.PUBLIC | Modifiers.PROTECTED)) == 0) return false; @@ -509,7 +509,7 @@ public bool IsExposedFromAssembly (DeclSpace ds) /// /// Resolve CLSCompliantAttribute value or gets cached value. /// - bool GetClsCompliantAttributeValue (DeclSpace ds) + bool GetClsCompliantAttributeValue () { if (OptAttributes != null) { Attribute cls_attribute = OptAttributes.Search ( @@ -519,7 +519,7 @@ bool GetClsCompliantAttributeValue (DeclSpace ds) return cls_attribute.GetClsCompliantAttributeValue (); } } - return ds.GetClsCompliantAttributeValue (); + return Parent.GetClsCompliantAttributeValue (); } /// @@ -545,11 +545,11 @@ public virtual bool MarkForDuplicationCheck () /// CLS-Compliant which means that CLS-Compliant tests are not necessary. A descendants override it /// and add their extra verifications. /// - protected virtual bool VerifyClsCompliance (DeclSpace ds) + protected virtual bool VerifyClsCompliance () { if (!IsClsComplianceRequired ()) { if (HasClsCompliantAttribute && RootContext.WarningLevel >= 2) { - if (!IsExposedFromAssembly (ds)) + if (!IsExposedFromAssembly ()) Report.Warning (3019, 2, Location, "CLS compliance checking will not be performed on `{0}' because it is not visible from outside this assembly", GetSignatureForError ()); if (!CodeGen.Assembly.IsClsCompliant) Report.Warning (3021, 2, Location, "`{0}' does not need a CLSCompliant attribute because the assembly is not marked as CLS-compliant", GetSignatureForError ()); @@ -1334,9 +1334,9 @@ public TypeParameterExpr LookupGeneric (string name, Location loc) get { return attribute_targets; } } - protected override bool VerifyClsCompliance (DeclSpace ds) + protected override bool VerifyClsCompliance () { - if (!base.VerifyClsCompliance (ds)) { + if (!base.VerifyClsCompliance ()) { return false; } diff --git a/mcs/gmcs/delegate.cs b/mcs/gmcs/delegate.cs index 284b1da98d7cb..e3824cd60142d 100644 --- a/mcs/gmcs/delegate.cs +++ b/mcs/gmcs/delegate.cs @@ -373,9 +373,9 @@ public override void Emit () } //TODO: duplicate - protected override bool VerifyClsCompliance (DeclSpace ds) + protected override bool VerifyClsCompliance () { - if (!base.VerifyClsCompliance (ds)) { + if (!base.VerifyClsCompliance ()) { return false; } diff --git a/mcs/gmcs/doc.cs b/mcs/gmcs/doc.cs index 3aa4590ead257..994d949a31dca 100644 --- a/mcs/gmcs/doc.cs +++ b/mcs/gmcs/doc.cs @@ -187,7 +187,7 @@ public class DocUtil n.WriteTo (RootContext.Documentation.XmlCommentOutput); } - else if (mc.IsExposedFromAssembly (ds)) { + else if (mc.IsExposedFromAssembly ()) { Constructor c = mc as Constructor; if (c == null || !c.IsDefault ()) Report.Warning (1591, 4, mc.Location, diff --git a/mcs/gmcs/enum.cs b/mcs/gmcs/enum.cs index f9fa0890877d1..0cf0cd6ea5f5a 100644 --- a/mcs/gmcs/enum.cs +++ b/mcs/gmcs/enum.cs @@ -186,13 +186,6 @@ public override string GetSignatureForError() } } - protected override bool VerifyClsCompliance(DeclSpace ds) - { - // Because parent is TypeContainer and we have only DeclSpace parent. - // Parameter replacing is required - return base.VerifyClsCompliance (parent_enum); - } - public override string DocCommentHeader { get { return "F:"; } } @@ -355,9 +348,9 @@ void VerifyClsName () } } - protected override bool VerifyClsCompliance (DeclSpace ds) + protected override bool VerifyClsCompliance () { - if (!base.VerifyClsCompliance (ds)) + if (!base.VerifyClsCompliance ()) return false; VerifyClsName (); From 534454e6684e669803e3e0d85ef47d65a4190078 Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Thu, 23 Mar 2006 08:57:15 +0000 Subject: [PATCH 066/117] 2006-03-23 Atsushi Enomoto * xmltool.cs : Added --validate-dtd (explicit DTD validation) --transform should use TextWriter output directly so that it can handle html output. IndexOutOfRange fix for --prettyprint args. svn path=/trunk/mcs/; revision=58342 --- mcs/tools/mono-xmltool/ChangeLog | 8 ++++++++ mcs/tools/mono-xmltool/xmltool.cs | 28 ++++++++++++++++++++++------ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/mcs/tools/mono-xmltool/ChangeLog b/mcs/tools/mono-xmltool/ChangeLog index 936ac4eaac9cf..9a0835af13856 100644 --- a/mcs/tools/mono-xmltool/ChangeLog +++ b/mcs/tools/mono-xmltool/ChangeLog @@ -1,3 +1,11 @@ +2006-03-23 Atsushi Enomoto + + * xmltool.cs : + Added --validate-dtd (explicit DTD validation) + --transform should use TextWriter output directly so that it can + handle html output. + IndexOutOfRange fix for --prettyprint args. + 2006-03-19 Boris Kirzner * nunit_transform.xslt: fixes to nunit results xslt transform diff --git a/mcs/tools/mono-xmltool/xmltool.cs b/mcs/tools/mono-xmltool/xmltool.cs index bdbfdaf3f6b5c..ccc88693aaf16 100644 --- a/mcs/tools/mono-xmltool/xmltool.cs +++ b/mcs/tools/mono-xmltool/xmltool.cs @@ -41,6 +41,7 @@ static void Usage () --validate-rnc relax-ng-compact-grammar-file [instances] --validate-nvdl nvdl-script-xml [instances] --validate-xsd xml-schema [instances] + --validate-dtd instances --transform stylesheet instance-xml [output-xml] --prettyprint [source] [result] @@ -79,6 +80,9 @@ static void Run (string [] args) case "--validate-xsd": ValidateXsd (args); return; + case "--validate-dtd": + ValidateDtd (args); + return; case "--transform": Transform (args); return; @@ -169,28 +173,40 @@ static void ValidateXsd (string [] args) } } + static void ValidateDtd (string [] args) + { + for (int i = 1; i < args.Length; i++) { + XmlValidatingReader xvr = new XmlValidatingReader ( + new XmlTextReader (args [i])); + xvr.ValidationType = ValidationType.DTD; + xvr.EntityHandling = EntityHandling.ExpandEntities; + while (!xvr.EOF) + xvr.Read (); + xvr.Close (); + } + } + static void Transform (string [] args) { XslTransform t = new XslTransform (); t.Load (args [1]); TextWriter output = args.Length > 3 ? File.CreateText (args [3]) : Console.Out; - XmlTextWriter xw = new XmlTextWriter (output); - t.Transform (new XPathDocument (args [2], XmlSpace.Preserve), null, xw, null); - xw.Close (); + t.Transform (new XPathDocument (args [2], XmlSpace.Preserve), null, output, null); + output.Close (); } static void PrettyPrint (string [] args) { XmlTextReader r = null; - if (args.Length > 0) + if (args.Length > 1) r = new XmlTextReader (args [1]); else r = new XmlTextReader (Console.In); r.WhitespaceHandling = WhitespaceHandling.Significant; XmlTextWriter w = null; - if (args.Length > 1) - w = new XmlTextWriter (args [2], Encoding.UTF8); + if (args.Length > 2) + w = new XmlTextWriter (args [1], Encoding.UTF8); else w = new XmlTextWriter (Console.Out); w.Formatting = Formatting.Indented; From a26d91b65eb3ba27b13f6428680b33577f2f270e Mon Sep 17 00:00:00 2001 From: Vladimir Krasnov Date: Thu, 23 Mar 2006 09:15:18 +0000 Subject: [PATCH 067/117] * MailMessageWrapper.cs: fixed Fields property, casting to string changed to ToString method call. svn path=/trunk/mcs/; revision=58343 --- mcs/class/System.Web/System.Web.Mail/ChangeLog | 5 +++++ mcs/class/System.Web/System.Web.Mail/MailMessageWrapper.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mcs/class/System.Web/System.Web.Mail/ChangeLog b/mcs/class/System.Web/System.Web.Mail/ChangeLog index a9cdc2abb08b8..25a278e502bce 100644 --- a/mcs/class/System.Web/System.Web.Mail/ChangeLog +++ b/mcs/class/System.Web/System.Web.Mail/ChangeLog @@ -1,3 +1,8 @@ +2006-03-23 Vladimir Krasnov + + * MailMessageWrapper.cs: fixed Fields property, casting to string + changed to ToString method call. + 2006-01-08 Konstantin Triger * SmtpClient.cs, SmtpMail.cs, MailMessage.cs, MailMessageWrapper.cs, diff --git a/mcs/class/System.Web/System.Web.Mail/MailMessageWrapper.cs b/mcs/class/System.Web/System.Web.Mail/MailMessageWrapper.cs index d7ab68663da94..5cdeacb781ad0 100644 --- a/mcs/class/System.Web/System.Web.Mail/MailMessageWrapper.cs +++ b/mcs/class/System.Web/System.Web.Mail/MailMessageWrapper.cs @@ -240,7 +240,7 @@ public MailMessageWrapper( MailMessage message ) MailHeader bodyHeaders = new MailHeader(); // Add Fields to MailHeader Object foreach( string key in message.Fields.Keys ) - bodyHeaders.Data[ key ] = (string)this.message.Fields[ key ]; + bodyHeaders.Data[ key ] = this.message.Fields[ key ].ToString(); return bodyHeaders; } From 65c29ca847accc406472aa8440cbaf04d59838bd Mon Sep 17 00:00:00 2001 From: Vladimir Krasnov Date: Thu, 23 Mar 2006 09:18:31 +0000 Subject: [PATCH 068/117] * SmtpMail.cs: removed TARGET_JVM part from Send method. svn path=/trunk/mcs/; revision=58344 --- mcs/class/System.Web/System.Web.Mail/ChangeLog | 4 ++++ mcs/class/System.Web/System.Web.Mail/SmtpMail.cs | 10 ---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/mcs/class/System.Web/System.Web.Mail/ChangeLog b/mcs/class/System.Web/System.Web.Mail/ChangeLog index 25a278e502bce..8dcfeecea654e 100644 --- a/mcs/class/System.Web/System.Web.Mail/ChangeLog +++ b/mcs/class/System.Web/System.Web.Mail/ChangeLog @@ -1,3 +1,7 @@ +2006-03-23 Vladimir Krasnov + + * SmtpMail.cs: removed TARGET_JVM part from Send method. + 2006-03-23 Vladimir Krasnov * MailMessageWrapper.cs: fixed Fields property, casting to string diff --git a/mcs/class/System.Web/System.Web.Mail/SmtpMail.cs b/mcs/class/System.Web/System.Web.Mail/SmtpMail.cs index 7e6042c02684d..0273f6ae1b46c 100644 --- a/mcs/class/System.Web/System.Web.Mail/SmtpMail.cs +++ b/mcs/class/System.Web/System.Web.Mail/SmtpMail.cs @@ -70,17 +70,7 @@ public static void Send (MailMessage message) // access to properties and to add some functionality MailMessageWrapper messageWrapper = new MailMessageWrapper( message ); -#if TARGET_JVM - string currentSmtpServer = smtpServer; - if (currentSmtpServer == "localhost") - { - java.net.InetAddress address = java.net.InetAddress.getLocalHost(); - currentSmtpServer = address.getHostAddress(); - } - SmtpClient smtp = new SmtpClient (currentSmtpServer); -#else SmtpClient smtp = new SmtpClient (smtpServer); -#endif smtp.Send (messageWrapper); From a5ab4e3f7b7392f1eeeac056b429cc9e89d4d47d Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Thu, 23 Mar 2006 09:23:30 +0000 Subject: [PATCH 069/117] 2006-03-23 Atsushi Enomoto * DTDValidatingReader.cs : avoid NullReferenceException. Input XmlReader might not be IHasXmlParserContext. svn path=/trunk/mcs/; revision=58345 --- mcs/class/System.XML/System.Xml/ChangeLog | 5 +++++ mcs/class/System.XML/System.Xml/DTDValidatingReader2.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog index 7e94379eb70eb..1386a6aed9dff 100644 --- a/mcs/class/System.XML/System.Xml/ChangeLog +++ b/mcs/class/System.XML/System.Xml/ChangeLog @@ -1,3 +1,8 @@ +2006-03-23 Atsushi Enomoto + + * DTDValidatingReader.cs : avoid NullReferenceException. Input + XmlReader might not be IHasXmlParserContext. + 2006-03-08 Atsushi Enomoto * XmlReader.cs: ReadContentAsXXX() just stops at start element, diff --git a/mcs/class/System.XML/System.Xml/DTDValidatingReader2.cs b/mcs/class/System.XML/System.Xml/DTDValidatingReader2.cs index 5376da6b64d5a..592226dbac324 100644 --- a/mcs/class/System.XML/System.Xml/DTDValidatingReader2.cs +++ b/mcs/class/System.XML/System.Xml/DTDValidatingReader2.cs @@ -97,7 +97,7 @@ public DTDValidatingReader (XmlReader reader) { IHasXmlParserContext container = reader as IHasXmlParserContext; this.reader = new EntityResolvingXmlReader (reader, - container.ParserContext); + container != null ? container.ParserContext : null); this.sourceTextReader = reader as XmlTextReader; elementStack = new Stack (); automataStack = new Stack (); From 700e221515b30ab587e1b41d9c195bc1ef2fca08 Mon Sep 17 00:00:00 2001 From: Vladimir Krasnov Date: Thu, 23 Mar 2006 09:54:03 +0000 Subject: [PATCH 070/117] * DataGrid.cs: fixed CreateControlHierarchy, added CurrentPageIndex validation in PrepareControlHierarchy fixed style applying to AlternatingItem svn path=/trunk/mcs/; revision=58346 --- mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog | 6 ++++++ mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog index 09179bf4848e8..d8377d881442b 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog +++ b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog @@ -1,3 +1,9 @@ +2006-03-23 Vladimir Krasnov + + * DataGrid.cs: fixed CreateControlHierarchy, added CurrentPageIndex + validation + in PrepareControlHierarchy fixed style applying to AlternatingItem + 2006-03-22 Vladimir Krasnov * DataList.cs: fixed RepeatColumns property, added value validation diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs index dc3a7bac63c9d..4a1880edeb86e 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs +++ b/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs @@ -942,6 +942,9 @@ protected override void CreateControlHierarchy (bool useDataSource) pds.PageSize = PageSize; pds.VirtualCount = VirtualItemCount; + if ((pds.IsPagingEnabled) && (pds.PageCount < pds.CurrentPageIndex)) + throw new HttpException ("Invalid DataGrid PageIndex"); + CreateRenderColumns (paged_data_source, useDataSource); if (useDataSource) { if (DataSource != null) @@ -1062,7 +1065,7 @@ protected override void PrepareControlHierarchy () case ListItemType.AlternatingItem: if (alt == null) { if (alt_item_style != null) { - alt = new Style (); + alt = new TableItemStyle (); alt.CopyFrom (item_style); alt.CopyFrom (alt_item_style); } else { From cb13a63be9de8704f2018f0a892ad84ca8530487 Mon Sep 17 00:00:00 2001 From: Vladimir Krasnov Date: Thu, 23 Mar 2006 10:00:18 +0000 Subject: [PATCH 071/117] * DataGrid.cs, DataList.cs, RepeatInfo.cs: added accessablity features svn path=/trunk/mcs/; revision=58348 --- .../System.Web.UI.WebControls/ChangeLog | 4 ++ .../System.Web.UI.WebControls/DataGrid.cs | 4 ++ .../System.Web.UI.WebControls/DataList.cs | 3 ++ .../System.Web.UI.WebControls/RepeatInfo.cs | 49 +++++++++++++++++++ 4 files changed, 60 insertions(+) diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog index d8377d881442b..365fb1d5e9c6f 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog +++ b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog @@ -1,3 +1,7 @@ +2006-03-23 Vladimir Krasnov + + * DataGrid.cs, DataList.cs, RepeatInfo.cs: added accessablity features + 2006-03-23 Vladimir Krasnov * DataGrid.cs: fixed CreateControlHierarchy, added CurrentPageIndex diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs index 4a1880edeb86e..313c064fe6bbc 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs +++ b/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs @@ -1053,6 +1053,10 @@ protected override void PrepareControlHierarchy () rt.CopyBaseAttributes (this); rt.ApplyStyle (ControlStyle); + rt.Caption = Caption; + rt.CaptionAlign = CaptionAlign; + rt.Enabled = Enabled; + bool top_pager = true; Style alt = null; foreach (DataGridItem item in rt.Rows) { diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataList.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataList.cs index 4767efdc6a58d..f331754f566be 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataList.cs +++ b/mcs/class/System.Web/System.Web.UI.WebControls/DataList.cs @@ -853,6 +853,9 @@ override void RenderContents (HtmlTextWriter writer) ri.RepeatColumns = RepeatColumns; ri.RepeatDirection = RepeatDirection; ri.RepeatLayout = RepeatLayout; + ri.CaptionAlign = CaptionAlign; + ri.Caption = Caption; + ri.UseAccessibleHeader = UseAccessibleHeader; /* // debugging stuff that I prefer to keep for a while Console.WriteLine ("RepeatColumns {0}", ri.RepeatColumns); diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeatInfo.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeatInfo.cs index 317818a065e10..bc789a0d923a7 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeatInfo.cs +++ b/mcs/class/System.Web/System.Web.UI.WebControls/RepeatInfo.cs @@ -29,6 +29,7 @@ //#define DEBUG_REPEAT_INFO using System.Diagnostics; +using System.ComponentModel; using System.Security.Permissions; namespace System.Web.UI.WebControls { @@ -83,6 +84,16 @@ void RenderVert (HtmlTextWriter w, IRepeatInfoUser user, Style controlStyle, Web if (! oti) RenderBeginTag (w, controlStyle, baseControl); + if (UseAccessibleHeader) { + if (CaptionAlign != TableCaptionAlign.NotSet) + w.AddAttribute (HtmlTextWriterAttribute.Align, CaptionAlign.ToString()); + + w.RenderBeginTag (HtmlTextWriterTag.Caption); + w.Write (Caption); + w.RenderEndTag (); + + } + // Render the header if (user.HasHeader) { if (oti) @@ -241,6 +252,16 @@ void RenderHoriz (HtmlTextWriter w, IRepeatInfoUser user, Style controlStyle, We RenderBeginTag (w, controlStyle, baseControl); + if (UseAccessibleHeader) { + if (CaptionAlign != TableCaptionAlign.NotSet) + w.AddAttribute (HtmlTextWriterAttribute.Align, CaptionAlign.ToString()); + + w.RenderBeginTag (HtmlTextWriterTag.Caption); + w.Write (Caption); + w.RenderEndTag (); + + } + // Render the header if (user.HasHeader) { if (table) { @@ -442,5 +463,33 @@ internal void PrintValues (IRepeatInfoUser riu) if (HttpContext.Current != null) HttpContext.Current.Trace.Write (s); } + + private string caption = ""; + private TableCaptionAlign captionAlign = TableCaptionAlign.NotSet; + private bool useAccessibleHeader = false; + + [WebSysDescription ("")] + [WebCategory ("Accessibility")] + public string Caption { + get {return caption;} + set { caption = value; } + } + + [WebSysDescription ("")] + [DefaultValue (TableCaptionAlign.NotSet)] + [WebCategory ("Accessibility")] + public TableCaptionAlign CaptionAlign { + get {return captionAlign;} + set { captionAlign = value; } + } + + [WebSysDescription ("")] + [DefaultValue (false)] + [WebCategory ("Accessibility")] + public bool UseAccessibleHeader { + get {return useAccessibleHeader;} + set { useAccessibleHeader = value; } + } + } } From 68b93f77df3867872110867fb40ee189a77605b3 Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Thu, 23 Mar 2006 12:54:37 +0000 Subject: [PATCH 072/117] 2006-03-23 Atsushi Enomoto * NvdlXsdSupport.cs : seems like "XmlReaderSettings.ValidationType = ValidationType.Auto" does not automatically start xsd validation, so set the property explicitly as ValidationType.Schema. svn path=/trunk/mcs/; revision=58353 --- mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/ChangeLog | 6 ++++++ .../Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlXsdSupport.cs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/ChangeLog b/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/ChangeLog index 4f03def42927f..bb028795ea4df 100644 --- a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/ChangeLog +++ b/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/ChangeLog @@ -1,3 +1,9 @@ +2006-03-23 Atsushi Enomoto + + * NvdlXsdSupport.cs : seems like "XmlReaderSettings.ValidationType = + ValidationType.Auto" does not automatically start xsd validation, + so set the property explicitly as ValidationType.Schema. + 2006-03-03 Atsushi Enomoto * NvdlXsdSupport.cs : oops, XmlSchemaValidationFlags. diff --git a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlXsdSupport.cs b/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlXsdSupport.cs index e6501d80bfafb..d1bd48023d741 100644 --- a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlXsdSupport.cs +++ b/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlXsdSupport.cs @@ -43,7 +43,7 @@ public NvdlXsdValidatorGenerator (XmlSchema [] schemas) { #if NET_2_0 XmlReaderSettings s = new XmlReaderSettings (); - s.ValidationType = ValidationType.Auto; + s.ValidationType = ValidationType.Schema; // do not allow inline schema and schemaLocation. s.ValidationFlags = XmlSchemaValidationFlags.ProcessIdentityConstraints; s.XmlResolver = resolver; From 659cdc1ac20a8c6b9c7115109c8b9e96efe768ff Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Thu, 23 Mar 2006 13:07:37 +0000 Subject: [PATCH 073/117] 2006-03-23 Atsushi Enomoto * XmlReader.cs : in XmlReader.Create() ValidationType Auto and XDR are simply ignored (it was found on running NvdlValidatingReader under MS.NET 2.0). svn path=/trunk/mcs/; revision=58354 --- mcs/class/System.XML/System.Xml/ChangeLog | 6 ++++++ mcs/class/System.XML/System.Xml/XmlReader.cs | 10 ++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog index 1386a6aed9dff..b4f02b212e38c 100644 --- a/mcs/class/System.XML/System.Xml/ChangeLog +++ b/mcs/class/System.XML/System.Xml/ChangeLog @@ -1,3 +1,9 @@ +2006-03-23 Atsushi Enomoto + + * XmlReader.cs : in XmlReader.Create() ValidationType Auto and XDR + are simply ignored (it was found on running NvdlValidatingReader + under MS.NET 2.0). + 2006-03-23 Atsushi Enomoto * DTDValidatingReader.cs : avoid NullReferenceException. Input diff --git a/mcs/class/System.XML/System.Xml/XmlReader.cs b/mcs/class/System.XML/System.Xml/XmlReader.cs index 1dfb512593272..80a68b9823cc1 100644 --- a/mcs/class/System.XML/System.Xml/XmlReader.cs +++ b/mcs/class/System.XML/System.Xml/XmlReader.cs @@ -400,7 +400,8 @@ private static XmlReader CreateValidatingXmlReader (XmlReader reader, XmlReaderS { XmlValidatingReader xvr = null; switch (settings.ValidationType) { - case ValidationType.None: + // Auto and XDR are obsoleted in 2.0 and therefore ignored. + default: return reader; case ValidationType.DTD: xvr = new XmlValidatingReader (reader); @@ -411,13 +412,6 @@ private static XmlReader CreateValidatingXmlReader (XmlReader reader, XmlReaderS // xvr = new XmlValidatingReader (reader); // xvr.ValidationType = ValidationType.Schema; return new XmlSchemaValidatingReader (reader, settings); - case ValidationType.Auto: - xvr = new XmlValidatingReader (reader); - xvr.ValidationType = ValidationType.DTD; - reader = xvr; - goto case ValidationType.Schema; - case ValidationType.XDR: - throw new NotSupportedException (); } if (xvr != null) xvr.SetSchemas (settings.Schemas); From 1f5bb728dbc37eee4499ffc978ce3bde2e87f216 Mon Sep 17 00:00:00 2001 From: Senganal T Date: Thu, 23 Mar 2006 13:15:08 +0000 Subject: [PATCH 074/117] 2006-03-23 Senganal T * Test/System.Data/DataTableTest2.cs : - Ensure duplicate rows are merged when using LoadDataRow * Test/System.Data/DataRowCollectionTest2.cs : - Ensure row can be searched using Find (), when added using LoadDataRow * System.Data/DataTable.cs : - LoadDataRow : Add the row to the indexes, when loading a new row. svn path=/trunk/mcs/; revision=58356 --- mcs/class/System.Data/System.Data/ChangeLog | 5 +++++ .../System.Data/System.Data/DataTable.cs | 2 +- .../System.Data/Test/System.Data/ChangeLog | 7 +++++++ .../System.Data/DataRowCollectionTest2.cs | 1 - .../Test/System.Data/DataTableTest2.cs | 19 +++++++++++++++++++ 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/mcs/class/System.Data/System.Data/ChangeLog b/mcs/class/System.Data/System.Data/ChangeLog index 7d66770d6b047..2f08fbabf9cde 100644 --- a/mcs/class/System.Data/System.Data/ChangeLog +++ b/mcs/class/System.Data/System.Data/ChangeLog @@ -1,3 +1,8 @@ +2006-03-23 Senganal T + + * DataTable.cs : + - LoadDataRow : Add the row to the indexes, when loading a new row. + 2006-03-22 Senganal T * DataTable.cs : diff --git a/mcs/class/System.Data/System.Data/DataTable.cs b/mcs/class/System.Data/System.Data/DataTable.cs index 22784a2cdefa2..3d3350ce90cd7 100644 --- a/mcs/class/System.Data/System.Data/DataTable.cs +++ b/mcs/class/System.Data/System.Data/DataTable.cs @@ -1203,6 +1203,7 @@ public DataRow LoadDataRow (object[] values, bool fAcceptChanges) if (existingRecord < 0) { row = NewRowFromBuilder (RowBuilder); row.Proposed = newRecord; + AddRowToIndexes (row); Rows.AddInternal(row); } else { @@ -1210,7 +1211,6 @@ public DataRow LoadDataRow (object[] values, bool fAcceptChanges) row.BeginEdit(); row.ImportRecord(newRecord); row.EndEdit(); - } if (fAcceptChanges) diff --git a/mcs/class/System.Data/Test/System.Data/ChangeLog b/mcs/class/System.Data/Test/System.Data/ChangeLog index 713828e5211b8..8b83b2d904dde 100644 --- a/mcs/class/System.Data/Test/System.Data/ChangeLog +++ b/mcs/class/System.Data/Test/System.Data/ChangeLog @@ -1,3 +1,10 @@ +2006-03-23 Senganal T + + * DataTableTest2.cs : + - Ensure duplicate rows are merged when using LoadDataRow + * DataRowCollectionTest2.cs : + - Ensure row can be searched using Find (), when added using LoadDataRow + 2006-03-22 Senganal T * DataColumnTest2.cs : diff --git a/mcs/class/System.Data/Test/System.Data/DataRowCollectionTest2.cs b/mcs/class/System.Data/Test/System.Data/DataRowCollectionTest2.cs index 66eeaea04b320..b79f0867faeba 100644 --- a/mcs/class/System.Data/Test/System.Data/DataRowCollectionTest2.cs +++ b/mcs/class/System.Data/Test/System.Data/DataRowCollectionTest2.cs @@ -225,7 +225,6 @@ public void FindByKey_VerifyOrder () } [Test] - [NUnit.Framework.Category ("NotWorking")] public void FindByKey_DuringDataLoad () { DataTable table = new DataTable (); diff --git a/mcs/class/System.Data/Test/System.Data/DataTableTest2.cs b/mcs/class/System.Data/Test/System.Data/DataTableTest2.cs index ee76b8e70033c..7c75420bfea44 100644 --- a/mcs/class/System.Data/Test/System.Data/DataTableTest2.cs +++ b/mcs/class/System.Data/Test/System.Data/DataTableTest2.cs @@ -422,6 +422,25 @@ private void Column_Changeding( object sender, DataColumnChangeEventArgs e ) } } + [Test] + public void EndLoadData_MergeDuplcateValues () + { + DataTable table = new DataTable (); + table.Columns.Add ("col1", typeof (int)); + table.Columns.Add ("col2", typeof (int)); + + table.PrimaryKey = new DataColumn[] {table.Columns [0]}; + + table.BeginLoadData (); + table.LoadDataRow (new object[] {1 , 1}, false); + table.LoadDataRow (new object[] {1 , 10}, false); + table.LoadDataRow (new object[] {1 , 100}, false); + table.EndLoadData (); + + Assert.AreEqual (1, table.Rows.Count, "#1"); + Assert.AreEqual (100, table.Rows [0][1], "#2"); + } + [Test] public void GetChanges() { DataTable dt1,dt2 = DataProvider.CreateParentDataTable(); From 2fa1f6928f93cff1a6e66e222be478ef47a3f8c0 Mon Sep 17 00:00:00 2001 From: Raja R Harinath Date: Thu, 23 Mar 2006 13:45:20 +0000 Subject: [PATCH 075/117] * generic.cs (TypeParameter.UpdateConstraints): Update 'constraints' if null. svn path=/trunk/mcs/; revision=58357 --- mcs/gmcs/ChangeLog | 5 +++++ mcs/gmcs/generic.cs | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/mcs/gmcs/ChangeLog b/mcs/gmcs/ChangeLog index bfe23489d454b..5292bd24bee68 100644 --- a/mcs/gmcs/ChangeLog +++ b/mcs/gmcs/ChangeLog @@ -1,3 +1,8 @@ +2006-03-23 Raja R Harinath + + * generic.cs (TypeParameter.UpdateConstraints): Update + 'constraints' if null. + 2006-02-22 Marek Safar A fix for #77615 diff --git a/mcs/gmcs/generic.cs b/mcs/gmcs/generic.cs index 0e18f4b4b0867..2ce534aa021da 100644 --- a/mcs/gmcs/generic.cs +++ b/mcs/gmcs/generic.cs @@ -785,10 +785,7 @@ public bool UpdateConstraints (IResolveContext ec, Constraints new_constraints) if (type == null) throw new InvalidOperationException (); - if (constraints == null) { - new_constraints = constraints; - return true; - } else if (new_constraints == null) + if (new_constraints == null) return true; if (!new_constraints.Resolve (ec)) @@ -796,7 +793,11 @@ public bool UpdateConstraints (IResolveContext ec, Constraints new_constraints) if (!new_constraints.ResolveTypes (ec)) return false; - return constraints.CheckInterfaceMethod (new_constraints); + if (constraints != null) + return constraints.CheckInterfaceMethod (new_constraints); + + constraints = new_constraints; + return true; } public void EmitAttributes () From 2c5050ae3a5748cd83de06d0f456dda6b37da31d Mon Sep 17 00:00:00 2001 From: Raja R Harinath Date: Thu, 23 Mar 2006 14:15:07 +0000 Subject: [PATCH 076/117] *** merged revision 57284 from mcs/ svn path=/trunk/mcs/; revision=58358 --- .../Mono.Posix/Mono.Unix.Native/ChangeLog | 14 +- .../NativeConvert.generated.cs | 3 - mcs/errors/known-issues-gmcs | 10 - mcs/gmcs/ChangeLog | 49 + mcs/gmcs/attribute.cs | 2 +- mcs/gmcs/class.cs | 1453 +++++++---------- mcs/gmcs/cs-parser.jay | 67 +- mcs/gmcs/decl.cs | 115 +- mcs/gmcs/doc.cs | 35 - mcs/gmcs/driver.cs | 2 +- mcs/gmcs/iterators.cs | 2 +- mcs/gmcs/modifiers.cs | 1 + mcs/gmcs/tree.cs | 34 +- mcs/tests/known-issues-gmcs | 5 +- 14 files changed, 744 insertions(+), 1048 deletions(-) diff --git a/mcs/class/Mono.Posix/Mono.Unix.Native/ChangeLog b/mcs/class/Mono.Posix/Mono.Unix.Native/ChangeLog index fd02630354052..c8812f77bdc4f 100644 --- a/mcs/class/Mono.Posix/Mono.Unix.Native/ChangeLog +++ b/mcs/class/Mono.Posix/Mono.Unix.Native/ChangeLog @@ -1,12 +1,16 @@ +2006-03-23 Raja R Harinath + + * NativeConvert.generated.cs: Update after merge. + 2006-02-25 Marek Safar - * NativeConvert.generated.cs: Guarded CLSCompliant attribute by NET_2_0 - until mcs is merged with gmcs. - + * NativeConvert.generated.cs: Guarded CLSCompliant attribute by NET_2_0 + until mcs is merged with gmcs. + 2006-02-21 Marek Safar - * NativeConvert.generated.cs: Removed duplicated CLSCompliant attribute. - + * NativeConvert.generated.cs: Removed duplicated CLSCompliant attribute. + 2006-01-10 Raja R Harinath * Syscall.cs (sys_futimes): Remove buggy custom marshaller on 'fd' parameter. diff --git a/mcs/class/Mono.Posix/Mono.Unix.Native/NativeConvert.generated.cs b/mcs/class/Mono.Posix/Mono.Unix.Native/NativeConvert.generated.cs index 3fc577ae51d1b..7fd06c2a3393c 100644 --- a/mcs/class/Mono.Posix/Mono.Unix.Native/NativeConvert.generated.cs +++ b/mcs/class/Mono.Posix/Mono.Unix.Native/NativeConvert.generated.cs @@ -9,9 +9,6 @@ using Mono.Unix.Native; namespace Mono.Unix.Native { -#if NET_2_0 - [CLSCompliant (false)] -#endif public sealed /* static */ partial class NativeConvert { private NativeConvert () {} diff --git a/mcs/errors/known-issues-gmcs b/mcs/errors/known-issues-gmcs index 0e8be33dbcefd..c8190a4913ce5 100644 --- a/mcs/errors/known-issues-gmcs +++ b/mcs/errors/known-issues-gmcs @@ -11,9 +11,6 @@ # csXXXX.cs NO ERROR : error test case doesn't report any error. An exception is considered # as NO ERROR and CS5001 is automatically ignored. -cs0102-16.cs -cs0111-16.cs NO ERROR -cs0111-17.cs cs0221-5.cs NO ERROR cs0229-2.cs cs0229.cs NO ERROR @@ -26,18 +23,14 @@ cs0548-4.cs cs0548.cs cs0560.cs cs0567.cs -cs0579-10.cs NO ERROR cs0612-2.cs NO ERROR cs0619-42.cs cs0619-47.cs NO ERROR cs0619-48.cs NO ERROR cs0619-49.cs -cs0625-2.cs NO ERROR cs0625-3.cs NO ERROR cs0631-2.cs cs0647-3.cs -cs0713-2.cs NO ERROR -cs0714-2.cs cs1035.cs cs1040-2.cs cs1040.cs @@ -58,9 +51,6 @@ cs1667-4.cs cs1667-5.cs cs1667.cs cs1670-2.cs -cs3005-24.cs NO ERROR -cs3016-4.cs NO ERROR -cs3018-3.cs NO ERROR gcs0146.cs gcs0305-2.cs gcs0305.cs diff --git a/mcs/gmcs/ChangeLog b/mcs/gmcs/ChangeLog index 5292bd24bee68..b3313cec43997 100644 --- a/mcs/gmcs/ChangeLog +++ b/mcs/gmcs/ChangeLog @@ -1,4 +1,53 @@ 2006-03-23 Raja R Harinath +2006-02-25 Marek Safar + + New partial class implementation. + A fix for #77027, #77029, #77403 + + * attribute.cs (Attributable): Made attributes protected. + + * class.cs (TypeContainer): Add PartialContainer and partial_parts as + the replacements of ClassPart and PartialContainer. + (TypeContainer.AddClassOrStruct): Call RecordDecl here. + (TypeContainer.AddInterface): Ditto. + (TypeContainer.AddPartial): The main method for partial classes. It checks + for errors and merges ModFlags and attributes. At the end class is added to + partial_parts list. + (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is + required here. + (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too. + (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces + from the rest of partial classes. + (TypeContainer.GetClassBases): Simplified. + (TypeContainer.DefineTypeBuilder): New method, mostly extracted from + DefineType. + (TypeContainer.DefineDefaultConstructor): Is used by derived classes. + (TypeContainer.HasExplicitLayout): Uses Flags now. + (PartialContainer): Removed. + (ClassOrStruct.AddToContainer): Moved enclosing member name check here. + (StaticClass): Was merged with Class. + (Class.GetClassBases): class and static class bases are verified here. + (Class.TypeAttr): Added static attributes when class is static. + (Struct.RegisterFieldForInitialization): Moved from TypeContainer. + (MemberBase): In some cases we need to call parent container for partial + class. It should be eliminated but it's not easy now. + + * cs-parser.jay: Replaced all PartialContainer with AddPartial. + + * decls.cs (MemberCore.DocComment): Introduced new property as is used by + partial classed to accumulate class comments. + (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer. + + * doc.cs (GenerateTypeDocComment): Partial classes clean up. + + * driver.cs (MainDriver): Tree.GetDecl was removed. + + * modifiers.cs (Modifiers): Add partial modifier. + + * tree.cs (Tree.decl): Removed. + (RootTypes): Started to use this class more often for root types + specializations. + * generic.cs (TypeParameter.UpdateConstraints): Update 'constraints' if null. diff --git a/mcs/gmcs/attribute.cs b/mcs/gmcs/attribute.cs index 941aa60500fec..de2e0af996e6d 100644 --- a/mcs/gmcs/attribute.cs +++ b/mcs/gmcs/attribute.cs @@ -32,7 +32,7 @@ public abstract class Attributable { /// /// Attributes for this type /// - Attributes attributes; + protected Attributes attributes; public Attributable (Attributes attrs) { diff --git a/mcs/gmcs/class.cs b/mcs/gmcs/class.cs index dcf3472c4f363..4efdaa64d3232 100644 --- a/mcs/gmcs/class.cs +++ b/mcs/gmcs/class.cs @@ -383,7 +383,7 @@ public override void DefineContainerMembers () public readonly Kind Kind; // Holds a list of classes and structures - ArrayList types; + protected ArrayList types; // Holds the list of properties MemberCoreArrayList properties; @@ -427,14 +427,11 @@ public override void DefineContainerMembers () // Holds the iterators ArrayList iterators; - // Holds the parts of a partial class; - ArrayList parts; - // // Pointers to the default constructor and the default static constructor // - protected Constructor default_constructor; - protected Constructor default_static_constructor; + Constructor default_constructor; + Constructor default_static_constructor; // // Points to the first non-static field added to the container. @@ -468,6 +465,15 @@ public override void DefineContainerMembers () Type GenericType; GenericTypeParameterBuilder[] gen_params; + public TypeContainer PartialContainer; + ArrayList partial_parts; + + /// + /// The pending methods that need to be implemented + // (interfaces or abstract methods) + /// + PendingImplementation pending; + public TypeContainer (NamespaceEntry ns, TypeContainer parent, MemberName name, Attributes attrs, Kind kind) : base (ns, parent, name, attrs) @@ -476,8 +482,6 @@ public override void DefineContainerMembers () throw new InternalErrorException ("A nested type should be in the same NamespaceEntry as its enclosing class"); this.Kind = kind; - - types = new ArrayList (); } public bool AddToMemberContainer (MemberCore symbol) @@ -517,10 +521,70 @@ public bool AddClassOrStruct (TypeContainer c) if (!AddToTypeContainer (c)) return false; + if (types == null) + types = new ArrayList (2); + + RootContext.Tree.RecordDecl (c.NamespaceEntry.NS, c.MemberName, c); types.Add (c); return true; } + public virtual TypeContainer AddPartial (TypeContainer nextPart) + { + return AddPartial (nextPart, nextPart.Basename); + } + + protected TypeContainer AddPartial (TypeContainer nextPart, string name) + { + nextPart.ModFlags |= Modifiers.PARTIAL; + TypeContainer tc = defined_names [name] as TypeContainer; + + if (tc == null) { + if (nextPart is Interface) + AddInterface (nextPart); + else + AddClassOrStruct (nextPart); + return nextPart; + } + + if ((tc.ModFlags & Modifiers.PARTIAL) == 0) { + Report.SymbolRelatedToPreviousError (tc); + Error_MissingPartialModifier (nextPart); + return tc; + } + + if (tc.Kind != nextPart.Kind) { + Report.SymbolRelatedToPreviousError (tc); + Report.Error (261, nextPart.Location, + "Partial declarations of `{0}' must be all classes, all structs or all interfaces", + nextPart.GetSignatureForError ()); + return tc; + } + + if ((tc.ModFlags & Modifiers.Accessibility) != (nextPart.ModFlags & Modifiers.Accessibility)) { + Report.SymbolRelatedToPreviousError (tc); + Report.Error (262, nextPart.Location, + "Partial declarations of `{0}' have conflicting accessibility modifiers", + nextPart.GetSignatureForError ()); + return tc; + } + + if (tc.partial_parts == null) + tc.partial_parts = new ArrayList (1); + + tc.ModFlags |= nextPart.ModFlags; + if (nextPart.attributes != null) { + if (tc.attributes == null) + tc.attributes = nextPart.attributes; + else + tc.attributes.AddAttributes (nextPart.attributes.Attrs); + } + + nextPart.PartialContainer = tc; + tc.partial_parts.Add (nextPart); + return tc; + } + public void AddDelegate (Delegate d) { if (!AddToTypeContainer (d)) @@ -610,6 +674,7 @@ public bool AddInterface (TypeContainer iface) interfaces = new MemberCoreArrayList (); } + RootContext.Tree.RecordDecl (iface.NamespaceEntry.NS, iface.MemberName, iface); interfaces.Add (iface); return true; } @@ -709,19 +774,6 @@ public void AddIterator (Iterator i) iterators.Add (i); } - public void AddType (TypeContainer tc) - { - types.Add (tc); - } - - public void AddPart (ClassPart part) - { - if (parts == null) - parts = new ArrayList (); - - parts.Add (part); - } - public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb) { if (a.Type == TypeManager.default_member_type) { @@ -736,16 +788,7 @@ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder public override AttributeTargets AttributeTargets { get { - switch (Kind) { - case Kind.Class: - return AttributeTargets.Class; - case Kind.Struct: - return AttributeTargets.Struct; - case Kind.Interface: - return AttributeTargets.Interface; - default: - throw new NotSupportedException (); - } + throw new NotSupportedException (); } } @@ -778,7 +821,7 @@ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder return iterators; } } - + protected Type BaseType { get { return TypeBuilder.BaseType; @@ -843,12 +886,6 @@ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder } } - public ArrayList Parts { - get { - return parts; - } - } - protected override TypeAttributes TypeAttr { get { return Modifiers.TypeAttr (ModFlags, this) | base.TypeAttr; @@ -888,7 +925,7 @@ public virtual void RegisterFieldForInitialization (FieldBase field) // // Emits the instance field initializers // - public virtual bool EmitFieldInitializers (EmitContext ec) + public bool EmitFieldInitializers (EmitContext ec) { ArrayList fields; @@ -912,95 +949,66 @@ public virtual bool EmitFieldInitializers (EmitContext ec) // protected void DefineDefaultConstructor (bool is_static) { - Constructor c; - - // The default constructor is public + // The default instance constructor is public // If the class is abstract, the default constructor is protected // The default static constructor is private - int mods = Modifiers.PUBLIC; - if (is_static) + int mods; + if (is_static) { + if (initialized_static_fields == null || default_static_constructor != null) + return; mods = Modifiers.STATIC | Modifiers.PRIVATE; - else if ((ModFlags & Modifiers.ABSTRACT) != 0) - mods = Modifiers.PROTECTED; + } else { + if (instance_constructors != null) + return; - TypeContainer constructor_parent = this; - if (Parts != null) - constructor_parent = (TypeContainer) Parts [0]; + mods = ((ModFlags & Modifiers.ABSTRACT) != 0) ? Modifiers.PROTECTED : Modifiers.PUBLIC; + } - c = new Constructor (constructor_parent, MemberName.Name, mods, + Constructor c = new Constructor (this, MemberName.Name, mods, Parameters.EmptyReadOnlyParameters, new GeneratedBaseInitializer (Location), Location); AddConstructor (c); - c.Block = new ToplevelBlock (null, Location); - } - /// - /// The pending methods that need to be implemented - // (interfaces or abstract methods) - /// - public PendingImplementation Pending; + public override string DocComment { + get { + return comment; + } + set { + if (value == null) + return; - public abstract PendingImplementation GetPendingImplementations (); + comment += value; + } + } - TypeExpr[] GetPartialBases (out TypeExpr base_class) + public PendingImplementation PendingImplementations { - ArrayList ifaces = new ArrayList (); - - base_class = null; - - foreach (ClassPart part in parts) { - TypeExpr new_base_class; - TypeExpr[] new_ifaces; - - new_ifaces = part.GetClassBases (out new_base_class); - if (new_ifaces == null && new_base_class != null) - return null; - - if ((base_class != null) && (new_base_class != null) && - !base_class.Equals (new_base_class)) { - Report.SymbolRelatedToPreviousError (base_class.Location, ""); - Report.Error (263, part.Location, - "Partial declarations of `{0}' must " + - "not specify different base classes", - Name); - - return null; - } - - if ((base_class == null) && (new_base_class != null)) { - base_class = new_base_class; - } - - if (new_ifaces == null) - continue; + get { + return pending; + } + } - foreach (TypeExpr iface in new_ifaces) { - bool found = false; - foreach (TypeExpr old_iface in ifaces) { - if (old_iface.Equals (iface)) { - found = true; - break; - } - } + public override bool GetClsCompliantAttributeValue () + { + if ((caching_flags & Flags.HasCompliantAttribute_Undetected) == 0) + return (caching_flags & Flags.ClsCompliantAttributeTrue) != 0; - if (!found) - ifaces.Add (iface); - } - } + if (IsPartial) + return PartialContainer.GetClsCompliantAttributeValue (); - TypeExpr[] retval = new TypeExpr [ifaces.Count]; - ifaces.CopyTo (retval, 0); - return retval; + return base.GetClsCompliantAttributeValue (); } TypeExpr[] GetNormalBases (out TypeExpr base_class) { base_class = null; + if (Bases == null) + return null; int count = Bases.Count; int start = 0, i, j; @@ -1031,7 +1039,49 @@ TypeExpr[] GetNormalBases (out TypeExpr base_class) ifaces [j] = resolved; } - return ifaces; + return ifaces.Length == 0 ? null : ifaces; + } + + + TypeExpr[] GetNormalPartialBases (ref TypeExpr base_class) + { + ArrayList ifaces = new ArrayList (0); + if (iface_exprs != null) + ifaces.AddRange (iface_exprs); + + foreach (TypeContainer part in partial_parts) { + TypeExpr new_base_class; + TypeExpr[] new_ifaces = part.GetClassBases (out new_base_class); + if (new_base_class != TypeManager.system_object_expr) { + if (base_class == TypeManager.system_object_expr) + base_class = new_base_class; + else { + if (new_base_class != null && !new_base_class.Equals (base_class)) { + Report.SymbolRelatedToPreviousError (base_class.Location, ""); + Report.Error (263, part.Location, + "Partial declarations of `{0}' must not specify different base classes", + part.GetSignatureForError ()); + + return null; + } + } + } + + if (new_ifaces == null) + continue; + + foreach (TypeExpr iface in new_ifaces) { + if (ifaces.Contains (iface)) + continue; + + ifaces.Add (iface); + } + } + + if (ifaces.Count == 0) + return null; + + return (TypeExpr[])ifaces.ToArray (typeof (TypeExpr)); } /// @@ -1044,69 +1094,16 @@ TypeExpr[] GetNormalBases (out TypeExpr base_class) /// The @base_class argument is set to the base object or null /// if this is `System.Object'. /// - protected virtual TypeExpr [] GetClassBases (out TypeExpr base_class) + public virtual TypeExpr [] GetClassBases (out TypeExpr base_class) { - int i; - - TypeExpr[] ifaces; - - if (parts != null) - ifaces = GetPartialBases (out base_class); - else if (Bases == null){ - base_class = null; - return null; - } else - ifaces = GetNormalBases (out base_class); - - if (ifaces == null) - return null; - - if ((base_class != null) && (Kind == Kind.Class)){ - if (base_class is TypeParameterExpr){ - Report.Error ( - 689, base_class.Location, - "Cannot derive from `{0}' because it is a type parameter", - base_class.GetSignatureForError ()); - error = true; - return null; - } - - if (base_class.Type.IsArray || base_class.Type.IsPointer) { - Report.Error (1521, base_class.Location, "Invalid base type"); - return null; - } - - if (base_class.IsSealed){ - Report.SymbolRelatedToPreviousError (base_class.Type); - if (base_class.Type.IsAbstract) { - Report.Error (709, Location, "`{0}': Cannot derive from static class `{1}'", - GetSignatureForError (), TypeManager.CSharpName (base_class.Type)); - } else { - Report.Error (509, Location, "`{0}': cannot derive from sealed class `{1}'", - GetSignatureForError (), TypeManager.CSharpName (base_class.Type)); - } - return null; - } - - if (!base_class.CanInheritFrom ()){ - Report.Error (644, Location, "`{0}' cannot derive from special class `{1}'", - GetSignatureForError (), base_class.GetSignatureForError ()); - return null; - } - - if (!base_class.AsAccessible (this, ModFlags)) { - Report.SymbolRelatedToPreviousError (base_class.Type); - Report.Error (60, Location, "Inconsistent accessibility: base class `{0}' is less accessible than class `{1}'", - TypeManager.CSharpName (base_class.Type), GetSignatureForError ()); - } - } + TypeExpr[] ifaces = GetNormalBases (out base_class); if (ifaces == null) return null; - int count = ifaces != null ? ifaces.Length : 0; + int count = ifaces.Length; - for (i = 0; i < count; i++) { + for (int i = 0; i < count; i++) { TypeExpr iface = (TypeExpr) ifaces [i]; if (!iface.IsInterface) { @@ -1128,7 +1125,7 @@ TypeExpr[] GetNormalBases (out TypeExpr base_class) if (iface.Equals (ifaces [x])) { Report.Error (528, Location, "`{0}' is already listed in " + - "interface list", iface.Name); + "interface list", iface.GetSignatureForError ()); return null; } } @@ -1181,24 +1178,12 @@ protected void Error_TypeInListIsNotInterface (Location loc, string type) Report.Error (527, loc, "Type `{0}' in interface list is not an interface", type); } - // - // Defines the type in the appropriate ModuleBuilder or TypeBuilder. - // - public override TypeBuilder DefineType () + bool DefineTypeBuilder () { - if (error) - return null; - - if (TypeBuilder != null) - return TypeBuilder; - - TypeAttributes type_attributes = TypeAttr; - try { if (IsTopLevel){ if (TypeManager.NamespaceClash (Name, Location)) { - error = true; - return null; + return false; } ModuleBuilder builder = CodeGen.Module.Builder; @@ -1206,31 +1191,20 @@ public override TypeBuilder DefineType () if (Kind == Kind.Struct) default_parent = TypeManager.value_type; TypeBuilder = builder.DefineType ( - Name, type_attributes, default_parent, null); + Name, TypeAttr, default_parent, null); } else { TypeBuilder builder = Parent.TypeBuilder; - if (builder == null) { - error = true; - return null; - } TypeBuilder = builder.DefineNestedType ( - Basename, type_attributes, null, null); + Basename, TypeAttr, null, null); } } catch (ArgumentException) { Report.RuntimeMissingSupport (Location, "static classes"); - error = true; - return null; + return false; } TypeManager.AddUserType (this); - if (Parts != null) { - foreach (ClassPart part in Parts) { - part.TypeBuilder = TypeBuilder; - } - } - if (IsGeneric) { string[] param_names = new string [TypeParameters.Length]; for (int i = 0; i < TypeParameters.Length; i++) @@ -1244,9 +1218,8 @@ public override TypeBuilder DefineType () } iface_exprs = GetClassBases (out base_type); - if (iface_exprs == null && base_type != null) { - error = true; - return null; + if (partial_parts != null) { + iface_exprs = GetNormalPartialBases (ref base_type); } // @@ -1262,37 +1235,17 @@ public override TypeBuilder DefineType () if (!(this is Iterator)) RootContext.RegisterOrder (this); - if (base_type == null) { - if (Kind == Kind.Class){ - if (RootContext.StdLib) - base_type = TypeManager.system_object_expr; - else if (Name != "System.Object") - base_type = TypeManager.system_object_expr; - } else if (Kind == Kind.Struct){ - // - // If we are compiling our runtime, - // and we are defining ValueType, then our - // base is `System.Object'. - // - if (!RootContext.StdLib && Name == "System.ValueType") - base_type = TypeManager.system_object_expr; - else if (Kind == Kind.Struct) - base_type = TypeManager.system_valuetype_expr; - } - } - - if (base_type != null) { base_type = base_type.ResolveAsTypeTerminal (this, false); if (base_type == null) - return null; + return false; if (IsGeneric && TypeManager.IsAttributeType (base_type.Type)) { Report.Error (698, base_type.Location, "A generic type cannot derive from `{0}' " + "because it is an attribute class", base_type.Name); - return null; + return false; } TypeBuilder.SetParent (base_type.Type); @@ -1300,84 +1253,148 @@ public override TypeBuilder DefineType () } if (!CheckRecursiveDefinition (this)) { - error = true; - return null; + return false; } // add interfaces that were not added at type creation if (iface_exprs != null) { ifaces = TypeManager.ExpandInterfaces (this, iface_exprs); if (ifaces == null) { - error = true; - return null; + return false; } foreach (Type itype in ifaces) TypeBuilder.AddInterfaceImplementation (itype); if (!CheckGenericInterfaces (ifaces)) { - error = true; - return null; + return false; } TypeManager.RegisterBuilder (TypeBuilder, ifaces); } if (this is Iterator && !ResolveType ()) { - error = true; - return null; + return false; } - if (!DefineNestedTypes ()) { + return true; + } + + // + // Defines the type in the appropriate ModuleBuilder or TypeBuilder. + // + public override TypeBuilder DefineType () + { + if (TypeBuilder != null) + return TypeBuilder; + + if (error) + return null; + + if (!DefineTypeBuilder ()) { error = true; return null; } + if (partial_parts != null) { + foreach (TypeContainer part in partial_parts) + part.TypeBuilder = TypeBuilder; + } + + DefineNestedTypes (); + return TypeBuilder; } - public bool ResolveType () + Constraints [] constraints; + public override void SetParameterInfo (ArrayList constraints_list) { - if ((base_type != null) && - (base_type.ResolveType (this) == null)) { - error = true; - return false; + if (!IsPartial) { + base.SetParameterInfo (constraints_list); + return; } - if (!IsGeneric) - return true; + if (constraints_list == null) + return; - TypeExpr current_type = null; - if (Parts != null) { - foreach (ClassPart part in Parts) { - if (!part.DefineTypeParameters ()) { - error = true; - return false; - } - } - } else { - foreach (TypeParameter type_param in CurrentTypeParameters) { - if (!type_param.Resolve (this)) { - error = true; - return false; - } - } + constraints = new Constraints [PartialContainer.CountCurrentTypeParameters]; - foreach (TypeParameter type_param in TypeParameters) { - if (!type_param.DefineType (this)) { - error = true; - return false; + TypeParameter[] current_params = PartialContainer.CurrentTypeParameters; + for (int i = 0; i < constraints.Length; i++) { + foreach (Constraints constraint in constraints_list) { + if (constraint.TypeParameter == current_params [i].Name) { + constraints [i] = constraint; + break; } } - - current_type = new ConstructedType ( - TypeBuilder, TypeParameters, Location); } + } - foreach (TypeParameter type_param in TypeParameters) - if (!type_param.CheckDependencies ()) { - error = true; - return false; + bool UpdateTypeParameterConstraints () + { + bool ok = true; + TypeParameter[] current_params = PartialContainer.CurrentTypeParameters; + + if (constraints == null) + return true; + + for (int i = 0; i < current_params.Length; i++) { + if (!current_params [i].UpdateConstraints (this, constraints [i])) { + Report.Error (265, Location, "Partial declarations of `{0}' have " + + "inconsistent constraints for type parameter `{1}'.", + MemberName.GetTypeName (), current_params [i].Name); + ok = false; + } + } + + return ok; + } + + public bool ResolveType () + { + if ((base_type != null) && + (base_type.ResolveType (this) == null)) { + error = true; + return false; + } + + if (!IsGeneric) + return true; + + if (IsPartial) + throw new InternalErrorException (); + + TypeExpr current_type = null; + + foreach (TypeParameter type_param in CurrentTypeParameters) { + if (!type_param.Resolve (this)) { + error = true; + return false; + } + } + + if (partial_parts != null) { + foreach (TypeContainer part in partial_parts) { + if (!part.UpdateTypeParameterConstraints ()) { + error = true; + return false; + } + } + } + + foreach (TypeParameter type_param in TypeParameters) { + if (!type_param.DefineType (this)) { + error = true; + return false; + } + } + + current_type = new ConstructedType (TypeBuilder, TypeParameters, Location); + + foreach (TypeParameter type_param in TypeParameters) + if (!type_param.CheckDependencies ()) { + error = true; + return false; } if (current_type != null) { @@ -1485,6 +1502,16 @@ public override bool DefineMembers () return members_defined_ok; } + public override bool IsPartial { + get { + return PartialContainer != null; + } + } + + public virtual void DefineDefaultConstructor () + { + } + protected virtual bool DoDefineMembers () { if (iface_exprs != null) { @@ -1518,38 +1545,10 @@ protected virtual bool DoDefineMembers () DefineContainerMembers (constants); DefineContainerMembers (fields); - if ((Kind == Kind.Class) && !(this is ClassPart)){ - if ((instance_constructors == null) && - !(this is StaticClass)) { - if (default_constructor == null) - DefineDefaultConstructor (false); - } - - if (initialized_static_fields != null && - default_static_constructor == null) - DefineDefaultConstructor (true); - } - - if (Kind == Kind.Struct){ - // - // Structs can not have initialized instance - // fields - // - if (initialized_static_fields != null && - default_static_constructor == null) - DefineDefaultConstructor (true); - - if (initialized_fields != null) - ReportStructInitializedInstanceError (); - } - - Pending = GetPendingImplementations (); + DefineDefaultConstructor (); - if (parts != null) { - foreach (ClassPart part in parts) { - if (!part.DefineMembers ()) - return false; - } + if (Kind == Kind.Struct || Kind == Kind.Class) { + pending = PendingImplementation.GetPendingImplementations (this); } // @@ -1574,15 +1573,12 @@ protected virtual bool DoDefineMembers () #if CACHE - if (!(this is ClassPart)) - member_cache = new MemberCache (this); -#endif - - if (parts != null) { - foreach (ClassPart part in parts) + member_cache = new MemberCache (this); + if (partial_parts != null) { + foreach (TypeContainer part in partial_parts) part.member_cache = member_cache; } - +#endif if (iterators != null) { foreach (Iterator iterator in iterators) { if (iterator.DefineType () == null) @@ -1598,15 +1594,6 @@ protected virtual bool DoDefineMembers () return true; } - void ReportStructInitializedInstanceError () - { - foreach (Field f in initialized_fields){ - Report.Error (573, Location, - "`{0}': Structs cannot have instance field initializers", - f.GetSignatureForError ()); - } - } - protected virtual void DefineContainerMembers (MemberCoreArrayList mcal) { if (mcal != null) @@ -1615,13 +1602,6 @@ protected virtual void DefineContainerMembers (MemberCoreArrayList mcal) public override bool Define () { - if (parts != null) { - foreach (ClassPart part in parts) { - if (!part.Define ()) - return false; - } - } - if (iterators != null) { foreach (Iterator iterator in iterators) { if (!iterator.Define ()) @@ -1723,14 +1703,20 @@ public MethodInfo[] GetMethods () } // Indicated whether container has StructLayout attribute set Explicit - public virtual bool HasExplicitLayout { + public bool HasExplicitLayout { get { - return false; + return (caching_flags & Flags.HasExplicitLayout) != 0; + } + set { + caching_flags |= Flags.HasExplicitLayout; } } public override Type FindNestedType (string name) { + if (IsPartial) { + return PartialContainer.FindNestedType (name); + } ArrayList [] lists = { types, enums, delegates, interfaces }; for (int j = 0; j < lists.Length; ++j) { @@ -1742,8 +1728,7 @@ public override Type FindNestedType (string name) for (int i = 0; i < len; ++i) { DeclSpace ds = (DeclSpace) list [i]; if (ds.Basename == name) { - ds.DefineType (); - return ds.TypeBuilder; + return ds.DefineType (); } } } @@ -2205,6 +2190,31 @@ public virtual void VerifyMembers () } } + // TODO: move to ClassOrStruct + void EmitConstructors () + { + if (instance_constructors == null) + return; + + if (TypeBuilder.IsSubclassOf (TypeManager.attribute_type) && RootContext.VerifyClsCompliance && IsClsComplianceRequired ()) { + bool has_compliant_args = false; + + foreach (Constructor c in instance_constructors) { + c.Emit (); + + if (has_compliant_args) + continue; + + has_compliant_args = c.HasCompliantArgs; + } + if (!has_compliant_args) + Report.Error (3015, Location, "`{0}' has no accessible constructors which use only CLS-compliant types", GetSignatureForError ()); + } else { + foreach (Constructor c in instance_constructors) + c.Emit (); + } + } + /// /// Emits the code, this step is performed after all /// the types, enumerations, constructors @@ -2214,7 +2224,7 @@ public virtual void EmitType () if (OptAttributes != null) OptAttributes.Emit (); - if (IsGeneric && !(this is ClassPart)) { + if (IsGeneric) { int offset = CountTypeParameters - CurrentTypeParameters.Length; for (int i = offset; i < gen_params.Length; i++) CurrentTypeParameters [i - offset].EmitAttributes (); @@ -2243,25 +2253,7 @@ public virtual void EmitType () Emit (); - if (instance_constructors != null) { - if (TypeBuilder.IsSubclassOf (TypeManager.attribute_type) && RootContext.VerifyClsCompliance && IsClsComplianceRequired ()) { - bool has_compliant_args = false; - - foreach (Constructor c in instance_constructors) { - c.Emit (); - - if (has_compliant_args) - continue; - - has_compliant_args = c.HasCompliantArgs; - } - if (!has_compliant_args) - Report.Error (3015, Location, "`{0}' has no accessible constructors which use only CLS-compliant types", GetSignatureForError ()); - } else { - foreach (Constructor c in instance_constructors) - c.Emit (); - } - } + EmitConstructors (); // Can not continue if constants are broken EmitConstants (); @@ -2309,22 +2301,13 @@ public virtual void EmitType () } } - if (parts != null) { - foreach (ClassPart part in parts) - part.EmitType (); - } - - if ((Pending != null) && !(this is ClassPart)) - if (Pending.VerifyPendingMethods ()) + if (pending != null) + if (pending.VerifyPendingMethods ()) return; if (iterators != null) foreach (Iterator iterator in iterators) iterator.EmitType (); - -// if (types != null) -// foreach (TypeContainer tc in types) -// tc.Emit (); } public override void CloseType () @@ -2552,422 +2535,95 @@ void VerifyClsName () public virtual bool VerifyImplements (MemberBase mb) { if (ifaces != null) { - foreach (Type t in ifaces){ - if (t == mb.InterfaceType) - return true; - } - } - - Report.Error (540, mb.Location, "`{0}': containing type does not implement interface `{1}'", - mb.GetSignatureForError (), TypeManager.CSharpName (mb.InterfaceType)); - return false; - } - - public virtual void Mark_HasEquals () - { - Methods.HasEquals = true; - } - - public virtual void Mark_HasGetHashCode () - { - Methods.HasGetHashCode = true; - } - - // - // IMemberContainer - // - - string IMemberContainer.Name { - get { - return Name; - } - } - - Type IMemberContainer.Type { - get { - return TypeBuilder; - } - } - - MemberCache IMemberContainer.MemberCache { - get { - return member_cache; - } - } - - bool IMemberContainer.IsInterface { - get { - return Kind == Kind.Interface; - } - } - - MemberList IMemberContainer.GetMembers (MemberTypes mt, BindingFlags bf) - { - BindingFlags new_bf = bf | BindingFlags.DeclaredOnly; - - if (GenericType != null) - return TypeManager.FindMembers (GenericType, mt, new_bf, - null, null); - else - return FindMembers (mt, new_bf, null, null); - } - - // - // Generates xml doc comments (if any), and if required, - // handle warning report. - // - internal override void GenerateDocComment (DeclSpace ds) - { - DocUtil.GenerateTypeDocComment (this, ds); - } - - public override string DocCommentHeader { - get { return "T:"; } - } - - public virtual MemberCache BaseCache { - get { - if (base_cache != null) - return base_cache; - if (TypeBuilder.BaseType != null) - base_cache = TypeManager.LookupMemberCache (TypeBuilder.BaseType); - if (TypeBuilder.IsInterface) - base_cache = TypeManager.LookupBaseInterfacesCache (TypeBuilder); - return base_cache; - } - } - - } - - public class PartialContainer : TypeContainer { - - public readonly Namespace Namespace; - public readonly int OriginalModFlags; - public readonly int AllowedModifiers; - public readonly TypeAttributes DefaultTypeAttributes; - public ListDictionary DeclarativeSecurity; - - static PartialContainer Create (NamespaceEntry ns, TypeContainer parent, - MemberName member_name, int mod_flags, Kind kind) - { - - if (!CheckModFlags (0, mod_flags, member_name)) - return null; - - PartialContainer pc = RootContext.Tree.GetDecl (member_name) as PartialContainer; - if (pc != null) { - if (pc.Kind != kind) { - Report.Error ( - 261, member_name.Location, - "Partial declarations of `{0}' must be all classes, " + - "all structs or all interfaces", - member_name.GetTypeName ()); - return null; - } - - if (!CheckModFlags (pc.OriginalModFlags, mod_flags, member_name)) - return null; - pc.ModFlags |= (mod_flags & pc.AllowedModifiers); - - if (pc.IsGeneric) { - if (pc.CountTypeParameters != member_name.CountTypeArguments) { - Report.Error ( - 264, member_name.Location, - "Partial declarations of `{0}' must have the " + - "same type parameter names in the same order", - member_name.GetTypeName ()); - return null; - } - - TypeParameterName[] pc_names = pc.MemberName.TypeArguments.GetDeclarations (); - TypeParameterName[] names = member_name.TypeArguments.GetDeclarations (); - - for (int i = 0; i < pc.CountTypeParameters; i++) { - if (pc_names [i].Name == names [i].Name) - continue; - - Report.Error ( - 264, member_name.Location, - "Partial declarations of `{0}' must have the " + - "same type parameter names in the same order", - member_name.GetTypeName ()); - return null; - } - } - - return pc; - } - - if (parent is ClassPart) - parent = ((ClassPart) parent).PartialContainer; - - pc = new PartialContainer (ns.NS, parent, member_name, mod_flags, kind); - - if (kind == Kind.Interface) { - if (!parent.AddInterface (pc)) - return null; - } else if (kind == Kind.Class || kind == Kind.Struct) { - if (!parent.AddClassOrStruct (pc)) - return null; - } else { - throw new InvalidOperationException (); - } - RootContext.Tree.RecordDecl (ns.NS, member_name, pc); - // This is needed to define our type parameters; we define the constraints later. - pc.SetParameterInfo (null); - return pc; - } - - static bool CheckModFlags (int flags_org, int flags, MemberName member_name) - { - // Check (abstract|static|sealed) sanity. - int tmp = (flags_org | flags) & (Modifiers.ABSTRACT | Modifiers.SEALED | Modifiers.STATIC); - if ((tmp & Modifiers.ABSTRACT) != 0) { - if ((tmp & (Modifiers.STATIC | Modifiers.SEALED)) != 0) { - Report.Error ( - 418, member_name.Location, - "`{0}': an abstract class cannot be sealed or static", member_name.ToString ()); - return false; - } - } else if (tmp == (Modifiers.SEALED | Modifiers.STATIC)) { - Report.Error (441, member_name.Location, "`{0}': a class cannot be both static and sealed", member_name.ToString ()); - return false; - } - - if (flags_org == 0) - return true; - - // Check conflicts. - if (0 != ((flags_org ^ flags) & (0xFFFFFFFF ^ (Modifiers.SEALED | Modifiers.ABSTRACT)))) { - Report.Error ( - 262, member_name.Location, "Partial declarations of `{0}' " + - "have conflicting accessibility modifiers", - member_name.GetName ()); - return false; - } - return true; - } - - public static ClassPart CreatePart (NamespaceEntry ns, TypeContainer parent, - MemberName name, int mod, Attributes attrs, - Kind kind, Location loc) - { - PartialContainer pc = Create (ns, parent, name, mod, kind); - if (pc == null) { - // An error occured; create a dummy container, but don't - // register it. - pc = new PartialContainer (ns.NS, parent, name, mod, kind); - } - - ClassPart part = new ClassPart (ns, pc, parent, mod, attrs, kind); - pc.AddPart (part); - return part; - } - - protected PartialContainer (Namespace ns, TypeContainer parent, - MemberName name, int mod, Kind kind) - : base (null, parent, name, null, kind) - { - this.Namespace = ns; - - switch (kind) { - case Kind.Class: - AllowedModifiers = Class.AllowedModifiers; - DefaultTypeAttributes = Class.DefaultTypeAttributes; - break; - - case Kind.Struct: - AllowedModifiers = Struct.AllowedModifiers; - DefaultTypeAttributes = Struct.DefaultTypeAttributes; - break; - - case Kind.Interface: - AllowedModifiers = Interface.AllowedModifiers; - DefaultTypeAttributes = Interface.DefaultTypeAttributes; - break; - - default: - throw new InvalidOperationException (); - } - - int accmods; - if (parent.Parent == null) - accmods = Modifiers.INTERNAL; - else - accmods = Modifiers.PRIVATE; - - // FIXME: remove this nasty fix for bug #77370 when - // we get good AllowModifiersProp implementation. - if ((mod & Modifiers.STATIC) != 0) { - AllowedModifiers |= Modifiers.STATIC; - AllowedModifiers &= ~ (Modifiers.ABSTRACT | Modifiers.SEALED); - } - - this.ModFlags = Modifiers.Check (AllowedModifiers, mod, accmods, Location); - this.OriginalModFlags = mod; - } - - public override void EmitType () - { - base.EmitType (); - - if (DeclarativeSecurity != null) { - foreach (DictionaryEntry de in DeclarativeSecurity) { - TypeBuilder.AddDeclarativeSecurity ((SecurityAction)de.Key, (PermissionSet)de.Value); - } - } - } - - public override PendingImplementation GetPendingImplementations () - { - return PendingImplementation.GetPendingImplementations (this); - } - - public override bool MarkForDuplicationCheck () - { - return true; - } - - protected override TypeAttributes TypeAttr { - get { - return base.TypeAttr | DefaultTypeAttributes; - } - } - } - - public class ClassPart : TypeContainer, IMemberContainer { - public readonly PartialContainer PartialContainer; - public readonly bool IsPartial; - - Constraints[] constraints; - - public ClassPart (NamespaceEntry ns, PartialContainer pc, TypeContainer parent, - int mod, Attributes attrs, Kind kind) - : base (ns, parent, pc.MemberName, attrs, kind) - { - this.PartialContainer = pc; - this.IsPartial = true; - - int accmods; - if (parent == null || parent == RootContext.Tree.Types) - accmods = Modifiers.INTERNAL; - else - accmods = Modifiers.PRIVATE; - - this.ModFlags = Modifiers.Check (pc.AllowedModifiers, mod, accmods, pc.MemberName.Location); - - if (pc.IsGeneric) - constraints = new Constraints [pc.CountCurrentTypeParameters]; - } - - public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb) - { - if (a.Type.IsSubclassOf (TypeManager.security_attr_type) && a.CheckSecurityActionValidity (false)) { - if (PartialContainer.DeclarativeSecurity == null) - PartialContainer.DeclarativeSecurity = new ListDictionary (); - - a.ExtractSecurityPermissionSet (PartialContainer.DeclarativeSecurity); - return; - } - - base.ApplyAttributeBuilder (a, cb); - } - - public override PendingImplementation GetPendingImplementations () - { - return PartialContainer.Pending; - } - - public override bool VerifyImplements (MemberBase mb) - { - return PartialContainer.VerifyImplements (mb); - } - - public override void SetParameterInfo (ArrayList constraints_list) - { - if (constraints_list == null) - return; - - TypeParameter[] current_params = PartialContainer.CurrentTypeParameters; - for (int i = 0; i < constraints.Length; i++) { - foreach (Constraints constraint in constraints_list) { - if (constraint.TypeParameter == current_params [i].Name) { - constraints [i] = constraint; - break; - } - } - } - } - - public bool DefineTypeParameters () - { - TypeParameter[] current_params = PartialContainer.CurrentTypeParameters; - - for (int i = 0; i < current_params.Length; i++) { - Constraints new_constraints = constraints [i]; - if (new_constraints == null) - continue; - - if (!current_params [i].UpdateConstraints (this, new_constraints)) { - Report.Error (265, Location, "Partial declarations of `{0}' have " + - "inconsistent constraints for type parameter `{1}'.", - MemberName.GetTypeName (), current_params [i].Name); - return false; - } - } - - for (int i = 0; i < current_params.Length; i++) { - if (!current_params [i].Resolve (this)) - return false; - } - - foreach (TypeParameter type_param in PartialContainer.TypeParameters) { - if (!type_param.DefineType (this)) - return false; + foreach (Type t in ifaces){ + if (t == mb.InterfaceType) + return true; + } } - - return true; + + Report.SymbolRelatedToPreviousError (mb.InterfaceType); + Report.Error (540, mb.Location, "`{0}': containing type does not implement interface `{1}'", + mb.GetSignatureForError (), TypeManager.CSharpName (mb.InterfaceType)); + return false; } - public override void RegisterFieldForInitialization (FieldBase field) + public void Mark_HasEquals () { - PartialContainer.RegisterFieldForInitialization (field); + Methods.HasEquals = true; } - public override bool EmitFieldInitializers (EmitContext ec) + public void Mark_HasGetHashCode () { - return PartialContainer.EmitFieldInitializers (ec); + Methods.HasGetHashCode = true; } - public override Type FindNestedType (string name) - { - return PartialContainer.FindNestedType (name); + // + // IMemberContainer + // + + string IMemberContainer.Name { + get { + return Name; + } } - public override MemberCache BaseCache { + Type IMemberContainer.Type { get { - return PartialContainer.BaseCache; + return TypeBuilder; } } - public override TypeBuilder DefineType () - { - throw new InternalErrorException ("Should not get here"); + MemberCache IMemberContainer.MemberCache { + get { + return member_cache; + } + } + + bool IMemberContainer.IsInterface { + get { + return Kind == Kind.Interface; + } } - public override void Mark_HasEquals () + MemberList IMemberContainer.GetMembers (MemberTypes mt, BindingFlags bf) { - PartialContainer.Mark_HasEquals (); + BindingFlags new_bf = bf | BindingFlags.DeclaredOnly; + + if (GenericType != null) + return TypeManager.FindMembers (GenericType, mt, new_bf, + null, null); + else + return FindMembers (mt, new_bf, null, null); } - public override void Mark_HasGetHashCode () + // + // Generates xml doc comments (if any), and if required, + // handle warning report. + // + internal override void GenerateDocComment (DeclSpace ds) { - PartialContainer.Mark_HasGetHashCode (); + DocUtil.GenerateTypeDocComment (this, ds); + } + + public override string DocCommentHeader { + get { return "T:"; } + } + + public virtual MemberCache BaseCache { + get { + if (base_cache != null) + return base_cache; + if (TypeBuilder.BaseType != null) + base_cache = TypeManager.LookupMemberCache (TypeBuilder.BaseType); + if (TypeBuilder.IsInterface) + base_cache = TypeManager.LookupBaseInterfacesCache (TypeBuilder); + return base_cache; + } } + } public abstract class ClassOrStruct : TypeContainer { - bool has_explicit_layout = false; ListDictionary declarative_security; public ClassOrStruct (NamespaceEntry ns, TypeContainer parent, @@ -2976,17 +2632,30 @@ public abstract class ClassOrStruct : TypeContainer { { } - public override PendingImplementation GetPendingImplementations () + protected override bool AddToContainer (MemberCore symbol, string name) { - return PendingImplementation.GetPendingImplementations (this); - } - - public override bool HasExplicitLayout { - get { - return has_explicit_layout; + if (name == MemberName.Name) { + if (symbol is TypeParameter) { + Report.Error (694, symbol.Location, + "Type parameter `{0}' has same name as " + + "containing type, or method", name); + return false; } + + Report.SymbolRelatedToPreviousError (this); + Report.Error (542, symbol.Location, "`{0}': member names cannot be the same as their enclosing type", + symbol.GetSignatureForError ()); + return false; } + return base.AddToContainer (symbol, name); + } + + public override void DefineDefaultConstructor () + { + DefineDefaultConstructor (true); + } + public override void VerifyMembers () { base.VerifyMembers (); @@ -3009,8 +2678,9 @@ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder return; } - if (a.Type == TypeManager.struct_layout_attribute_type && a.GetLayoutKindValue () == LayoutKind.Explicit) - has_explicit_layout = true; + if (a.Type == TypeManager.struct_layout_attribute_type && a.GetLayoutKindValue () == LayoutKind.Explicit) { + HasExplicitLayout = true; + } base.ApplyAttributeBuilder (a, cb); } @@ -3027,23 +2697,56 @@ public override void Emit() } } - /// - /// Class handles static classes declaration - /// - public sealed class StaticClass: Class { - public StaticClass (NamespaceEntry ns, TypeContainer parent, MemberName name, int mod, - Attributes attrs) - : base (ns, parent, name, mod, attrs) + + // TODO: should be sealed + public class Class : ClassOrStruct { + const int AllowedModifiers = + Modifiers.NEW | + Modifiers.PUBLIC | + Modifiers.PROTECTED | + Modifiers.INTERNAL | + Modifiers.PRIVATE | + Modifiers.ABSTRACT | + Modifiers.SEALED | + Modifiers.STATIC | + Modifiers.UNSAFE; + + public Class (NamespaceEntry ns, TypeContainer parent, MemberName name, int mod, + Attributes attrs) + : base (ns, parent, name, attrs, Kind.Class) { - if (RootContext.Version == LanguageVersion.ISO_1) { + int accmods = Parent.Parent == null ? Modifiers.INTERNAL : Modifiers.PRIVATE; + this.ModFlags = Modifiers.Check (AllowedModifiers, mod, accmods, Location); + + if (IsStatic && RootContext.Version == LanguageVersion.ISO_1) { Report.FeatureIsNotStandardized (Location, "static classes"); } } - protected override int AllowedModifiersProp { + public override void ApplyAttributeBuilder(Attribute a, CustomAttributeBuilder cb) + { + if (a.Type == TypeManager.attribute_usage_type) { + if (BaseType != TypeManager.attribute_type && !BaseType.IsSubclassOf (TypeManager.attribute_type) && + TypeBuilder.FullName != "System.Attribute") { + Report.Error (641, a.Location, "Attribute `{0}' is only valid on classes derived from System.Attribute", a.GetSignatureForError ()); + } + } + + if (a.Type == TypeManager.conditional_attribute_type && + !(BaseType == TypeManager.attribute_type || BaseType.IsSubclassOf (TypeManager.attribute_type))) { + Report.Error (1689, a.Location, "Attribute `System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes"); + return; + } + + if (AttributeTester.IsAttributeExcluded (a.Type)) + return; + + base.ApplyAttributeBuilder (a, cb); + } + + public override AttributeTargets AttributeTargets { get { - return Modifiers.NEW | Modifiers.PUBLIC | Modifiers.PROTECTED | Modifiers.INTERNAL | Modifiers.PRIVATE | - Modifiers.STATIC | Modifiers.UNSAFE; + return AttributeTargets.Class; } } @@ -3052,6 +2755,11 @@ protected override void DefineContainerMembers (MemberCoreArrayList list) if (list == null) return; + if (!IsStatic) { + base.DefineContainerMembers (list); + return; + } + foreach (MemberCore m in list) { if (m is Operator) { Report.Error (715, m.Location, "`{0}': Static classes cannot contain user-defined operators", m.GetSignatureForError ()); @@ -3087,98 +2795,92 @@ protected override void DefineContainerMembers (MemberCoreArrayList list) base.DefineContainerMembers (list); } - public override TypeBuilder DefineType() + public override void DefineDefaultConstructor () { - if ((ModFlags & (Modifiers.SEALED | Modifiers.STATIC)) == (Modifiers.SEALED | Modifiers.STATIC)) { - Report.Error (441, Location, "`{0}': a class cannot be both static and sealed", GetSignatureForError ()); - return null; - } + if (!IsStatic) + DefineDefaultConstructor (false); - TypeBuilder tb = base.DefineType (); - if (tb == null) - return null; + base.DefineDefaultConstructor (); + } - if (BaseType != TypeManager.object_type) { - Report.Error (713, Location, "Static class `{0}' cannot derive from type `{1}'. Static classes must derive from object", - GetSignatureForError (), TypeManager.CSharpName (BaseType)); + public override TypeBuilder DefineType () + { + if ((ModFlags & Modifiers.ABSTRACT) == Modifiers.ABSTRACT && (ModFlags & (Modifiers.SEALED | Modifiers.STATIC)) != 0) { + Report.Error (418, Location, "`{0}': an abstract class cannot be sealed or static", GetSignatureForError ()); return null; } - if (ifaces != null) { - foreach (Type t in ifaces) - Report.SymbolRelatedToPreviousError (t); - Report.Error (714, Location, "`{0}': static classes cannot implement interfaces", GetSignatureForError ()); + if ((ModFlags & (Modifiers.SEALED | Modifiers.STATIC)) == (Modifiers.SEALED | Modifiers.STATIC)) { + Report.Error (441, Location, "`{0}': a class cannot be both static and sealed", GetSignatureForError ()); + return null; } - return tb; - } - protected override TypeAttributes TypeAttr { - get { - return base.TypeAttr | TypeAttributes.Abstract | TypeAttributes.Sealed; - } - } + return base.DefineType (); } - public class Class : ClassOrStruct { - // TODO: remove this and use only AllowedModifiersProp to fix partial classes bugs - public const int AllowedModifiers = - Modifiers.NEW | - Modifiers.PUBLIC | - Modifiers.PROTECTED | - Modifiers.INTERNAL | - Modifiers.PRIVATE | - Modifiers.ABSTRACT | - Modifiers.SEALED | - Modifiers.UNSAFE; - - public Class (NamespaceEntry ns, TypeContainer parent, MemberName name, int mod, - Attributes attrs) - : base (ns, parent, name, attrs, Kind.Class) + public override TypeExpr[] GetClassBases (out TypeExpr base_class) { - this.ModFlags = mod; - } + TypeExpr[] ifaces = base.GetClassBases (out base_class); - virtual protected int AllowedModifiersProp { - get { - return AllowedModifiers; - } - } + if (base_class == null) { + if (RootContext.StdLib) + base_class = TypeManager.system_object_expr; + else if (Name != "System.Object") + base_class = TypeManager.system_object_expr; + } else { + if (Kind == Kind.Class && base_class is TypeParameterExpr){ + Report.Error ( + 689, base_class.Location, + "Cannot derive from `{0}' because it is a type parameter", + base_class.GetSignatureForError ()); + return ifaces; + } - public override void ApplyAttributeBuilder(Attribute a, CustomAttributeBuilder cb) - { - if (a.Type == TypeManager.attribute_usage_type) { - if (BaseType != TypeManager.attribute_type && !BaseType.IsSubclassOf (TypeManager.attribute_type) && - TypeBuilder.FullName != "System.Attribute") { - Report.Error (641, a.Location, "Attribute `{0}' is only valid on classes derived from System.Attribute", a.GetSignatureForError ()); + if (base_class.Type.IsArray || base_class.Type.IsPointer) { + Report.Error (1521, base_class.Location, "Invalid base type"); + return ifaces; } - } - if (a.Type == TypeManager.conditional_attribute_type && - !(BaseType == TypeManager.attribute_type || BaseType.IsSubclassOf (TypeManager.attribute_type))) { - Report.Error (1689, a.Location, "Attribute 'System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes"); - return; - } + if (base_class.IsSealed){ + Report.SymbolRelatedToPreviousError (base_class.Type); + if (base_class.Type.IsAbstract) { + Report.Error (709, Location, "`{0}': Cannot derive from static class `{1}'", + GetSignatureForError (), TypeManager.CSharpName (base_class.Type)); + } else { + Report.Error (509, Location, "`{0}': cannot derive from sealed class `{1}'", + GetSignatureForError (), TypeManager.CSharpName (base_class.Type)); + } + return ifaces; + } - if (AttributeTester.IsAttributeExcluded (a.Type)) - return; + if (!base_class.CanInheritFrom ()){ + Report.Error (644, Location, "`{0}' cannot derive from special class `{1}'", + GetSignatureForError (), base_class.GetSignatureForError ()); + return ifaces; + } - base.ApplyAttributeBuilder (a, cb); - } + if (!base_class.AsAccessible (this, ModFlags)) { + Report.SymbolRelatedToPreviousError (base_class.Type); + Report.Error (60, Location, "Inconsistent accessibility: base class `{0}' is less accessible than class `{1}'", + TypeManager.CSharpName (base_class.Type), GetSignatureForError ()); + } + } - public const TypeAttributes DefaultTypeAttributes = - TypeAttributes.AutoLayout | TypeAttributes.Class; + if (IsStatic) { + if (base_class != TypeManager.system_object_expr) { + Report.Error (713, Location, "Static class `{0}' cannot derive from type `{1}'. Static classes must derive from object", + GetSignatureForError (), base_class.GetSignatureForError ()); + return ifaces; + } - public override TypeBuilder DefineType() - { - if ((ModFlags & Modifiers.ABSTRACT) == Modifiers.ABSTRACT && (ModFlags & (Modifiers.SEALED | Modifiers.STATIC)) != 0) { - Report.Error (418, Location, "`{0}': an abstract class cannot be sealed or static", GetSignatureForError ()); - return null; + if (ifaces != null) { + foreach (TypeExpr t in ifaces) + Report.SymbolRelatedToPreviousError (t.Type); + Report.Error (714, Location, "`{0}': static classes cannot implement interfaces", GetSignatureForError ()); + } } - int accmods = Parent.Parent == null ? Modifiers.INTERNAL : Modifiers.PRIVATE; - ModFlags = Modifiers.Check (AllowedModifiersProp, ModFlags, accmods, Location); - - return base.DefineType (); + return ifaces; } /// Search for at least one defined condition in ConditionalAttribute of attribute class @@ -3208,22 +2910,31 @@ public bool IsExcluded () return true; } + bool IsStatic { + get { + return (ModFlags & Modifiers.STATIC) != 0; + } + } + // // FIXME: How do we deal with the user specifying a different // layout? // protected override TypeAttributes TypeAttr { get { - return base.TypeAttr | DefaultTypeAttributes; + TypeAttributes ta = base.TypeAttr | TypeAttributes.AutoLayout | TypeAttributes.Class; + if (IsStatic) + ta |= TypeAttributes.Abstract | TypeAttributes.Sealed; + return ta; } } } - public class Struct : ClassOrStruct { + public sealed class Struct : ClassOrStruct { // // Modifiers allowed in a struct declaration // - public const int AllowedModifiers = + const int AllowedModifiers = Modifiers.NEW | Modifiers.PUBLIC | Modifiers.PROTECTED | @@ -3247,11 +2958,36 @@ public class Struct : ClassOrStruct { this.ModFlags |= Modifiers.SEALED; } - public const TypeAttributes DefaultTypeAttributes = + public override AttributeTargets AttributeTargets { + get { + return AttributeTargets.Struct; + } + } + + const TypeAttributes DefaultTypeAttributes = TypeAttributes.SequentialLayout | TypeAttributes.Sealed | TypeAttributes.BeforeFieldInit; + + public override TypeExpr[] GetClassBases (out TypeExpr base_class) + { + TypeExpr[] ifaces = base.GetClassBases (out base_class); + // + // If we are compiling our runtime, + // and we are defining ValueType, then our + // base is `System.Object'. + // + if (base_class == null) { + if (!RootContext.StdLib && Name == "System.ValueType") + base_class = TypeManager.system_object_expr; + else + base_class = TypeManager.system_valuetype_expr; + } + + return ifaces; + } + // // FIXME: Allow the user to specify a different set of attributes // in some cases (Sealed for example is mandatory for a class, @@ -3262,12 +2998,23 @@ public class Struct : ClassOrStruct { return base.TypeAttr | DefaultTypeAttributes; } } + + public override void RegisterFieldForInitialization (FieldBase field) + { + if ((field.ModFlags & Modifiers.STATIC) == 0) { + Report.Error (573, field.Location, "`{0}': Structs cannot have instance field initializers", + field.GetSignatureForError ()); + return; + } + base.RegisterFieldForInitialization (field); + } + } /// /// Interfaces /// - public class Interface : TypeContainer, IMemberContainer { + public sealed class Interface : TypeContainer, IMemberContainer { /// /// Modifiers allowed in a class declaration @@ -3294,12 +3041,13 @@ public class Interface : TypeContainer, IMemberContainer { this.ModFlags = Modifiers.Check (AllowedModifiers, mod, accmods, name.Location); } - public override PendingImplementation GetPendingImplementations () - { - return null; + public override AttributeTargets AttributeTargets { + get { + return AttributeTargets.Interface; + } } - public const TypeAttributes DefaultTypeAttributes = + const TypeAttributes DefaultTypeAttributes = TypeAttributes.AutoLayout | TypeAttributes.Abstract | TypeAttributes.Interface; @@ -4140,7 +3888,7 @@ public override bool Define () MethodData = new MethodData (this, ModFlags, flags, this, mb, GenericMethod, base_method); - if (!MethodData.Define (Parent)) + if (!MethodData.Define (ParentContainer)) return false; if (ReturnType == TypeManager.void_type && ParameterTypes.Length == 0 && @@ -4245,9 +3993,9 @@ protected override bool VerifyClsCompliance () return false; if (ParameterInfo.Count > 0) { - ArrayList al = (ArrayList)Parent.MemberCache.Members [Name]; + ArrayList al = (ArrayList)ParentContainer.MemberCache.Members [Name]; if (al.Count > 1) - Parent.MemberCache.VerifyClsParameterConflict (al, this, MethodBuilder); + ParentContainer.MemberCache.VerifyClsParameterConflict (al, this, MethodBuilder); } return true; @@ -4724,7 +4472,7 @@ public override void Emit () // do not emit field initializers, they are initialized in the other constructor // if (!(Initializer != null && Initializer is ConstructorThisInitializer)) - Parent.EmitFieldInitializers (ec); + ParentContainer.EmitFieldInitializers (ec); } } if (Initializer != null) { @@ -4732,7 +4480,7 @@ public override void Emit () } if ((ModFlags & Modifiers.STATIC) != 0) - Parent.EmitFieldInitializers (ec); + ParentContainer.EmitFieldInitializers (ec); if (OptAttributes != null) OptAttributes.Emit (); @@ -4926,7 +4674,7 @@ public bool Define (TypeContainer container) string name = method.MethodName.Basename; string method_name = method.MethodName.FullName; - PendingImplementation pending = container.Pending; + PendingImplementation pending = container.PendingImplementations; if (pending != null){ if (member is Indexer) // TODO: test it, but it should work without this IF implementing = pending.IsInterfaceIndexer ( @@ -5267,6 +5015,18 @@ abstract public class MemberBase : MemberCore { get { return (TypeContainer) base.Parent; } } + /// + /// Use this for access to parent container from partial classes (not master partial). + /// This should be used rarely as all members are hosted in master partial class. + /// Also with some effort this should be eliminated (not easy now). + /// + public TypeContainer ParentContainer { + get { + return base.Parent.IsPartial ? + Parent.PartialContainer : Parent; + } + } + // // The type of this property / indexer / event // @@ -5368,7 +5128,7 @@ protected virtual bool DoDefineBase () return false; } - if (!Parent.VerifyImplements (this)) + if (!ParentContainer.VerifyImplements (this)) return false; Modifiers.Check (Modifiers.AllowedExplicitImplFlags, explicit_mod_flags, 0, Location); @@ -5437,7 +5197,7 @@ protected virtual bool DoDefine () return false; } - if (!Parent.VerifyImplements (this)) + if (!ParentContainer.VerifyImplements (this)) return false; Modifiers.Check (Modifiers.AllowedExplicitImplFlags, explicit_mod_flags, 0, Location); @@ -5589,7 +5349,7 @@ protected override bool CheckBase () set { if (value != null) { this.initializer = value; - Parent.RegisterFieldForInitialization (this); + ParentContainer.RegisterFieldForInitialization (this); } } } @@ -5662,7 +5422,6 @@ public override void ApplyAttributeBuilder(Attribute a, CustomAttributeBuilder c base.ApplyAttributeBuilder (a, cb); } - public override bool Define() { if (MemberType == null || Type == null) diff --git a/mcs/gmcs/cs-parser.jay b/mcs/gmcs/cs-parser.jay index 1e5297fda46cb..ad3106132434c 100644 --- a/mcs/gmcs/cs-parser.jay +++ b/mcs/gmcs/cs-parser.jay @@ -794,21 +794,15 @@ struct_declaration member_name { MemberName name = MakeName ((MemberName) $6); - if ($3 != null) { - ClassPart part = PartialContainer.CreatePart ( - current_namespace, current_class, name, (int) $2, - (Attributes) $1, Kind.Struct, (Location) $3); + current_class = new Struct ( + current_namespace, current_class, name, (int) $2, + (Attributes) $1); - current_container = part.PartialContainer; - current_class = part; + if ($3 != null) { + current_container = current_container.AddPartial (current_class); } else { - current_class = new Struct ( - current_namespace, current_class, name, (int) $2, - (Attributes) $1); - current_container.AddClassOrStruct (current_class); current_container = current_class; - RootContext.Tree.RecordDecl (current_namespace.NS, name, current_class); } } opt_class_base @@ -822,7 +816,7 @@ struct_declaration current_class.SetParameterInfo ((ArrayList) $9); if (RootContext.Documentation != null) - current_class.DocComment = Lexer.consume_doc_comment (); + current_container.DocComment = Lexer.consume_doc_comment (); } struct_body { @@ -1544,21 +1538,15 @@ interface_declaration { MemberName name = MakeName ((MemberName) $6); - if ($3 != null) { - ClassPart part = PartialContainer.CreatePart ( - current_namespace, current_class, name, (int) $2, - (Attributes) $1, Kind.Interface, (Location) $3); + current_class = new Interface ( + current_namespace, current_class, name, (int) $2, + (Attributes) $1); - current_container = part.PartialContainer; - current_class = part; + if ($3 != null) { + current_container = current_container.AddPartial (current_class); } else { - current_class = new Interface ( - current_namespace, current_class, name, (int) $2, - (Attributes) $1); - current_container.AddInterface (current_class); current_container = current_class; - RootContext.Tree.RecordDecl (current_namespace.NS, name, current_class); } } opt_class_base @@ -1572,7 +1560,7 @@ interface_declaration current_class.SetParameterInfo ((ArrayList) $9); if (RootContext.Documentation != null) { - current_class.DocComment = Lexer.consume_doc_comment (); + current_container.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } } @@ -3842,27 +3830,15 @@ class_declaration MemberName name = MakeName ((MemberName) $6); int mod_flags = (int) $2; - if ($3 != null) { - ClassPart part = PartialContainer.CreatePart ( - current_namespace, current_class, name, mod_flags, - (Attributes) $1, Kind.Class, (Location) $3); + current_class = new Class ( + current_namespace, current_class, name, + mod_flags, (Attributes) $1); - current_container = part.PartialContainer; - current_class = part; + if ($3 != null) { + current_container = current_container.AddPartial (current_class); } else { - if ((mod_flags & Modifiers.STATIC) != 0) { - current_class = new StaticClass ( - current_namespace, current_class, name, - mod_flags, (Attributes) $1); - } else { - current_class = new Class ( - current_namespace, current_class, name, - mod_flags, (Attributes) $1); - } - current_container.AddClassOrStruct (current_class); current_container = current_class; - RootContext.Tree.RecordDecl (current_namespace.NS, name, current_class); } } opt_class_base @@ -3882,7 +3858,7 @@ class_declaration current_class.SetParameterInfo ((ArrayList) $9); if (RootContext.Documentation != null) { - current_class.DocComment = Lexer.consume_doc_comment (); + current_container.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } } @@ -5081,13 +5057,12 @@ TypeContainer pop_current_class () TypeContainer retval = current_class; current_class = (TypeContainer) current_class.Parent; - current_container = (TypeContainer) current_container.Parent; + current_container = current_class.IsPartial ? current_class.PartialContainer : current_class; if (current_class != current_container) { - if (((ClassPart) current_class).PartialContainer != current_container) + if (current_class.PartialContainer != current_container) throw new InternalErrorException ("current_container and current_class are out of sync"); - } else if (current_container is ClassPart) - current_container = ((ClassPart) current_class).PartialContainer; + } return retval; } diff --git a/mcs/gmcs/decl.cs b/mcs/gmcs/decl.cs index f8f38fbf52f5f..32ec23a8b7ac6 100644 --- a/mcs/gmcs/decl.cs +++ b/mcs/gmcs/decl.cs @@ -323,7 +323,7 @@ public abstract class MemberCore : Attributable, IResolveContext { /// public int ModFlags; - public /*readonly*/ DeclSpace Parent; + public readonly DeclSpace Parent; /// /// Location where this declaration happens @@ -335,7 +335,7 @@ public abstract class MemberCore : Attributable, IResolveContext { /// /// XML documentation comment /// - public string DocComment; + protected string comment; /// /// Represents header string for documentation comment @@ -357,7 +357,8 @@ public enum Flags { Excluded = 1 << 9, // Method is conditional TestMethodDuplication = 1 << 10, // Test for duplication must be performed IsUsed = 1 << 11, - IsAssigned = 1 << 12 // Field is assigned + IsAssigned = 1 << 12, // Field is assigned + HasExplicitLayout = 1 << 13 } /// @@ -368,10 +369,7 @@ public enum Flags { public MemberCore (DeclSpace parent, MemberName name, Attributes attrs) : base (attrs) { - if (parent is PartialContainer && !(this is PartialContainer)) - throw new InternalErrorException ("A PartialContainer cannot be the direct parent of a member"); - - Parent = parent; + this.Parent = parent; member_name = name; caching_flags = Flags.Obsolete_Undetected | Flags.ClsCompliance_Undetected | Flags.HasCompliantAttribute_Undetected | Flags.Excluded_Undetected; } @@ -384,6 +382,15 @@ protected virtual void SetMemberName (MemberName new_name) public abstract bool Define (); + public virtual string DocComment { + get { + return comment; + } + set { + comment = value; + } + } + // // Returns full member name for error message // @@ -507,10 +514,16 @@ public bool IsExposedFromAssembly () } /// - /// Resolve CLSCompliantAttribute value or gets cached value. + /// Goes through class hierarchy and gets value of first found CLSCompliantAttribute. + /// If no is attribute exists then assembly CLSCompliantAttribute is returned. /// - bool GetClsCompliantAttributeValue () + public virtual bool GetClsCompliantAttributeValue () { + if ((caching_flags & Flags.HasCompliantAttribute_Undetected) == 0) + return (caching_flags & Flags.ClsCompliantAttributeTrue) != 0; + + caching_flags &= ~Flags.HasCompliantAttribute_Undetected; + if (OptAttributes != null) { Attribute cls_attribute = OptAttributes.Search ( TypeManager.cls_compliant_attribute_type); @@ -519,7 +532,12 @@ bool GetClsCompliantAttributeValue () return cls_attribute.GetClsCompliantAttributeValue (); } } - return Parent.GetClsCompliantAttributeValue (); + + if (Parent.GetClsCompliantAttributeValue ()) { + caching_flags |= Flags.ClsCompliantAttributeTrue; + return true; + } + return false; } /// @@ -714,23 +732,8 @@ public abstract class DeclSpace : MemberCore { /// /// Adds the member to defined_names table. It tests for duplications and enclosing name conflicts /// - protected bool AddToContainer (MemberCore symbol, string name) - { - if (name == MemberName.Name && !(this is Interface) && !(this is Enum)) { - if (symbol is TypeParameter) - Report.Error (694, symbol.Location, - "Type parameter `{0}' has same name as " + - "containing type, or method", name); - else { - Report.SymbolRelatedToPreviousError (this); - Report.Error (542, symbol.Location, - "`{0}': member names cannot be the same " + - "as their enclosing type", - symbol.GetSignatureForError ()); - return false; - } - } - + protected virtual bool AddToContainer (MemberCore symbol, string name) + { MemberCore mc = (MemberCore) defined_names [name]; if (mc == null) { @@ -742,10 +745,8 @@ protected bool AddToContainer (MemberCore symbol, string name) return true; Report.SymbolRelatedToPreviousError (mc); - if (symbol is PartialContainer || mc is PartialContainer) { - Report.Error (260, symbol.Location, - "Missing partial modifier on declaration of type `{0}'. Another partial declaration of this type exists", - name); + if ((mc.ModFlags & Modifiers.PARTIAL) != 0 && (symbol is ClassOrStruct || symbol is Interface)) { + Error_MissingPartialModifier (symbol); return false; } @@ -827,6 +828,13 @@ public virtual bool DefineMembers () return true; } + protected void Error_MissingPartialModifier (MemberCore type) + { + Report.Error (260, type.Location, + "Missing partial modifier on declaration of type `{0}'. Another partial declaration of this type exists", + type.GetSignatureForError ()); + } + public override string GetSignatureForError () { if (IsGeneric) { @@ -1086,9 +1094,6 @@ private Type LookupNestedTypeInHierarchy (string name) // public FullNamedExpression LookupType (string name, Location loc, bool ignore_cs0104) { - if (this is PartialContainer) - throw new InternalErrorException ("Should not get here"); - if (Cache.Contains (name)) return (FullNamedExpression) Cache [name]; @@ -1130,42 +1135,10 @@ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder TypeBuilder.SetCustomAttribute (cb); } - /// - /// Goes through class hierarchy and get value of first CLSCompliantAttribute that found. - /// If no is attribute exists then return assembly CLSCompliantAttribute. - /// - public bool GetClsCompliantAttributeValue () - { - if ((caching_flags & Flags.HasCompliantAttribute_Undetected) == 0) - return (caching_flags & Flags.ClsCompliantAttributeTrue) != 0; - - caching_flags &= ~Flags.HasCompliantAttribute_Undetected; - - if (OptAttributes != null) { - Attribute cls_attribute = OptAttributes.Search (TypeManager.cls_compliant_attribute_type); - if (cls_attribute != null) { - caching_flags |= Flags.HasClsCompliantAttribute; - if (cls_attribute.GetClsCompliantAttributeValue ()) { - caching_flags |= Flags.ClsCompliantAttributeTrue; - return true; - } - return false; - } - } - - if (Parent == null) { - if (CodeGen.Assembly.IsClsCompliant) { - caching_flags |= Flags.ClsCompliantAttributeTrue; - return true; - } + public virtual bool IsPartial { + get { return false; } - - if (Parent.GetClsCompliantAttributeValue ()) { - caching_flags |= Flags.ClsCompliantAttributeTrue; - return true; - } - return false; } // @@ -1317,7 +1290,8 @@ public TypeParameterExpr LookupGeneric (string name, Location loc) if (!IsGeneric) return null; - foreach (TypeParameter type_param in CurrentTypeParameters) { + TypeParameter [] current_params = IsPartial ? ((TypeContainer) this).PartialContainer.CurrentTypeParameters : CurrentTypeParameters; + foreach (TypeParameter type_param in current_params) { if (type_param.Name != name) continue; @@ -1355,9 +1329,6 @@ protected override bool VerifyClsCompliance () Report.SymbolRelatedToPreviousError (t); } else { - if (val is PartialContainer) - return true; - Report.SymbolRelatedToPreviousError ((DeclSpace)val); } Report.Warning (3005, 1, Location, "Identifier `{0}' differing only in case is not CLS-compliant", GetSignatureForError ()); diff --git a/mcs/gmcs/doc.cs b/mcs/gmcs/doc.cs index 994d949a31dca..1c12168aef0cc 100644 --- a/mcs/gmcs/doc.cs +++ b/mcs/gmcs/doc.cs @@ -62,15 +62,6 @@ public class DocUtil foreach (TypeContainer tc in t.Types) tc.GenerateDocComment (t); - if (t.Parts != null) { - IDictionary comments = RootContext.Documentation.PartialComments; - foreach (ClassPart cp in t.Parts) { - if (cp.DocComment == null) - continue; - comments [cp] = cp; - } - } - if (t.Enums != null) foreach (Enum en in t.Enums) en.GenerateDocComment (t); @@ -995,13 +986,6 @@ public Documentation (string xml_output_filename) // public Hashtable StoredDocuments = new Hashtable (); - // - // Stores comments on partial types (should handle uniquely). - // Keys are PartialContainers, values are comment strings - // (didn't use StringBuilder; usually we have just 2 or more). - // - public IDictionary PartialComments = new ListDictionary (); - // // Outputs XML documentation comment from tokenized comments. // @@ -1050,15 +1034,6 @@ public void GenerateDocComment () foreach (TypeContainer tc in root.Types) DocUtil.GenerateTypeDocComment (tc, null); - if (root.Parts != null) { - IDictionary comments = PartialComments; - foreach (ClassPart cp in root.Parts) { - if (cp.DocComment == null) - continue; - comments [cp] = cp; - } - } - if (root.Delegates != null) foreach (Delegate d in root.Delegates) DocUtil.GenerateDocComment (d, null); @@ -1067,16 +1042,6 @@ public void GenerateDocComment () foreach (Enum e in root.Enums) e.GenerateDocComment (null); - IDictionary table = new ListDictionary (); - foreach (ClassPart cp in PartialComments.Keys) { - // FIXME: IDictionary does not guarantee that the keys will be - // accessed in the order they were added. - table [cp.PartialContainer] += cp.DocComment; - } - foreach (PartialContainer pc in table.Keys) { - pc.DocComment = table [pc] as string; - DocUtil.GenerateDocComment (pc, null); - } } } } diff --git a/mcs/gmcs/driver.cs b/mcs/gmcs/driver.cs index 5e5dbae1bf07d..58b793e7818ae 100644 --- a/mcs/gmcs/driver.cs +++ b/mcs/gmcs/driver.cs @@ -1741,7 +1741,7 @@ internal static bool MainDriver (string [] args) if (ep == null) { if (RootContext.MainClass != null) { - DeclSpace main_cont = RootContext.Tree.GetDecl (MemberName.FromDotted (RootContext.MainClass, Location.Null)); + DeclSpace main_cont = RootContext.Tree.Types.GetDefinition (RootContext.MainClass) as DeclSpace; if (main_cont == null) { Report.Error (1555, "Could not find `{0}' specified for Main method", RootContext.MainClass); return false; diff --git a/mcs/gmcs/iterators.cs b/mcs/gmcs/iterators.cs index 4e19463512ec2..6be75fa1690c0 100644 --- a/mcs/gmcs/iterators.cs +++ b/mcs/gmcs/iterators.cs @@ -542,7 +542,7 @@ Parameters InflateParameters (Parameters parameters, EmitContext ec) return new Parameters (fixed_params, parameters.HasArglist); } - protected override TypeExpr [] GetClassBases (out TypeExpr base_class) + public override TypeExpr [] GetClassBases (out TypeExpr base_class) { iterator_type_expr = InflateType (original_iterator_type); diff --git a/mcs/gmcs/modifiers.cs b/mcs/gmcs/modifiers.cs index a430171adb35f..441e6ff83d3ab 100644 --- a/mcs/gmcs/modifiers.cs +++ b/mcs/gmcs/modifiers.cs @@ -28,6 +28,7 @@ public class Modifiers { public const int TOP = 0x2000; public const int PROPERTY_CUSTOM = 0x4000; // Custom property modifier + public const int PARTIAL = 0x20000; // // We use this internally to flag that the method contains an iterator diff --git a/mcs/gmcs/tree.cs b/mcs/gmcs/tree.cs index cb2ab7f61de9d..d6a822811d060 100644 --- a/mcs/gmcs/tree.cs +++ b/mcs/gmcs/tree.cs @@ -33,23 +33,13 @@ public interface ITreeDump { public class Tree { TypeContainer root_types; - // - // Keeps track of all the types definied (classes, structs, ifaces, enums) - // - Hashtable decls; - public Tree () { root_types = new RootTypes (); - - decls = new Hashtable (); } public void RecordDecl (Namespace ns, MemberName name, DeclSpace ds) { - // This is recorded for tracking inner partial classes only - decls [name] = ds; - if (ds.Parent == root_types) ns.AddDeclSpace (name.Basename, ds); } @@ -60,15 +50,6 @@ public void RecordDecl (Namespace ns, MemberName name, DeclSpace ds) public TypeContainer Types { get { return root_types; } } - - public DeclSpace GetDecl (MemberName name) - { - return (DeclSpace) decls [name]; - } - - public Hashtable AllDecls { - get { return decls; } - } } public sealed class RootTypes : TypeContainer @@ -76,16 +57,17 @@ public sealed class RootTypes : TypeContainer public RootTypes () : base (null, null, MemberName.Null, null, Kind.Root) { + types = new ArrayList (); } - public override PendingImplementation GetPendingImplementations () + public override bool IsClsComplianceRequired () { - throw new InvalidOperationException (); + return true; } - public override bool IsClsComplianceRequired () + public override bool GetClsCompliantAttributeValue () { - return true; + return CodeGen.Assembly.IsClsCompliant; } public override string GetSignatureForError () @@ -97,5 +79,11 @@ protected override bool AddToTypeContainer (DeclSpace ds) { return AddToContainer (ds, ds.Name); } + + public override TypeContainer AddPartial (TypeContainer nextPart) + { + return AddPartial (nextPart, nextPart.Name); + } + } } diff --git a/mcs/tests/known-issues-gmcs b/mcs/tests/known-issues-gmcs index 871fa26550fa4..06467d7c9250d 100644 --- a/mcs/tests/known-issues-gmcs +++ b/mcs/tests/known-issues-gmcs @@ -10,10 +10,6 @@ test-anon-27.cs test-xml-027.cs test-465.cs IGNORE # need to fix the path separator to work both on Unix and Windows test-476.cs -test-cls-01.cs -test-partial-07.cs -test-partial-11.cs -test-partial-12.cs test-492.cs test-494.cs test-495.cs @@ -21,3 +17,4 @@ test-anon-11.cs test-anon-36.cs gtest-230.cs +test-partial-13.cs From 66f37c2a7b0dd5a9a4d578b636ab90b62d229662 Mon Sep 17 00:00:00 2001 From: Raja R Harinath Date: Thu, 23 Mar 2006 14:29:14 +0000 Subject: [PATCH 077/117] ** merged revision 57289 from mcs/ svn path=/trunk/mcs/; revision=58359 --- mcs/gmcs/ChangeLog | 7 ++++++- mcs/gmcs/delegate.cs | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/mcs/gmcs/ChangeLog b/mcs/gmcs/ChangeLog index b3313cec43997..9a4b09edafcbe 100644 --- a/mcs/gmcs/ChangeLog +++ b/mcs/gmcs/ChangeLog @@ -1,4 +1,8 @@ -2006-03-23 Raja R Harinath +2006-02-25 Marek Safar + + * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report + error multiple times. + 2006-02-25 Marek Safar New partial class implementation. @@ -48,6 +52,7 @@ (RootTypes): Started to use this class more often for root types specializations. +2006-03-23 Raja R Harinath * generic.cs (TypeParameter.UpdateConstraints): Update 'constraints' if null. diff --git a/mcs/gmcs/delegate.cs b/mcs/gmcs/delegate.cs index e3824cd60142d..77db0a961f435 100644 --- a/mcs/gmcs/delegate.cs +++ b/mcs/gmcs/delegate.cs @@ -762,12 +762,16 @@ public static MethodBase ImplicitStandardConversionExists (MethodGroupExpr mg, T IMethodData md = TypeManager.GetMethod (delegate_method); if (md == null) { if (System.Attribute.GetCustomAttribute (delegate_method, TypeManager.conditional_attribute_type) != null) { + Report.SymbolRelatedToPreviousError (delegate_method); Report.Error (1618, loc, "Cannot create delegate with `{0}' because it has a Conditional attribute", TypeManager.CSharpSignature (delegate_method)); + return null; } } else { md.SetMemberIsUsed (); if (md.OptAttributes != null && md.OptAttributes.Search (TypeManager.conditional_attribute_type) != null) { + Report.SymbolRelatedToPreviousError (delegate_method); Report.Error (1618, loc, "Cannot create delegate with `{0}' because it has a Conditional attribute", TypeManager.CSharpSignature (delegate_method)); + return null; } } From fc6227072b807770ed49f6eae4b3e721ca93d2f5 Mon Sep 17 00:00:00 2001 From: Raja R Harinath Date: Thu, 23 Mar 2006 14:56:16 +0000 Subject: [PATCH 078/117] ** merge revision 57358 from mcs/ svn path=/trunk/mcs/; revision=58360 --- mcs/errors/known-issues-gmcs | 4 - mcs/gmcs/ChangeLog | 31 +++ mcs/gmcs/attribute.cs | 479 ++++++++++++++++------------------- mcs/gmcs/cfold.cs | 20 +- mcs/gmcs/class.cs | 5 +- mcs/gmcs/constant.cs | 18 +- mcs/gmcs/cs-parser.jay | 25 +- mcs/gmcs/ecore.cs | 61 +++-- mcs/gmcs/expression.cs | 77 +++--- mcs/gmcs/typemanager.cs | 17 +- mcs/tests/known-issues-gmcs | 1 - 11 files changed, 375 insertions(+), 363 deletions(-) diff --git a/mcs/errors/known-issues-gmcs b/mcs/errors/known-issues-gmcs index c8190a4913ce5..e507161556212 100644 --- a/mcs/errors/known-issues-gmcs +++ b/mcs/errors/known-issues-gmcs @@ -11,7 +11,6 @@ # csXXXX.cs NO ERROR : error test case doesn't report any error. An exception is considered # as NO ERROR and CS5001 is automatically ignored. -cs0221-5.cs NO ERROR cs0229-2.cs cs0229.cs NO ERROR cs0525.cs @@ -25,9 +24,6 @@ cs0560.cs cs0567.cs cs0612-2.cs NO ERROR cs0619-42.cs -cs0619-47.cs NO ERROR -cs0619-48.cs NO ERROR -cs0619-49.cs cs0625-3.cs NO ERROR cs0631-2.cs cs0647-3.cs diff --git a/mcs/gmcs/ChangeLog b/mcs/gmcs/ChangeLog index 9a4b09edafcbe..dbc6a3e4fe1fb 100644 --- a/mcs/gmcs/ChangeLog +++ b/mcs/gmcs/ChangeLog @@ -1,3 +1,34 @@ +2006-02-27 Marek Safar + + * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use + these two separated members to simplify the code. + (Attribute.Resolve): Refactored to use new fields and methods. + (Attribute.ResolveConstructor): Extracted from ResolveArguments and + implemented obsolete attribute checking. + (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and + implemented obsolete checking again. It look line never ending quest ;-) + (GlobalAttribute.ResolveConstructor): Need to override as the rest. + + * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error. + + * constanct.cs (TryReduce): Throws OverflowException to indicate error. + + *class.cs (Property.Define): Add RegisterProperty call. + + * cs-parser.jay: Replaced ArrayList with fixed array for attribute + argument groups (only 2). + + * ecore.cs (Expression.GetAttributableValue): New virtual method used for + encoding expression to arguments. + (Expression.ExprClassToResolveFlags): Just turned to property. + + * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized. + (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and + optimized as well as implemented support for zero-length attributes. + + * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty): + Add caching of PropertyInfo's. + 2006-02-25 Marek Safar * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report diff --git a/mcs/gmcs/attribute.cs b/mcs/gmcs/attribute.cs index de2e0af996e6d..55acd1be58aaa 100644 --- a/mcs/gmcs/attribute.cs +++ b/mcs/gmcs/attribute.cs @@ -83,7 +83,8 @@ public class Attribute { public readonly Expression LeftExpr; public readonly string Identifier; - public readonly ArrayList Arguments; + readonly ArrayList PosArguments; + readonly ArrayList NamedArguments; public readonly Location Location; @@ -93,8 +94,9 @@ public class Attribute { readonly bool nameEscaped; Attributable owner; - static AttributeUsageAttribute DefaultUsageAttribute = new AttributeUsageAttribute (AttributeTargets.All); + static readonly AttributeUsageAttribute DefaultUsageAttribute = new AttributeUsageAttribute (AttributeTargets.All); static Assembly orig_sec_assembly; + public static readonly object[] EmptyObject = new object [0]; // non-null if named args present after Resolve () is called PropertyInfo [] prop_info_arr; @@ -104,13 +106,19 @@ public class Attribute { object [] pos_values; static PtrHashtable usage_attr_cache = new PtrHashtable (); + + // Cache for parameter-less attributes + static PtrHashtable att_cache = new PtrHashtable (); - public Attribute (string target, Expression left_expr, string identifier, ArrayList args, Location loc, bool nameEscaped) + public Attribute (string target, Expression left_expr, string identifier, object[] args, Location loc, bool nameEscaped) { LeftExpr = left_expr; Identifier = identifier; Name = LeftExpr == null ? identifier : LeftExpr + "." + identifier; - Arguments = args; + if (args != null) { + PosArguments = (ArrayList)args [0]; + NamedArguments = (ArrayList)args [1]; + } Location = loc; ExplicitTarget = target; this.nameEscaped = nameEscaped; @@ -135,16 +143,11 @@ void Error_InvalidNamedAgrumentType (string name) "attribute parameter type", name); } - static void Error_AttributeArgumentNotValid (string extra, Location loc) + public static void Error_AttributeArgumentNotValid (Location loc) { Report.Error (182, loc, "An attribute argument must be a constant expression, typeof " + - "expression or array creation expression" + extra); - } - - static void Error_AttributeArgumentNotValid (Location loc) - { - Error_AttributeArgumentNotValid ("", loc); + "expression or array creation expression"); } static void Error_TypeParameterInAttribute (Location loc) @@ -266,41 +269,6 @@ public string GetSignatureForError () return LeftExpr == null ? Identifier : LeftExpr.GetSignatureForError () + "." + Identifier; } - // - // Given an expression, if the expression is a valid attribute-argument-expression - // returns an object that can be used to encode it, or null on failure. - // - public static bool GetAttributeArgumentExpression (Expression e, Location loc, Type arg_type, out object result) - { - Constant constant = e as Constant; - if (constant != null) { - constant = constant.ToType (arg_type, loc); - if (constant == null) { - result = null; - return false; - } - result = constant.GetTypedValue (); - return true; - } else if (e is TypeOf) { - result = ((TypeOf) e).TypeArg; - return true; - } else if (e is ArrayCreation){ - result = ((ArrayCreation) e).EncodeAsAttribute (); - if (result != null) - return true; - } else if (e is EmptyCast) { - Expression child = ((EmptyCast)e).Child; - return GetAttributeArgumentExpression (child, loc, child.Type, out result); - } else if (e is As) { - As as_e = (As) e; - return GetAttributeArgumentExpression (as_e.Expr, loc, as_e.ProbeType.Type, out result); - } - - result = null; - Error_AttributeArgumentNotValid (loc); - return false; - } - bool IsValidArgumentType (Type t) { if (t.IsArray) @@ -313,9 +281,6 @@ bool IsValidArgumentType (Type t) t == TypeManager.type_type; } - // Cache for parameter-less attributes - static PtrHashtable att_cache = new PtrHashtable (); - public CustomAttributeBuilder Resolve () { if (resolve_error) @@ -339,7 +304,7 @@ public CustomAttributeBuilder Resolve () AttributeTester.Report_ObsoleteMessage (obsolete_attr, TypeManager.CSharpName (Type), Location); } - if (Arguments == null) { + if (PosArguments == null && NamedArguments == null) { object o = att_cache [Type]; if (o != null) { resolve_error = false; @@ -347,7 +312,10 @@ public CustomAttributeBuilder Resolve () } } - ConstructorInfo ctor = ResolveArguments (); + EmitContext ec = new EmitContext (owner.ResolveContext, owner.ResolveContext.DeclContainer, owner.ResolveContext.DeclContainer, + Location, null, null, owner.ResolveContext.DeclContainer.ModFlags, false); + + ConstructorInfo ctor = ResolveConstructor (ec); if (ctor == null) { if (Type is TypeBuilder && TypeManager.LookupDeclSpace (Type).MemberCache == null) @@ -360,111 +328,167 @@ public CustomAttributeBuilder Resolve () CustomAttributeBuilder cb; try { - if (prop_info_arr != null || field_info_arr != null) { - cb = new CustomAttributeBuilder ( - ctor, pos_values, - prop_info_arr, prop_values_arr, - field_info_arr, field_values_arr); - } else { - cb = new CustomAttributeBuilder ( - ctor, pos_values); + if (NamedArguments == null) { + cb = new CustomAttributeBuilder (ctor, pos_values); if (pos_values.Length == 0) att_cache.Add (Type, cb); + + resolve_error = false; + return cb; } + + if (!ResolveNamedArguments (ec)) { + return null; + } + + cb = new CustomAttributeBuilder (ctor, pos_values, + prop_info_arr, prop_values_arr, + field_info_arr, field_values_arr); + + resolve_error = false; + return cb; } catch (Exception) { Error_AttributeArgumentNotValid (Location); return null; } - - resolve_error = false; - return cb; } - protected virtual ConstructorInfo ResolveArguments () + protected virtual ConstructorInfo ResolveConstructor (EmitContext ec) { - // Now we extract the positional and named arguments - - ArrayList pos_args = null; - ArrayList named_args = null; - int pos_arg_count = 0; - int named_arg_count = 0; - - if (Arguments != null) { - pos_args = (ArrayList) Arguments [0]; - if (pos_args != null) - pos_arg_count = pos_args.Count; - if (Arguments.Count > 1) { - named_args = (ArrayList) Arguments [1]; - named_arg_count = named_args.Count; + if (PosArguments != null) { + for (int i = 0; i < PosArguments.Count; i++) { + Argument a = (Argument) PosArguments [i]; + + if (!a.Resolve (ec, Location)) + return null; } } - pos_values = new object [pos_arg_count]; + Expression mg = Expression.MemberLookup (ec.ContainerType, + Type, ".ctor", MemberTypes.Constructor, + BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly, + Location); - // - // First process positional arguments - // + MethodBase constructor = Invocation.OverloadResolve ( + ec, (MethodGroupExpr) mg, PosArguments, false, Location); - EmitContext ec = new EmitContext (owner.ResolveContext, owner.ResolveContext.DeclContainer, owner.ResolveContext.DeclContainer, - Location, null, null, owner.ResolveContext.DeclContainer.ModFlags, false); + if (constructor == null) + return null; - int i; - for (i = 0; i < pos_arg_count; i++) { - Argument a = (Argument) pos_args [i]; - Expression e; + ObsoleteAttribute oa = AttributeTester.GetMethodObsoleteAttribute (constructor); + if (oa != null && !owner.ResolveContext.IsInObsoleteScope) { + AttributeTester.Report_ObsoleteMessage (oa, mg.GetSignatureForError (), mg.Location); + } - if (!a.Resolve (ec, Location)) - return null; + if (PosArguments == null) { + pos_values = EmptyObject; + return (ConstructorInfo)constructor; + } - e = a.Expr; + ParameterData pd = TypeManager.GetParameterData (constructor); - object val; - if (!GetAttributeArgumentExpression (e, Location, a.Type, out val)) - return null; + int pos_arg_count = PosArguments.Count; + int last_real_param = pd.Count; - pos_values [i] = val; + pos_values = new object [pos_arg_count]; - if (i == 0 && Type == TypeManager.attribute_usage_type && (int)val == 0) { - Report.Error (591, Location, "Invalid value for argument to 'System.AttributeUsage' attribute"); + if (pd.HasParams) { + // When the params is not filled we need to put one + if (last_real_param > pos_arg_count) { + object [] new_pos_values = new object [pos_arg_count + 1]; + pos_values.CopyTo (new_pos_values, 0); + new_pos_values [pos_arg_count] = new object [] {} ; + pos_values = new_pos_values; + } + last_real_param--; + } + + for (int j = 0; j < pos_arg_count; ++j) { + Argument a = (Argument) PosArguments [j]; + + if (!a.Expr.GetAttributableValue (out pos_values [j])) return null; + + if (TypeManager.IsPrimitiveType (a.Type) && a.Type != pos_values [j].GetType ()) { + bool fail; + // This can happen only for constants in same range + pos_values [j] = TypeManager.ChangeType (pos_values [j], a.Type, out fail); + } + + if (j < last_real_param) + continue; + + if (j == last_real_param) { + object [] array = new object [pos_arg_count - last_real_param]; + array [0] = pos_values [j]; + pos_values [j] = array; + continue; } + + object [] params_array = (object []) pos_values [last_real_param]; + params_array [j - last_real_param] = pos_values [j]; } - // - // Now process named arguments - // + // Adjust the size of the pos_values if it had params + if (last_real_param != pos_arg_count) { + object [] new_pos_values = new object [last_real_param + 1]; + Array.Copy (pos_values, new_pos_values, last_real_param + 1); + pos_values = new_pos_values; + } - ArrayList field_infos = null; - ArrayList prop_infos = null; - ArrayList field_values = null; - ArrayList prop_values = null; - Hashtable seen_names = null; + // Here we do the checks which should be done by corlib or by runtime. + // However Zoltan doesn't like it and every Mono compiler has to do it again. + + if (Type == TypeManager.guid_attr_type) { + try { + new Guid ((string)pos_values [0]); + } + catch (Exception e) { + Error_AttributeEmitError (e.Message); + return null; + } + } - if (named_arg_count > 0) { - field_infos = new ArrayList (4); - prop_infos = new ArrayList (4); - field_values = new ArrayList (4); - prop_values = new ArrayList (4); + if (Type == TypeManager.attribute_usage_type && (int)pos_values [0] == 0) { + Report.Error (591, Location, "Invalid value for argument to 'System.AttributeUsage' attribute"); + return null; + } - seen_names = new Hashtable(4); + if (Type == TypeManager.methodimpl_attr_type && pos_values.Length == 1 && + pd.ParameterType (0) == TypeManager.short_type && + !System.Enum.IsDefined (typeof (MethodImplOptions), pos_values [0].ToString ())) { + Error_AttributeEmitError ("Incorrect argument value."); + return null; } + + return (ConstructorInfo)constructor; + } + + protected virtual bool ResolveNamedArguments (EmitContext ec) + { + int named_arg_count = NamedArguments.Count; + + ArrayList field_infos = new ArrayList (named_arg_count); + ArrayList prop_infos = new ArrayList (named_arg_count); + ArrayList field_values = new ArrayList (named_arg_count); + ArrayList prop_values = new ArrayList (named_arg_count); + + ArrayList seen_names = new ArrayList(named_arg_count); - for (i = 0; i < named_arg_count; i++) { - DictionaryEntry de = (DictionaryEntry) named_args [i]; + foreach (DictionaryEntry de in NamedArguments) { string member_name = (string) de.Key; - Argument a = (Argument) de.Value; - Expression e; if (seen_names.Contains(member_name)) { Report.Error(643, Location, "'" + member_name + "' duplicate named attribute argument"); - return null; + return false; } - seen_names.Add(member_name, 1); - + seen_names.Add(member_name); + + Argument a = (Argument) de.Value; if (!a.Resolve (ec, Location)) - return null; + return false; Expression member = Expression.MemberLookup ( ec.ContainerType, Type, member_name, @@ -479,187 +503,107 @@ protected virtual ConstructorInfo ResolveArguments () if (member != null) { Expression.ErrorIsInaccesible (Location, member.GetSignatureForError ()); - return null; + return false; } } if (member == null){ Report.Error (117, Location, "`{0}' does not contain a definition for `{1}'", TypeManager.CSharpName (Type), member_name); - return null; + return false; } if (!(member is PropertyExpr || member is FieldExpr)) { Error_InvalidNamedArgument (member_name); - return null; + return false; } - e = a.Expr; - if (e is TypeParameterExpr){ + if (a.Expr is TypeParameterExpr){ Error_TypeParameterInAttribute (Location); - return null; + return false; } - + + ObsoleteAttribute obsolete_attr; + if (member is PropertyExpr) { - PropertyExpr pe = (PropertyExpr) member; - PropertyInfo pi = pe.PropertyInfo; + PropertyInfo pi = ((PropertyExpr) member).PropertyInfo; if (!pi.CanWrite || !pi.CanRead) { Report.SymbolRelatedToPreviousError (pi); Error_InvalidNamedArgument (member_name); - return null; + return false; } if (!IsValidArgumentType (pi.PropertyType)) { Report.SymbolRelatedToPreviousError (pi); Error_InvalidNamedAgrumentType (member_name); - return null; + return false; } + Expression e = Convert.ImplicitConversionRequired (ec, a.Expr, pi.PropertyType, a.Expr.Location); + if (e == null) + return false; + object value; - if (!GetAttributeArgumentExpression (e, Location, pi.PropertyType, out value)) - return null; + if (!e.GetAttributableValue (out value)) + return false; + + PropertyBase pb = TypeManager.GetProperty (pi); + if (pb != null) + obsolete_attr = pb.GetObsoleteAttribute (); + else + obsolete_attr = AttributeTester.GetMemberObsoleteAttribute (pi); prop_values.Add (value); prop_infos.Add (pi); - } else if (member is FieldExpr) { - FieldExpr fe = (FieldExpr) member; - FieldInfo fi = fe.FieldInfo; + } else { + FieldInfo fi = ((FieldExpr) member).FieldInfo; if (fi.IsInitOnly) { Error_InvalidNamedArgument (member_name); - return null; + return false; } if (!IsValidArgumentType (fi.FieldType)) { Report.SymbolRelatedToPreviousError (fi); Error_InvalidNamedAgrumentType (member_name); - return null; + return false; } + Expression e = Convert.ImplicitConversionRequired (ec, a.Expr, fi.FieldType, a.Expr.Location); + if (e == null) + return false; object value; - if (!GetAttributeArgumentExpression (e, Location, fi.FieldType, out value)) - return null; + if (!e.GetAttributableValue (out value)) + return false; + + FieldBase fb = TypeManager.GetField (fi); + if (fb != null) + obsolete_attr = fb.GetObsoleteAttribute (); + else + obsolete_attr = AttributeTester.GetMemberObsoleteAttribute (fi); field_values.Add (value); field_infos.Add (fi); } - } - Expression mg = Expression.MemberLookup (ec.ContainerType, - Type, ".ctor", MemberTypes.Constructor, - BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly, - Location); - - if (mg == null) { - // FIXME: Punt the issue for now. - if (Type is TypeBuilder) - return null; - throw new InternalErrorException ("Type " + Type + " doesn't have constructors"); - } - - MethodBase constructor = Invocation.OverloadResolve ( - ec, (MethodGroupExpr) mg, pos_args, false, Location); - - if (constructor == null) { - return null; - } - - - // Here we do the checks which should be done by corlib or by runtime. - // However Zoltan doesn't like it and every Mono compiler has to do it again. - - if (Type == TypeManager.guid_attr_type) { - try { - new Guid ((string)pos_values [0]); - } - catch (Exception e) { - Error_AttributeEmitError (e.Message); - return null; - } + if (obsolete_attr != null && !owner.ResolveContext.IsInObsoleteScope) + AttributeTester.Report_ObsoleteMessage (obsolete_attr, member.GetSignatureForError (), member.Location); } - if (Type == TypeManager.methodimpl_attr_type && - pos_values.Length == 1 && ((Argument)pos_args [0]).Type == TypeManager.short_type && - !System.Enum.IsDefined (typeof (MethodImplOptions), pos_values [0])) { - Error_AttributeEmitError ("Incorrect argument value."); - return null; - } + prop_info_arr = new PropertyInfo [prop_infos.Count]; + field_info_arr = new FieldInfo [field_infos.Count]; + field_values_arr = new object [field_values.Count]; + prop_values_arr = new object [prop_values.Count]; - // - // Now we perform some checks on the positional args as they - // cannot be null for a constructor which expects a parameter - // of type object - // + field_infos.CopyTo (field_info_arr, 0); + field_values.CopyTo (field_values_arr, 0); - ParameterData pd = TypeManager.GetParameterData (constructor); + prop_values.CopyTo (prop_values_arr, 0); + prop_infos.CopyTo (prop_info_arr, 0); - int last_real_param = pd.Count; - if (pd.HasParams) { - // When the params is not filled we need to put one - if (last_real_param > pos_arg_count) { - object [] new_pos_values = new object [pos_arg_count + 1]; - pos_values.CopyTo (new_pos_values, 0); - new_pos_values [pos_arg_count] = new object [] {} ; - pos_values = new_pos_values; - } - last_real_param--; - } - - for (int j = 0; j < pos_arg_count; ++j) { - Argument a = (Argument) pos_args [j]; - - if (a.Expr is NullLiteral && pd.ParameterType (j) == TypeManager.object_type) { - Error_AttributeArgumentNotValid (Location); - return null; - } - - object value = pos_values [j]; - if (value != null && a.Type != value.GetType () && TypeManager.IsPrimitiveType (a.Type)) { - bool fail; - pos_values [j] = TypeManager.ChangeType (value, a.Type, out fail); - if (fail) { - // TODO: Can failed ? - throw new NotImplementedException (); - } - } - - if (j < last_real_param) - continue; - - if (j == last_real_param) { - object [] array = new object [pos_arg_count - last_real_param]; - array [0] = pos_values [j]; - pos_values [j] = array; - continue; - } - - object [] params_array = (object []) pos_values [last_real_param]; - params_array [j - last_real_param] = pos_values [j]; - } - - // Adjust the size of the pos_values if it had params - if (last_real_param != pos_arg_count) { - object [] new_pos_values = new object [last_real_param + 1]; - Array.Copy (pos_values, new_pos_values, last_real_param + 1); - pos_values = new_pos_values; - } - - if (named_arg_count > 0) { - prop_info_arr = new PropertyInfo [prop_infos.Count]; - field_info_arr = new FieldInfo [field_infos.Count]; - field_values_arr = new object [field_values.Count]; - prop_values_arr = new object [prop_values.Count]; - - field_infos.CopyTo (field_info_arr, 0); - field_values.CopyTo (field_values_arr, 0); - - prop_values.CopyTo (prop_values_arr, 0); - prop_infos.CopyTo (prop_info_arr, 0); - } - - return (ConstructorInfo) constructor; + return true; } /// @@ -1214,12 +1158,8 @@ public void Emit (ListDictionary allEmitted) // Here we are testing attribute arguments for array usage (error 3016) if (owner.IsClsComplianceRequired ()) { - if (Arguments == null) - return; - - ArrayList pos_args = (ArrayList) Arguments [0]; - if (pos_args != null) { - foreach (Argument arg in pos_args) { + if (PosArguments != null) { + foreach (Argument arg in PosArguments) { // Type is undefined (was error 246) if (arg.Type == null) return; @@ -1231,11 +1171,10 @@ public void Emit (ListDictionary allEmitted) } } - if (Arguments.Count < 2) + if (NamedArguments == null) return; - ArrayList named_args = (ArrayList) Arguments [1]; - foreach (DictionaryEntry de in named_args) { + foreach (DictionaryEntry de in NamedArguments) { Argument arg = (Argument) de.Value; // Type is undefined (was error 246) @@ -1367,15 +1306,10 @@ public void Emit (ListDictionary allEmitted) private Expression GetValue () { - if ((Arguments == null) || (Arguments.Count < 1)) - return null; - ArrayList al = (ArrayList) Arguments [0]; - if ((al == null) || (al.Count < 1)) + if (PosArguments == null || PosArguments.Count < 1) return null; - Argument arg = (Argument) al [0]; - if ((arg == null) || (arg.Expr == null)) - return null; - return arg.Expr; + + return ((Argument) PosArguments [0]).Expr; } public string GetString () @@ -1405,7 +1339,7 @@ public class GlobalAttribute : Attribute public readonly NamespaceEntry ns; public GlobalAttribute (NamespaceEntry ns, string target, - Expression left_expr, string identifier, ArrayList args, Location loc, bool nameEscaped): + Expression left_expr, string identifier, object[] args, Location loc, bool nameEscaped): base (target, left_expr, identifier, args, loc, nameEscaped) { this.ns = ns; @@ -1454,11 +1388,22 @@ protected override FullNamedExpression ResolveAsTypeTerminal (Expression expr, E } } - protected override ConstructorInfo ResolveArguments () + protected override ConstructorInfo ResolveConstructor (EmitContext ec) + { + try { + Enter (); + return base.ResolveConstructor (ec); + } + finally { + Leave (); + } + } + + protected override bool ResolveNamedArguments (EmitContext ec) { try { Enter (); - return base.ResolveArguments (); + return base.ResolveNamedArguments (ec); } finally { Leave (); diff --git a/mcs/gmcs/cfold.cs b/mcs/gmcs/cfold.cs index 303002901a6b7..aba3ad37c4850 100644 --- a/mcs/gmcs/cfold.cs +++ b/mcs/gmcs/cfold.cs @@ -550,8 +550,14 @@ static void Error_CompileTimeOverflow (Location loc) Error_CompileTimeOverflow (loc); } - if (wrap_as != null) - return result.TryReduce (ec, wrap_as, loc); + if (wrap_as != null) { + try { + return result.TryReduce (ec, wrap_as, loc); + } + catch (OverflowException) { + return null; + } + } else return result; @@ -682,8 +688,14 @@ static void Error_CompileTimeOverflow (Location loc) Error_CompileTimeOverflow (loc); } - if (wrap_as != null) - return result.TryReduce (ec, wrap_as, loc); + if (wrap_as != null) { + try { + return result.TryReduce (ec, wrap_as, loc); + } + catch (OverflowException) { + return null; + } + } return result; diff --git a/mcs/gmcs/class.cs b/mcs/gmcs/class.cs index 4efdaa64d3232..7dea31c34b433 100644 --- a/mcs/gmcs/class.cs +++ b/mcs/gmcs/class.cs @@ -4357,7 +4357,7 @@ protected override bool CheckBase () if ((RootContext.WarningLevel >= 4) && ((Parent.ModFlags & Modifiers.SEALED) != 0 && (ModFlags & Modifiers.PROTECTED) != 0)) { Report.Warning (628, 4, Location, "`{0}': new protected member declared in sealed class", GetSignatureForError ()); } - + return true; } @@ -4414,7 +4414,7 @@ public override bool Define () } ConstructorBuilder.SetImplementationFlags (MethodImplAttributes.InternalCall); } - + TypeManager.AddMethod (ConstructorBuilder, this); return true; @@ -6525,6 +6525,7 @@ public override bool Define () if (!Set.IsDummy) PropertyBuilder.SetSetMethod (SetBuilder); + TypeManager.RegisterProperty (PropertyBuilder, this); return true; } } diff --git a/mcs/gmcs/constant.cs b/mcs/gmcs/constant.cs index 8424e41d8d7ea..339b97d870076 100644 --- a/mcs/gmcs/constant.cs +++ b/mcs/gmcs/constant.cs @@ -39,6 +39,12 @@ override public string ToString () return this.GetType ().Name + " (" + AsString () + ")"; } + public override bool GetAttributableValue (out object value) + { + value = GetTypedValue (); + return true; + } + /// /// This is used to obtain the actual value of the literal /// cast into an object. @@ -233,6 +239,10 @@ protected void CheckUnsigned (EmitContext ec, long value, Type type) throw new OverflowException (); } + /// + /// Maybe ConvertTo name is better. It tries to convert `this' constant to target_type. + /// It throws OverflowException + /// public abstract Constant Reduce (EmitContext ec, Type target_type); /// @@ -244,11 +254,9 @@ public Constant TryReduce (EmitContext ec, Type target_type, Location loc) return TryReduce (ec, target_type); } catch (OverflowException) { - if (ec.ConstantCheckState) { - Report.Error (221, loc, "Constant value `{0}' cannot be converted to a `{1}' (use `unchecked' syntax to override)", - GetValue ().ToString (), TypeManager.CSharpName (target_type)); - } - return null; + Report.Error (221, loc, "Constant value `{0}' cannot be converted to a `{1}' (use `unchecked' syntax to override)", + GetValue ().ToString (), TypeManager.CSharpName (target_type)); + throw; } } diff --git a/mcs/gmcs/cs-parser.jay b/mcs/gmcs/cs-parser.jay index ad3106132434c..1b4502a3c45bc 100644 --- a/mcs/gmcs/cs-parser.jay +++ b/mcs/gmcs/cs-parser.jay @@ -641,7 +641,7 @@ attribute "'<' unexpected: attributes cannot be generic"); } - ArrayList arguments = (ArrayList) $2; + object [] arguments = (object []) $2; MemberName left = mname.Left; string identifier = mname.Name; @@ -675,29 +675,18 @@ attribute_arguments if ($1 == null) $$ = null; else { - ArrayList args = new ArrayList (4); - args.Add ($1); - - $$ = args; + $$ = new object [] { $1, null }; } } - | positional_argument_list COMMA named_argument_list + | positional_argument_list COMMA named_argument_list { - ArrayList args = new ArrayList (4); - args.Add ($1); - args.Add ($3); - - $$ = args; + $$ = new object[] { $1, $3 }; } - | named_argument_list + | named_argument_list { - ArrayList args = new ArrayList (4); - args.Add (null); - args.Add ($1); - - $$ = args; + $$ = new object [] { null, $1 }; } - ; + ; opt_positional_argument_list diff --git a/mcs/gmcs/ecore.cs b/mcs/gmcs/ecore.cs index 0ed86431368b7..509d7634e37e8 100644 --- a/mcs/gmcs/ecore.cs +++ b/mcs/gmcs/ecore.cs @@ -137,6 +137,13 @@ public void Error (int error, string s) // Not nice but we have broken hierarchy public virtual void CheckMarshallByRefAccess (Type container) {} + public virtual bool GetAttributableValue (out object value) + { + Attribute.Error_AttributeArgumentNotValid (loc); + value = null; + return false; + } + public virtual string GetSignatureForError () { return TypeManager.CSharpName (type); @@ -324,28 +331,29 @@ protected static void Error_TypeDoesNotContainDefinition (Location loc, Type typ TypeManager.CSharpName (type), name); } - ResolveFlags ExprClassToResolveFlags () + ResolveFlags ExprClassToResolveFlags { - switch (eclass) { - case ExprClass.Type: - case ExprClass.Namespace: - return ResolveFlags.Type; + get { + switch (eclass) { + case ExprClass.Type: + case ExprClass.Namespace: + return ResolveFlags.Type; - case ExprClass.MethodGroup: - return ResolveFlags.MethodGroup; + case ExprClass.MethodGroup: + return ResolveFlags.MethodGroup; - case ExprClass.Value: - case ExprClass.Variable: - case ExprClass.PropertyAccess: - case ExprClass.EventAccess: - case ExprClass.IndexerAccess: - return ResolveFlags.VariableOrValue; + case ExprClass.Value: + case ExprClass.Variable: + case ExprClass.PropertyAccess: + case ExprClass.EventAccess: + case ExprClass.IndexerAccess: + return ResolveFlags.VariableOrValue; - default: - throw new Exception ("Expression " + GetType () + - " ExprClass is Invalid after resolve"); + default: + throw new Exception ("Expression " + GetType () + + " ExprClass is Invalid after resolve"); + } } - } /// @@ -369,10 +377,10 @@ public Expression Resolve (EmitContext ec, ResolveFlags flags) ec.OmitStructFlowAnalysis = true; Expression e; - bool intermediate = (flags & ResolveFlags.Intermediate) == ResolveFlags.Intermediate; - if (this is SimpleName) + if (this is SimpleName) { + bool intermediate = (flags & ResolveFlags.Intermediate) == ResolveFlags.Intermediate; e = ((SimpleName) this).DoResolve (ec, intermediate); - + } else e = DoResolve (ec); @@ -382,7 +390,7 @@ public Expression Resolve (EmitContext ec, ResolveFlags flags) if (e == null) return null; - if ((flags & e.ExprClassToResolveFlags ()) == 0) { + if ((flags & e.ExprClassToResolveFlags) == 0) { e.Error_UnexpectedKind (flags, loc); return null; } @@ -1150,8 +1158,8 @@ public virtual ExpressionStatement ResolveStatement (EmitContext ec) /// /// public class EmptyCast : Expression { - protected Expression child; - + protected readonly Expression child; + public Expression Child { get { return child; @@ -1178,6 +1186,12 @@ public override void Emit (EmitContext ec) { child.Emit (ec); } + + public override bool GetAttributableValue (out object value) + { + return child.GetAttributableValue (out value); + } + } /// /// This is a numeric cast to a Decimal @@ -3493,6 +3507,7 @@ void FindAccessors (Type invocation_type) // We also perform the permission checking here, as the PropertyInfo does not // hold the information for the accessibility of its setter/getter // + // TODO: can use TypeManager.GetProperty to boost performance void ResolveAccessors (Type containerType) { FindAccessors (containerType); diff --git a/mcs/gmcs/expression.cs b/mcs/gmcs/expression.cs index 3a510c725d0c2..0bb3f1a0965f3 100644 --- a/mcs/gmcs/expression.cs +++ b/mcs/gmcs/expression.cs @@ -1290,7 +1290,12 @@ public override Expression DoResolve (EmitContext ec) Error_CannotConvertType (etype, type, loc); return null; - } + } + + public override bool GetAttributableValue (out object value) + { + return expr.GetAttributableValue (out value); + } } /// @@ -1365,9 +1370,14 @@ Expression ResolveRest (EmitContext ec) Constant c = expr as Constant; if (c != null) { - c = c.TryReduce (ec, type, loc); - if (c != null) - return c; + try { + c = c.TryReduce (ec, type, loc); + if (c != null) + return c; + } + catch (OverflowException) { + return null; + } } if (type.IsPointer && !ec.InUnsafe) { @@ -6309,10 +6319,7 @@ public void UpdateIndices (EmitContext ec) public bool ValidateInitializers (EmitContext ec, Type array_type) { if (initializers == null) { - if (expect_initializers) - return false; - else - return true; + return !expect_initializers; } if (underlying_type == null) @@ -6325,17 +6332,12 @@ public bool ValidateInitializers (EmitContext ec, Type array_type) array_data = new ArrayList (); bounds = new Hashtable (); - bool ret; - if (arguments != null) { - ret = CheckIndices (ec, initializers, 0, true); - return ret; + return CheckIndices (ec, initializers, 0, true); } else { arguments = new ArrayList (); - ret = CheckIndices (ec, initializers, 0, false); - - if (!ret) + if (!CheckIndices (ec, initializers, 0, false)) return false; UpdateIndices (ec); @@ -6345,7 +6347,7 @@ public bool ValidateInitializers (EmitContext ec, Type array_type) return false; } - return ret; + return true; } } @@ -6806,32 +6808,33 @@ public override void Emit (EmitContext ec) } } - public object EncodeAsAttribute () + public override bool GetAttributableValue (out object value) { if (!is_one_dimensional){ - Report.Error (-211, Location, "attribute can not encode multi-dimensional arrays"); - return null; +// Report.Error (-211, Location, "attribute can not encode multi-dimensional arrays"); + return base.GetAttributableValue (out value); } - if (array_data == null){ - Report.Error (-212, Location, "array should be initialized when passing it to an attribute"); - return null; + if (array_data == null) { + Constant c = (Constant)((Argument)arguments [0]).Expr; + if (c.IsDefaultValue) { + value = new object [0]; + return true; + } +// Report.Error (-212, Location, "array should be initialized when passing it to an attribute"); + return base.GetAttributableValue (out value); } object [] ret = new object [array_data.Count]; - int i = 0; - foreach (Expression e in array_data){ - object v; - - if (e is NullLiteral) - v = null; - else { - if (!Attribute.GetAttributeArgumentExpression (e, Location, array_element_type, out v)) - return null; + for (int i = 0; i < ret.Length; ++i) + { + if (!((Expression)array_data [i]).GetAttributableValue (out ret [i])) { + value = null; + return false; } - ret [i++] = v; } - return ret; + value = ret; + return true; } } @@ -7096,7 +7099,7 @@ public void AddressOf (EmitContext ec, AddressOp mode) /// Implements the typeof operator /// public class TypeOf : Expression { - public Expression QueriedType; + readonly Expression QueriedType; protected Type typearg; public TypeOf (Expression queried_type, Location l) @@ -7136,8 +7139,10 @@ public override void Emit (EmitContext ec) ec.ig.Emit (OpCodes.Call, TypeManager.system_type_get_type_from_handle); } - public Type TypeArg { - get { return typearg; } + public override bool GetAttributableValue (out object value) + { + value = typearg; + return true; } } diff --git a/mcs/gmcs/typemanager.cs b/mcs/gmcs/typemanager.cs index 6d13970cc1bd0..221989a2d0399 100644 --- a/mcs/gmcs/typemanager.cs +++ b/mcs/gmcs/typemanager.cs @@ -243,7 +243,9 @@ public partial class TypeManager { public static Hashtable AllClsTopLevelTypes; static Hashtable fieldbuilders_to_fields; + static Hashtable propertybuilder_to_property; static Hashtable fields; + static Hashtable events; static PtrHashtable assembly_internals_vis_attrs; @@ -266,8 +268,8 @@ public static void CleanUp () fieldbuilders_to_fields = null; events = null; priv_fields_events = null; - type_hash = null; + propertybuilder_to_property = null; assembly_internals_vis_attrs = null; @@ -365,6 +367,7 @@ static public void Reset () builder_to_ifaces = new PtrHashtable (); fieldbuilders_to_fields = new Hashtable (); + propertybuilder_to_property = new Hashtable (); fields = new Hashtable (); type_hash = new DoubleHash (); @@ -1874,6 +1877,16 @@ public static IConstant GetConstant (FieldInfo fb) return (IConstant)fields [fb]; } + public static void RegisterProperty (PropertyInfo pi, PropertyBase pb) + { + propertybuilder_to_property.Add (pi, pb); + } + + public static PropertyBase GetProperty (PropertyInfo pi) + { + return (PropertyBase)propertybuilder_to_property [pi]; + } + static public bool RegisterFieldBase (FieldBuilder fb, FieldBase f) { if (fieldbuilders_to_fields.Contains (fb)) @@ -1894,8 +1907,6 @@ static public FieldBase GetField (FieldInfo fb) return (FieldBase) fieldbuilders_to_fields [fb]; } - static Hashtable events; - static public void RegisterEvent (MyEventBuilder eb, MethodBase add, MethodBase remove) { if (events == null) diff --git a/mcs/tests/known-issues-gmcs b/mcs/tests/known-issues-gmcs index 06467d7c9250d..895821cab1406 100644 --- a/mcs/tests/known-issues-gmcs +++ b/mcs/tests/known-issues-gmcs @@ -10,7 +10,6 @@ test-anon-27.cs test-xml-027.cs test-465.cs IGNORE # need to fix the path separator to work both on Unix and Windows test-476.cs -test-492.cs test-494.cs test-495.cs test-anon-11.cs From 9fbbf111d5f05b5956b1693d5fbdb4508226f5c5 Mon Sep 17 00:00:00 2001 From: Alexander Olk Date: Thu, 23 Mar 2006 15:18:15 +0000 Subject: [PATCH 079/117] 2006-03-23 Alexander Olk * FileDialog.cs: Make FileDialog remember which directory it was in last in the same execution. svn path=/trunk/mcs/; revision=58361 --- .../System.Windows.Forms/ChangeLog | 5 +++++ .../System.Windows.Forms/FileDialog.cs | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index c0e662a09b982..32abc52380861 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2006-03-23 Alexander Olk + + * FileDialog.cs: Make FileDialog remember which directory it was in + last in the same execution. + 2006-03-22 Mike Kestner * FileDialog.cs: make the DropDownMenu on the toolbar display diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs index 771e9bc39c8e8..ba5a616597bc9 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs @@ -116,6 +116,9 @@ internal enum FileDialogType { internal FileFilter fileFilter; + private string last_dir_when_opened_or_saved = ""; + private string start_dir; + internal FileDialog () { fileTypeComboBox = new ComboBox (); @@ -355,7 +358,7 @@ internal FileDialog () readonlyCheckBox.CheckedChanged += new EventHandler (OnCheckCheckChanged); - ChangeDirectory (null, currentDirectoryName); + start_dir = currentDirectoryName; } [DefaultValue(true)] @@ -496,6 +499,7 @@ internal FileDialog () set { if (Directory.Exists (value)) { initialDirectory = value; + start_dir = value; ChangeDirectory (null, initialDirectory); } @@ -623,6 +627,11 @@ protected override bool RunDialog (IntPtr hWndOwner) { form.Refresh (); + if (last_dir_when_opened_or_saved != String.Empty) + ChangeDirectory (null, last_dir_when_opened_or_saved); + else + ChangeDirectory (null, start_dir); + fileNameComboBox.Select (); return true; @@ -877,6 +886,11 @@ void OnClickOpenSaveButton (object sender, EventArgs e) if (restoreDirectory) currentDirectoryName = restoreDirectoryString; + if (current_special_case != String.Empty) + last_dir_when_opened_or_saved = current_special_case; + else + last_dir_when_opened_or_saved = currentDirectoryName; + CancelEventArgs cancelEventArgs = new CancelEventArgs (); cancelEventArgs.Cancel = false; @@ -1078,6 +1092,8 @@ internal void ChangeDirectory (object sender, string path_or_special_case) } else { currentDirectoryName = path_or_special_case; + current_special_case = ""; + currentDirectoryInfo = new DirectoryInfo (path_or_special_case); mwfFileView.UpdateFileView (currentDirectoryInfo); From e1839917904d237a0e4ec2414906b48fb70e701c Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Thu, 23 Mar 2006 16:06:40 +0000 Subject: [PATCH 080/117] 2006-03-23 Martin Baulig * convert.cs (Convert.ImplicitTypeParameterConversion): Do not blindly allow all conversions if we do not have any constraints. svn path=/trunk/mcs/; revision=58363 --- mcs/errors/gcs0030.cs | 16 ++++++++++++++++ mcs/gmcs/ChangeLog | 5 +++++ mcs/gmcs/convert.cs | 4 ---- 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100755 mcs/errors/gcs0030.cs diff --git a/mcs/errors/gcs0030.cs b/mcs/errors/gcs0030.cs new file mode 100755 index 0000000000000..a87c044b718ed --- /dev/null +++ b/mcs/errors/gcs0030.cs @@ -0,0 +1,16 @@ +// CS0030: Cannot convert type `T' to `X'. +// Line: 8 +class Foo + where T : System.ICloneable +{ + public X Test (T t) + { + return (X) t; + } +} + +class X +{ + static void Main () + { } +} diff --git a/mcs/gmcs/ChangeLog b/mcs/gmcs/ChangeLog index dbc6a3e4fe1fb..f3532fe8cf9e6 100644 --- a/mcs/gmcs/ChangeLog +++ b/mcs/gmcs/ChangeLog @@ -1,3 +1,8 @@ +2006-03-23 Martin Baulig + + * convert.cs (Convert.ImplicitTypeParameterConversion): Do not + blindly allow all conversions if we do not have any constraints. + 2006-02-27 Marek Safar * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use diff --git a/mcs/gmcs/convert.cs b/mcs/gmcs/convert.cs index ebd7862465dad..7569579739355 100644 --- a/mcs/gmcs/convert.cs +++ b/mcs/gmcs/convert.cs @@ -86,10 +86,6 @@ static Type TypeParam_EffectiveBaseType (GenericConstraints gc) return null; } - if (!gc.HasClassConstraint && !gc.HasConstructorConstraint && !gc.HasReferenceTypeConstraint && - !gc.HasValueTypeConstraint) - return new ClassCast (expr, target_type); - // We're converting from a type parameter which is known to be a reference type. Type base_type = TypeParam_EffectiveBaseType (gc); From 149075cbb0574ccdeae6a8396505788aeb8ed124 Mon Sep 17 00:00:00 2001 From: Vladimir Krasnov Date: Thu, 23 Mar 2006 16:44:36 +0000 Subject: [PATCH 081/117] * System.Web.vmwcsproj: grasshopper project file fix, added System.Web\TempFileStream.cs svn path=/trunk/mcs/; revision=58364 --- mcs/class/System.Web/ChangeLog | 5 +++++ mcs/class/System.Web/System.Web.vmwcsproj | 1 + 2 files changed, 6 insertions(+) diff --git a/mcs/class/System.Web/ChangeLog b/mcs/class/System.Web/ChangeLog index b9688056a4cbc..0eae5805500a3 100644 --- a/mcs/class/System.Web/ChangeLog +++ b/mcs/class/System.Web/ChangeLog @@ -1,3 +1,8 @@ +2006-03-23 Vladimir Krasnov + + * System.Web.vmwcsproj: grasshopper project file fix, + added System.Web\TempFileStream.cs + 2006-03-19 Gonzalo Paniagua Javier * System.Web.dll.sources: add TempFileStream.cs diff --git a/mcs/class/System.Web/System.Web.vmwcsproj b/mcs/class/System.Web/System.Web.vmwcsproj index 2b84be2c977fb..6bff841d51a61 100644 --- a/mcs/class/System.Web/System.Web.vmwcsproj +++ b/mcs/class/System.Web/System.Web.vmwcsproj @@ -95,6 +95,7 @@ + From 2ceab7c1f233d0cf35907ef666c847439b7270f2 Mon Sep 17 00:00:00 2001 From: Paolo Molaro Date: Thu, 23 Mar 2006 17:09:18 +0000 Subject: [PATCH 082/117] Compilation fix after Zoltan's changes. svn path=/trunk/mono/; revision=58365 --- mono/mini/mini-sparc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mono/mini/mini-sparc.c b/mono/mini/mini-sparc.c index 7182d8ed8b652..5f6959cabb42c 100644 --- a/mono/mini/mini-sparc.c +++ b/mono/mini/mini-sparc.c @@ -2435,9 +2435,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) sparc_cmp (code, ins->sreg1, sparc_o7); } break; - case OP_X86_TEST_NULL: - sparc_cmp_imm (code, ins->sreg1, 0); - break; case CEE_BREAK: /* * gdb does not like encountering 'ta 1' in the debugged code. So From 70c5ba429e384c8a86c5a9e8ddb3d78de3237709 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Thu, 23 Mar 2006 17:14:41 +0000 Subject: [PATCH 083/117] Don't crash here if we don't find any ctors. svn path=/trunk/mcs/; revision=58366 --- mcs/gmcs/attribute.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mcs/gmcs/attribute.cs b/mcs/gmcs/attribute.cs index 55acd1be58aaa..7b352e52b9820 100644 --- a/mcs/gmcs/attribute.cs +++ b/mcs/gmcs/attribute.cs @@ -371,6 +371,9 @@ protected virtual ConstructorInfo ResolveConstructor (EmitContext ec) BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly, Location); + if (mg == null) + return null; + MethodBase constructor = Invocation.OverloadResolve ( ec, (MethodGroupExpr) mg, PosArguments, false, Location); From 657f811c6d72c666f1321df492c741c368320016 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Thu, 23 Mar 2006 17:15:52 +0000 Subject: [PATCH 084/117] 2006-03-23 Martin Baulig * convert.cs (Convert.ExplicitTypeParameterConversion): New method; implement explicit type parameter conversions. svn path=/trunk/mcs/; revision=58367 --- mcs/gmcs/ChangeLog | 6 +++++ mcs/gmcs/convert.cs | 55 +++++++++++++++++++++++++++++++++++++++++- mcs/tests/gtest-263.cs | 22 +++++++++++++++++ 3 files changed, 82 insertions(+), 1 deletion(-) create mode 100755 mcs/tests/gtest-263.cs diff --git a/mcs/gmcs/ChangeLog b/mcs/gmcs/ChangeLog index f3532fe8cf9e6..a11562b4fc00b 100644 --- a/mcs/gmcs/ChangeLog +++ b/mcs/gmcs/ChangeLog @@ -1,3 +1,9 @@ +2006-03-23 Martin Baulig + + * convert.cs + (Convert.ExplicitTypeParameterConversion): New method; implement + explicit type parameter conversions. + 2006-03-23 Martin Baulig * convert.cs (Convert.ImplicitTypeParameterConversion): Do not diff --git a/mcs/gmcs/convert.cs b/mcs/gmcs/convert.cs index 7569579739355..ae12f159fd62a 100644 --- a/mcs/gmcs/convert.cs +++ b/mcs/gmcs/convert.cs @@ -116,6 +116,52 @@ static Type TypeParam_EffectiveBaseType (GenericConstraints gc) return null; } + static bool ExplicitTypeParameterConversionExists (Type source_type, Type target_type) + { + if (target_type.IsInterface) + return true; + + if (source_type.IsGenericParameter) { + GenericConstraints gc = TypeManager.GetTypeParameterConstraints (target_type); + if (gc == null) + return false; + + foreach (Type iface in gc.InterfaceConstraints) { + if (!iface.IsGenericParameter) + continue; + + if (TypeManager.IsSubclassOf (source_type, iface)) + return true; + } + } + + return false; + } + + static Expression ExplicitTypeParameterConversion (Expression source, Type target_type) + { + Type source_type = source.Type; + + if (target_type.IsInterface) + return new ClassCast (source, target_type); + + if (source_type.IsGenericParameter) { + GenericConstraints gc = TypeManager.GetTypeParameterConstraints (target_type); + if (gc == null) + return null; + + foreach (Type iface in gc.InterfaceConstraints) { + if (!iface.IsGenericParameter) + continue; + + if (TypeManager.IsSubclassOf (source_type, iface)) + return new ClassCast (source, target_type); + } + } + + return null; + } + static EmptyExpression MyEmptyExpr; static public Expression ImplicitReferenceConversion (Expression expr, Type target_type) { @@ -1613,7 +1659,7 @@ public static bool ExplicitReferenceConversionExists (Type source_type, Type tar // From generic parameter to any type // if (source_type.IsGenericParameter) - return true; + return ExplicitTypeParameterConversionExists (source_type, target_type); // // From object to a generic parameter @@ -1719,6 +1765,13 @@ static Expression ExplicitReferenceConversion (Expression source, Type target_ty if (source_type == TypeManager.object_type && target_is_type_param) return new UnboxCast (source, target_type); + // + // Explicit type parameter conversion. + // + + if (source_type.IsGenericParameter) + return ExplicitTypeParameterConversion (source, target_type); + // // From object to any reference type // diff --git a/mcs/tests/gtest-263.cs b/mcs/tests/gtest-263.cs new file mode 100755 index 0000000000000..4911dcd8798a7 --- /dev/null +++ b/mcs/tests/gtest-263.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; + +class Foo +{ + public ICloneable Test (S t) + { + return (ICloneable) t; + } +} + +public static class ConvertHelper +{ + public static IEnumerator Test (S s) + where T : S + { + yield return (T) s; + } + + static void Main () + { } +} From 4355d3de37a08218468b4ef5eb582e6f851b9b19 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Thu, 23 Mar 2006 17:28:14 +0000 Subject: [PATCH 085/117] Ooooops. svn path=/trunk/mcs/; revision=58369 --- mcs/gmcs/convert.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mcs/gmcs/convert.cs b/mcs/gmcs/convert.cs index ae12f159fd62a..c9bdbf90a5cb1 100644 --- a/mcs/gmcs/convert.cs +++ b/mcs/gmcs/convert.cs @@ -121,7 +121,7 @@ static bool ExplicitTypeParameterConversionExists (Type source_type, Type target if (target_type.IsInterface) return true; - if (source_type.IsGenericParameter) { + if (target_type.IsGenericParameter) { GenericConstraints gc = TypeManager.GetTypeParameterConstraints (target_type); if (gc == null) return false; @@ -145,7 +145,7 @@ static Expression ExplicitTypeParameterConversion (Expression source, Type targe if (target_type.IsInterface) return new ClassCast (source, target_type); - if (source_type.IsGenericParameter) { + if (target_type.IsGenericParameter) { GenericConstraints gc = TypeManager.GetTypeParameterConstraints (target_type); if (gc == null) return null; From 9a610d8ea6a94134f26568b7c2502a1b49ae1f37 Mon Sep 17 00:00:00 2001 From: Marek Sieradzki Date: Thu, 23 Mar 2006 17:35:31 +0000 Subject: [PATCH 086/117] 2006-03-23 Marek Sieradzki * Microsoft.Build.Engine.Test.csproj: Updated. svn path=/trunk/mcs/; revision=58370 --- .../Test/Microsoft.Build.BuildEngine/ChangeLog | 4 ++++ .../Microsoft.Build.Engine.Test.csproj | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog index f498b8d8807e7..4bb2e9d029409 100644 --- a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog +++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog @@ -1,3 +1,7 @@ +2006-03-23 Marek Sieradzki + + * Microsoft.Build.Engine.Test.csproj: Updated. + 2006-03-21 Crestez Leonard * InternalLoggerExceptionTest.cs, InvalidProjectFileExceptionTest.cs: diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/Microsoft.Build.Engine.Test.csproj b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/Microsoft.Build.Engine.Test.csproj index 6d1d9664d8da1..abcdb675e9a11 100644 --- a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/Microsoft.Build.Engine.Test.csproj +++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/Microsoft.Build.Engine.Test.csproj @@ -14,14 +14,22 @@ True Full True + true + + + false - bin\Debug\ + bin\Release\ True TRACE False None False + true + + + false From 202fba166e2b3d1b7a49270d951d01093d48b208 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Thu, 23 Mar 2006 17:53:29 +0000 Subject: [PATCH 087/117] remove a cwl, oops svn path=/trunk/mcs/; revision=58371 --- .../System.Windows.Forms/ThemeWin32Classic.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs index 89857effb09bd..405e5a9b95124 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs @@ -1901,7 +1901,6 @@ Bitmap CreateGlyphBitmap (Size size, MenuGlyph glyph, Color color) bg_color = Color.White; else bg_color = Color.Black; - Console.WriteLine (color + " " + bg_color); Bitmap bmp = new Bitmap (size.Width, size.Height); Graphics gr = Graphics.FromImage (bmp); Rectangle rect = new Rectangle (Point.Empty, size); From e1458fde1216987800d80d972ed662253003ceca Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Thu, 23 Mar 2006 18:09:36 +0000 Subject: [PATCH 088/117] 2006-03-23 Chris Toshok * DefaultAuthenticationModule.cs (OnDefaultAuthentication): always set Thread.CurrentPrincipal, not just if we set it to the GenericPrincipal. svn path=/trunk/mcs/; revision=58372 --- mcs/class/System.Web/System.Web.Security/ChangeLog | 6 ++++++ .../System.Web.Security/DefaultAuthenticationModule.cs | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mcs/class/System.Web/System.Web.Security/ChangeLog b/mcs/class/System.Web/System.Web.Security/ChangeLog index d3765bcd347d2..90a7d10cf407c 100644 --- a/mcs/class/System.Web/System.Web.Security/ChangeLog +++ b/mcs/class/System.Web/System.Web.Security/ChangeLog @@ -1,3 +1,9 @@ +2006-03-23 Chris Toshok + + * DefaultAuthenticationModule.cs (OnDefaultAuthentication): always + set Thread.CurrentPrincipal, not just if we set it to the + GenericPrincipal. + 2006-03-22 Chris Toshok * RoleManagerModule.cs: implement using info in Shackow's book. diff --git a/mcs/class/System.Web/System.Web.Security/DefaultAuthenticationModule.cs b/mcs/class/System.Web/System.Web.Security/DefaultAuthenticationModule.cs index 8e0e5c5e1d510..0eb65a656b989 100644 --- a/mcs/class/System.Web/System.Web.Security/DefaultAuthenticationModule.cs +++ b/mcs/class/System.Web/System.Web.Security/DefaultAuthenticationModule.cs @@ -65,10 +65,10 @@ void OnDefaultAuthentication (object sender, EventArgs args) if (context.User == null && Authenticate != null) Authenticate (this, new DefaultAuthenticationEventArgs (context)); - if (context.User == null) { + if (context.User == null) context.User = new GenericPrincipal (defaultIdentity, new string [0]); - Thread.CurrentPrincipal = context.User; - } + + Thread.CurrentPrincipal = context.User; } } } From 5b8d8b0324e6d2a893457c3bc2fb80937a4f24f2 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Thu, 23 Mar 2006 18:23:19 +0000 Subject: [PATCH 089/117] 2006-03-23 Martin Baulig * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic type check if either of the types is an open generic type. svn path=/trunk/mcs/; revision=58373 --- mcs/gmcs/ChangeLog | 5 +++++ mcs/gmcs/expression.cs | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/mcs/gmcs/ChangeLog b/mcs/gmcs/ChangeLog index a11562b4fc00b..3fda0d6257681 100644 --- a/mcs/gmcs/ChangeLog +++ b/mcs/gmcs/ChangeLog @@ -1,3 +1,8 @@ +2006-03-23 Martin Baulig + + * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic + type check if either of the types is an open generic type. + 2006-03-23 Martin Baulig * convert.cs diff --git a/mcs/gmcs/expression.cs b/mcs/gmcs/expression.cs index 0bb3f1a0965f3..2f842e4fe090f 100644 --- a/mcs/gmcs/expression.cs +++ b/mcs/gmcs/expression.cs @@ -1184,6 +1184,9 @@ public override Expression DoResolve (EmitContext ec) action = Action.AlwaysFalse; else action = Action.Probe; + } else if (etype.ContainsGenericParameters || probe_type.ContainsGenericParameters) { + expr = new BoxedCast (expr, etype); + action = Action.Probe; } else { action = Action.AlwaysFalse; warning_never_matches = true; @@ -1288,6 +1291,12 @@ public override Expression DoResolve (EmitContext ec) return this; } + if (etype.ContainsGenericParameters || type.ContainsGenericParameters) { + expr = new BoxedCast (expr, etype); + do_isinst = true; + return this; + } + Error_CannotConvertType (etype, type, loc); return null; } From eaad6a4fcbbace38f3b7a44f292d67c930e3fed5 Mon Sep 17 00:00:00 2001 From: Alexander Olk Date: Thu, 23 Mar 2006 18:38:03 +0000 Subject: [PATCH 090/117] * FontDialog.cs: Update the example panel if the selected index of the fontListBox changes. 2006-03-23 Alexander Olk svn path=/trunk/mcs/; revision=58374 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 5 +++++ .../Managed.Windows.Forms/System.Windows.Forms/FontDialog.cs | 2 ++ 2 files changed, 7 insertions(+) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 32abc52380861..cb676a27f57d4 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2006-03-23 Alexander Olk + + * FontDialog.cs: Update the example panel if the selected index of + the fontListBox changes. + 2006-03-23 Alexander Olk * FileDialog.cs: Make FileDialog remember which directory it was in diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FontDialog.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FontDialog.cs index a90681496200f..0562034367b71 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FontDialog.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FontDialog.cs @@ -706,6 +706,8 @@ void OnSelectedIndexChangedFontListBox( object sender, EventArgs e ) UpdateFontSizeListBox (); + UpdateExamplePanel (); + form.Select(fontTextBox); internal_change = false; From b6f8f55392d2501daff5c4d7f3508f27b1d70929 Mon Sep 17 00:00:00 2001 From: Peter Dennis Bartok Date: Thu, 23 Mar 2006 20:11:49 +0000 Subject: [PATCH 091/117] 2006-03-23 Peter Dennis Bartok * FontCollection.cs (Dispose): When on Linux/Unix, call GdipDeletePrivateFontCollection to free up the font collection (even though it's not private, we'd be leaking otherwise. Don't try this with Microsoft's GDI+ on Win32, though.) svn path=/trunk/mcs/; revision=58381 --- mcs/class/System.Drawing/System.Drawing.Text/ChangeLog | 7 +++++++ .../System.Drawing/System.Drawing.Text/FontCollection.cs | 8 ++++++++ .../System.Drawing.Text/PrivateFontCollection.cs | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/mcs/class/System.Drawing/System.Drawing.Text/ChangeLog b/mcs/class/System.Drawing/System.Drawing.Text/ChangeLog index c362e6019f88b..3bf96ff7cac39 100644 --- a/mcs/class/System.Drawing/System.Drawing.Text/ChangeLog +++ b/mcs/class/System.Drawing/System.Drawing.Text/ChangeLog @@ -1,3 +1,10 @@ +2006-03-23 Peter Dennis Bartok + + * FontCollection.cs (Dispose): When on Linux/Unix, call + GdipDeletePrivateFontCollection to free up the font collection (even + though it's not private, we'd be leaking otherwise. Don't try this + with Microsoft's GDI+ on Win32, though.) + 2006-03-23 Peter Dennis Bartok * FontCollection.cs (get_Families): Now letting the runtime do the diff --git a/mcs/class/System.Drawing/System.Drawing.Text/FontCollection.cs b/mcs/class/System.Drawing/System.Drawing.Text/FontCollection.cs index b01d65d540575..47a140f765269 100644 --- a/mcs/class/System.Drawing/System.Drawing.Text/FontCollection.cs +++ b/mcs/class/System.Drawing/System.Drawing.Text/FontCollection.cs @@ -56,6 +56,14 @@ public void Dispose() protected virtual void Dispose (bool disposing) { + OperatingSystem osInfo = Environment.OSVersion; + + if (nativeFontCollection != IntPtr.Zero) { + if ((int) osInfo.Platform == 128 || (int) osInfo.Platform == 4) { + GDIPlus.GdipDeletePrivateFontCollection (ref nativeFontCollection); + nativeFontCollection = IntPtr.Zero; + } + } } // properties diff --git a/mcs/class/System.Drawing/System.Drawing.Text/PrivateFontCollection.cs b/mcs/class/System.Drawing/System.Drawing.Text/PrivateFontCollection.cs index e332fe4c89cf5..4488706f06c96 100644 --- a/mcs/class/System.Drawing/System.Drawing.Text/PrivateFontCollection.cs +++ b/mcs/class/System.Drawing/System.Drawing.Text/PrivateFontCollection.cs @@ -74,6 +74,10 @@ protected override void Dispose(bool disposing) { if (nativeFontCollection!=IntPtr.Zero){ GDIPlus.GdipDeletePrivateFontCollection (ref nativeFontCollection); + + // This must be zeroed out, otherwise our base will also call + // the GDI+ delete method on unix platforms. We're keeping the + // base.Dispose() call in case other cleanup ever gets added there nativeFontCollection = IntPtr.Zero; } From a21af9920375734b0918bd42be2e567f8a7c84d2 Mon Sep 17 00:00:00 2001 From: Gonzalo Paniagua Javier Date: Thu, 23 Mar 2006 20:18:05 +0000 Subject: [PATCH 092/117] temporary workaround for compiler regression svn path=/trunk/mcs/; revision=58385 --- .../System.Web/System.Web.Configuration_2.0/CacheSection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/CacheSection.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/CacheSection.cs index 37175ec7f7d45..34fb7bf7ea479 100644 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/CacheSection.cs +++ b/mcs/class/System.Web/System.Web.Configuration_2.0/CacheSection.cs @@ -91,7 +91,7 @@ static CacheSection () set { base[percentagePhysicalMemoryUsedLimitProp] = value; } } - [LongValidator (MinValue = 0, MaxValue = Int64.MaxValue)] + [LongValidator (MinValue = (long) 0, MaxValue = Int64.MaxValue)] [ConfigurationProperty ("privateBytesLimit", DefaultValue = "0")] public long PrivateBytesLimit { get { return (long) base [privateBytesLimitProp];} From 82c0c9e77a89a9ece88aaf5f6d6971dd5032a657 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Thu, 23 Mar 2006 20:19:50 +0000 Subject: [PATCH 093/117] 2006-03-23 Mike Kestner * XplatUIX11.cs: rework the fix for #77828 by changing the order of the if and else if and reverting back to the original == check on the None conditional. svn path=/trunk/mcs/; revision=58386 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 6 ++++++ .../System.Windows.Forms/XplatUIX11.cs | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index cb676a27f57d4..ebfeed03853a2 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,9 @@ +2006-03-23 Mike Kestner + + * XplatUIX11.cs: rework the fix for #77828 by changing the order of + the if and else if and reverting back to the original == check on the + None conditional. + 2006-03-23 Alexander Olk * FontDialog.cs: Update the example panel if the selected index of diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs index fa5015711cb0c..36b18d3565594 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs @@ -586,10 +586,10 @@ internal class XException : ApplicationException { tool_caption_height = 19; if ((Style & (int) WindowStyles.WS_CHILD) != 0) { - if ((Style & (int) WindowStyles.WS_BORDER) != 0) { - border_style = FormBorderStyle.None; - } else if ((ExStyle & (int) WindowExStyles.WS_EX_CLIENTEDGE) != 0) { + if ((ExStyle & (int) WindowExStyles.WS_EX_CLIENTEDGE) != 0) { border_style = FormBorderStyle.Fixed3D; + } else if ((Style & (int) WindowStyles.WS_BORDER) == 0) { + border_style = FormBorderStyle.None; } else { border_style = FormBorderStyle.FixedSingle; } From a9116fadf9bc3dafeae6e3c4a962a09782411d23 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Thu, 23 Mar 2006 21:03:43 +0000 Subject: [PATCH 094/117] 2006-03-23 Mike Kestner * ThemeWin32Classic.cs: fix FullRowSelect selection background and focus rectangle drawing. Fixes #77835. svn path=/trunk/mcs/; revision=58388 --- .../System.Windows.Forms/ChangeLog | 5 ++ .../System.Windows.Forms/ThemeWin32Classic.cs | 51 +++++++++---------- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index ebfeed03853a2..34182a2b92ee8 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2006-03-23 Mike Kestner + + * ThemeWin32Classic.cs: fix FullRowSelect selection background and + focus rectangle drawing. Fixes #77835. + 2006-03-23 Mike Kestner * XplatUIX11.cs: rework the fix for #77828 by changing the order of diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs index 405e5a9b95124..5ea211b1c5bb5 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs @@ -1513,7 +1513,6 @@ public override void DrawListViewHeaderDragDetails (Graphics dc, ListView view, dc.DrawLine (pen, target_x, 0, target_x, col.Rect.Height); } - // draws the ListViewItem of the given index protected virtual void DrawListViewItem (Graphics dc, ListView control, ListViewItem item) { int col_offset; @@ -1611,10 +1610,7 @@ protected virtual void DrawListViewItem (Graphics dc, ListView control, ListView if (item.Selected) { if (control.View == View.Details) { if (control.FullRowSelect) { - // fill the entire rect excluding the checkbox - full_rect.Location = item.GetBounds (ItemBoundsPortion.Label).Location; - dc.FillRectangle (this.ResPool.GetSolidBrush - (this.ColorHighlight), full_rect); + dc.FillRectangle (ResPool.GetSolidBrush (ColorHighlight), text_rect); } else { Size text_size = Size.Ceiling (dc.MeasureString (item.Text, @@ -1665,55 +1661,56 @@ protected virtual void DrawListViewItem (Graphics dc, ListView control, ListView subItem = subItems [index]; col = control.Columns [index]; format.Alignment = col.Format.Alignment; - sub_item_rect.X = col.Rect.Left + 3; - sub_item_rect.Width = col.Wd - 6; - sub_item_rect.X -= control.h_marker; + sub_item_rect.X = col.Rect.X - control.h_marker; + sub_item_rect.Width = col.Wd; + Rectangle sub_item_text_rect = sub_item_rect; + sub_item_text_rect.X += 3; + sub_item_text_rect.Width -= 6; SolidBrush sub_item_back_br = null; SolidBrush sub_item_fore_br = null; Font sub_item_font = null; if (item.UseItemStyleForSubItems) { - sub_item_back_br = this.ResPool.GetSolidBrush - (item.BackColor); - sub_item_fore_br = this.ResPool.GetSolidBrush - (item.ForeColor); + sub_item_back_br = ResPool.GetSolidBrush (item.BackColor); + sub_item_fore_br = ResPool.GetSolidBrush (item.ForeColor); sub_item_font = item.Font; - } - else { - sub_item_back_br = this.ResPool.GetSolidBrush - (subItem.BackColor); - sub_item_fore_br = this.ResPool.GetSolidBrush - (subItem.ForeColor); + } else { + sub_item_back_br = ResPool.GetSolidBrush (subItem.BackColor); + sub_item_fore_br = ResPool.GetSolidBrush (subItem.ForeColor); sub_item_font = subItem.Font; } - // In case of fullrowselect, background is filled - // for the entire rect above if (item.Selected && control.FullRowSelect) { + dc.FillRectangle (ResPool.GetSolidBrush (ColorHighlight), sub_item_rect); if (subItem.Text != null && subItem.Text.Length > 0) dc.DrawString (subItem.Text, sub_item_font, this.ResPool.GetSolidBrush (this.ColorHighlightText), - sub_item_rect, format); - } - else { + sub_item_text_rect, format); + } else { dc.FillRectangle (sub_item_back_br, sub_item_rect); if (subItem.Text != null && subItem.Text.Length > 0) dc.DrawString (subItem.Text, sub_item_font, sub_item_fore_br, - sub_item_rect, format); + sub_item_text_rect, format); } - sub_item_rect.X += col.Wd; } } } if (item.Focused) { + Rectangle focus_rect = text_rect; + if (control.FullRowSelect && control.View == View.Details) { + int width = 0; + foreach (ColumnHeader col in control.Columns) + width += col.Width; + focus_rect = new Rectangle (0, full_rect.Y, width, full_rect.Height); + } if (item.Selected) - CPDrawFocusRectangle (dc, text_rect, ColorHighlightText, ColorHighlight); + CPDrawFocusRectangle (dc, focus_rect, ColorHighlightText, ColorHighlight); else - CPDrawFocusRectangle (dc, text_rect, control.ForeColor, control.BackColor); + CPDrawFocusRectangle (dc, focus_rect, control.ForeColor, control.BackColor); } format.Dispose (); From 74504b1a44c638a8ff2cb15035c3b52e2bf728b3 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Thu, 23 Mar 2006 21:47:44 +0000 Subject: [PATCH 095/117] * Roles.cs: make this 2.0 configuration aware. * SqlRoleProvider.cs: flesh out all the operations. the only things that need dealing with are the Initialize method's handling of a few parameters, and the ApplicationName property. 2006-03-23 Chris Toshok svn path=/trunk/mcs/; revision=58390 --- .../System.Web/System.Web.Security/ChangeLog | 8 + .../System.Web/System.Web.Security/Roles.cs | 65 +-- .../System.Web.Security/SqlRoleProvider.cs | 527 +++++++++++++++++- 3 files changed, 536 insertions(+), 64 deletions(-) diff --git a/mcs/class/System.Web/System.Web.Security/ChangeLog b/mcs/class/System.Web/System.Web.Security/ChangeLog index 90a7d10cf407c..920d46c2a5d85 100644 --- a/mcs/class/System.Web/System.Web.Security/ChangeLog +++ b/mcs/class/System.Web/System.Web.Security/ChangeLog @@ -1,3 +1,11 @@ +2006-03-23 Chris Toshok + + * Roles.cs: make this 2.0 configuration aware. + + * SqlRoleProvider.cs: flesh out all the operations. the only + things that need dealing with are the Initialize method's handling + of a few parameters, and the ApplicationName property. + 2006-03-23 Chris Toshok * DefaultAuthenticationModule.cs (OnDefaultAuthentication): always diff --git a/mcs/class/System.Web/System.Web.Security/Roles.cs b/mcs/class/System.Web/System.Web.Security/Roles.cs index c2c18133aea69..8bcbf94e7a2d7 100644 --- a/mcs/class/System.Web/System.Web.Security/Roles.cs +++ b/mcs/class/System.Web/System.Web.Security/Roles.cs @@ -4,9 +4,10 @@ // Authors: // Ben Maurer (bmaurer@users.sourceforge.net) // Sebastien Pouliot +// Chris Toshok // // (C) 2003 Ben Maurer -// Copyright (c) 2005 Novell, Inc (http://www.novell.com) +// Copyright (c) 2005,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 @@ -31,33 +32,22 @@ #if NET_2_0 using System.Configuration.Provider; +using System.Web.Configuration; namespace System.Web.Security { - [MonoTODO ("read infos from web.config")] public static class Roles { - private static RoleProvider provider; - private static bool cookie_cache_roles; - private static string cookie_name; - private static string cookie_path; private static CookieProtection cookie_protection; - private static bool cookie_ssl; - private static bool cookie_sliding; - private static int cookie_timeout; - private static bool cookie_persistent; - private static string domain; - private static int max_cached_result; + private static RoleManagerSection config; + static RoleProviderCollection providersCollection; static Roles () { // default values (when not supplied in web.config) - cookie_name = ".ASPXROLES"; - cookie_path = "/"; cookie_protection = CookieProtection.All; - cookie_sliding = true; - cookie_timeout = 30; - max_cached_result = 25; + + config = (RoleManagerSection)WebConfigurationManager.GetSection ("system.web/roleManager"); } @@ -177,71 +167,70 @@ public static string[] FindUsersInRole (string rolename, string usernameToMatch) } public static bool CacheRolesInCookie { - get { return cookie_cache_roles; } + get { return config.CacheRolesInCookie; } } public static string CookieName { - get { return cookie_name; } + get { return config.CookieName; } } public static string CookiePath { - get { return cookie_path; } + get { return config.CookiePath; } } + [MonoTODO ("read infos from web.config")] public static CookieProtection CookieProtectionValue { get { return cookie_protection; } } public static bool CookieRequireSSL { - get { return cookie_ssl; } + get { return config.CookieRequireSSL; } } public static bool CookieSlidingExpiration { - get { return cookie_sliding; } + get { return config.CookieSlidingExpiration; } } public static int CookieTimeout { - get { return cookie_timeout; } + get { return (int)config.CookieTimeout.TotalMinutes; } } public static bool CreatePersistentCookie { - get { return cookie_persistent; } + get { return config.CreatePersistentCookie; } } public static string Domain { - get { return domain; } + get { return config.Domain; } } public static bool Enabled { - get { return (provider != null); } + get { return config.Enabled; } } public static int MaxCachedResults { - get { return max_cached_result; } + get { return config.MaxCachedResults; } } - [MonoTODO] public static RoleProvider Provider { - get { - CheckProvider (); - throw new NotImplementedException (); - } + get { return Providers[config.DefaultProvider]; } } - [MonoTODO] public static RoleProviderCollection Providers { get { - CheckProvider (); - throw new NotImplementedException (); + CheckEnabled (); + if (providersCollection == null) { + providersCollection = new RoleProviderCollection (); + ProvidersHelper.InstantiateProviders (config.Providers, providersCollection, typeof (RoleProvider)); + } + return providersCollection; } } // private stuff - - private static void CheckProvider () + private static void CheckEnabled () { if (!Enabled) - throw new ProviderException (); + throw new ProviderException ("This feature is not enabled. To enable it, add to your configuration file."); } } } diff --git a/mcs/class/System.Web/System.Web.Security/SqlRoleProvider.cs b/mcs/class/System.Web/System.Web.Security/SqlRoleProvider.cs index 3804fe0a38ce1..e8dc87512dc1f 100644 --- a/mcs/class/System.Web/System.Web.Security/SqlRoleProvider.cs +++ b/mcs/class/System.Web/System.Web.Security/SqlRoleProvider.cs @@ -3,9 +3,10 @@ // // Authors: // Ben Maurer (bmaurer@users.sourceforge.net) +// Chris Toshok (toshok@ximian.com) // // (C) 2003 Ben Maurer -// Copyright (c) 2005 Novell, Inc (http://www.novell.com) +// Copyright (c) 2005,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 @@ -29,82 +30,556 @@ #if NET_2_0 +using System.Collections; using System.Collections.Specialized; +using System.Data; +using System.Data.Common; +using System.Configuration; +using System.Configuration.Provider; +using System.Web.Configuration; namespace System.Web.Security { public class SqlRoleProvider: RoleProvider { - - [MonoTODO] + + string applicationName; + string loweredApplicationName; + int commandTimeout; + ConnectionStringSettings connectionString; + string providerName; + + DbProviderFactory factory; + DbConnection connection; + + void InitConnection () + { + if (factory == null) + factory = ProvidersHelper.GetDbProviderFactory (connectionString.ProviderName); + if (connection == null) { + connection = factory.CreateConnection(); + connection.ConnectionString = connectionString.ConnectionString; + } + } + + void AddParameter (DbCommand command, string parameterName, string parameterValue) + { + DbParameter dbp = command.CreateParameter (); + dbp.ParameterName = parameterName; + dbp.Value = parameterValue; + dbp.Direction = ParameterDirection.Input; + command.Parameters.Add (dbp); + } + public override void AddUsersToRoles (string [] usernames, string [] rolenames) { - throw new NotImplementedException (); + Hashtable h; + + h = new Hashtable(); + foreach (string u in usernames) { + if (u == null) + throw new ArgumentNullException ("null element in usernames array"); + if (h.ContainsKey (u)) + throw new ArgumentException ("duplicate element in usernames array"); + if (u.Length == 0 || u.Length > 256 || u.IndexOf (",") != -1) + throw new ArgumentException ("element in usernames array in illegal format"); + h.Add (u, u); + } + + h = new Hashtable(); + foreach (string r in usernames) { + if (r == null) + throw new ArgumentNullException ("null element in usernames array"); + if (h.ContainsKey (r)) + throw new ArgumentException ("duplicate element in usernames array"); + if (r.Length == 0 || r.Length > 256 || r.IndexOf (",") != -1) + throw new ArgumentException ("element in usernames array in illegal format"); + h.Add (r, r); + } + + InitConnection(); + + bool closed = connection.State == ConnectionState.Closed; + if (closed) + connection.Open(); + + DbTransaction trans = connection.BeginTransaction (); + + try { + foreach (string username in usernames) { + string loweredUserName = username.ToLower(); + + foreach (string rolename in rolenames) { + string loweredRoleName = rolename.ToLower(); + + /* add the user/role combination to dbo.aspnet_UsersInRoles */ + DbCommand command = factory.CreateCommand (); + command.Transaction = trans; + command.CommandText = @" +INSERT INTO dbo.aspnet_UsersInRoles (UserId, RoleId) + SELECT dbo.aspnet_Users.UserId, dbo.aspnet_Roles.RoleId + FROM dbo.aspnet_Users, dbo.aspnet_Roles, dbo.aspnet_Applications + WHERE dbo.aspnet_Users.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_Roles.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_Applications.LoweredApplicationName = @LoweredApplicationName + AND dbo.aspnet_Users.LoweredUserName = @LoweredUserName + AND dbo.aspnet_Roles.LoweredRoleName = @LoweredRoleName +"; + command.Connection = connection; + command.CommandType = CommandType.Text; + AddParameter (command, "LoweredRoleName", loweredRoleName); + AddParameter (command, "LoweredUserName", loweredUserName); + AddParameter (command, "LoweredApplicationName", loweredApplicationName); + + if (command.ExecuteNonQuery() != 1) + throw new ProviderException ("failed to create new user/role association."); + } + } + + trans.Commit (); + } + catch (Exception e) { + trans.Rollback (); + if (e is ProviderException) + throw e; + else + throw new ProviderException ("", e); + } + finally { + if (closed) + connection.Close (); + } } - [MonoTODO] public override void CreateRole (string rolename) { - throw new NotImplementedException (); + string commandText = @" +INSERT INTO dbo.aspnet_Roles + (ApplicationId, RoleName, LoweredRoleName) + VALUES ((SELECT ApplicationId FROM dbo.aspnet_Applications WHERE LoweredApplicationName = @LoweredApplicationName), @RoleName, @LoweredRoleName) +"; + if (rolename == null) + throw new ArgumentNullException ("rolename"); + + if (rolename.Length == 0 || rolename.Length > 256 || rolename.IndexOf (",") != -1) + throw new ArgumentException ("rolename is in invalid format"); + + InitConnection(); + bool closed = connection.State == ConnectionState.Closed; + if (closed) + connection.Open(); + + string loweredRoleName = rolename.ToLower (); + + DbCommand command = factory.CreateCommand (); + command.CommandText = commandText; + command.Connection = connection; + command.CommandType = CommandType.Text; + AddParameter (command, "LoweredApplicationName", loweredApplicationName); + AddParameter (command, "RoleName", rolename); + AddParameter (command, "LoweredRoleName", loweredRoleName); + + if (command.ExecuteNonQuery() != 1) + throw new ProviderException ("failed to create new role."); + + if (closed) + connection.Close (); } - [MonoTODO] public override bool DeleteRole (string rolename, bool throwOnPopulatedRole) { - throw new NotImplementedException (); + if (rolename == null) + throw new ArgumentNullException ("rolename"); + + if (rolename.Length == 0 || rolename.Length > 256 || rolename.IndexOf (",") != -1) + throw new ArgumentException ("rolename is in invalid format"); + + InitConnection(); + bool closed = connection.State == ConnectionState.Closed; + if (closed) + connection.Open(); + + string loweredRoleName = rolename.ToLower (); + + DbCommand command; + if (throwOnPopulatedRole) { + command = factory.CreateCommand (); + command.CommandText = @" +SELECT COUNT(*) + FROM dbo.aspnet_UsersInRoles, dbo.aspnet_Roles, dbo.aspnet_Users, dbo.aspnet_Applications + WHERE dbo.aspnet_Roles.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_UsersInRoles.RoleId = dbo.aspnet_Roles.RoleId + AND dbo.aspnet_Applications.LoweredApplicationName = @LoweredApplicationName + AND dbo.aspnet_Roles.LoweredRoleName = @LoweredRoleName"; + command.Connection = connection; + command.CommandType = CommandType.Text; + AddParameter (command, "LoweredApplicationName", loweredApplicationName); + AddParameter (command, "LoweredRoleName", loweredRoleName); + + int count = (int)command.ExecuteScalar (); + if (count != 0) + throw new ProviderException (String.Format ("The role '{0}' has users in it and can't be deleted", rolename)); + } + else { + command = factory.CreateCommand (); + command.CommandText = @" +DELETE dbo.aspnet_UsersInRoles FROM dbo.aspnet_UsersInRoles, dbo.aspnet_Roles, dbo.aspnet_Applications + WHERE dbo.aspnet_UsersInRoles.RoleId = dbo.aspnet_Roles.RoleId + AND dbo.aspnet_Roles.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_Roles.LoweredRoleName = @LoweredRoleName + AND dbo.aspnet_Applications.LoweredApplicationName = @LoweredApplicationName"; + command.Connection = connection; + command.CommandType = CommandType.Text; + AddParameter (command, "LoweredRoleName", loweredRoleName); + AddParameter (command, "LoweredApplicationName", loweredApplicationName); + + command.ExecuteNonQuery (); + } + + command = factory.CreateCommand (); + command.CommandText = @" +DELETE dbo.aspnet_Roles FROM dbo.aspnet_Roles, dbo.aspnet_Applications + WHERE dbo.aspnet_Roles.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_Applications.LoweredApplicationName = @LoweredApplicationName + AND dbo.aspnet_Roles.LoweredRoleName = @LoweredRoleName"; + command.Connection = connection; + command.CommandType = CommandType.Text; + AddParameter (command, "LoweredApplicationName", loweredApplicationName); + AddParameter (command, "LoweredRoleName", loweredRoleName); + + bool rv = command.ExecuteNonQuery() == 1; + + if (closed) + connection.Close (); + + return rv; } - [MonoTODO] public override string[] FindUsersInRole (string roleName, string usernameToMatch) { - throw new NotImplementedException (); + string commandTextFormat = @" +SELECT dbo.aspnet_Users.UserName + FROM dbo.aspnet_Users, dbo.aspnet_Roles, dbo.aspnet_UsersInRoles, dbo.aspnet_Applications + WHERE dbo.aspnet_Roles.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_Users.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_UsersInRoles.UserId = dbo.aspnet_Users.UserId + AND dbo.aspnet_UsersInRoles.RoleId = dbo.aspnet_Roles.RoleId + AND dbo.aspnet_Roles.LoweredRoleName = @LoweredRoleName + AND dbo.aspnet_Applications.LoweredApplicationName = @LoweredApplicationName + AND dbo.aspnet_Users.UserName {0} @UsernameToMatch +"; + if (roleName == null) + throw new ArgumentNullException ("roleName"); + if (usernameToMatch == null) + throw new ArgumentNullException ("usernameToMatch"); + + if (roleName.Length == 0 || roleName.Length > 256 || roleName.IndexOf (",") != -1) + throw new ArgumentException ("roleName is in invalid format"); + if (usernameToMatch.Length == 0 || usernameToMatch.Length > 256) + throw new ArgumentException ("usernameToMatch is in invalid format"); + + InitConnection(); + + bool useLike = usernameToMatch.IndexOf ("%") != -1; + DbCommand command = factory.CreateCommand (); + command.CommandText = String.Format(commandTextFormat, useLike ? "LIKE" : "="); + command.Connection = connection; + command.CommandType = CommandType.Text; + AddParameter (command, "LoweredApplicationName", loweredApplicationName); + AddParameter (command, "LoweredRoleName", roleName.ToLower()); + AddParameter (command, "UsernameToMatch", usernameToMatch); + + DbDataReader reader = command.ExecuteReader (); + ArrayList userList = new ArrayList(); + while (reader.Read()) + userList.Add (reader.GetString(0)); + reader.Close(); + + return (string[])userList.ToArray(typeof (string)); } - - [MonoTODO] + public override string [] GetAllRoles () { - throw new NotImplementedException (); + string commandText = @" +SELECT aspnet_Roles.RoleName + FROM aspnet_Roles, aspnet_Applications + WHERE aspnet_Roles.ApplicationId = aspnet_Applications.ApplicationId + AND aspnet_Applications.LoweredApplicationName = @LoweredApplicationName +"; + InitConnection(); + bool closed = connection.State == ConnectionState.Closed; + if (closed) + connection.Open(); + + DbCommand command = factory.CreateCommand (); + command.CommandText = commandText; + command.Connection = connection; + command.CommandType = CommandType.Text; + AddParameter (command, "LoweredApplicationName", loweredApplicationName); + + DbDataReader reader = command.ExecuteReader (); + ArrayList roleList = new ArrayList(); + while (reader.Read()) + roleList.Add (reader.GetString(0)); + reader.Close(); + + if (closed) + connection.Close (); + + return (string[])roleList.ToArray(typeof (string)); } - [MonoTODO] public override string [] GetRolesForUser (string username) { - throw new NotImplementedException (); + string commandText = @" +SELECT dbo.aspnet_Roles.RoleName + FROM dbo.aspnet_Roles, dbo.aspnet_UsersInRoles, dbo.aspnet_Users, dbo.aspnet_Applications +WHERE dbo.aspnet_Roles.RoleId = dbo.aspnet_UsersInRoles.RoleId + AND dbo.aspnet_Roles.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_UsersInRoles.UserId = dbo.aspnet_Users.UserId + AND dbo.aspnet_Users.LoweredUserName = @LoweredUserName + AND dbo.aspnet_Users.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_Applications.LoweredApplicationName = @LoweredApplicationName +"; + + InitConnection(); + bool closed = connection.State == ConnectionState.Closed; + if (closed) + connection.Open(); + + DbCommand command = factory.CreateCommand (); + command.CommandText = commandText; + command.Connection = connection; + command.CommandType = CommandType.Text; + AddParameter (command, "LoweredUserName", username.ToLower()); + AddParameter (command, "LoweredApplicationName", loweredApplicationName); + + DbDataReader reader = command.ExecuteReader (); + ArrayList roleList = new ArrayList(); + while (reader.Read()) + roleList.Add (reader.GetString(0)); + reader.Close(); + + if (closed) + connection.Close (); + + return (string[])roleList.ToArray(typeof (string)); } - [MonoTODO] public override string [] GetUsersInRole (string rolename) { - throw new NotImplementedException (); + string commandText = @" +SELECT dbo.aspnet_Users.UserName + FROM dbo.aspnet_Roles, dbo.aspnet_UsersInRoles, dbo.aspnet_Users, dbo.aspnet_Applications +WHERE dbo.aspnet_Roles.RoleId = dbo.aspnet_UsersInRoles.RoleId + AND dbo.aspnet_Roles.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_UsersInRoles.UserId = dbo.aspnet_Users.UserId + AND dbo.aspnet_Roles.LoweredRoleName = @LoweredRoleName + AND dbo.aspnet_Users.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_Applications.LoweredApplicationName = @LoweredApplicationName +"; + + InitConnection(); + bool closed = connection.State == ConnectionState.Closed; + if (closed) + connection.Open(); + + DbCommand command = factory.CreateCommand (); + command.CommandText = commandText; + command.Connection = connection; + command.CommandType = CommandType.Text; + AddParameter (command, "LoweredRoleName", rolename.ToLower()); + AddParameter (command, "LoweredApplicationName", loweredApplicationName); + + DbDataReader reader = command.ExecuteReader (); + ArrayList userList = new ArrayList(); + while (reader.Read()) + userList.Add (reader.GetString(0)); + reader.Close(); + + if (closed) + connection.Close (); + + return (string[])userList.ToArray(typeof (string)); } [MonoTODO] public override void Initialize (string name, NameValueCollection config) { - throw new NotImplementedException (); + if (config == null) + throw new ArgumentNullException ("config"); + + base.Initialize (name, config); + +#if false + ApplicationName = config["applicationName"]; +#else + ApplicationName = "/"; +#endif + string connectionStringName = config["connectionStringName"]; + string commandTimeout = config["commandTimeout"]; + + if (applicationName.Length > 256) + throw new ProviderException ("The ApplicationName attribute must be 256 characters long or less."); + if (connectionStringName == null || connectionStringName.Length == 0) + throw new ProviderException ("The ConnectionStringName attribute must be present and non-zero length."); + + // XXX check connectionStringName and commandTimeout + + connectionString = WebConfigurationManager.ConnectionStrings[connectionStringName]; } - [MonoTODO] public override bool IsUserInRole (string username, string rolename) { - throw new NotImplementedException (); + string commandText = @" +SELECT COUNT(*) + FROM dbo.aspnet_Users, dbo.aspnet_UsersInRoles, dbo.aspnet_Roles, dbo.aspnet_Applications + WHERE dbo.aspnet_Roles.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_Users.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_UsersInRoles.RoleId = dbo.aspnet_Roles.RoleId + AND dbo.aspnet_UsersInRoles.UserId = dbo.aspnet_Users.UserId + AND dbo.aspnet_Applications.LoweredApplicationName = @LoweredApplicationName + AND dbo.aspnet_Roles.LoweredRoleName = @LoweredRoleName + AND dbo.aspnet_Users.LoweredUserName = @LoweredUserName +"; + + InitConnection(); + bool closed = connection.State == ConnectionState.Closed; + if (closed) + connection.Open(); + + DbCommand command = factory.CreateCommand (); + command.CommandText = commandText; + command.Connection = connection; + command.CommandType = CommandType.Text; + AddParameter (command, "LoweredRoleName", rolename.ToLower()); + AddParameter (command, "LoweredUserName", username.ToLower()); + AddParameter (command, "LoweredApplicationName", loweredApplicationName); + + bool rv = ((int)command.ExecuteScalar ()) != 0; + + if (closed) + connection.Close (); + + return rv; } - [MonoTODO] public override void RemoveUsersFromRoles (string [] usernames, string [] rolenames) { - throw new NotImplementedException (); + Hashtable h; + + h = new Hashtable(); + foreach (string u in usernames) { + if (u == null) + throw new ArgumentNullException ("null element in usernames array"); + if (h.ContainsKey (u)) + throw new ArgumentException ("duplicate element in usernames array"); + if (u.Length == 0 || u.Length > 256 || u.IndexOf (",") != -1) + throw new ArgumentException ("element in usernames array in illegal format"); + h.Add (u, u); + } + + h = new Hashtable(); + foreach (string r in usernames) { + if (r == null) + throw new ArgumentNullException ("null element in usernames array"); + if (h.ContainsKey (r)) + throw new ArgumentException ("duplicate element in usernames array"); + if (r.Length == 0 || r.Length > 256 || r.IndexOf (",") != -1) + throw new ArgumentException ("element in usernames array in illegal format"); + h.Add (r, r); + } + + InitConnection(); + + bool closed = connection.State == ConnectionState.Closed; + if (closed) + connection.Open(); + + DbTransaction trans = connection.BeginTransaction (); + + try { + foreach (string username in usernames) { + string loweredUserName = username.ToLower(); + + foreach (string rolename in rolenames) { + string loweredRoleName = rolename.ToLower(); + + DbCommand command = factory.CreateCommand (); + command.Transaction = trans; + command.CommandText = @" +DELETE dbo.aspnet_UsersInRoles + FROM dbo.aspnet_UsersInRoles, dbo.aspnet_Users, dbo.aspnet_Roles, dbo.aspnet_Applications + WHERE dbo.aspnet_UsersInRoles.UserId = dbo.aspnet_Users.UserId + AND dbo.aspnet_UsersInRoles.RoleId = dbo.aspnet_Roles.RoleId + AND dbo.aspnet_Roles.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_Users.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_Users.LoweredUserName = @LoweredUserName + AND dbo.aspnet_Roles.LoweredRoleName = @LoweredRoleName + AND dbo.aspnet_Applications.LoweredApplicationName = @LoweredApplicationName"; + + command.Connection = connection; + command.CommandType = CommandType.Text; + AddParameter (command, "LoweredUserName", loweredUserName); + AddParameter (command, "LoweredRoleName", loweredRoleName); + AddParameter (command, "LoweredApplicationName", loweredApplicationName); + + if (command.ExecuteNonQuery() != 1) + throw new ProviderException (String.Format ("failed to remove users from role '{0}'.", rolename)); + } + } + + trans.Commit (); + } + catch (Exception e) { + trans.Rollback (); + if (e is ProviderException) + throw e; + else + throw new ProviderException ("", e); + } + finally { + if (closed) + connection.Close (); + } } - [MonoTODO] public override bool RoleExists (string rolename) { - throw new NotImplementedException (); + string commandText = @" +SELECT COUNT(*) + FROM dbo.aspnet_Roles, dbo.aspnet_Applications + WHERE dbo.aspnet_Roles.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_Applications.LoweredApplicationName = @LoweredApplicationName + AND dbo.aspnet_Roles.LoweredRoleName = @LoweredRoleName +"; + + InitConnection(); + bool closed = connection.State == ConnectionState.Closed; + if (closed) + connection.Open(); + + DbCommand command = factory.CreateCommand (); + command.CommandText = commandText; + command.Connection = connection; + command.CommandType = CommandType.Text; + AddParameter (command, "LoweredApplicationName", loweredApplicationName); + AddParameter (command, "LoweredRoleName", rolename.ToLower()); + + bool rv = ((int)command.ExecuteScalar ()) != 0; + + if (closed) + connection.Close (); + + return rv; } [MonoTODO] public override string ApplicationName { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } + get { return applicationName; } + set { + applicationName = value; + loweredApplicationName = applicationName.ToLower(); + } } } } From b457248728cd2547194e42a151369e471a03e56d Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Thu, 23 Mar 2006 21:50:38 +0000 Subject: [PATCH 096/117] move some sql text to the start of the methods, and add a MonoTODO to DeleteRole svn path=/trunk/mcs/; revision=58391 --- .../System.Web.Security/SqlRoleProvider.cs | 55 ++++++++++--------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/mcs/class/System.Web/System.Web.Security/SqlRoleProvider.cs b/mcs/class/System.Web/System.Web.Security/SqlRoleProvider.cs index e8dc87512dc1f..a9587af446fb7 100644 --- a/mcs/class/System.Web/System.Web.Security/SqlRoleProvider.cs +++ b/mcs/class/System.Web/System.Web.Security/SqlRoleProvider.cs @@ -72,6 +72,17 @@ void AddParameter (DbCommand command, string parameterName, string parameterValu public override void AddUsersToRoles (string [] usernames, string [] rolenames) { + string commandText = @" +INSERT INTO dbo.aspnet_UsersInRoles (UserId, RoleId) + SELECT dbo.aspnet_Users.UserId, dbo.aspnet_Roles.RoleId + FROM dbo.aspnet_Users, dbo.aspnet_Roles, dbo.aspnet_Applications + WHERE dbo.aspnet_Users.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_Roles.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_Applications.LoweredApplicationName = @LoweredApplicationName + AND dbo.aspnet_Users.LoweredUserName = @LoweredUserName + AND dbo.aspnet_Roles.LoweredRoleName = @LoweredRoleName +"; + Hashtable h; h = new Hashtable(); @@ -114,16 +125,7 @@ public override void AddUsersToRoles (string [] usernames, string [] rolenames) /* add the user/role combination to dbo.aspnet_UsersInRoles */ DbCommand command = factory.CreateCommand (); command.Transaction = trans; - command.CommandText = @" -INSERT INTO dbo.aspnet_UsersInRoles (UserId, RoleId) - SELECT dbo.aspnet_Users.UserId, dbo.aspnet_Roles.RoleId - FROM dbo.aspnet_Users, dbo.aspnet_Roles, dbo.aspnet_Applications - WHERE dbo.aspnet_Users.ApplicationId = dbo.aspnet_Applications.ApplicationId - AND dbo.aspnet_Roles.ApplicationId = dbo.aspnet_Applications.ApplicationId - AND dbo.aspnet_Applications.LoweredApplicationName = @LoweredApplicationName - AND dbo.aspnet_Users.LoweredUserName = @LoweredUserName - AND dbo.aspnet_Roles.LoweredRoleName = @LoweredRoleName -"; + command.CommandText = commandText; command.Connection = connection; command.CommandType = CommandType.Text; AddParameter (command, "LoweredRoleName", loweredRoleName); @@ -185,6 +187,7 @@ public override void CreateRole (string rolename) connection.Close (); } + [MonoTODO] public override bool DeleteRole (string rolename, bool throwOnPopulatedRole) { if (rolename == null) @@ -220,6 +223,7 @@ SELECT COUNT(*) throw new ProviderException (String.Format ("The role '{0}' has users in it and can't be deleted", rolename)); } else { + /* XXX are we really supposed to delete all the user/role associations in this case? */ command = factory.CreateCommand (); command.CommandText = @" DELETE dbo.aspnet_UsersInRoles FROM dbo.aspnet_UsersInRoles, dbo.aspnet_Roles, dbo.aspnet_Applications @@ -300,10 +304,10 @@ SELECT dbo.aspnet_Users.UserName public override string [] GetAllRoles () { string commandText = @" -SELECT aspnet_Roles.RoleName - FROM aspnet_Roles, aspnet_Applications - WHERE aspnet_Roles.ApplicationId = aspnet_Applications.ApplicationId - AND aspnet_Applications.LoweredApplicationName = @LoweredApplicationName +SELECT dbo.aspnet_Roles.RoleName + FROM dbo.aspnet_Roles, dbo.aspnet_Applications + WHERE dbo.aspnet_Roles.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_Applications.LoweredApplicationName = @LoweredApplicationName "; InitConnection(); bool closed = connection.State == ConnectionState.Closed; @@ -465,6 +469,17 @@ SELECT COUNT(*) public override void RemoveUsersFromRoles (string [] usernames, string [] rolenames) { + string commandText = @" +DELETE dbo.aspnet_UsersInRoles + FROM dbo.aspnet_UsersInRoles, dbo.aspnet_Users, dbo.aspnet_Roles, dbo.aspnet_Applications + WHERE dbo.aspnet_UsersInRoles.UserId = dbo.aspnet_Users.UserId + AND dbo.aspnet_UsersInRoles.RoleId = dbo.aspnet_Roles.RoleId + AND dbo.aspnet_Roles.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_Users.ApplicationId = dbo.aspnet_Applications.ApplicationId + AND dbo.aspnet_Users.LoweredUserName = @LoweredUserName + AND dbo.aspnet_Roles.LoweredRoleName = @LoweredRoleName + AND dbo.aspnet_Applications.LoweredApplicationName = @LoweredApplicationName"; + Hashtable h; h = new Hashtable(); @@ -506,17 +521,7 @@ public override void RemoveUsersFromRoles (string [] usernames, string [] rolena DbCommand command = factory.CreateCommand (); command.Transaction = trans; - command.CommandText = @" -DELETE dbo.aspnet_UsersInRoles - FROM dbo.aspnet_UsersInRoles, dbo.aspnet_Users, dbo.aspnet_Roles, dbo.aspnet_Applications - WHERE dbo.aspnet_UsersInRoles.UserId = dbo.aspnet_Users.UserId - AND dbo.aspnet_UsersInRoles.RoleId = dbo.aspnet_Roles.RoleId - AND dbo.aspnet_Roles.ApplicationId = dbo.aspnet_Applications.ApplicationId - AND dbo.aspnet_Users.ApplicationId = dbo.aspnet_Applications.ApplicationId - AND dbo.aspnet_Users.LoweredUserName = @LoweredUserName - AND dbo.aspnet_Roles.LoweredRoleName = @LoweredRoleName - AND dbo.aspnet_Applications.LoweredApplicationName = @LoweredApplicationName"; - + command.CommandText = commandText; command.Connection = connection; command.CommandType = CommandType.Text; AddParameter (command, "LoweredUserName", loweredUserName); From c6ab8d6e169456f24e08f5e1aba3a59053a49050 Mon Sep 17 00:00:00 2001 From: Gonzalo Paniagua Javier Date: Thu, 23 Mar 2006 22:08:48 +0000 Subject: [PATCH 097/117] 2006-03-23 Gonzalo Paniagua Javier * SimpleWorkerRequestTest.cs: new tests for PathInfo and disabled a test that throws a nullref under MS. * ApplicationHostTest.cs: fixed 2 assertions to expect what MS does. svn path=/trunk/mcs/; revision=58393 --- .../System.Web.Hosting/ApplicationHostTest.cs | 5 +++-- .../Test/System.Web.Hosting/ChangeLog | 7 +++++++ .../SimpleWorkerRequestTest.cs | 20 ++++++++++++++++--- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/mcs/class/System.Web/Test/System.Web.Hosting/ApplicationHostTest.cs b/mcs/class/System.Web/Test/System.Web.Hosting/ApplicationHostTest.cs index de97fbaba9017..ab35353bd2cec 100644 --- a/mcs/class/System.Web/Test/System.Web.Hosting/ApplicationHostTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Hosting/ApplicationHostTest.cs @@ -170,11 +170,12 @@ public void ConstructorTest () Assert.AreEqual (null, setup.LicenseFile, "D8"); //Assert.AreEqual (LoaderOptimization.NotSpecified, setup.LoaderOptimization); p ("LoaderOptimization is: ", setup.LoaderOptimization); - Assert.AreEqual ("bin", setup.PrivateBinPath, "D9"); + string expected = Path.Combine (Environment.CurrentDirectory, "bin"); + Assert.AreEqual (expected, setup.PrivateBinPath, "D9"); Assert.AreEqual (setup.PrivateBinPathProbe, "*", "D10"); p ("ShadowCopyDirs: ", setup.ShadowCopyDirectories); Assert.AreEqual (true, setup.ShadowCopyDirectories.EndsWith ("bin"), "D11"); - Assert.AreEqual (true, setup.ShadowCopyDirectories.StartsWith ("file:"), "D12"); + Assert.AreEqual (false, setup.ShadowCopyDirectories.StartsWith ("file:"), "D12"); Assert.AreEqual ("true", setup.ShadowCopyFiles, "D13"); p ("ApsInstal", HttpRuntime.AspInstallDirectory); diff --git a/mcs/class/System.Web/Test/System.Web.Hosting/ChangeLog b/mcs/class/System.Web/Test/System.Web.Hosting/ChangeLog index d638509df8b02..a5d1a6995b9ff 100644 --- a/mcs/class/System.Web/Test/System.Web.Hosting/ChangeLog +++ b/mcs/class/System.Web/Test/System.Web.Hosting/ChangeLog @@ -1,3 +1,10 @@ +2006-03-23 Gonzalo Paniagua Javier + + * SimpleWorkerRequestTest.cs: new tests for PathInfo and disabled a test + that throws a nullref under MS. + + * ApplicationHostTest.cs: fixed 2 assertions to expect what MS does. + 2006-02-02 Gonzalo Paniagua Javier * HostingEnvironmentTest.cs: tests for MapPath. diff --git a/mcs/class/System.Web/Test/System.Web.Hosting/SimpleWorkerRequestTest.cs b/mcs/class/System.Web/Test/System.Web.Hosting/SimpleWorkerRequestTest.cs index 17a32d5dd0173..ad9c809b12d36 100644 --- a/mcs/class/System.Web/Test/System.Web.Hosting/SimpleWorkerRequestTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Hosting/SimpleWorkerRequestTest.cs @@ -207,8 +207,10 @@ public void Demo () // \windows\microsoft.net\framework\v1.1.4322 // Assert.AreEqual (true, swr.MachineInstallDirectory != null, "T15"); - - Assert.AreEqual (Path.Combine (cwd, "file.aspx"), swr.GetFilePathTranslated (), "T16"); + + // Disabled T16. It throws a nullref on MS + // Assert.AreEqual (Path.Combine (cwd, "file.aspx"), swr.GetFilePathTranslated (), "T16"); + // Assert.AreEqual ("", swr.GetServerVariable ("AUTH_TYPE"), "T18"); Assert.AreEqual ("", swr.GetServerVariable ("AUTH_USER"), "T19"); Assert.AreEqual ("", swr.GetServerVariable ("REMOTE_USER"), "T20"); @@ -313,12 +315,24 @@ public void AppDomain_MapPath4 () // This tests the constructor when the target application domain is created with // CreateApplicationHost // - [Test] public void ConstructorTest_CreateApplicationHost () + [Test] + public void ConstructorTest_CreateApplicationHost () { // Does not work without a NRE, need to call CreateApplicationHost. // = new SimpleWorkerRequest ("pageVirtualPath", "querystring", sw); // Assert.AreEqual ("querystring", swr.GetQueryString ()); } + + [Test] + public void PathInfos () + { + SimpleWorkerRequest wr = new SimpleWorkerRequest ("/appDir", "", "page.aspx/pathinfo", "", null); + HttpContext c = new HttpContext (wr); + Assert.AreEqual ("http://127.0.0.1/appDir/page.aspx/pathinfo", c.Request.Url.AbsoluteUri); + Assert.AreEqual ("/appDir/page.aspx", c.Request.FilePath); + Assert.AreEqual ("/appDir/page.aspx/pathinfo", c.Request.Path); + Assert.AreEqual ("/pathinfo", c.Request.PathInfo); + } } } From 8cac82405054b1bf051ca42553842ef176e2385d Mon Sep 17 00:00:00 2001 From: Gonzalo Paniagua Javier Date: Thu, 23 Mar 2006 22:09:40 +0000 Subject: [PATCH 098/117] 2006-03-23 Gonzalo Paniagua Javier * HttpResponseTest.cs: added tests for CacheControl that set it to null and string.Empty. svn path=/trunk/mcs/; revision=58394 --- mcs/class/System.Web/Test/System.Web/ChangeLog | 5 +++++ mcs/class/System.Web/Test/System.Web/HttpResponseTest.cs | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/mcs/class/System.Web/Test/System.Web/ChangeLog b/mcs/class/System.Web/Test/System.Web/ChangeLog index 207e2ebabbd8b..6f8133c618153 100644 --- a/mcs/class/System.Web/Test/System.Web/ChangeLog +++ b/mcs/class/System.Web/Test/System.Web/ChangeLog @@ -1,3 +1,8 @@ +2006-03-23 Gonzalo Paniagua Javier + + * HttpResponseTest.cs: added tests for CacheControl that set it to null + and string.Empty. + 2006-03-10 Chris Toshok * StaticSiteMapProviderTest.cs: new tests. diff --git a/mcs/class/System.Web/Test/System.Web/HttpResponseTest.cs b/mcs/class/System.Web/Test/System.Web/HttpResponseTest.cs index 153e821e16ec7..bba378d1fe1c9 100644 --- a/mcs/class/System.Web/Test/System.Web/HttpResponseTest.cs +++ b/mcs/class/System.Web/Test/System.Web/HttpResponseTest.cs @@ -337,6 +337,12 @@ public void CacheControl () c.Response.CacheControl = "no-cache"; Assert.AreEqual ("no-cache", c.Response.CacheControl, "D4"); + + c.Response.CacheControl = null; + Assert.AreEqual ("private", c.Response.CacheControl, "D5"); + + c.Response.CacheControl = ""; + Assert.AreEqual ("private", c.Response.CacheControl, "D6"); } //[Test][ExpectedException (typeof (HttpException))] From 213a3e34f896341be6efce7a1e3f6d59acc87ad0 Mon Sep 17 00:00:00 2001 From: Gonzalo Paniagua Javier Date: Thu, 23 Mar 2006 22:17:26 +0000 Subject: [PATCH 099/117] 2006-03-23 Gonzalo Paniagua Javier * SimpleWorkerRequest.cs: use UrlUtils instead of Path. Several fixes to make PathInfo + SimpleWorkerRequest work as in MS. svn path=/trunk/mcs/; revision=58395 --- .../System.Web/System.Web.Hosting/ChangeLog | 5 ++ .../System.Web.Hosting/SimpleWorkerRequest.cs | 48 ++++++++++++------- 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/mcs/class/System.Web/System.Web.Hosting/ChangeLog b/mcs/class/System.Web/System.Web.Hosting/ChangeLog index 11c6c52a9c57e..87b77dc787cf0 100644 --- a/mcs/class/System.Web/System.Web.Hosting/ChangeLog +++ b/mcs/class/System.Web/System.Web.Hosting/ChangeLog @@ -1,3 +1,8 @@ +2006-03-23 Gonzalo Paniagua Javier + + * SimpleWorkerRequest.cs: use UrlUtils instead of Path. Several fixes + to make PathInfo + SimpleWorkerRequest work as in MS. + 2006-03-15 Vladimir Krasnov * ServletWorkerRequest.jvm.cs: fixed ctor, UrlDecode applied on diff --git a/mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs b/mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs index 6d91f9d633e7f..dc3c61107719d 100644 --- a/mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs +++ b/mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs @@ -3,10 +3,11 @@ // // Author: // Miguel de Icaza (miguel@novell.com) +// Gonzalo Paniagua Javier (gonzalo@novell.com) // // -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) +// Copyright (C) 2005,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 @@ -71,6 +72,7 @@ public SimpleWorkerRequest (string page, string query, TextWriter output) app_virtual_dir = HttpRuntime.AppDomainAppVirtualPath; app_physical_dir = HttpRuntime.AppDomainAppPath; hosted = true; + InitializePaths (); } // @@ -86,9 +88,20 @@ public SimpleWorkerRequest (string appVirtualDir, string appPhysicalDir, string this.output = output; app_virtual_dir = appVirtualDir; app_physical_dir = appPhysicalDir; + InitializePaths (); } - - + + void InitializePaths () + { + int idx = page.IndexOf ('/'); + if (idx >= 0) { + path_info = page.Substring (idx); + page = page.Substring (0, idx); + } else { + path_info = ""; + } + } + public override string MachineConfigPath { get { if (hosted) { @@ -143,7 +156,11 @@ public override string GetAppPathTranslated () public override string GetFilePath () { - return Path.Combine (app_virtual_dir, page); + string result = UrlUtils.Combine (app_virtual_dir, page); + if (result == "") + return app_virtual_dir == "/" ? app_virtual_dir : app_virtual_dir + "/"; + + return result; } public override string GetFilePathTranslated () @@ -155,7 +172,7 @@ public override string GetFilePathTranslated () else local_page = page; - string path = Path.Combine (app_physical_dir, local_page); + string path = UrlUtils.Combine (app_physical_dir, local_page); if (SecurityManager.SecurityEnabled && (path != null) && (path.Length > 0)) { new FileIOPermission (FileIOPermissionAccess.PathDiscovery, path).Demand (); } @@ -184,14 +201,6 @@ public override int GetLocalPort () public override string GetPathInfo () { - if (path_info == null) { - int idx = page.IndexOf ('/'); - if (idx >= 0) { - path_info = page.Substring (idx); - } else { - path_info = ""; - } - } return path_info; } @@ -204,8 +213,12 @@ public override string GetRawUrl () { if (raw_url == null){ string q = ((query == null || query == "") ? "" : "?" + query); - - raw_url = Path.Combine (app_virtual_dir, page) + q; + raw_url = UrlUtils.Combine (app_virtual_dir, page); + if (path_info != "") { + raw_url += "/" + path_info + q; + } else { + raw_url += q; + } } return raw_url; } @@ -228,8 +241,9 @@ public override string GetServerVariable (string name) public override string GetUriPath () { if (app_virtual_dir == "/") - return app_virtual_dir + page; - return app_virtual_dir + "/" + page; + return app_virtual_dir + page + path_info; + + return app_virtual_dir + "/" + page + path_info; } public override IntPtr GetUserToken () From cb7b13a99177d776bf1736c9ed7ad34c77a629e3 Mon Sep 17 00:00:00 2001 From: Gonzalo Paniagua Javier Date: Thu, 23 Mar 2006 22:20:26 +0000 Subject: [PATCH 100/117] 2006-03-23 Gonzalo Paniagua Javier * HttpResponse.cs: more fixes for CacheControl: MS allows to set it to null and "" and the getter value does not completely depend on Cache. * HttpRequest.cs: fail validating the request input if there's a control character after a '<'. Fixes XSS_Null test. All System.Web tests pass again. svn path=/trunk/mcs/; revision=58396 --- mcs/class/System.Web/System.Web/ChangeLog | 9 +++++ .../System.Web/System.Web/HttpRequest.cs | 3 +- .../System.Web/System.Web/HttpResponse.cs | 35 +++++++------------ 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/mcs/class/System.Web/System.Web/ChangeLog b/mcs/class/System.Web/System.Web/ChangeLog index b411f50c16c31..9118bd3fdc5f2 100644 --- a/mcs/class/System.Web/System.Web/ChangeLog +++ b/mcs/class/System.Web/System.Web/ChangeLog @@ -1,3 +1,12 @@ +2006-03-23 Gonzalo Paniagua Javier + + * HttpResponse.cs: more fixes for CacheControl: MS allows to set it to + null and "" and the getter value does not completely depend on Cache. + + * HttpRequest.cs: fail validating the request input if there's a control + character after a '<'. Fixes XSS_Null test. + + All System.Web tests pass again. 2006-03-22 Robert Jordan * HttpCachePolicy.cs: fix the Cache-control header. Fixes bug #77826. diff --git a/mcs/class/System.Web/System.Web/HttpRequest.cs b/mcs/class/System.Web/System.Web/HttpRequest.cs index 7c909826247eb..5a495ca999f95 100644 --- a/mcs/class/System.Web/System.Web/HttpRequest.cs +++ b/mcs/class/System.Web/System.Web/HttpRequest.cs @@ -1034,7 +1034,6 @@ internal void ReleaseResources () if (cached_url == null) { UriBuilder builder = new UriBuilder (uri_builder.Uri); - builder.Path += path_info; cached_url = builder.Uri; } return cached_url; @@ -1386,7 +1385,7 @@ static bool CheckString (string val) for (int idx = 1; idx < len; idx++) { char next = val [idx]; if (current == '<' || current == '\xff1c') { - if (next == '!' + if (next == '!' || next < ' ' || (next >= 'a' && next <= 'z') || (next >= 'A' && next <= 'Z')) return true; diff --git a/mcs/class/System.Web/System.Web/HttpResponse.cs b/mcs/class/System.Web/System.Web/HttpResponse.cs index bea5e09f0e47d..84e6b85291db9 100644 --- a/mcs/class/System.Web/System.Web/HttpResponse.cs +++ b/mcs/class/System.Web/System.Web/HttpResponse.cs @@ -61,7 +61,7 @@ public sealed class HttpResponse { string charset; bool charset_set; CachedRawResponse cached_response; - string user_cache_control; + string user_cache_control = "private"; string redirect_location; // @@ -610,8 +610,6 @@ void AddHeadersNoCache (ArrayList write_headers, bool final_flush) // if (cache_policy != null) cache_policy.SetHeaders (this, headers); - else if (user_cache_control != null) - write_headers.Add (new UnknownResponseHeader ("Cache-Control", user_cache_control)); else write_headers.Add (new UnknownResponseHeader ("Cache-Control", CacheControl)); @@ -961,34 +959,25 @@ internal CachedRawResponse GetCachedResponse () // public string CacheControl { set { - if (String.Compare (value, "public", true, CultureInfo.InvariantCulture) == 0) + if (value == null || value == "") { + Cache.SetCacheability (HttpCacheability.NoCache); + user_cache_control = null; + } else if (String.Compare (value, "public", true, CultureInfo.InvariantCulture) == 0) { Cache.SetCacheability (HttpCacheability.Public); - else if (String.Compare (value, "private", true, CultureInfo.InvariantCulture) == 0) + user_cache_control = "public"; + } else if (String.Compare (value, "private", true, CultureInfo.InvariantCulture) == 0) { Cache.SetCacheability (HttpCacheability.Private); - else if (String.Compare (value, "no-cache", true, CultureInfo.InvariantCulture) == 0) + user_cache_control = "private"; + } else if (String.Compare (value, "no-cache", true, CultureInfo.InvariantCulture) == 0) { Cache.SetCacheability (HttpCacheability.NoCache); - else + user_cache_control = "no-cache"; + } else throw new ArgumentException ("CacheControl property only allows `public', " + "`private' or no-cache, for different uses, use " + "Response.AppendHeader"); - user_cache_control = null; } - get { - switch (Cache.Cacheability) { - case (HttpCacheability)0: - case HttpCacheability.NoCache: - return "no-cache"; - case HttpCacheability.Private: - case HttpCacheability.Server: - case HttpCacheability.ServerAndPrivate: - return "private"; - case HttpCacheability.Public: - return "public"; - default: - throw new Exception ("Unknown internal state: " + Cache.Cacheability); - } - } + get { return (user_cache_control != null) ? user_cache_control : "private"; } } #endregion From 23c6a85f5263a5126c001b6fff03ba0fc77be908 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Thu, 23 Mar 2006 22:25:09 +0000 Subject: [PATCH 101/117] add internal GetDbProviderFactory method, to actually instantiate a factory and fall back to SqlClientFactory svn path=/trunk/mcs/; revision=58397 --- .../ProvidersHelper.cs | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/ProvidersHelper.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/ProvidersHelper.cs index 7955ab28470ce..46a88eb1fef26 100644 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/ProvidersHelper.cs +++ b/mcs/class/System.Web/System.Web.Configuration_2.0/ProvidersHelper.cs @@ -27,12 +27,13 @@ // 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.Configuration; - #if NET_2_0 +using System; +using System.Configuration; using System.Configuration.Provider; +using System.Data.Common; +using System.Data.SqlClient; namespace System.Web.Configuration { @@ -62,6 +63,22 @@ public static void InstantiateProviders (ProviderSettingsCollection configProvid foreach (ProviderSettings settings in configProviders) providers.Add (InstantiateProvider (settings, providerType)); } + + internal static DbProviderFactory GetDbProviderFactory (string providerName) + { + DbProviderFactory f = null; + + if (providerName != null && providerName != "") { + try { + f = DbProviderFactories.GetFactory(providerName); + } + catch (Exception e) { Console.WriteLine (e); /* nada */ } + if (f != null) + return f; + } + + return SqlClientFactory.Instance; + } } } From fca89672555bea6b9b9f946a48a297bad51a88e9 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Thu, 23 Mar 2006 22:27:01 +0000 Subject: [PATCH 102/117] remove Item since it conflicts with 'this []' svn path=/trunk/mcs/; revision=58398 --- .../System.Web.Configuration_2.0/HttpCapabilitiesBase.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/HttpCapabilitiesBase.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/HttpCapabilitiesBase.cs index c9d6587d4e848..28cb45f64cd32 100644 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/HttpCapabilitiesBase.cs +++ b/mcs/class/System.Web/System.Web.Configuration_2.0/HttpCapabilitiesBase.cs @@ -159,10 +159,6 @@ public HttpCapabilitiesBase GetConfigCapabilities () get { throw new NotImplementedException (); } } - public virtual string Item { - get { throw new NotImplementedException (); } - } - public Version JScriptVersion { get { throw new NotImplementedException (); } } From c056798bb915fcf142ff4a4e15f9c7997e91001f Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Thu, 23 Mar 2006 22:27:43 +0000 Subject: [PATCH 103/117] 2006-03-23 Marek Safar * attribute.cs (Attribute.ResolveConstructor): Check for an invalid attribute arguments here. * class.cs (Indexer.Define): The check was moved to attribute class. svn path=/trunk/mcs/; revision=58399 --- mcs/errors/cs0591.cs | 2 +- mcs/errors/cs0633-2.cs | 2 +- mcs/errors/cs0633-3.cs | 14 ++++++++++++++ mcs/errors/cs0633.cs | 2 +- mcs/errors/gcs0030.cs | 2 +- mcs/errors/gcs0633-4.cs | 7 +++++++ mcs/errors/known-issues-gmcs | 4 ++++ mcs/mcs/ChangeLog | 7 +++++++ mcs/mcs/attribute.cs | 10 +++++++++- mcs/mcs/class.cs | 15 ++++++++------- mcs/tests/test-238.cs | 2 +- 11 files changed, 54 insertions(+), 13 deletions(-) create mode 100644 mcs/errors/cs0633-3.cs create mode 100644 mcs/errors/gcs0633-4.cs diff --git a/mcs/errors/cs0591.cs b/mcs/errors/cs0591.cs index 61058c85dd8cf..5ce0bb823f235 100644 --- a/mcs/errors/cs0591.cs +++ b/mcs/errors/cs0591.cs @@ -1,4 +1,4 @@ -// cs0591.cs: Invalid value for argument to 'System.AttributeUsage' attribute +// cs0591.cs: Invalid value for argument to `System.AttributeUsage' attribute // Line: 4 [System.AttributeUsage(0)] diff --git a/mcs/errors/cs0633-2.cs b/mcs/errors/cs0633-2.cs index 2ef70bf1cc128..ecdf906abb723 100644 --- a/mcs/errors/cs0633-2.cs +++ b/mcs/errors/cs0633-2.cs @@ -1,4 +1,4 @@ -// cs0633-2.cs: The argument to the `IndexerName' attribute must be a valid identifier +// cs0633-2.cs: The argument to the `System.Runtime.CompilerServices.IndexerNameAttribute' attribute must be a valid identifier // Line: 5 public class MonthDays { diff --git a/mcs/errors/cs0633-3.cs b/mcs/errors/cs0633-3.cs new file mode 100644 index 0000000000000..17e58dd7a5c02 --- /dev/null +++ b/mcs/errors/cs0633-3.cs @@ -0,0 +1,14 @@ +// cs0633-3.cs: The argument to the `System.Diagnostics.ConditionalAttribute' attribute must be a valid identifier +// Line: 8 + +using System; +using System.Diagnostics; + +class TestClass { + [Conditional ("UNDEFINED CONDITION")] + static void ConditionalMethod () + { + } +} + + diff --git a/mcs/errors/cs0633.cs b/mcs/errors/cs0633.cs index c84812d7b4ef7..3f7ba41fc5e5c 100644 --- a/mcs/errors/cs0633.cs +++ b/mcs/errors/cs0633.cs @@ -1,4 +1,4 @@ -// cs0633.cs: The argument to the `IndexerName' attribute must be a valid identifier +// cs0633.cs: The argument to the `System.Runtime.CompilerServices.IndexerNameAttribute' attribute must be a valid identifier // Line: 5 public class MonthDays { diff --git a/mcs/errors/gcs0030.cs b/mcs/errors/gcs0030.cs index a87c044b718ed..99ca9da44b5f4 100755 --- a/mcs/errors/gcs0030.cs +++ b/mcs/errors/gcs0030.cs @@ -1,4 +1,4 @@ -// CS0030: Cannot convert type `T' to `X'. +// CS0030: Cannot convert type `T' to `X' // Line: 8 class Foo where T : System.ICloneable diff --git a/mcs/errors/gcs0633-4.cs b/mcs/errors/gcs0633-4.cs new file mode 100644 index 0000000000000..848dbae35b6cd --- /dev/null +++ b/mcs/errors/gcs0633-4.cs @@ -0,0 +1,7 @@ +// gcs0633-4.cs: The argument to the `System.Diagnostics.ConditionalAttribute' attribute must be a valid identifier +// Line: 6 + +using System.Diagnostics; + +[Conditional("DEBUG+2")] +public class Test: System.Attribute {} diff --git a/mcs/errors/known-issues-gmcs b/mcs/errors/known-issues-gmcs index e507161556212..6453bf29466f6 100644 --- a/mcs/errors/known-issues-gmcs +++ b/mcs/errors/known-issues-gmcs @@ -57,6 +57,10 @@ cs1669-2.cs NO ERROR cs1677.cs cs0134-2.cs NO ERROR cs0134.cs +cs0633-2.cs +cs0633-3.cs +cs0633.cs +gcs0633-4.cs gcs0208-2.cs NO ERROR gcs0208-3.cs NO ERROR diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog index 5331c072e0d9b..e17880b5a948d 100644 --- a/mcs/mcs/ChangeLog +++ b/mcs/mcs/ChangeLog @@ -1,3 +1,10 @@ +2006-03-23 Marek Safar + + * attribute.cs (Attribute.ResolveConstructor): Check for an invalid + attribute arguments here. + + * class.cs (Indexer.Define): The check was moved to attribute class. + 2006-03-22 Marek Safar * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs, diff --git a/mcs/mcs/attribute.cs b/mcs/mcs/attribute.cs index 3bb3a3f01d847..0ee0303350005 100644 --- a/mcs/mcs/attribute.cs +++ b/mcs/mcs/attribute.cs @@ -425,10 +425,18 @@ protected virtual ConstructorInfo ResolveConstructor (EmitContext ec) } if (Type == TypeManager.attribute_usage_type && (int)pos_values [0] == 0) { - Report.Error (591, Location, "Invalid value for argument to 'System.AttributeUsage' attribute"); + Report.Error (591, Location, "Invalid value for argument to `System.AttributeUsage' attribute"); return null; } + if (Type == TypeManager.indexer_name_type || Type == TypeManager.conditional_attribute_type) { + if (!Tokenizer.IsValidIdentifier ((string)pos_values [0])) { + Report.Error (633, ((Argument)PosArguments[0]).Expr.Location, + "The argument to the `{0}' attribute must be a valid identifier", GetSignatureForError ()); + return null; + } + } + if (Type == TypeManager.methodimpl_attr_type && pos_values.Length == 1 && pd.ParameterType (0) == TypeManager.short_type && !System.Enum.IsDefined (typeof (MethodImplOptions), pos_values [0].ToString ())) { diff --git a/mcs/mcs/class.cs b/mcs/mcs/class.cs index 74544a5c9162a..e99b34f1688b8 100644 --- a/mcs/mcs/class.cs +++ b/mcs/mcs/class.cs @@ -3828,6 +3828,9 @@ public bool IsExcluded () foreach (Attribute a in attrs) { string condition = a.GetConditionalAttributeValue (); + if (condition == null) + return false; + if (RootContext.AllDefines.Contains (condition)) return false; } @@ -6772,7 +6775,11 @@ public override bool Define () // Remove the attribute from the list because it is not emitted OptAttributes.Attrs.Remove (indexer_attr); - ShortName = indexer_attr.GetIndexerAttributeValue (); + string name = indexer_attr.GetIndexerAttributeValue (); + if (name == null) + return false; + + ShortName = name; if (IsExplicitImpl) { Report.Error (415, indexer_attr.Location, @@ -6786,12 +6793,6 @@ public override bool Define () "Cannot set the `IndexerName' attribute on an indexer marked override"); return false; } - - if (!Tokenizer.IsValidIdentifier (ShortName)) { - Report.Error (633, indexer_attr.Location, - "The argument to the `IndexerName' attribute must be a valid identifier"); - return false; - } } } diff --git a/mcs/tests/test-238.cs b/mcs/tests/test-238.cs index ba745a101ca9c..def44e87b7c4d 100644 --- a/mcs/tests/test-238.cs +++ b/mcs/tests/test-238.cs @@ -2,7 +2,7 @@ using System.Diagnostics; class TestClass { - [Conditional ("UNDEFINED CONDITION")] + [Conditional ("UNDEFINED_CONDITION")] static void ConditionalMethod () { Environment.Exit (1); From e827ba87fe4abe2236b1470bbc476b304aaba6ae Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Fri, 24 Mar 2006 00:47:37 +0000 Subject: [PATCH 104/117] * ScrollableControl.cs: Special case negative sized areas, not zero. svn path=/trunk/mcs/; revision=58402 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 5 +++++ .../System.Windows.Forms/ScrollableControl.cs | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 34182a2b92ee8..4ecbca8797ffb 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2006-03-23 Jackson Harper + + * ScrollableControl.cs: Special case negative sized areas, not + zero. + 2006-03-23 Mike Kestner * ThemeWin32Classic.cs: fix FullRowSelect selection background and diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs index bd0dc08db4bf0..3351659a61a72 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs @@ -557,7 +557,7 @@ private void Recalculate (object sender, EventArgs e) prev_right_edge = right_edge; prev_bottom_edge = bottom_edge; - if ((force_hscroll_visible || canvas.Width > right_edge) && client.Width != 0) { + if ((force_hscroll_visible || canvas.Width > right_edge) && client.Width > 0) { hscroll_visible = true; bottom_edge = client.Height - SystemInformation.HorizontalScrollBarHeight; } else { @@ -565,7 +565,7 @@ private void Recalculate (object sender, EventArgs e) bottom_edge = client.Height; } - if ((force_vscroll_visible || canvas.Height > bottom_edge) && client.Height != 0) { + if ((force_vscroll_visible || canvas.Height > bottom_edge) && client.Height > 0) { vscroll_visible = true; right_edge = client.Width - SystemInformation.VerticalScrollBarWidth; } else { From 669af4d9e49bf73b25085f2ab8039170ff70682e Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Fri, 24 Mar 2006 01:13:38 +0000 Subject: [PATCH 105/117] * MonthCalendar.cs: Save the rect of the clicked date so we can use it for invalidation. - Try to cut down on the number of invalidates - Invalidate the rect the mouse is over and was over when moving the mouse, so we get the focus box following the cursor. svn path=/trunk/mcs/; revision=58403 --- .../System.Windows.Forms/ChangeLog | 5 +++++ .../System.Windows.Forms/MonthCalendar.cs | 21 +++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 4ecbca8797ffb..d8868c6c54f25 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -2,6 +2,11 @@ * ScrollableControl.cs: Special case negative sized areas, not zero. + * MonthCalendar.cs: Save the rect of the clicked date so we can + use it for invalidation. + - Try to cut down on the number of invalidates + - Invalidate the rect the mouse is over and was over when moving + the mouse, so we get the focus box following the cursor. 2006-03-23 Mike Kestner diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MonthCalendar.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MonthCalendar.cs index 972383df92c37..9860253acbd5b 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MonthCalendar.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MonthCalendar.cs @@ -72,6 +72,7 @@ public class MonthCalendar : Control { internal Size calendar_spacing; internal int divider_line_offset; internal DateTime clicked_date; + internal Rectangle clicked_rect; internal bool is_date_clicked; internal bool is_previous_clicked; internal bool is_next_clicked; @@ -501,9 +502,12 @@ public class MonthCalendar : Control { diff_end = old_range.Start; } } - - // invalidate the region required - this.InvalidateDateRange (new SelectionRange (diff_start, diff_end)); + + + // invalidate the region required + SelectionRange new_range = new SelectionRange (diff_start, diff_end); + if (new_range.End != old_range.End || new_range.Start != old_range.Start) + this.InvalidateDateRange (new_range); // raise date changed event this.OnDateChanged (new DateRangeEventArgs (SelectionStart, SelectionEnd)); } @@ -1136,6 +1140,7 @@ private void CreateYearUpDown () new Point (day_rect.X, day_rect.Bottom), new Size (day_rect.Width, Math.Max(calendars[i].Bottom - day_rect.Bottom, 0))); if (date_grid.Contains (point)) { + clicked_rect = date_grid; // okay so it's inside the grid, get the offset Point offset = new Point (point.X - date_grid.X, point.Y - date_grid.Y); int row = offset.Y / date_cell_size.Height; @@ -1605,6 +1610,8 @@ private void SetItemClick(HitTestInfo hti) hti.HitArea == HitArea.NextMonthDate || hti.HitArea == HitArea.Date) { + Rectangle prev_rect = clicked_rect; + DateTime prev_clicked = clicked_date; DoDateMouseDown (hti); if (owner == null) { click_state [0] = true; @@ -1613,6 +1620,11 @@ private void SetItemClick(HitTestInfo hti) click_state [1] = false; click_state [2] = false; } + + if (prev_clicked != clicked_date) { + Rectangle invalid = Rectangle.Union (prev_rect, clicked_rect); + Invalidate (invalid); + } } } @@ -1839,10 +1851,11 @@ private void MouseUpHandler (object sender, MouseEventArgs e) this.Paint (sender, pe); } } - + // returns the region of the control that needs to be redrawn private void InvalidateDateRange (SelectionRange range) { SelectionRange bounds = this.GetDisplayRange (false); + if (range.End < bounds.Start || range.Start > bounds.End) { // don't invalidate anything, as the modified date range // is outside the visible bounds of this control From fe8e71035bcd41599e5412209119469180d0a190 Mon Sep 17 00:00:00 2001 From: Raja R Harinath Date: Fri, 24 Mar 2006 06:51:52 +0000 Subject: [PATCH 106/117] Backport r58366 from gmcs/ svn path=/trunk/mcs/; revision=58405 --- mcs/mcs/attribute.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mcs/mcs/attribute.cs b/mcs/mcs/attribute.cs index 0ee0303350005..5de2857fce590 100644 --- a/mcs/mcs/attribute.cs +++ b/mcs/mcs/attribute.cs @@ -344,6 +344,9 @@ protected virtual ConstructorInfo ResolveConstructor (EmitContext ec) BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly, Location); + if (mg == null) + return null; + MethodBase constructor = Invocation.OverloadResolve ( ec, (MethodGroupExpr) mg, PosArguments, false, Location); From 8e401ab539e37065d94d900726dd0a559cba8169 Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Fri, 24 Mar 2006 07:48:55 +0000 Subject: [PATCH 107/117] 2006-03-23 Atsushi Enomoto * String.cs : added new IndexOf() and LastIndexOf() overloads, and IEnumerable.GetEnumerator(). svn path=/trunk/mcs/; revision=58406 --- mcs/class/corlib/System/ChangeLog | 5 +++ mcs/class/corlib/System/String.cs | 68 ++++++++++++++++++++++++++++++- 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/mcs/class/corlib/System/ChangeLog b/mcs/class/corlib/System/ChangeLog index 8d18b8ceda322..b305d3d417d5a 100644 --- a/mcs/class/corlib/System/ChangeLog +++ b/mcs/class/corlib/System/ChangeLog @@ -1,3 +1,8 @@ +2006-03-23 Atsushi Enomoto + + * String.cs : added new IndexOf() and LastIndexOf() overloads, and + IEnumerable.GetEnumerator(). + 2006-03-21 Kornél Pál * String.cs: Make memcpy4 private as it is a helper method. diff --git a/mcs/class/corlib/System/String.cs b/mcs/class/corlib/System/String.cs index f6b5daaf72e42..6aad9d08f5d84 100644 --- a/mcs/class/corlib/System/String.cs +++ b/mcs/class/corlib/System/String.cs @@ -36,6 +36,7 @@ using System.Runtime.CompilerServices; #if NET_2_0 +using System.Collections.Generic; using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; #endif @@ -45,7 +46,7 @@ namespace System [Serializable] #if NET_2_0 [ComVisible (true)] - public sealed class String : IConvertible, ICloneable, IEnumerable, IComparable, IComparable, IEquatable + public sealed class String : IConvertible, ICloneable, IEnumerable, IComparable, IComparable, IEquatable , IEnumerable #else public sealed class String : IConvertible, ICloneable, IEnumerable, IComparable #endif @@ -689,6 +690,66 @@ public int IndexOfAny (char [] anyOf, int startIndex, int count) return InternalIndexOfAny (anyOf, startIndex, count); } +#if NET_2_0 + public int IndexOf (string value, StringComparison comparison) + { + return IndexOf (value, 0, value.Length, comparison); + } + + public int IndexOf (string value, int startIndex, StringComparison comparison) + { + return IndexOf (value, startIndex, value.Length - startIndex, comparison); + } + + public int IndexOf (string value, int startIndex, int count, StringComparison comparison) + { + switch (comparison) { + case StringComparison.CurrentCulture: + return CultureInfo.CurrentCulture.CompareInfo.IndexOf (this, value, startIndex, count, CompareOptions.None); + case StringComparison.CurrentCultureIgnoreCase: + return CultureInfo.CurrentCulture.CompareInfo.IndexOf (this, value, startIndex, count, CompareOptions.IgnoreCase); + case StringComparison.InvariantCulture: + return CultureInfo.InvariantCulture.CompareInfo.IndexOf (this, value, startIndex, count, CompareOptions.None); + case StringComparison.InvariantCultureIgnoreCase: + return CultureInfo.InvariantCulture.CompareInfo.IndexOf (this, value, startIndex, count, CompareOptions.IgnoreCase); + case StringComparison.Ordinal: + return CultureInfo.InvariantCulture.CompareInfo.IndexOf (this, value, startIndex, count, CompareOptions.Ordinal); + case StringComparison.OrdinalIgnoreCase: + return CultureInfo.InvariantCulture.CompareInfo.IndexOf (this, value, startIndex, count, CompareOptions.OrdinalIgnoreCase); + } + throw new SystemException ("INTERNAL ERROR: should not reach here ..."); + } + + public int LastIndexOf (string value, StringComparison comparison) + { + return LastIndexOf (value, value.Length - 1, value.Length, comparison); + } + + public int LastIndexOf (string value, int startIndex, StringComparison comparison) + { + return LastIndexOf (value, startIndex, startIndex + 1, comparison); + } + + public int LastIndexOf (string value, int startIndex, int count, StringComparison comparison) + { + switch (comparison) { + case StringComparison.CurrentCulture: + return CultureInfo.CurrentCulture.CompareInfo.LastIndexOf (this, value, startIndex, count, CompareOptions.None); + case StringComparison.CurrentCultureIgnoreCase: + return CultureInfo.CurrentCulture.CompareInfo.LastIndexOf (this, value, startIndex, count, CompareOptions.IgnoreCase); + case StringComparison.InvariantCulture: + return CultureInfo.InvariantCulture.CompareInfo.LastIndexOf (this, value, startIndex, count, CompareOptions.None); + case StringComparison.InvariantCultureIgnoreCase: + return CultureInfo.InvariantCulture.CompareInfo.LastIndexOf (this, value, startIndex, count, CompareOptions.IgnoreCase); + case StringComparison.Ordinal: + return CultureInfo.InvariantCulture.CompareInfo.LastIndexOf (this, value, startIndex, count, CompareOptions.Ordinal); + case StringComparison.OrdinalIgnoreCase: + return CultureInfo.InvariantCulture.CompareInfo.LastIndexOf (this, value, startIndex, count, CompareOptions.OrdinalIgnoreCase); + } + throw new SystemException ("INTERNAL ERROR: should not reach here ..."); + } +#endif + public int IndexOf (char value) { return IndexOf (value, 0, this.length); @@ -1661,6 +1722,11 @@ public CharEnumerator GetEnumerator () return new CharEnumerator (this); } + IEnumerator IEnumerable.GetEnumerator () + { + return GetEnumerator (); + } + IEnumerator IEnumerable.GetEnumerator () { return new CharEnumerator (this); From ee90ea55f19c2b359810e7390926183991f2c351 Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Fri, 24 Mar 2006 07:52:52 +0000 Subject: [PATCH 108/117] 2006-03-23 Atsushi Enomoto * String.cs : oops, NET_2_0. svn path=/trunk/mcs/; revision=58407 --- mcs/class/corlib/System/ChangeLog | 4 ++++ mcs/class/corlib/System/String.cs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/mcs/class/corlib/System/ChangeLog b/mcs/class/corlib/System/ChangeLog index b305d3d417d5a..14d54f10cc587 100644 --- a/mcs/class/corlib/System/ChangeLog +++ b/mcs/class/corlib/System/ChangeLog @@ -1,3 +1,7 @@ +2006-03-23 Atsushi Enomoto + + * String.cs : oops, NET_2_0. + 2006-03-23 Atsushi Enomoto * String.cs : added new IndexOf() and LastIndexOf() overloads, and diff --git a/mcs/class/corlib/System/String.cs b/mcs/class/corlib/System/String.cs index 6aad9d08f5d84..1829e41b826f8 100644 --- a/mcs/class/corlib/System/String.cs +++ b/mcs/class/corlib/System/String.cs @@ -1722,10 +1722,12 @@ public CharEnumerator GetEnumerator () return new CharEnumerator (this); } +#if NET_2_0 IEnumerator IEnumerable.GetEnumerator () { return GetEnumerator (); } +#endif IEnumerator IEnumerable.GetEnumerator () { From abcea4f6f083aa3ff7a4a11ac7b5dbbc76b89656 Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Fri, 24 Mar 2006 11:20:24 +0000 Subject: [PATCH 109/117] 2006-03-24 Atsushi Enomoto * UTF8Encoding.cs : made internal implementation as pointer-based, and added pointer-based converter method overloads. svn path=/trunk/mcs/; revision=58408 --- mcs/class/corlib/System.Text/ChangeLog | 5 + mcs/class/corlib/System.Text/UTF8Encoding.cs | 211 ++++++++++++++++--- 2 files changed, 185 insertions(+), 31 deletions(-) diff --git a/mcs/class/corlib/System.Text/ChangeLog b/mcs/class/corlib/System.Text/ChangeLog index 73e58bb257c0c..ad6bc59f1fc16 100644 --- a/mcs/class/corlib/System.Text/ChangeLog +++ b/mcs/class/corlib/System.Text/ChangeLog @@ -1,3 +1,8 @@ +2006-03-24 Atsushi Enomoto + + * UTF8Encoding.cs : made internal implementation as pointer-based, + and added pointer-based converter method overloads. + 2006-03-21 Kornél Pál * UnicodeEncoding.cs: Use unsafe code for copying characters to speed diff --git a/mcs/class/corlib/System.Text/UTF8Encoding.cs b/mcs/class/corlib/System.Text/UTF8Encoding.cs index ecc3998979a03..3d5d91d9b9470 100644 --- a/mcs/class/corlib/System.Text/UTF8Encoding.cs +++ b/mcs/class/corlib/System.Text/UTF8Encoding.cs @@ -27,11 +27,13 @@ namespace System.Text { using System; +using System.Runtime.InteropServices; [Serializable] [MonoTODO ("Fix serialization compatibility with MS.NET")] #if NET_2_0 [MonoTODO ("EncoderFallback is not handled")] +[ComVisible (true)] #endif public class UTF8Encoding : Encoding { @@ -180,6 +182,7 @@ public override int GetByteCount (char[] chars, int index, int count) return InternalGetByteCount (chars, index, count, ref dummy, true); } +#if !NET_2_0 // Convenience wrappers for "GetByteCount". public override int GetByteCount (String s) { @@ -195,6 +198,21 @@ public override int GetByteCount (String s) } } } +#endif + +#if NET_2_0 + [CLSCompliant (false)] + [ComVisible (false)] + public unsafe override int GetByteCount (char* chars, int count) + { + if (chars == null) + throw new ArgumentNullException ("chars"); + if (count == 0) + return 0; + char dummy = '\0'; + return InternalGetByteCount (chars, count, ref dummy, true); + } +#endif #endregion @@ -437,17 +455,42 @@ private unsafe int Fallback (byte* bytes, int byteCount, char lead, char tail) } } +#if NET_2_0 + [CLSCompliant (false)] + [ComVisible (false)] + public unsafe override int GetBytes (char* chars, int charCount, byte* bytes, int byteCount) + { + if (chars == null) + throw new ArgumentNullException ("chars"); + if (charCount < 0) + throw new IndexOutOfRangeException ("charCount"); + if (bytes == null) + throw new ArgumentNullException ("bytes"); + if (byteCount < 0) + throw new IndexOutOfRangeException ("charCount"); + + if (charCount == 0) + return 0; + + char dummy = '\0'; + if (byteCount == 0) + return InternalGetBytes (chars, charCount, null, 0, ref dummy, true); + else + return InternalGetBytes (chars, charCount, bytes, byteCount, ref dummy, true); + } +#endif + #endregion // Internal version of "GetCharCount" which can handle a rolling // state between multiple calls to this method. #if NET_2_0 - private static int InternalGetCharCount ( + private unsafe static int InternalGetCharCount ( byte[] bytes, int index, int count, uint leftOverBits, uint leftOverCount, object provider, - ref DecoderFallbackBuffer fallbackBuffer, bool flush) + ref DecoderFallbackBuffer fallbackBuffer, ref byte [] bufferArg, bool flush) #else - private static int InternalGetCharCount ( + private unsafe static int InternalGetCharCount ( byte[] bytes, int index, int count, uint leftOverBits, uint leftOverCount, bool throwOnInvalid, bool flush) #endif @@ -463,6 +506,31 @@ private unsafe int Fallback (byte* bytes, int byteCount, char lead, char tail) throw new ArgumentOutOfRangeException ("count", _("ArgRange_Array")); } + if (count == 0) + return 0; + fixed (byte *bptr = bytes) +#if NET_2_0 + return InternalGetCharCount (bptr + index, count, + leftOverBits, leftOverCount, provider, ref fallbackBuffer, ref bufferArg, flush); +#else + return InternalGetCharCount (bptr + index, count, + leftOverBits, leftOverCount, throwOnInvalid, flush); +#endif + } + +#if NET_2_0 + private unsafe static int InternalGetCharCount ( + byte* bytes, int count, uint leftOverBits, + uint leftOverCount, object provider, + ref DecoderFallbackBuffer fallbackBuffer, ref byte [] bufferArg, bool flush) +#else + private unsafe static int InternalGetCharCount ( + byte* bytes, int count, uint leftOverBits, + uint leftOverCount, bool throwOnInvalid, bool flush) +#endif + { + int index = 0; + int length = 0; if (leftOverCount == 0) { @@ -516,7 +584,7 @@ private unsafe int Fallback (byte* bytes, int byteCount, char lead, char tail) } else { // Invalid UTF-8 start character. #if NET_2_0 - length += Fallback (provider, ref fallbackBuffer, bytes, index - 1); + length += Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, index - 1); #else if (throwOnInvalid) throw new ArgumentException (_("Arg_InvalidUTF8"), "bytes"); @@ -550,7 +618,7 @@ private unsafe int Fallback (byte* bytes, int byteCount, char lead, char tail) } if (overlong) { #if NET_2_0 - length += Fallback (provider, ref fallbackBuffer, bytes, index - 1); + length += Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, index - 1); #else if (throwOnInvalid) throw new ArgumentException (_("Overlong"), leftBits.ToString ()); @@ -562,7 +630,7 @@ private unsafe int Fallback (byte* bytes, int byteCount, char lead, char tail) length += 2; } else { #if NET_2_0 - length += Fallback (provider, ref fallbackBuffer, bytes, index - 1); + length += Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, index - 1); #else if (throwOnInvalid) throw new ArgumentException (_("Arg_InvalidUTF8"), "bytes"); @@ -573,7 +641,7 @@ private unsafe int Fallback (byte* bytes, int byteCount, char lead, char tail) } else { // Invalid UTF-8 sequence: clear and restart. #if NET_2_0 - length += Fallback (provider, ref fallbackBuffer, bytes, index - 1); + length += Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, index - 1); #else if (throwOnInvalid) throw new ArgumentException (_("Arg_InvalidUTF8"), "bytes"); @@ -588,7 +656,7 @@ private unsafe int Fallback (byte* bytes, int byteCount, char lead, char tail) // We had left-over bytes that didn't make up // a complete UTF-8 character sequence. #if NET_2_0 - length += Fallback (provider, ref fallbackBuffer, bytes, index); + length += Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, index); #else if (throwOnInvalid) throw new ArgumentException (_("Arg_InvalidUTF8"), "bytes"); @@ -601,7 +669,7 @@ private unsafe int Fallback (byte* bytes, int byteCount, char lead, char tail) #if NET_2_0 // for GetCharCount() - static int Fallback (object provider, ref DecoderFallbackBuffer buffer, byte [] bytes, int index) + static unsafe int Fallback (object provider, ref DecoderFallbackBuffer buffer, ref byte [] bufferArg, byte* bytes, int index) { if (buffer == null) { DecoderFallback fb = provider as DecoderFallback; @@ -610,13 +678,16 @@ static int Fallback (object provider, ref DecoderFallbackBuffer buffer, byte [] else buffer = ((Decoder) provider).FallbackBuffer; } - buffer.Fallback (bytes, index); + if (bufferArg == null) + bufferArg = new byte [1]; + bufferArg [0] = bytes [index]; + buffer.Fallback (bufferArg, 0); return buffer.Remaining; } // for GetChars() - static void Fallback (object provider, ref DecoderFallbackBuffer buffer, byte [] bytes, int byteIndex, - char [] chars, ref int charIndex) + static unsafe void Fallback (object provider, ref DecoderFallbackBuffer buffer, ref byte [] bufferArg, byte* bytes, int byteIndex, + char* chars, ref int charIndex) { if (buffer == null) { DecoderFallback fb = provider as DecoderFallback; @@ -625,7 +696,10 @@ static int Fallback (object provider, ref DecoderFallbackBuffer buffer, byte [] else buffer = ((Decoder) provider).FallbackBuffer; } - buffer.Fallback (bytes, byteIndex); + if (bufferArg == null) + bufferArg = new byte [1]; + bufferArg [0] = bytes [byteIndex]; + buffer.Fallback (bufferArg, 0); while (buffer.Remaining > 0) chars [charIndex++] = buffer.GetNextChar (); } @@ -636,21 +710,33 @@ public override int GetCharCount (byte[] bytes, int index, int count) { #if NET_2_0 DecoderFallbackBuffer buf = null; - return InternalGetCharCount (bytes, index, count, 0, 0, DecoderFallback, ref buf, true); + byte [] bufferArg = null; + return InternalGetCharCount (bytes, index, count, 0, 0, DecoderFallback, ref buf, ref bufferArg, true); #else return InternalGetCharCount (bytes, index, count, 0, 0, throwOnInvalid, true); #endif } +#if NET_2_0 + [CLSCompliant (false)] + [ComVisible (false)] + public unsafe override int GetCharCount (byte* bytes, int count) + { + DecoderFallbackBuffer buf = null; + byte [] bufferArg = null; + return InternalGetCharCount (bytes, count, 0, 0, DecoderFallback, ref buf, ref bufferArg, true); + } +#endif + // Get the characters that result from decoding a byte buffer. #if NET_2_0 - private static int InternalGetChars ( + private unsafe static int InternalGetChars ( byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, ref uint leftOverBits, ref uint leftOverCount, object provider, - ref DecoderFallbackBuffer fallbackBuffer, bool flush) + ref DecoderFallbackBuffer fallbackBuffer, ref byte [] bufferArg, bool flush) #else - private static int InternalGetChars ( + private unsafe static int InternalGetChars ( byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, ref uint leftOverBits, ref uint leftOverCount, bool throwOnInvalid, bool flush) @@ -676,6 +762,38 @@ public override int GetCharCount (byte[] bytes, int index, int count) if (charIndex == chars.Length) return 0; + fixed (char* cptr = chars) { +#if NET_2_0 + if (byteCount == 0 || byteIndex == bytes.Length) + return InternalGetChars (null, 0, cptr + charIndex, chars.Length - charIndex, ref leftOverBits, ref leftOverCount, provider, ref fallbackBuffer, ref bufferArg, flush); + // otherwise... + fixed (byte* bptr = bytes) + return InternalGetChars (bptr + byteIndex, byteCount, cptr + charIndex, chars.Length - charIndex, ref leftOverBits, ref leftOverCount, provider, ref fallbackBuffer, ref bufferArg, flush); +#else + if (byteCount == 0 || byteIndex == bytes.Length) + return InternalGetChars (null, 0, cptr + charIndex, chars.Length - charIndex, ref leftOverBits, ref leftOverCount, throwOnInvalid, flush); + // otherwise... + fixed (byte* bptr = bytes) + return InternalGetChars (bptr + byteIndex, byteCount, cptr + charIndex, chars.Length - charIndex, ref leftOverBits, ref leftOverCount, throwOnInvalid, flush); +#endif + } + } + +#if NET_2_0 + private unsafe static int InternalGetChars ( + byte* bytes, int byteCount, char* chars, int charCount, + ref uint leftOverBits, ref uint leftOverCount, + object provider, + ref DecoderFallbackBuffer fallbackBuffer, ref byte [] bufferArg, bool flush) +#else + private unsafe static int InternalGetChars ( + byte* bytes, int byteCount, char* chars, int charCount, + ref uint leftOverBits, ref uint leftOverCount, + bool throwOnInvalid, bool flush) +#endif + { + int charIndex = 0, byteIndex = 0; + int length = charCount; int posn = charIndex; if (leftOverCount == 0) { @@ -690,15 +808,11 @@ public override int GetCharCount (byte[] bytes, int index, int count) // Convert the bytes into the output buffer. uint ch; - int length = chars.Length; uint leftBits = leftOverBits; uint leftSoFar = (leftOverCount & (uint)0x0F); uint leftSize = ((leftOverCount >> 4) & (uint)0x0F); int byteEnd = byteIndex + byteCount; - if (byteEnd < 0 || byteEnd > bytes.Length) - throw new SystemException (String.Format ("INTERNAL ERROR: should not happen: {0} {1} {2}", byteIndex, byteCount, byteEnd)); - for(; byteIndex < byteEnd; byteIndex++) { // Fetch the next character from the byte buffer. ch = (uint)(bytes[byteIndex]); @@ -738,7 +852,7 @@ public override int GetCharCount (byte[] bytes, int index, int count) } else { // Invalid UTF-8 start character. #if NET_2_0 - Fallback (provider, ref fallbackBuffer, bytes, byteIndex, chars, ref posn); + Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, byteIndex, chars, ref posn); #else if (throwOnInvalid) throw new ArgumentException (_("Arg_InvalidUTF8"), "bytes"); @@ -772,7 +886,7 @@ public override int GetCharCount (byte[] bytes, int index, int count) } if (overlong) { #if NET_2_0 - Fallback (provider, ref fallbackBuffer, bytes, byteIndex, chars, ref posn); + Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, byteIndex, chars, ref posn); #else if (throwOnInvalid) throw new ArgumentException (_("Overlong"), leftBits.ToString ()); @@ -781,7 +895,7 @@ public override int GetCharCount (byte[] bytes, int index, int count) else if ((leftBits & 0xF800) == 0xD800) { // UTF-8 doesn't use surrogate characters #if NET_2_0 - Fallback (provider, ref fallbackBuffer, bytes, byteIndex, chars, ref posn); + Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, byteIndex, chars, ref posn); #else if (throwOnInvalid) throw new ArgumentException (_("Arg_InvalidUTF8"), "bytes"); @@ -806,7 +920,7 @@ public override int GetCharCount (byte[] bytes, int index, int count) (char)((leftBits & (uint)0x3FF) + (uint)0xDC00); } else { #if NET_2_0 - Fallback (provider, ref fallbackBuffer, bytes, byteIndex, chars, ref posn); + Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, byteIndex, chars, ref posn); #else if (throwOnInvalid) throw new ArgumentException (_("Arg_InvalidUTF8"), "bytes"); @@ -817,7 +931,7 @@ public override int GetCharCount (byte[] bytes, int index, int count) } else { // Invalid UTF-8 sequence: clear and restart. #if NET_2_0 - Fallback (provider, ref fallbackBuffer, bytes, byteIndex, chars, ref posn); + Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, byteIndex, chars, ref posn); #else if (throwOnInvalid) throw new ArgumentException (_("Arg_InvalidUTF8"), "bytes"); @@ -831,7 +945,7 @@ public override int GetCharCount (byte[] bytes, int index, int count) // We had left-over bytes that didn't make up // a complete UTF-8 character sequence. #if NET_2_0 - Fallback (provider, ref fallbackBuffer, bytes, byteIndex, chars, ref posn); + Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, byteIndex, chars, ref posn); #else if (throwOnInvalid) throw new ArgumentException (_("Arg_InvalidUTF8"), "bytes"); @@ -852,14 +966,29 @@ public override int GetCharCount (byte[] bytes, int index, int count) uint leftOverCount = 0; #if NET_2_0 DecoderFallbackBuffer buf = null; + byte [] bufferArg = null; return InternalGetChars (bytes, byteIndex, byteCount, chars, - charIndex, ref leftOverBits, ref leftOverCount, DecoderFallback, ref buf, true); + charIndex, ref leftOverBits, ref leftOverCount, DecoderFallback, ref buf, ref bufferArg, true); #else return InternalGetChars (bytes, byteIndex, byteCount, chars, charIndex, ref leftOverBits, ref leftOverCount, throwOnInvalid, true); #endif } +#if NET_2_0 + [CLSCompliant (false)] + [ComVisible (false)] + public unsafe override int GetChars (byte* bytes, int byteCount, char* chars, int charCount) + { + DecoderFallbackBuffer buf = null; + byte [] bufferArg = null; + uint leftOverBits = 0; + uint leftOverCount = 0; + return InternalGetChars (bytes, byteCount, chars, + charCount, ref leftOverBits, ref leftOverCount, DecoderFallback, ref buf, ref bufferArg, true); + } +#endif + // Get the maximum number of bytes needed to encode a // specified number of characters. public override int GetMaxByteCount (int charCount) @@ -935,7 +1064,24 @@ public override int GetHashCode () { return base.GetHashCode (); } - + +#if NET_2_0 + [MonoTODO] + public override int GetByteCount (string s) + { + // hmm, does this override make any sense? + return base.GetByteCount (s); + } + + [MonoTODO] + public override string GetString (byte [] bytes, int index, int count) + { + // hmm, does this override make any sense? + return base.GetString (bytes, index, count); + } +#endif + +#if !NET_2_0 public override byte [] GetBytes (String s) { if (s == null) @@ -946,6 +1092,7 @@ public override int GetHashCode () GetBytes (s, 0, s.Length, bytes, 0); return bytes; } +#endif // UTF-8 decoder implementation. [Serializable] @@ -978,8 +1125,9 @@ public override int GetCharCount (byte[] bytes, int index, int count) { #if NET_2_0 DecoderFallbackBuffer buf = null; + byte [] bufferArg = null; return InternalGetCharCount (bytes, index, count, - leftOverBits, leftOverCount, this, ref buf, false); + leftOverBits, leftOverCount, this, ref buf, ref bufferArg, false); #else return InternalGetCharCount (bytes, index, count, leftOverBits, leftOverCount, throwOnInvalid, false); @@ -990,8 +1138,9 @@ public override int GetCharCount (byte[] bytes, int index, int count) { #if NET_2_0 DecoderFallbackBuffer buf = null; + byte [] bufferArg = null; return InternalGetChars (bytes, byteIndex, byteCount, - chars, charIndex, ref leftOverBits, ref leftOverCount, this, ref buf, false); + chars, charIndex, ref leftOverBits, ref leftOverCount, this, ref buf, ref bufferArg, false); #else return InternalGetChars (bytes, byteIndex, byteCount, chars, charIndex, ref leftOverBits, ref leftOverCount, throwOnInvalid, false); From ddc438299133d9098fbcaca301bb0fb79436c66b Mon Sep 17 00:00:00 2001 From: Dick Porter Date: Fri, 24 Mar 2006 12:19:30 +0000 Subject: [PATCH 110/117] 2006-03-22 Dick Porter * handles.c: * wapi-private.h: * shared.h: * shared.c: Delete the semaphores and shared files when the last process has finished with them svn path=/trunk/mono/; revision=58409 --- mono/io-layer/ChangeLog | 8 ++ mono/io-layer/handles.c | 19 +++- mono/io-layer/shared.c | 163 ++++++++++++++++++++++++++++++++--- mono/io-layer/shared.h | 3 +- mono/io-layer/wapi-private.h | 5 +- 5 files changed, 183 insertions(+), 15 deletions(-) diff --git a/mono/io-layer/ChangeLog b/mono/io-layer/ChangeLog index 1b59d9f25ce6b..3a8de9d05de82 100644 --- a/mono/io-layer/ChangeLog +++ b/mono/io-layer/ChangeLog @@ -1,3 +1,11 @@ +2006-03-22 Dick Porter + + * handles.c: + * wapi-private.h: + * shared.h: + * shared.c: Delete the semaphores and shared files when the last + process has finished with them + 2006-03-15 Dick Porter * events.c: diff --git a/mono/io-layer/handles.c b/mono/io-layer/handles.c index e827cc11535c7..cab0dec8b5fed 100644 --- a/mono/io-layer/handles.c +++ b/mono/io-layer/handles.c @@ -4,7 +4,7 @@ * Author: * Dick Porter (dick@ximian.com) * - * (C) 2002-2006 Ximian, Inc. + * (C) 2002-2006 Novell, Inc. */ #include @@ -132,6 +132,11 @@ pid_t _wapi_getpid (void) static mono_mutex_t scan_mutex = MONO_MUTEX_INITIALIZER; +static void handle_cleanup (void) +{ + _wapi_shm_semaphores_remove (); +} + static mono_once_t shared_init_once = MONO_ONCE_INIT; static void shared_init (void) { @@ -149,11 +154,11 @@ static void shared_init (void) _wapi_private_handle_count += _WAPI_HANDLE_INITIAL_COUNT; } while(_wapi_fd_reserve > _wapi_private_handle_count); + + _wapi_shm_semaphores_init (); _wapi_shared_layout = _wapi_shm_attach (WAPI_SHM_DATA); g_assert (_wapi_shared_layout != NULL); - - _wapi_shm_semaphores_init (); _wapi_fileshare_layout = _wapi_shm_attach (WAPI_SHM_FILESHARE); g_assert (_wapi_fileshare_layout != NULL); @@ -165,6 +170,13 @@ static void shared_init (void) thr_ret = mono_mutex_init(&_wapi_global_signal_mutex, NULL); g_assert (thr_ret == 0); + + /* Using g_atexit here instead of an explicit function call in + * a cleanup routine lets us cope when a third-party library + * calls exit (eg if an X client loses the connection to its + * server.) + */ + g_atexit (handle_cleanup); } static void _wapi_handle_init_shared (struct _WapiHandleShared *handle, @@ -1709,3 +1721,4 @@ void _wapi_handle_update_refs (void) _wapi_handle_unlock_shared_handles (); } + diff --git a/mono/io-layer/shared.c b/mono/io-layer/shared.c index 8f7f28570c5a8..3e92c3436e00d 100644 --- a/mono/io-layer/shared.c +++ b/mono/io-layer/shared.c @@ -4,7 +4,7 @@ * Author: * Dick Porter (dick@ximian.com) * - * (C) 2002 Ximian, Inc. + * (C) 2002-2006 Novell, Inc. */ @@ -34,7 +34,7 @@ static guchar *_wapi_shm_file (_wapi_shm_t type) static guchar file[_POSIX_PATH_MAX]; guchar *name = NULL, *filename, *dir, *wapi_dir; gchar machine_name[256]; - gchar *fake_name; + const gchar *fake_name; struct utsname ubuf; int ret; int len; @@ -259,9 +259,11 @@ gpointer _wapi_shm_attach (_wapi_shm_t type) void _wapi_shm_semaphores_init () { - key_t key = ftok (_wapi_shm_file (WAPI_SHM_DATA), 'M'); + key_t key; key_t oldkey; - + int thr_ret; + struct _WapiHandleSharedLayout *tmp_shared; + /* Yet more barmy API - this union is a well-defined parameter * in a syscall, yet I still have to define it here as it * doesn't appear in a header @@ -278,11 +280,31 @@ void _wapi_shm_semaphores_init () for (i = 0; i < _WAPI_SHARED_SEM_COUNT; i++) { def_vals[i] = 1; } +#ifdef NEXT_VERSION_INC + /* Process count must start at '0' - the 1 for all the others + * sets the semaphore to "unlocked" + */ + def_vals[_WAPI_SHARED_SEM_PROCESS_COUNT] = 0; +#endif + defs.array = def_vals; + /* Temporarily attach the shared data so we can read the + * semaphore key. We release this mapping and attach again + * after getting the semaphores to avoid a race condition + * where a terminating process can delete the shared files + * between a new process attaching the file and getting access + * to the semaphores (which increments the process count, + * preventing destruction of the shared data...) + */ + tmp_shared = _wapi_shm_attach (WAPI_SHM_DATA); + g_assert (tmp_shared != NULL); + + key = ftok (_wapi_shm_file (WAPI_SHM_DATA), 'M'); + again: retries++; - oldkey = _wapi_shared_layout->sem_key; + oldkey = tmp_shared->sem_key; if (oldkey == 0) { #ifdef DEBUG @@ -328,7 +350,7 @@ void _wapi_shm_semaphores_init () goto again; } - if (InterlockedCompareExchange (&_wapi_shared_layout->sem_key, + if (InterlockedCompareExchange (&tmp_shared->sem_key, key, 0) != 0) { /* Someone else created one and installed the * key while we were working, so delete the @@ -336,12 +358,12 @@ void _wapi_shm_semaphores_init () * 'key already known' case. */ semctl (_wapi_sem_id, 0, IPC_RMID); - oldkey = _wapi_shared_layout->sem_key; + oldkey = tmp_shared->sem_key; } else { /* We've installed this semaphore set's key into * the shared memory */ - return; + goto done; } } @@ -358,11 +380,80 @@ void _wapi_shm_semaphores_init () /* Someone must have deleted the semaphore set, so * blow away the bad key and try again */ - InterlockedCompareExchange (&_wapi_shared_layout->sem_key, 0, - oldkey); + InterlockedCompareExchange (&tmp_shared->sem_key, 0, oldkey); goto again; } + + done: + /* Increment the usage count of this semaphore set */ + thr_ret = _wapi_shm_sem_lock (_WAPI_SHARED_SEM_PROCESS_COUNT_LOCK); + g_assert (thr_ret == 0); + +#ifdef DEBUG + g_message ("%s: Incrementing the process count", __func__); +#endif + + /* We only ever _unlock_ this semaphore, letting the kernel + * restore (ie decrement) this unlock when this process exits. + * We lock another semaphore around it so we can serialise + * access when we're testing the value of this semaphore when + * we exit cleanly, so we can delete the whole semaphore set. + */ + _wapi_shm_sem_unlock (_WAPI_SHARED_SEM_PROCESS_COUNT); + +#ifdef DEBUG + g_message ("%s: Process count is now %d", __func__, semctl (_wapi_sem_id, _WAPI_SHARED_SEM_PROCESS_COUNT, GETVAL)); +#endif + + _wapi_shm_sem_unlock (_WAPI_SHARED_SEM_PROCESS_COUNT_LOCK); + + munmap (tmp_shared, sizeof(struct _WapiHandleSharedLayout)); +} + +void _wapi_shm_semaphores_remove (void) +{ + int thr_ret; + int proc_count; + +#ifdef DEBUG + g_message ("%s: Checking process count", __func__); +#endif + + thr_ret = _wapi_shm_sem_lock (_WAPI_SHARED_SEM_PROCESS_COUNT_LOCK); + g_assert (thr_ret == 0); + + proc_count = semctl (_wapi_sem_id, _WAPI_SHARED_SEM_PROCESS_COUNT, + GETVAL); +#ifdef NEXT_VERSION_INC + g_assert (proc_count > 0); + if (proc_count == 1) { +#else + /* Compatibility - the semaphore was initialised to '1' (which + * normally means 'unlocked'. Instead of fixing that right + * now, which would mean a shared file version increment, just + * cope with the value starting too high for now. Fix this + * next time I have to change the file version. + */ + g_assert (proc_count > 1); + if (proc_count == 2) { +#endif + /* Just us, so blow away the semaphores and the shared + * files + */ +#ifdef DEBUG + g_message ("%s: Removing semaphores!", __func__); +#endif + + semctl (_wapi_sem_id, IPC_RMID, 0); + unlink (_wapi_shm_file (WAPI_SHM_DATA)); + unlink (_wapi_shm_file (WAPI_SHM_FILESHARE)); + } else { + /* "else" clause, because there's no point unlocking + * the semaphore if we've just blown it away... + */ + _wapi_shm_sem_unlock (_WAPI_SHARED_SEM_PROCESS_COUNT_LOCK); + } } int _wapi_shm_sem_lock (int sem) @@ -378,11 +469,28 @@ int _wapi_shm_sem_lock (int sem) ops.sem_op = -1; ops.sem_flg = SEM_UNDO; + retry: do { ret = semop (_wapi_sem_id, &ops, 1); } while (ret == -1 && errno == EINTR); if (ret == -1) { + /* EINVAL covers the case when the semaphore was + * deleted before we started the semop + */ + if (errno == EIDRM || errno == EINVAL) { + /* Someone blew away this semaphore set, so + * get a new one and try again + */ +#ifdef DEBUG + g_message ("%s: Reinitialising the semaphores!", + __func__); +#endif + + _wapi_shm_semaphores_init (); + goto retry; + } + /* Turn this into a pthreads-style return value */ ret = errno; } @@ -407,11 +515,28 @@ int _wapi_shm_sem_trylock (int sem) ops.sem_op = -1; ops.sem_flg = IPC_NOWAIT | SEM_UNDO; + retry: do { ret = semop (_wapi_sem_id, &ops, 1); } while (ret == -1 && errno == EINTR); if (ret == -1) { + /* EINVAL covers the case when the semaphore was + * deleted before we started the semop + */ + if (errno == EIDRM || errno == EINVAL) { + /* Someone blew away this semaphore set, so + * get a new one and try again + */ +#ifdef DEBUG + g_message ("%s: Reinitialising the semaphores!", + __func__); +#endif + + _wapi_shm_semaphores_init (); + goto retry; + } + /* Turn this into a pthreads-style return value */ ret = errno; } @@ -441,11 +566,29 @@ int _wapi_shm_sem_unlock (int sem) ops.sem_op = 1; ops.sem_flg = SEM_UNDO; + retry: do { ret = semop (_wapi_sem_id, &ops, 1); } while (ret == -1 && errno == EINTR); if (ret == -1) { + /* EINVAL covers the case when the semaphore was + * deleted before we started the semop + */ + if (errno == EIDRM || errno == EINVAL) { + /* Someone blew away this semaphore set, so + * get a new one and try again (we can't just + * assume that the semaphore is now unlocked) + */ +#ifdef DEBUG + g_message ("%s: Reinitialising the semaphores!", + __func__); +#endif + + _wapi_shm_semaphores_init (); + goto retry; + } + /* Turn this into a pthreads-style return value */ ret = errno; } diff --git a/mono/io-layer/shared.h b/mono/io-layer/shared.h index af31fe1d9085d..be256f23fc6a3 100644 --- a/mono/io-layer/shared.h +++ b/mono/io-layer/shared.h @@ -4,7 +4,7 @@ * Author: * Dick Porter (dick@ximian.com) * - * (C) 2002 Ximian, Inc. + * (C) 2002-2006 Novell, Inc. */ #ifndef _WAPI_SHARED_H_ @@ -19,6 +19,7 @@ typedef enum { extern gpointer _wapi_shm_attach (_wapi_shm_t type); extern void _wapi_shm_semaphores_init (void); +extern void _wapi_shm_semaphores_remove (void); extern int _wapi_shm_sem_lock (int sem); extern int _wapi_shm_sem_trylock (int sem); extern int _wapi_shm_sem_unlock (int sem); diff --git a/mono/io-layer/wapi-private.h b/mono/io-layer/wapi-private.h index d82fbaf256463..918c1d4ee312b 100644 --- a/mono/io-layer/wapi-private.h +++ b/mono/io-layer/wapi-private.h @@ -4,7 +4,7 @@ * Author: * Dick Porter (dick@ximian.com) * - * (C) 2002 Ximian, Inc. + * (C) 2002-2006 Novell, Inc. */ #ifndef _WAPI_PRIVATE_H_ @@ -24,6 +24,7 @@ /* Increment this whenever an incompatible change is made to the * shared handle structure. */ +/* Next time I change this, remember to fix the process count in shared.c */ #define _WAPI_HANDLE_VERSION 10 typedef enum { @@ -165,6 +166,8 @@ struct _WapiHandleShared /*#define _WAPI_SHARED_SEM_COLLECTION 1*/ #define _WAPI_SHARED_SEM_FILESHARE 2 #define _WAPI_SHARED_SEM_SHARED_HANDLES 3 +#define _WAPI_SHARED_SEM_PROCESS_COUNT_LOCK 6 +#define _WAPI_SHARED_SEM_PROCESS_COUNT 7 #define _WAPI_SHARED_SEM_COUNT 8 /* Leave some future expansion space */ struct _WapiHandleSharedLayout From e159d170bf0f536c8e8b046cfd8ee9eeb7ebeeb1 Mon Sep 17 00:00:00 2001 From: Paolo Molaro Date: Fri, 24 Mar 2006 14:27:08 +0000 Subject: [PATCH 111/117] Fri Mar 24 15:26:00 CET 2006 Paolo Molaro * profiler.c: added the file=filename option in the default profiler to output the profile data to filename. svn path=/trunk/mono/; revision=58410 --- mono/metadata/ChangeLog | 6 +++++ mono/metadata/profiler.c | 47 ++++++++++++++++++++++++---------------- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/mono/metadata/ChangeLog b/mono/metadata/ChangeLog index a5f1d9241f2bc..2553cfd4a35f3 100644 --- a/mono/metadata/ChangeLog +++ b/mono/metadata/ChangeLog @@ -1,3 +1,9 @@ + +Fri Mar 24 15:26:00 CET 2006 Paolo Molaro + + * profiler.c: added the file=filename option in the default profiler + to output the profile data to filename. + 2006-03-22 Gonzalo Paniagua Javier * icall.c: CodeBase returns '/' instead of '\\' on windows. Fixes diff --git a/mono/metadata/profiler.c b/mono/metadata/profiler.c index cd9ac26966748..0fea99533fa67 100644 --- a/mono/metadata/profiler.c +++ b/mono/metadata/profiler.c @@ -484,6 +484,8 @@ mono_profiler_coverage_get (MonoProfiler *prof, MonoMethod *method, MonoProfileC * and improve it to do graphs and more accurate timestamping with rdtsc. */ +static FILE* poutput = NULL; + #define USE_X86TSC 0 #define USE_WIN32COUNTER 0 #if USE_X86TSC @@ -735,24 +737,24 @@ output_profile (GList *funcs) guint64 total_calls = 0; if (funcs) - g_print ("Time(ms) Count P/call(ms) Method name\n"); + fprintf (poutput, "Time(ms) Count P/call(ms) Method name\n"); for (tmp = funcs; tmp; tmp = tmp->next) { p = tmp->data; total_calls += p->count; if (!(gint)(p->total*1000)) continue; m = method_get_name (p->method); - printf ("########################\n"); - printf ("% 8.3f ", (double) (p->total * 1000)); - printf ("%7llu ", (unsigned long long)p->count); - printf ("% 8.3f ", (double) (p->total * 1000)/(double)p->count); - printf (" %s\n", m); + fprintf (poutput, "########################\n"); + fprintf (poutput, "% 8.3f ", (double) (p->total * 1000)); + fprintf (poutput, "%7llu ", (unsigned long long)p->count); + fprintf (poutput, "% 8.3f ", (double) (p->total * 1000)/(double)p->count); + fprintf (poutput, " %s\n", m); g_free (m); /* callers */ output_callers (p); } - printf ("Total number of calls: %lld\n", (long long)total_calls); + fprintf (poutput, "Total number of calls: %lld\n", (long long)total_calls); } typedef struct { @@ -825,7 +827,7 @@ output_callers (MethodProfile *p) { CallerInfo *cinfo; char *m; - g_print (" Callers (with count) that contribute at least for 1%%:\n"); + fprintf (poutput, " Callers (with count) that contribute at least for 1%%:\n"); total_callers = 0; for (cinfo = p->caller_info; cinfo; cinfo = cinfo->next) { total_callers += cinfo->count; @@ -837,7 +839,7 @@ output_callers (MethodProfile *p) { if (percent < 1) continue; m = method_get_name (cinfo->caller); - g_print (" %8d % 3d %% %s\n", cinfo->count, percent, m); + fprintf (poutput, " %8d % 3d %% %s\n", cinfo->count, percent, m); g_free (m); } } @@ -861,10 +863,10 @@ output_newobj_profile (GList *proflist) guint64 total = 0; GSList *sorted, *tmps; - g_print ("\nAllocation profiler\n"); + fprintf (poutput, "\nAllocation profiler\n"); if (proflist) - g_print ("%-9s %s\n", "Total mem", "Method"); + fprintf (poutput, "%-9s %s\n", "Total mem", "Method"); for (tmp = proflist; tmp; tmp = tmp->next) { p = tmp->data; total += p->count; @@ -872,7 +874,7 @@ output_newobj_profile (GList *proflist) continue; mp = p->mp; m = method_get_name (mp->method); - g_print ("########################\n%8" G_GUINT64_FORMAT " KB %s\n", (p->count / 1024), m); + fprintf (poutput, "########################\n%8" G_GUINT64_FORMAT " KB %s\n", (p->count / 1024), m); g_free (m); sorted = sort_alloc_list (mp->alloc_info); for (tmps = sorted; tmps; tmps = tmps->next) { @@ -888,12 +890,12 @@ output_newobj_profile (GList *proflist) } g_snprintf (buf, sizeof (buf), "%s%s%s%s", klass->name_space, klass->name_space ? "." : "", klass->name, isarray); - g_print (" %8" G_GUINT64_FORMAT " KB %8" G_GUINT64_FORMAT " %-48s\n", (ainfo->mem / 1024), ainfo->count, buf); + fprintf (poutput, " %8" G_GUINT64_FORMAT " KB %8" G_GUINT64_FORMAT " %-48s\n", (ainfo->mem / 1024), ainfo->count, buf); } /* callers */ output_callers (mp); } - g_print ("Total memory allocated: %" G_GUINT64_FORMAT " KB\n", total / 1024); + fprintf (poutput, "Total memory allocated: %" G_GUINT64_FORMAT " KB\n", total / 1024); } static void @@ -1225,13 +1227,13 @@ stat_prof_report (void) if (c > 1) g_free (mn); } - g_print ("prof counts: total/unmanaged: %d/%d\n", pcount, prof_ucounts); + fprintf (poutput, "prof counts: total/unmanaged: %d/%d\n", pcount, prof_ucounts); g_hash_table_foreach (prof_table, (GHFunc)prof_foreach, &sorted); for (tmp = sorted; tmp; tmp = tmp->next) { double perc; c = GPOINTER_TO_UINT (g_hash_table_lookup (prof_table, tmp->data)); perc = c*100.0/count; - g_print ("%7d\t%5.2f %% %s\n", c, perc, (char*)tmp->data); + fprintf (poutput, "%7d\t%5.2f %% %s\n", c, perc, (char*)tmp->data); } g_list_free (sorted); } @@ -1259,10 +1261,10 @@ simple_shutdown (MonoProfiler *prof) merge_thread_data (prof, tprof); } - printf("Total time spent compiling %d methods (sec): %.4g\n", prof->methods_jitted, prof->jit_time); + fprintf (poutput, "Total time spent compiling %d methods (sec): %.4g\n", prof->methods_jitted, prof->jit_time); if (prof->max_jit_method) { str = method_get_name (prof->max_jit_method); - printf("Slowest method to compile (sec): %.4g: %s\n", prof->max_jit_time, str); + fprintf (poutput, "Slowest method to compile (sec): %.4g: %s\n", prof->max_jit_time, str); g_free (str); } g_hash_table_foreach (prof->methods, (GHFunc)build_profile, &profile); @@ -1287,6 +1289,7 @@ mono_profiler_install_simple (const char *desc) MonoProfileFlags flags = 0; MONO_TIMER_STARTUP; + poutput = stdout; if (!desc) desc = "alloc,time,jit"; @@ -1310,7 +1313,13 @@ mono_profiler_install_simple (const char *desc) flags |= MONO_PROFILE_STATISTICAL | MONO_PROFILE_APPDOMAIN_EVENTS; else if (!strcmp (arg, "jit")) flags |= MONO_PROFILE_JIT_COMPILATION; - else { + else if (strncmp (arg, "file=", 5) == 0) { + poutput = fopen (arg + 5, "wb"); + if (!poutput) { + poutput = stdout; + fprintf (stderr, "profiler : cannot open profile output file '%s'.\n", arg + 5); + } + } else { fprintf (stderr, "profiler : Unknown argument '%s'.\n", arg); return; } From d7f41b2194e0225bd6eb290217f247c00b1d240e Mon Sep 17 00:00:00 2001 From: Paolo Molaro Date: Fri, 24 Mar 2006 14:38:51 +0000 Subject: [PATCH 112/117] Updates to the profiler section. svn path=/trunk/mono/; revision=58411 --- man/mono.1 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/man/mono.1 b/man/mono.1 index b39164d3af7eb..bac314961a7a1 100644 --- a/man/mono.1 +++ b/man/mono.1 @@ -277,8 +277,11 @@ is a profiler-specific string of options for the profiler itself. .Sp The default profiler accepts the following options 'alloc' to profile memory consumption by the application; 'time' to profile the time -spent on each routine and 'stat' to perform sample statistical -profiling. If no options are provided the default is 'alloc,time'. +spent on each routine; 'jit' to collect time spent JIT-compiling methods +and 'stat' to perform sample statistical profiling. +If no options are provided the default is 'alloc,time,jit'. By default the +profile data is printed to stdout: to change this, use the 'file=filename' +option to output the data to filename. .Sp For example: .nf @@ -292,11 +295,16 @@ and allocation profiling. .Sp .nf - mono --profile=default:stat,alloc program.exe + mono --profile=default:stat,alloc,file=prof.out program.exe .fi Will do sample statistical profiling and allocation profiling on -program.exe. +program.exe. The profile data is put in prof.out. +.Sp +Note that the statistical profiler has a very low overhead and should +be the preferred profiler to use (for better output use the full path +to the mono binary when running and make sure you have installed the +addr2line utility that comes from the binutils package). .SH PROFILERS There are a number of external profilers that have been developed for Mono, we will update this section to contain the profilers. From 19f6a7f521daeb3f5d7834ed3a270ce7a1ca7ad9 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Fri, 24 Mar 2006 16:09:39 +0000 Subject: [PATCH 113/117] 2006-03-24 Mike Kestner * ListView.cs: Scroll wheel support for the item control. Fixes #77839. svn path=/trunk/mcs/; revision=58416 --- .../System.Windows.Forms/ChangeLog | 5 +++ .../System.Windows.Forms/ListView.cs | 44 +++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index d8868c6c54f25..77da6ca12977d 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2006-03-24 Mike Kestner + + * ListView.cs: Scroll wheel support for the item control. Fixes + #77839. + 2006-03-23 Jackson Harper * ScrollableControl.cs: Special case negative sized areas, not diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs index 50e94608ca94f..91437996b645b 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs @@ -713,6 +713,25 @@ private void CalcTextSize () text_size.Height += 2; } + private void Scroll (ScrollBar scrollbar, int delta) + { + if (delta == 0 || !scrollbar.Visible) + return; + + int max; + if (scrollbar == h_scroll) + max = h_scroll.Maximum - item_control.Width; + else + max = v_scroll.Maximum - item_control.Height; + + int val = scrollbar.Value + delta; + if (val > max) + val = max; + else if (val < scrollbar.Minimum) + val = scrollbar.Minimum; + scrollbar.Value = val; + } + private void CalculateScrollBars () { Rectangle client_area = ClientRectangle; @@ -1171,6 +1190,7 @@ public ItemControl (ListView owner) MouseMove += new MouseEventHandler(ItemsMouseMove); MouseHover += new EventHandler(ItemsMouseHover); MouseUp += new MouseEventHandler(ItemsMouseUp); + MouseWheel += new MouseEventHandler(ItemsMouseWheel); Paint += new PaintEventHandler (ItemsPaint); } @@ -1318,6 +1338,30 @@ private void ItemsMouseUp (object sender, MouseEventArgs me) clicked_item = null; } + private void ItemsMouseWheel (object sender, MouseEventArgs me) + { + if (owner.Items.Count == 0) + return; + + int lines = me.Delta / 120; + + if (lines == 0) + return; + + switch (owner.View) { + case View.Details: + case View.SmallIcon: + owner.Scroll (owner.v_scroll, -owner.Items [0].Bounds.Height * SystemInformation.MouseWheelScrollLines * lines); + break; + case View.LargeIcon: + owner.Scroll (owner.v_scroll, -(owner.Items [0].Bounds.Height + ThemeEngine.Current.ListViewVerticalSpacing) * lines); + break; + case View.List: + owner.Scroll (owner.h_scroll, -owner.Items [0].Bounds.Width * lines); + break; + } + } + private void ItemsPaint (object sender, PaintEventArgs pe) { ThemeEngine.Current.DrawListViewItems (pe.Graphics, pe.ClipRectangle, owner); From 23860cbfbe456cbae321fbb0a8139f41ad0caa74 Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Fri, 24 Mar 2006 16:36:28 +0000 Subject: [PATCH 114/117] a few minor fixes to make the test tools more useful svn path=/trunk/mcs/; revision=58431 --- mcs/class/Mono.Security/Test/tools/mutual/mutual.cs | 3 ++- mcs/class/Mono.Security/Test/tools/tlstest/tlstest.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mcs/class/Mono.Security/Test/tools/mutual/mutual.cs b/mcs/class/Mono.Security/Test/tools/mutual/mutual.cs index ceb5c44e40779..9282d35505147 100644 --- a/mcs/class/Mono.Security/Test/tools/mutual/mutual.cs +++ b/mcs/class/Mono.Security/Test/tools/mutual/mutual.cs @@ -49,7 +49,8 @@ static void Main(string[] args) ssl.PrivateKeyCertSelectionDelegate += new PrivateKeySelectionCallback (PrivateKeySelection); StreamWriter sw = new StreamWriter (ssl, System.Text.Encoding.ASCII); - sw.WriteLine ("Hello"); + sw.WriteLine ("GET /clientcert.aspx{0}", Environment.NewLine); + sw.Flush (); StreamReader sr = new StreamReader (ssl); Console.WriteLine (sr.ReadToEnd ()); diff --git a/mcs/class/Mono.Security/Test/tools/tlstest/tlstest.cs b/mcs/class/Mono.Security/Test/tools/tlstest/tlstest.cs index 2f06912ca55cf..bd22b188c815d 100644 --- a/mcs/class/Mono.Security/Test/tools/tlstest/tlstest.cs +++ b/mcs/class/Mono.Security/Test/tools/tlstest/tlstest.cs @@ -207,7 +207,7 @@ public static string GetStreamPage (string url) ssl.ServerCertValidationDelegate += new CertificateValidationCallback (CertificateValidation); StreamWriter sw = new StreamWriter (ssl); - sw.WriteLine ("GET {0}{1}", uri.AbsolutePath, Environment.NewLine); + sw.WriteLine ("GET {0} HTTP/1.0{1}", uri.AbsolutePath, Environment.NewLine); sw.Flush (); StreamReader sr = new StreamReader (ssl, Encoding.UTF8); From 7d19e658219da84840330219914b0e94a64f73f0 Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Fri, 24 Mar 2006 16:37:22 +0000 Subject: [PATCH 115/117] Update SSL implementation to match 1.1.13.x branch svn path=/trunk/mcs/; revision=58433 --- .../ChangeLog | 13 + .../TlsClientHello.cs | 3 +- .../TlsServerFinished.cs | 3 - .../TlsServerHello.cs | 26 +- .../Mono.Security.Protocol.Tls/ChangeLog | 32 +++ .../CipherSuiteFactory.cs | 24 +- .../ClientSessionCache.cs | 234 ++++++++++++++++++ .../Mono.Security.Protocol.Tls/Context.cs | 7 + .../RecordProtocol.cs | 8 +- .../SslClientStream.cs | 113 ++++++--- .../SslServerStream.cs | 12 +- .../SslStreamBase.cs | 190 +++++++++++++- .../TlsCipherSuite.cs | 1 + .../Mono.Security.Protocol.Tls/TlsStream.cs | 3 +- .../Mono.Security/Mono.Security.dll.sources | 1 + 15 files changed, 598 insertions(+), 72 deletions(-) create mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/ChangeLog b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/ChangeLog index 1ce7c2a65372a..4172546ddb33a 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/ChangeLog +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/ChangeLog @@ -1,3 +1,16 @@ +2006-03-16 Sebastien Pouliot + + * TlsClientHello.cs: Check to see if we already have a known session + (past or concurrent) with the same target host. If so the use this + session id to try to resume (i.e. abbreviated handshake). + * TlsServerFinished.cs: Don't reset the hasndshake stream here. The + stream must be resetted once BOTH the client and the server are done. + The order of message can be different if we use an abbreviated + handshake sequence which leads to an invalid handshake. + * TlsServerHello.cs: Add this session info to the client cache. If the + server sends the same session id (as we supplied) then we MUST do an + abbreviated handshake. + 2005-11-23 Sebastien Pouliot * TlsServerCertificate.cs: Add support for Netscape Server Gated diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs index b2692bebc690a..9800ce04c0b26 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs @@ -82,7 +82,8 @@ protected override void ProcessAsTls1() this.Write(this.random); // Session id - // Send the session ID empty + // Check if we have a cache session we could reuse + this.Context.SessionId = ClientSessionCache.FromHost (this.Context.ClientSettings.TargetHost); if (this.Context.SessionId != null) { this.Write((byte)this.Context.SessionId.Length); diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs index a9238061eb017..1d27c81253d3a 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs @@ -46,9 +46,6 @@ public override void Update() { base.Update(); - // Reset Hahdshake messages information - this.Context.HandshakeMessages.Reset(); - // Hahdshake is finished this.Context.HandshakeState = HandshakeState.Finished; } diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs index 0023d60355905..6c097c355e74f 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs @@ -93,12 +93,18 @@ protected override void ProcessAsTls1() // Read random - Unix time + Random bytes this.random = this.ReadBytes(32); - + // Read Session id - int length = (int)ReadByte(); + int length = (int) ReadByte (); if (length > 0) { this.sessionId = this.ReadBytes(length); + ClientSessionCache.Add (this.Context.ClientSettings.TargetHost, this.sessionId); + this.Context.AbbreviatedHandshake = CompareSessionId (this.sessionId, this.Context.SessionId); + } + else + { + this.Context.AbbreviatedHandshake = false; } // Read cipher suite @@ -118,6 +124,22 @@ protected override void ProcessAsTls1() #region Private Methods + private bool CompareSessionId (byte[] id1, byte[] id2) + { + // in our case both null can't exist (or be valid) + if ((id1 == null) || (id2 == null)) + return false; + + if (id1.Length != id2.Length) + return false; + + for (int i = 0; i < id1.Length; i++) { + if (id1 [i] != id2 [i]) + return false; + } + return true; + } + private void processProtocol(short protocol) { SecurityProtocolType serverProtocol = this.Context.DecodeProtocolCode(protocol); diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog index 2adb1ed5e8d8b..40c0339e64758 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog @@ -1,3 +1,35 @@ +2006-03-16 Sebastien Pouliot + + * CipherSuiteFactory.cs: Fix bad key exchange values for non-export + cihpers. Most certificates have "too much" usages by default so this + was hidden from view. + * SslStreamBase.cs: Safety net. Throw an exception if we're waiting + for more than five (5) minutes for an async read or write to complete. + +2006-03-16 Sebastien Pouliot + + * ClientSessionCache.cs: New. Handle a client-side session cache to + enable the use of abbreviated handshake whenever possible. This will + reduce the number of negotiation (a very CPU intensive process) done + with the same host. + * Context.cs: Add a property for AbbreviatedHandshake. + * RecordProtocol.cs: Don't send Finished record from ChangeCipherSpec + as this won't work if the message flow change. + * SslClientStream.cs: Line endings. + * SslServerStream.cs: Throw an exception if ReceiveRecord return null + or an empty buffer (i.e. communication ended with client). Fix #76254. + * SslStreamBase.cs: Re-add synchronous implementations for Read and + Write. + * TlsCipherSuite.cs: Update the client-side session cache with the + mastersecret. + * TlsStream.cs: Avoid possible buffer underun reading bytes (found by + Gonzalo). + +2006-03-08 Sebastien Pouliot + + * SslStreamBase.cs: Re-implemented the synchronous versions of Read + and Write methods so they don't use the async code. + 2006-03-07 Gonzalo Paniagua Javier * SslStreamBase.cs: avoid creating the ManualResetEvent whenever diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs index 8c8f6ee7d96fc..3fa618a280a39 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs @@ -52,12 +52,12 @@ private static CipherSuiteCollection GetTls1SupportedCiphers() CipherSuiteCollection scs = new CipherSuiteCollection(SecurityProtocolType.Tls); // Supported ciphers - scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 32, 32, 256, 16, 16); - scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 16, 16); - scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); - scs.Add((0x00 << 0x08) | 0x05, "TLS_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); - scs.Add((0x00 << 0x08) | 0x04, "TLS_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); - scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); + scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, true, 32, 32, 256, 16, 16); + scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, true, 16, 16, 128, 16, 16); + scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, true, 24, 24, 168, 8, 8); + scs.Add((0x00 << 0x08) | 0x05, "TLS_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, false, 16, 16, 128, 0, 0); + scs.Add((0x00 << 0x08) | 0x04, "TLS_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, false, false, 16, 16, 128, 0, 0); + scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, true, 8, 8, 56, 8, 8); // Supported exportable ciphers scs.Add((0x00 << 0x08) | 0x03, "TLS_RSA_EXPORT_WITH_RC4_40_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, false, 5, 16, 40, 0, 0); @@ -131,11 +131,11 @@ private static CipherSuiteCollection GetSsl3SupportedCiphers() CipherSuiteCollection scs = new CipherSuiteCollection(SecurityProtocolType.Ssl3); // Supported ciphers - scs.Add((0x00 << 0x08) | 0x35, "SSL_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 32, 32, 256, 16, 16); - scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); - scs.Add((0x00 << 0x08) | 0x05, "SSL_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); - scs.Add((0x00 << 0x08) | 0x04, "SSL_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); - scs.Add((0x00 << 0x08) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); + scs.Add((0x00 << 0x08) | 0x35, "SSL_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, true, 32, 32, 256, 16, 16); + scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, true, 24, 24, 168, 8, 8); + scs.Add((0x00 << 0x08) | 0x05, "SSL_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, false, 16, 16, 128, 0, 0); + scs.Add((0x00 << 0x08) | 0x04, "SSL_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, false, false, 16, 16, 128, 0, 0); + scs.Add((0x00 << 0x08) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, true, 8, 8, 56, 8, 8); // Supported exportable ciphers scs.Add((0x00 << 0x08) | 0x03, "SSL_RSA_EXPORT_WITH_RC4_40_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, false, 5, 16, 40, 0, 0); @@ -188,4 +188,4 @@ private static CipherSuiteCollection GetSsl3SupportedCiphers() #endregion } -} \ No newline at end of file +} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs new file mode 100644 index 0000000000000..cac365c911ff2 --- /dev/null +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs @@ -0,0 +1,234 @@ +// +// ClientSessionCache.cs: Client-side cache for re-using sessions +// +// Author: +// Sebastien Pouliot +// +// Copyright (C) 2006 Novell (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.Collections; + +namespace Mono.Security.Protocol.Tls { + + internal class ClientSessionInfo : IDisposable { + + // we keep this item valid for 3 minutes (if unused) + private const int ValidityInterval = 3 * 60; + + private bool disposed; + private DateTime validuntil; + private string host; + + // see RFC2246 - Section 7 + private byte[] sid; + private byte[] masterSecret; + + public ClientSessionInfo (string hostname, byte[] id) + { + host = hostname; + sid = id; + KeepAlive (); + } + + ~ClientSessionInfo () + { + Dispose (false); + } + + + public string HostName { + get { return host; } + } + + public byte[] Id { + get { return sid; } + } + + public bool Valid { + get { return (validuntil > DateTime.UtcNow); } + } + + + public void GetContext (Context context) + { + CheckDisposed (); + masterSecret = (byte[]) context.MasterSecret.Clone (); + } + + public void SetContext (Context context) + { + CheckDisposed (); + context.MasterSecret = (byte[]) masterSecret.Clone (); + } + + public void KeepAlive () + { + CheckDisposed (); + validuntil = DateTime.UtcNow.AddSeconds (ValidityInterval); + } + + public void Dispose () + { + Dispose (true); + GC.SuppressFinalize (this); + } + + private void Dispose (bool disposing) + { + if (!disposed) { + validuntil = DateTime.MinValue; + host = null; + sid = null; + + if (masterSecret != null) { + Array.Clear (masterSecret, 0, masterSecret.Length); + masterSecret = null; + } + } + disposed = true; + } + + private void CheckDisposed () + { + if (disposed) { + string msg = Locale.GetText ("Cache session information were disposed."); + throw new ObjectDisposedException (msg); + } + } + } + + // note: locking is aggressive but isn't used often (and we gain much more :) + internal class ClientSessionCache { + + static Hashtable cache; + static object locker; + + static ClientSessionCache () + { + cache = new Hashtable (); + locker = new object (); + } + + // note: we may have multiple connections with a host, so + // possibly multiple entries per host (each with a different + // id), so we do not use the host as the hashtable key + static public void Add (string host, byte[] id) + { + lock (locker) { + string uid = BitConverter.ToString (id); + ClientSessionInfo si = (ClientSessionInfo) cache[uid]; + if (si == null) { + cache.Add (uid, new ClientSessionInfo (host, id)); + } else if (si.HostName == host) { + // we already have this and it's still valid + // on the server, so we'll keep it a little longer + si.KeepAlive (); + } else { + // it's very unlikely but the same session id + // could be used by more than one host. In this + // case we replace the older one with the new one + si.Dispose (); + cache.Remove (uid); + cache.Add (uid, new ClientSessionInfo (host, id)); + } + } + } + + // return the first session us + static public byte[] FromHost (string host) + { + lock (locker) { + foreach (ClientSessionInfo si in cache.Values) { + if (si.HostName == host) { + if (si.Valid) { + // ensure it's still valid when we really need it + si.KeepAlive (); + return si.Id; + } + } + } + return null; + } + } + + // only called inside the lock + static private ClientSessionInfo FromContext (Context context) + { + if (context == null) + return null; + + byte[] id = context.SessionId; + if (id == null) + return null; + + // do we have a session cached for this host ? + string uid = BitConverter.ToString (id); + + ClientSessionInfo si = (ClientSessionInfo) cache[uid]; + if (si == null) + return null; + + // In the unlikely case of multiple hosts using the same + // session id, we just act like we do not know about it + if (context.ClientSettings.TargetHost != si.HostName) + return null; + + // yes, so what's its status ? + if (!si.Valid) { + si.Dispose (); + cache.Remove (uid); + return null; + } + + // ok, it make sense + return si; + } + + static public bool SetContextInCache (Context context) + { + lock (locker) { + ClientSessionInfo csi = FromContext (context); + if (csi == null) + return false; + + csi.GetContext (context); + csi.KeepAlive (); + return true; + } + } + + static public bool SetContextFromCache (Context context) + { + lock (locker) { + ClientSessionInfo csi = FromContext (context); + if (csi == null) + return false; + + csi.SetContext (context); + csi.KeepAlive (); + return true; + } + } + } +} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/Context.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/Context.cs index 579548d5e3b9c..1baf7439fdc76 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/Context.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/Context.cs @@ -72,6 +72,7 @@ internal abstract class Context private HandshakeState handshakeState; // Misc + private bool abbreviatedHandshake; private bool isActual; private bool connectionEnd; private bool protocolNegotiated; @@ -108,6 +109,12 @@ internal abstract class Context #region Properties + public bool AbbreviatedHandshake + { + get { return abbreviatedHandshake; } + set { abbreviatedHandshake = value; } + } + public bool ProtocolNegotiated { get { return this.protocolNegotiated; } diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs index 79e37745bc332..98aa811ee06b4 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs @@ -174,14 +174,13 @@ private void SetComplete(Exception ex, byte[] resultingBuffer) return; completed = true; + _asyncException = ex; + _resultingBuffer = resultingBuffer; if (handle != null) handle.Set (); if (_userCallback != null) _userCallback.BeginInvoke (this, null, null); - - _asyncException = ex; - _resultingBuffer = resultingBuffer; } } @@ -632,9 +631,6 @@ public void SendChangeCipherSpec() // Make the pending state to be the current state this.context.IsActual = true; - - // Send Finished message - this.SendRecord(HandshakeType.Finished); } public IAsyncResult BeginSendRecord(HandshakeType handshakeType, AsyncCallback callback, object state) diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs index 0f4e3b44e477b..c4407e05b010c 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs @@ -252,60 +252,103 @@ internal override IAsyncResult OnBeginNegotiateHandshake(AsyncCallback callback, } } + private void SafeReceiveRecord (Stream s) + { + byte[] record = this.protocol.ReceiveRecord (s); + if ((record == null) || (record.Length == 0)) { + throw new TlsException ( + AlertDescription.HandshakeFailiure, + "The server stopped the handshake."); + } + } + internal override void OnNegotiateHandshakeCallback(IAsyncResult asyncResult) { this.protocol.EndSendRecord(asyncResult); // Read server response - while (this.context.LastHandshakeMsg != HandshakeType.ServerHelloDone) + while (this.context.LastHandshakeMsg != HandshakeType.ServerHelloDone) { // Read next record - this.protocol.ReceiveRecord(this.innerStream); - } - - // Send client certificate if requested - // even if the server ask for it it _may_ still be optional - bool clientCertificate = this.context.ServerSettings.CertificateRequest; + SafeReceiveRecord (this.innerStream); - // NOTE: sadly SSL3 and TLS1 differs in how they handle this and - // the current design doesn't allow a very cute way to handle - // SSL3 alert warning for NoCertificate (41). - if (this.context.SecurityProtocol == SecurityProtocolType.Ssl3) - { - clientCertificate = ((this.context.ClientSettings.Certificates != null) && - (this.context.ClientSettings.Certificates.Count > 0)); - // this works well with OpenSSL (but only for SSL3) + // special case for abbreviated handshake where no ServerHelloDone is sent from the server + if (this.context.AbbreviatedHandshake && (this.context.LastHandshakeMsg == HandshakeType.ServerHello)) + break; } - if (clientCertificate) + // the handshake is much easier if we can reuse a preivous session settings + if (this.context.AbbreviatedHandshake) { - this.protocol.SendRecord(HandshakeType.Certificate); - } + ClientSessionCache.SetContextFromCache (this.context); + this.context.Cipher.ComputeKeys (); + this.context.Cipher.InitializeCipher (); - // Send Client Key Exchange - this.protocol.SendRecord(HandshakeType.ClientKeyExchange); + // Send Cipher Spec protocol + this.protocol.SendChangeCipherSpec (); - // Now initialize session cipher with the generated keys - this.context.Cipher.InitializeCipher(); + // Read record until server finished is received + while (this.context.HandshakeState != HandshakeState.Finished) + { + // If all goes well this will process messages: + // Change Cipher Spec + // Server finished + SafeReceiveRecord (this.innerStream); + } - // Send certificate verify if requested (optional) - if (clientCertificate && (this.context.ClientSettings.ClientCertificate != null)) - { - this.protocol.SendRecord(HandshakeType.CertificateVerify); + // Send Finished message + this.protocol.SendRecord (HandshakeType.Finished); } + else + { + // Send client certificate if requested + // even if the server ask for it it _may_ still be optional + bool clientCertificate = this.context.ServerSettings.CertificateRequest; + + // NOTE: sadly SSL3 and TLS1 differs in how they handle this and + // the current design doesn't allow a very cute way to handle + // SSL3 alert warning for NoCertificate (41). + if (this.context.SecurityProtocol == SecurityProtocolType.Ssl3) + { + clientCertificate = ((this.context.ClientSettings.Certificates != null) && + (this.context.ClientSettings.Certificates.Count > 0)); + // this works well with OpenSSL (but only for SSL3) + } + + if (clientCertificate) + { + this.protocol.SendRecord(HandshakeType.Certificate); + } - // Send Cipher Spec protocol - this.protocol.SendChangeCipherSpec(); + // Send Client Key Exchange + this.protocol.SendRecord(HandshakeType.ClientKeyExchange); - // Read record until server finished is received - while (this.context.HandshakeState != HandshakeState.Finished) - { - // If all goes well this will process messages: - // Change Cipher Spec - // Server finished - this.protocol.ReceiveRecord(this.innerStream); + // Now initialize session cipher with the generated keys + this.context.Cipher.InitializeCipher(); + + // Send certificate verify if requested (optional) + if (clientCertificate && (this.context.ClientSettings.ClientCertificate != null)) + { + this.protocol.SendRecord(HandshakeType.CertificateVerify); + } + + // Send Cipher Spec protocol + this.protocol.SendChangeCipherSpec (); + // Send Finished message + this.protocol.SendRecord (HandshakeType.Finished); + + // Read record until server finished is received + while (this.context.HandshakeState != HandshakeState.Finished) { + // If all goes well this will process messages: + // Change Cipher Spec + // Server finished + SafeReceiveRecord (this.innerStream); + } } + // Reset Handshake messages information + this.context.HandshakeMessages.Reset (); + // Clear Key Info this.context.ClearKeyInfo(); diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs index 09b7c1f1df827..a97204b10fb5d 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs @@ -226,10 +226,18 @@ internal override void OnNegotiateHandshakeCallback(IAsyncResult asyncResult) this.protocol.SendRecord(HandshakeType.ServerHelloDone); // Receive client response, until the Client Finished message - // is received + // is received. IE can be interrupted at this stage and never + // complete the handshake + DateTime complete = DateTime.Now.AddSeconds (10); while (this.context.LastHandshakeMsg != HandshakeType.Finished) { - this.protocol.ReceiveRecord(this.innerStream); + byte[] record = this.protocol.ReceiveRecord(this.innerStream); + if ((record == null) || (record.Length == 0)) + { + throw new TlsException( + AlertDescription.HandshakeFailiure, + "The client stopped the handshake."); + } } if (certRequested && (this.context.ClientSettings.ClientCertificate == null)) diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs index 952623fa050ee..d236029c3e921 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs @@ -39,6 +39,8 @@ public abstract class SslStreamBase: Stream, IDisposable #region Fields + private const int WaitTimeOut = 5 * 60 * 1000; + internal Stream innerStream; internal MemoryStream inputBuffer; internal Context context; @@ -442,10 +444,10 @@ private void SetComplete(Exception ex, int bytesRead) return; completed = true; - if (handle != null) - handle.Set (); _asyncException = ex; _bytesRead = bytesRead; + if (handle != null) + handle.Set (); } if (_userCallback != null) _userCallback.BeginInvoke (this, null, null); @@ -858,8 +860,11 @@ public override int EndRead(IAsyncResult asyncResult) } // Always wait until the read is complete - if (asyncResult.IsCompleted == false) - asyncResult.AsyncWaitHandle.WaitOne(); + if (!asyncResult.IsCompleted) + { + if (!asyncResult.AsyncWaitHandle.WaitOne (WaitTimeOut, false)) + throw new TlsException (AlertDescription.InternalError, "Couldn't complete EndRead"); + } if (internalResult.CompletedWithError) { @@ -880,8 +885,11 @@ public override void EndWrite(IAsyncResult asyncResult) } - if (asyncResult.IsCompleted == false) - internalResult.AsyncWaitHandle.WaitOne(); + if (!asyncResult.IsCompleted) + { + if (!internalResult.AsyncWaitHandle.WaitOne (WaitTimeOut, false)) + throw new TlsException (AlertDescription.InternalError, "Couldn't complete EndWrite"); + } if (internalResult.CompletedWithError) { @@ -908,9 +916,127 @@ public int Read(byte[] buffer) public override int Read(byte[] buffer, int offset, int count) { - IAsyncResult res = this.BeginRead(buffer, offset, count, null, null); + this.checkDisposed (); + + if (buffer == null) + { + throw new ArgumentNullException ("buffer"); + } + if (offset < 0) + { + throw new ArgumentOutOfRangeException("offset is less than 0."); + } + if (offset > buffer.Length) + { + throw new ArgumentOutOfRangeException("offset is greater than the length of buffer."); + } + if (count < 0) + { + throw new ArgumentOutOfRangeException("count is less than 0."); + } + if (count > (buffer.Length - offset)) + { + throw new ArgumentOutOfRangeException("count is less than the length of buffer minus the value of the offset parameter."); + } + + if (this.context.HandshakeState != HandshakeState.Finished) + { + this.NegotiateHandshake (); // Handshake negotiation + } - return this.EndRead(res); + lock (this.read) { + try { + // do we already have some decrypted data ? + if (this.inputBuffer.Position > 0) { + // or maybe we used all the buffer before ? + if (this.inputBuffer.Position == this.inputBuffer.Length) { + this.inputBuffer.SetLength (0); + } else { + int n = this.inputBuffer.Read (buffer, offset, count); + if (n > 0) + return n; + } + } + + bool needMoreData = false; + while (true) { + // we first try to process the read with the data we already have + if ((recordStream.Position == 0) || needMoreData) { + needMoreData = false; + // if we loop, then it either means we need more data + byte[] recbuf = new byte[16384]; + int n = innerStream.Read (recbuf, 0, recbuf.Length); + if (n > 0) { + // Add the new received data to the waiting data + if ((recordStream.Length > 0) && (recordStream.Position != recordStream.Length)) + recordStream.Seek (0, SeekOrigin.End); + recordStream.Write (recbuf, 0, n); + } else { + // or that the read operation is done (lost connection in the case of a network stream). + return 0; + } + } + + bool dataToReturn = false; + long pos = recordStream.Position; + + recordStream.Position = 0; + byte[] record = null; + + // don't try to decode record unless we have at least 5 bytes + // i.e. type (1), protocol (2) and length (2) + if (recordStream.Length >= 5) { + record = this.protocol.ReceiveRecord (recordStream); + needMoreData = (record == null); + } + + // a record of 0 length is valid (and there may be more record after it) + while (record != null) { + // we probably received more stuff after the record, and we must keep it! + long remainder = recordStream.Length - recordStream.Position; + byte[] outofrecord = null; + if (remainder > 0) { + outofrecord = new byte[remainder]; + recordStream.Read (outofrecord, 0, outofrecord.Length); + } + + long position = this.inputBuffer.Position; + + if (record.Length > 0) { + // Write new data to the inputBuffer + this.inputBuffer.Seek (0, SeekOrigin.End); + this.inputBuffer.Write (record, 0, record.Length); + + // Restore buffer position + this.inputBuffer.Seek (position, SeekOrigin.Begin); + dataToReturn = true; + } + + recordStream.SetLength (0); + record = null; + + if (remainder > 0) { + recordStream.Write (outofrecord, 0, outofrecord.Length); + } + + if (dataToReturn) { + // we have record(s) to return -or- no more available to read from network + // reset position for further reading + return this.inputBuffer.Read (buffer, offset, count); + } + } + } + } + catch (TlsException ex) + { + throw new IOException("The authentication or decryption has failed.", ex); + } + catch (Exception ex) + { + throw new IOException("IO exception during read.", ex); + } + } + return 0; } public override long Seek(long offset, SeekOrigin origin) @@ -930,9 +1056,53 @@ public void Write(byte[] buffer) public override void Write(byte[] buffer, int offset, int count) { - IAsyncResult res = this.BeginWrite(buffer, offset, count, null, null); + this.checkDisposed (); + + if (buffer == null) + { + throw new ArgumentNullException ("buffer"); + } + if (offset < 0) + { + throw new ArgumentOutOfRangeException("offset is less than 0."); + } + if (offset > buffer.Length) + { + throw new ArgumentOutOfRangeException("offset is greater than the length of buffer."); + } + if (count < 0) + { + throw new ArgumentOutOfRangeException("count is less than 0."); + } + if (count > (buffer.Length - offset)) + { + throw new ArgumentOutOfRangeException("count is less than the length of buffer minus the value of the offset parameter."); + } - this.EndWrite(res); + if (this.context.HandshakeState != HandshakeState.Finished) + { + this.NegotiateHandshake (); + } + + lock (this.write) + { + try + { + // Send the buffer as a TLS record + byte[] record = this.protocol.EncodeRecord (ContentType.ApplicationData, buffer, offset, count); + this.innerStream.Write (record, 0, record.Length); + } + catch (TlsException ex) + { + this.protocol.SendAlert(ex.Alert); + this.Close(); + throw new IOException("The authentication or decryption has failed.", ex); + } + catch (Exception ex) + { + throw new IOException("IO exception during Write.", ex); + } + } } public override bool CanRead diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs index 6b9dbc4360f1a..0b90a278714dd 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs @@ -183,6 +183,7 @@ public override void ComputeKeys() DebugHelper.WriteLine(">>>> ServerWriteIV", this.Context.ServerWriteIV); DebugHelper.WriteLine(">>>> ServerWriteMAC", this.Context.ServerWriteMAC); + ClientSessionCache.SetContextInCache (this.Context); // Clear no more needed data keyBlock.Reset(); } diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs index cb112e9bdad92..6257b20202669 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs @@ -143,7 +143,8 @@ public long ReadInt64() public byte[] ReadBytes(int count) { byte[] bytes = new byte[count]; - this.Read(bytes, 0, count); + if (this.Read(bytes, 0, count) != count) + throw new TlsException ("buffer underrun"); return bytes; } diff --git a/mcs/class/Mono.Security/Mono.Security.dll.sources b/mcs/class/Mono.Security/Mono.Security.dll.sources index 8a5ff91beb5f4..183eaa7f8f97b 100644 --- a/mcs/class/Mono.Security/Mono.Security.dll.sources +++ b/mcs/class/Mono.Security/Mono.Security.dll.sources @@ -78,6 +78,7 @@ ./Mono.Security.Protocol.Tls/CipherSuiteFactory.cs ./Mono.Security.Protocol.Tls/ClientContext.cs ./Mono.Security.Protocol.Tls/ClientRecordProtocol.cs +./Mono.Security.Protocol.Tls/ClientSessionCache.cs ./Mono.Security.Protocol.Tls/ContentType.cs ./Mono.Security.Protocol.Tls/Context.cs ./Mono.Security.Protocol.Tls/DebugHelper.cs From 74dc7c9a0a84cdd07045bf0cb7ede939a0278c90 Mon Sep 17 00:00:00 2001 From: Dick Porter Date: Fri, 24 Mar 2006 16:50:16 +0000 Subject: [PATCH 116/117] 2006-03-24 Dick Porter * file-io.c (get_file_attributes): More stat macro breakage. Fixes bug 77759. svn path=/trunk/mono/; revision=58446 --- mono/metadata/ChangeLog | 4 ++++ mono/metadata/file-io.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mono/metadata/ChangeLog b/mono/metadata/ChangeLog index 2553cfd4a35f3..afb7e741e3d3f 100644 --- a/mono/metadata/ChangeLog +++ b/mono/metadata/ChangeLog @@ -1,3 +1,7 @@ +2006-03-24 Dick Porter + + * file-io.c (get_file_attributes): More stat macro breakage. + Fixes bug 77759. Fri Mar 24 15:26:00 CET 2006 Paolo Molaro diff --git a/mono/metadata/file-io.c b/mono/metadata/file-io.c index b507e6d41919c..cf5a355fb631a 100644 --- a/mono/metadata/file-io.c +++ b/mono/metadata/file-io.c @@ -351,7 +351,7 @@ get_file_attributes (const char *filename) buf.st_mode &= ~S_IFSOCK; /* don't consider socket protection */ file_attrs = 0; - if ((buf.st_mode & S_IFDIR) != 0) + if (S_ISDIR (buf.st_mode)) file_attrs |= FILE_ATTRIBUTE_DIRECTORY; else file_attrs |= FILE_ATTRIBUTE_ARCHIVE; From 51ad032d8e1d4997bea0ca46c797b25d1899f3f3 Mon Sep 17 00:00:00 2001 From: Gonzalo Paniagua Javier Date: Fri, 24 Mar 2006 17:46:37 +0000 Subject: [PATCH 117/117] 2006-03-24 Gonzalo Paniagua Javier * assembly.c: publickeytoken is case insensitive. Fixes bug #77898. svn path=/trunk/mono/; revision=58458 --- mono/metadata/ChangeLog | 4 ++++ mono/metadata/assembly.c | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/mono/metadata/ChangeLog b/mono/metadata/ChangeLog index afb7e741e3d3f..4a90eebf332f4 100644 --- a/mono/metadata/ChangeLog +++ b/mono/metadata/ChangeLog @@ -1,3 +1,7 @@ +2006-03-24 Gonzalo Paniagua Javier + + * assembly.c: publickeytoken is case insensitive. Fixes bug #77898. + 2006-03-24 Dick Porter * file-io.c (get_file_attributes): More stat macro breakage. diff --git a/mono/metadata/assembly.c b/mono/metadata/assembly.c index 63178ae8f6950..b32914c7d08c0 100644 --- a/mono/metadata/assembly.c +++ b/mono/metadata/assembly.c @@ -1549,14 +1549,17 @@ build_assembly_name (const char *name, const char *version, const char *culture, aname->name = g_strdup (name); if (culture) { - if (g_strcasecmp (culture, "neutral") == 0) + if (g_ascii_strcasecmp (culture, "neutral") == 0) aname->culture = g_strdup (""); else aname->culture = g_strdup (culture); } - if (token && strncmp (token, "null", 4) != 0) - g_strlcpy ((char*)aname->public_key_token, token, MONO_PUBLIC_KEY_TOKEN_LENGTH); + if (token && strncmp (token, "null", 4) != 0) { + char *lower = g_ascii_strdown (token, MONO_PUBLIC_KEY_TOKEN_LENGTH); + g_strlcpy ((char*)aname->public_key_token, lower, MONO_PUBLIC_KEY_TOKEN_LENGTH); + g_free (lower); + } if (key && strncmp (key, "null", 4) != 0) { if (!parse_public_key (key, &pkey)) {