From mono-patches-list at lists.ximian.com Mon Dec 1 00:00:42 2008 From: mono-patches-list at lists.ximian.com (Calen Chen (cachen@novell.com)) Date: Mon, 1 Dec 2008 00:00:42 -0500 (EST) Subject: [Mono-patches] r120334 - in trunk/uia2atk/test: . samples Message-ID: <20081201050042.DDC309472C@mono-cvs.ximian.com> Author: cachen Date: 2008-12-01 00:00:42 -0500 (Mon, 01 Dec 2008) New Revision: 120334 Added: trunk/uia2atk/test/samples/toolstripprogressbar.py Modified: trunk/uia2atk/test/ChangeLog Log: add SWF toolstripprogressbar example Modified: trunk/uia2atk/test/ChangeLog =================================================================== --- trunk/uia2atk/test/ChangeLog 2008-12-01 04:08:59 UTC (rev 120333) +++ trunk/uia2atk/test/ChangeLog 2008-12-01 05:00:42 UTC (rev 120334) @@ -1,3 +1,10 @@ +2008-12-01 Calen Chen + + * samples/toolstripprogressbar.py: reduce windows size. delete + extraneous widget except for statusstrip and toolstripprogressbar. + add button1 to process the progressbar value, add label to show the + process of progressbar + 2008-11-28 Calen Chen * samples/toolstripdropdownbutton.py: reduce windows size, delete Added: trunk/uia2atk/test/samples/toolstripprogressbar.py =================================================================== --- trunk/uia2atk/test/samples/toolstripprogressbar.py 2008-12-01 04:08:59 UTC (rev 120333) +++ trunk/uia2atk/test/samples/toolstripprogressbar.py 2008-12-01 05:00:42 UTC (rev 120334) @@ -0,0 +1,86 @@ +#!/usr/bin/env ipy + +############################################################################## +# Written by: Calen Chen +# Date: 12/01/2008 +# Description: This is a test application sample for winforms control: +# ToolStripProgressBar +############################################################################## + +# The docstring below is used in the generated log file +""" +This sample will show "ToolStripProgressBar" controls in the form. +It can be used for Autotest tools(e.g. Strongwind) to test the behaviors of controls. +""" + +import clr +import System +import System.IO + +clr.AddReference('System.Windows.Forms') +clr.AddReference('System.Drawing') + +from System.Windows.Forms import * +from System.Drawing import * +import System.Drawing.Text + + +class RunApp(Form): + + def __init__(self): + + # setup form + self.Text = "ToolStripProgressBar control" + self.Width = 300 + self.Height = 230 + self.FormBorderStyle = FormBorderStyle.Fixed3D + + self.count = 0 + + #click button to change progressbar's process + self.button = Button() + self.button.Text = "button1" + self.button.Location = Point(10, 20) + self.button.AutoSize = True + self.button.Click += self.bc + self.Controls.Add(self.button) + + #label shows the change of process + self.label = Label() + self.label.Text = "It is 0% of 100%" + self.label.Location = Point(10, 80) + self.label.AutoSize = True + self.Controls.Add(self.label) + + #StatusStrip: + self.statusstrip1 = StatusStrip() + self.statusstrip1.GripStyle = ToolStripGripStyle.Visible + self.statusstrip1.Name = "toolstrip1" + self.Controls.Add(self.statusstrip1) + +##ToolStripProgressBar + self.toolstripprogressbar1 = ToolStripProgressBar() + self.toolstripprogressbar1.Enabled = True + self.toolstripprogressbar1.Text = "ToolStripProgressBar" + self.toolstripprogressbar1.ToolTipText = "ToolStripProgressBar" + self.toolstripprogressbar1.Minimum = 0 + self.toolstripprogressbar1.Maximum = 100 + self.toolstripprogressbar1.Value = 0 + self.toolstripprogressbar1.Step = 10 + + self.statusstrip1.Items.Add(self.toolstripprogressbar1) + + + def bc(self, sender, event): + #MessageBox.Show("the first plugin") + #print "Clicked ToolStripButton at StatusStrip" + if self.toolstripprogressbar1.Value < self.toolstripprogressbar1.Maximum: + self.toolstripprogressbar1.Value = self.toolstripprogressbar1.Value + self.toolstripprogressbar1.Step + self.label.Text = "It is %d%% of 100%%" % self.toolstripprogressbar1.Value + else: + self.label.Text = "Done" + +form = RunApp() +Application.Run(form) + + Property changes on: trunk/uia2atk/test/samples/toolstripprogressbar.py ___________________________________________________________________ Name: svn:executable + * From mono-patches-list at lists.ximian.com Mon Dec 1 00:12:26 2008 From: mono-patches-list at lists.ximian.com (Atsushi Enomoto (atsushi@ximian.com)) Date: Mon, 1 Dec 2008 00:12:26 -0500 (EST) Subject: [Mono-patches] r120335 - trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel Message-ID: <20081201051226.486059472C@mono-cvs.ximian.com> Author: atsushi Date: 2008-12-01 00:12:25 -0500 (Mon, 01 Dec 2008) New Revision: 120335 Modified: trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/Activity.cs Log: fix inconsistent EOL. Modified: trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/Activity.cs =================================================================== --- trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/Activity.cs 2008-12-01 05:00:42 UTC (rev 120334) +++ trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/Activity.cs 2008-12-01 05:12:25 UTC (rev 120335) @@ -34,12 +34,12 @@ namespace System.Workflow.ComponentModel { - public class Activity : DependencyObject + public class Activity : DependencyObject { private static DependencyProperty NameProperty; private static DependencyProperty DescriptionProperty; private static DependencyProperty EnabledProperty; - private static DependencyProperty ExecutionResultProperty; + private static DependencyProperty ExecutionResultProperty; private static DependencyProperty ExecutionStatusProperty; private Guid workflow_id; private Queue exec_activities; @@ -70,14 +70,14 @@ Console.WriteLine ("*** You should use a version built with the Runtime dependencies"); #endif } - - // Constructors + + // Constructors public Activity () { Init (); Name = GetType().Name; } - + public Activity (string name) { Init (); @@ -101,32 +101,32 @@ return parent; } } - + public string Description { get { - return (string) GetValue (DescriptionProperty); + return (string) GetValue (DescriptionProperty); } set { SetValue (DescriptionProperty, value); } } - + public bool Enabled { get { - return (bool) GetValue (EnabledProperty); + return (bool) GetValue (EnabledProperty); } set { SetValue (EnabledProperty, value); } } - + public ActivityExecutionResult ExecutionResult { get { return (ActivityExecutionResult) GetValue (ExecutionResultProperty); } - } + } public ActivityExecutionStatus ExecutionStatus { get { return (ActivityExecutionStatus) GetValue (ExecutionStatusProperty); @@ -137,17 +137,17 @@ public bool IsDynamicActivity { get {return false;} } - + public string Name { get { - return (string) GetValue (Activity.NameProperty); + return (string) GetValue (Activity.NameProperty); } set { SetValue (Activity.NameProperty, value); } - } - + } + public string QualifiedName { get { return Name; @@ -186,7 +186,7 @@ set { parallel_parent = value; } - } + } // Methods [MonoTODO] @@ -195,7 +195,7 @@ throw new NotImplementedException (); } - protected internal virtual ActivityExecutionStatus Cancel (ActivityExecutionContext executionContext) + protected internal virtual ActivityExecutionStatus Cancel (ActivityExecutionContext executionContext) { return ActivityExecutionStatus.Canceling; } @@ -210,7 +210,7 @@ { } - + public Activity GetActivityByName (string activityQualifiedName) { return GetActivityByName (activityQualifiedName, true); @@ -252,11 +252,12 @@ protected internal virtual ActivityExecutionStatus HandleFault (ActivityExecutionContext executionContext, Exception exception) { - return ActivityExecutionStatus.Closed; + return ActivityExecutionStatus.Closed; } - + //public static Activity Load(Stream stream, Activity outerActivity) - //public static Activity Load (Stream stream, Activity outerActivity, IFormatter formatter) + + //public static Activity Load (Stream stream, Activity outerActivity, IFormatter formatter) //public void RegisterForStatusChange (DependencyProperty dependencyProp, IActivityEventListener activityStatusChangeListener) //public void Save (Stream stream) //public void Save (Stream stream, IFormatter formatter) @@ -265,12 +266,12 @@ { } - + public override string ToString () { return Name + " [" + base.ToString ()+ "]"; } - + //public void UnregisterForStatusChange (DependencyProperty dependencyProp, IActivityEventListener activityStatusChangeListener) // Private methods @@ -288,7 +289,7 @@ te = new TimerEventSubscription (executionContext.ExecutionContextManager.Workflow.InstanceId, expiresAt); - WorkflowQueuingService qService = executionContext.GetService (); + WorkflowQueuingService qService = executionContext.GetService (); queue = qService.CreateWorkflowQueue (te.QueueName, true); queue.QueueItemArrived += OnQueueTimerItemArrived; executionContext.ExecutionContextManager.Workflow.TimerEventSubscriptionCollection.Add (te); From mono-patches-list at lists.ximian.com Mon Dec 1 00:13:20 2008 From: mono-patches-list at lists.ximian.com (Atsushi Enomoto (atsushi@ximian.com)) Date: Mon, 1 Dec 2008 00:13:20 -0500 (EST) Subject: [Mono-patches] r120336 - in trunk/olive/class/System.Workflow.ComponentModel: System.Workflow.ComponentModel Test/System.Workflow.ComponentModel Message-ID: <20081201051320.31BAC9472C@mono-cvs.ximian.com> Author: atsushi Date: 2008-12-01 00:13:19 -0500 (Mon, 01 Dec 2008) New Revision: 120336 Modified: trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/Activity.cs trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/ChangeLog trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/DependencyObject.cs trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/DependencyProperty.cs trunk/olive/class/System.Workflow.ComponentModel/Test/System.Workflow.ComponentModel/ChangeLog trunk/olive/class/System.Workflow.ComponentModel/Test/System.Workflow.ComponentModel/DependencyPropertyTest.cs Log: 2008-12-01 Anton Kytmanov * Activity.cs: Class is marked with [Serializable] attribute; initial extremely naive implementation of Save and Load methods just to satisfy to unit-test; commented Save and Load declarions were removed from code. * DependencyObject.cs: Class is marked with [Serializable] attribute * DependencyProperty.cs: Method GetObjectData was implemented; some xml comments were added. * DependencyPropertyTest.cs: Test added for method DependencyProperty.FromName and for method GetObjectData which is used during serialization Modified: trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/Activity.cs =================================================================== --- trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/Activity.cs 2008-12-01 05:12:25 UTC (rev 120335) +++ trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/Activity.cs 2008-12-01 05:13:19 UTC (rev 120336) @@ -27,6 +27,8 @@ using System.ComponentModel; using System.Collections.Generic; using System.Workflow.ComponentModel; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters.Binary; #if RUNTIME_DEP using System.Workflow.Runtime; @@ -34,6 +36,7 @@ namespace System.Workflow.ComponentModel { + [Serializable] public class Activity : DependencyObject { private static DependencyProperty NameProperty; @@ -255,12 +258,7 @@ return ActivityExecutionStatus.Closed; } - //public static Activity Load(Stream stream, Activity outerActivity) - - //public static Activity Load (Stream stream, Activity outerActivity, IFormatter formatter) //public void RegisterForStatusChange (DependencyProperty dependencyProp, IActivityEventListener activityStatusChangeListener) - //public void Save (Stream stream) - //public void Save (Stream stream, IFormatter formatter) protected internal virtual void OnActivityExecutionContextLoad (IServiceProvider provider) { @@ -343,6 +341,51 @@ return activity; } + + /// + /// Save activity to the given stream + /// + /// stream to store data + public void Save (Stream stream) { + BinaryFormatter formatter = new BinaryFormatter (); + Save (stream, formatter); + } + + /// + /// Save activity to the given stream using given formmatter + /// + /// stream to store data + /// formatter to be used during serialization + public void Save (Stream stream, IFormatter formatter) { + if (stream == null) + throw new ArgumentNullException ("stream"); + if (formatter == null) + throw new ArgumentNullException ("formatter"); + formatter.Serialize (stream, this); + } + + /// + /// Load activity from the given stream + /// + /// stream with serialized activity + /// deserialized activity + public static Activity Load (Stream stream, Activity outerActivity) { + BinaryFormatter formatter = new BinaryFormatter (); + return Load (stream, outerActivity, formatter); + } + + /// + /// Load activity from the given stream + /// + /// stream with serialized activity + /// formatter to be used during deserialization + /// deserialized activity + public static Activity Load (Stream stream, Activity outerActivity, IFormatter formatter) { + if (stream == null) + throw new ArgumentNullException ("stream"); + if (formatter == null) + throw new ArgumentNullException ("formatter"); + return (Activity)formatter.Deserialize (stream); + } } } - Modified: trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/ChangeLog =================================================================== --- trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/ChangeLog 2008-12-01 05:12:25 UTC (rev 120335) +++ trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/ChangeLog 2008-12-01 05:13:19 UTC (rev 120336) @@ -1,3 +1,17 @@ +2008-12-01 Anton Kytmanov + + * Activity.cs: Class is marked with [Serializable] attribute; + initial extremely naive implementation of Save and Load methods + just to satisfy to unit-test; commented Save and Load declarions + were removed from code. + * DependencyObject.cs: Class is marked with [Serializable] attribute + * DependencyProperty.cs: Method GetObjectData was implemented; + some xml comments were added. + +2008-12-01 Atsushi Enomoto + + * Activity.cs : fix inconsistent line endings. + 2006-09-26 Jordi Mas i Hernandez * WorkflowParameterBindingCollection.cs: SetItem call base method Modified: trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/DependencyObject.cs =================================================================== --- trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/DependencyObject.cs 2008-12-01 05:12:25 UTC (rev 120335) +++ trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/DependencyObject.cs 2008-12-01 05:13:19 UTC (rev 120336) @@ -28,27 +28,28 @@ namespace System.Workflow.ComponentModel { - public abstract class DependencyObject : IComponent, IDisposable + [Serializable] + public abstract class DependencyObject : IComponent, IDisposable { private IDictionary values; private IDictionary bindings; - + // Constructors protected DependencyObject () { values = new Dictionary (); bindings = new Dictionary (); - } + } // Properties [MonoTODO] public ISite Site { get { throw new NotImplementedException (); - } + } set { - throw new NotImplementedException (); - } + throw new NotImplementedException (); + } } [MonoTODO] @@ -58,7 +59,7 @@ } } - // Methods + // Methods public void AddHandler (DependencyProperty dependencyEvent, object value) { ArrayList handlers = null; @@ -86,12 +87,12 @@ handlers.Add (value); } - + public void Dispose () { } - + public ActivityBind GetBinding (DependencyProperty dependencyProperty) { ActivityBind binding; @@ -99,14 +100,14 @@ return binding; } - + protected virtual object GetBoundValue (ActivityBind bind, Type targetType) { Activity activity = GetActivityByClassName ((Activity)this, bind.Name); return bind.GetRuntimeValue (activity, targetType); } - protected T[] GetInvocationList (DependencyProperty dependencyEvent) + protected T[] GetInvocationList (DependencyProperty dependencyEvent) { object obj; T [] rslt; @@ -124,12 +125,12 @@ return rslt; } - + public object GetValue (DependencyProperty dependencyProperty) { return GetValueBase (dependencyProperty); } - + public object GetValueBase (DependencyProperty dependencyProperty) { object obj; @@ -153,12 +154,12 @@ return obj; } - + protected virtual void InitializeProperties () { } - + public bool IsBindingSet (DependencyProperty dependencyProperty) { if (dependencyProperty == null) { @@ -168,12 +169,12 @@ return bindings.ContainsKey (dependencyProperty); } - [MonoTODO] + [MonoTODO] public bool MetaEquals (DependencyObject dependencyObject) { throw new NotImplementedException (); } - + public void RemoveHandler (DependencyProperty dependencyEvent, object value) { ArrayList handlers; @@ -186,12 +187,12 @@ handlers.Remove (value); } - + public bool RemoveProperty (DependencyProperty dependencyProperty) { throw new NotImplementedException (); } - + public void SetBinding (DependencyProperty dependencyProperty, ActivityBind bind) { if (dependencyProperty == null) { @@ -209,12 +210,12 @@ bindings.Add (dependencyProperty, bind); } } - + public void SetValue (DependencyProperty dependencyProperty, object value) { SetValueBase (dependencyProperty, value); } - + public void SetValueBase (DependencyProperty dependencyProperty, object value) { if (values.ContainsKey (dependencyProperty) == true) { Modified: trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/DependencyProperty.cs =================================================================== --- trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/DependencyProperty.cs 2008-12-01 05:12:25 UTC (rev 120335) +++ trunk/olive/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel/DependencyProperty.cs 2008-12-01 05:13:19 UTC (rev 120336) @@ -31,19 +31,19 @@ namespace System.Workflow.ComponentModel { - [Serializable] - public sealed class DependencyProperty : ISerializable + [Serializable] + public sealed class DependencyProperty : ISerializable { - private static IDictionary properties = new Dictionary (); + private static IDictionary properties = new Dictionary (); private PropertyMetadata def_metadata; private bool attached; private bool _event; private string name; - private Type owner_type; - private Type property_type; + private Type owner_type; + private Type property_type; private Type validator_type; - + // Constructors private DependencyProperty () { @@ -56,50 +56,62 @@ property_type = propertyType; owner_type = ownerType; def_metadata = defaultMetadata; - } + } // Properties public PropertyMetadata DefaultMetadata { get { return def_metadata; } } - + public bool IsAttached { get {return attached; } } - + public bool IsEvent { get {return _event; } } - + public string Name { get {return name; } } - + public Type OwnerType { get {return owner_type; } } - + public Type PropertyType { get {return property_type; } } - + public Type ValidatorType { get {return validator_type; } } internal bool IsEventSet { set { _event = value; } - } + } // Methods + + /// + /// Method searches for particular DependencyProperty among registered in repository + /// using its name and owner type + /// + /// property name + /// owner type + /// null, if nothing found; property otherwise public static DependencyProperty FromName (string propertyName, Type ownerType) { - DependencyProperty rslt; + DependencyProperty result = null; - rslt = properties [propertyName.GetHashCode() * ownerType.GetHashCode()]; - return rslt; + int key = propertyName.GetHashCode () * ownerType.GetHashCode (); + if (properties.ContainsKey (key)) { + result = properties [key]; + } + + return result; } - + public static IList FromType (Type ownerType) { List rslt = new List (); @@ -120,17 +132,17 @@ return rslt; } - + public override int GetHashCode () { return name.GetHashCode() * owner_type.GetHashCode (); } - + public static DependencyProperty Register (string name, Type propertyType, Type ownerType) { return Register (name, propertyType, ownerType, new PropertyMetadata ()); } - + public static DependencyProperty Register (string name, Type propertyType, Type ownerType, PropertyMetadata defaultMetadata) { DependencyProperty property = new DependencyProperty (name, propertyType, ownerType, defaultMetadata); @@ -146,18 +158,18 @@ properties.Add (property.GetHashCode (), property); return property; } - + public static DependencyProperty RegisterAttached (string name, Type propertyType, Type ownerType) { return RegisterAttached (name, propertyType, ownerType, new PropertyMetadata (), null); } - + public static DependencyProperty RegisterAttached (string name, Type propertyType, Type ownerType, PropertyMetadata defaultMetadata) { return RegisterAttached (name, propertyType, ownerType, defaultMetadata, null); } - + public static DependencyProperty RegisterAttached (string name, Type propertyType, Type ownerType, PropertyMetadata defaultMetadata, Type validatorType) { DependencyProperty property = Register (name, propertyType, ownerType, defaultMetadata); @@ -166,12 +178,30 @@ return property; } - [MonoTODO] - void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context) - { - throw new NotImplementedException (); - } - + /// + /// Helper class to incapsulate property name and owner type in single box during serialization + /// + [Serializable] + private class SerializationStorageBox : IObjectReference { + private string property_name; + private Type owner_type; + + #region IObjectReference Members + public object GetRealObject (StreamingContext context) { + return DependencyProperty.FromName (property_name, owner_type); + } + #endregion + } + + /// + /// Method is used to put enough information about state of the object in SerializationInfo. + /// + void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context) { + info.AddValue ("property_name", this.name); + info.AddValue ("owner_type", this.owner_type); + info.SetType (typeof(SerializationStorageBox)); + } + public override string ToString () { return name; Modified: trunk/olive/class/System.Workflow.ComponentModel/Test/System.Workflow.ComponentModel/ChangeLog =================================================================== --- trunk/olive/class/System.Workflow.ComponentModel/Test/System.Workflow.ComponentModel/ChangeLog 2008-12-01 05:12:25 UTC (rev 120335) +++ trunk/olive/class/System.Workflow.ComponentModel/Test/System.Workflow.ComponentModel/ChangeLog 2008-12-01 05:13:19 UTC (rev 120336) @@ -1,3 +1,8 @@ +2008-12-01 Anton Kytmanov + + * DependencyPropertyTest.cs: Test added for method DependencyProperty.FromName + and for method GetObjectData which is used during serialization + 2006-09-24 Jordi Mas i Hernandez * WorkflowParameterBindingCollectionTest.cs: added Modified: trunk/olive/class/System.Workflow.ComponentModel/Test/System.Workflow.ComponentModel/DependencyPropertyTest.cs =================================================================== --- trunk/olive/class/System.Workflow.ComponentModel/Test/System.Workflow.ComponentModel/DependencyPropertyTest.cs 2008-12-01 05:12:25 UTC (rev 120335) +++ trunk/olive/class/System.Workflow.ComponentModel/Test/System.Workflow.ComponentModel/DependencyPropertyTest.cs 2008-12-01 05:13:19 UTC (rev 120336) @@ -30,6 +30,7 @@ using System.Workflow.ComponentModel; using System.Collections; using System.Collections.Generic; +using System.Runtime.Serialization.Formatters.Binary; namespace MonoTests.System.Workflow.ComponentModel { @@ -60,7 +61,7 @@ public static DependencyProperty FromProperty = DependencyProperty.Register ("From", typeof(string), typeof(ClassProp2), new PropertyMetadata("someone at example.com")); } - + public class ClassPropEv { public static readonly DependencyProperty ExecuteCodeEvent; @@ -71,6 +72,30 @@ } } + [Serializable] + public class SerializationTestHelperClass : DependencyObject { + public const string propertyName = "Name"; + + private static DependencyProperty NameProperty = DependencyProperty.Register (propertyName, typeof (string), + typeof (SerializationTestHelperClass), new PropertyMetadata ("some default value")); + + public SerializationTestHelperClass () { + } + + public SerializationTestHelperClass (string name) { + Name = name; + } + + public string Name { + get { + return (string)GetValue (SerializationTestHelperClass.NameProperty); + } + set { + SetValue (SerializationTestHelperClass.NameProperty, value); + } + } + } + [Test] public void RegisterEvent () { @@ -130,6 +155,50 @@ typeof (ClassProp3), new PropertyMetadata ("someone at example.com")); } + [Test] + public void TestFromNameMethod () { + string propertyName = "To"; + Type ownerType = typeof (ClassProp3); + DependencyProperty expected = DependencyProperty.Register (propertyName, typeof (string), + ownerType, new PropertyMetadata ("someone at mail.ru")); + + DependencyProperty actual = DependencyProperty.FromName (propertyName, ownerType); + + Assert.IsNotNull (actual, "#K1#1"); + Assert.AreEqual (expected.Name, actual.Name, "#K1#2"); + Assert.AreEqual (expected.OwnerType, actual.OwnerType, "#K1#3"); + Assert.AreEqual (expected.PropertyType, actual.PropertyType, "#K1#4"); + Assert.AreSame (expected, actual, "#K1#5"); + + actual = DependencyProperty.FromName ("garbage", ownerType); + + Assert.IsNull (actual, "#K1#11"); + } + + [Test] + public void TestGetObjectDataMethod () { + string activityName = "TestSerialization"; + string propertyName = SerializationTestHelperClass.propertyName; + + SerializationTestHelperClass expected = new SerializationTestHelperClass (activityName); + object actual = null; + + BinaryFormatter formatter = new BinaryFormatter (); + using (MemoryStream ms = new MemoryStream ()) { + formatter.Serialize (ms, expected); + ms.Position = 0; + actual = formatter.Deserialize (ms); + } + + Assert.IsNotNull (actual, "#K2#1"); + Assert.IsTrue (actual is SerializationTestHelperClass, "#K2#2"); + + DependencyProperty actualDepProp = DependencyProperty.FromName (propertyName, typeof (SerializationTestHelperClass)); + Assert.IsNotNull (actualDepProp, "#K2#3"); + Assert.AreEqual (propertyName, actualDepProp.Name, "#K2#4"); + Assert.AreEqual (typeof (SerializationTestHelperClass), actualDepProp.OwnerType, "#K2#5"); + Assert.AreEqual (typeof (string), actualDepProp.PropertyType, "#K2#6"); + Assert.AreEqual (activityName, ((SerializationTestHelperClass)actual).Name, "#K2#7"); + } } } - From mono-patches-list at lists.ximian.com Mon Dec 1 02:55:12 2008 From: mono-patches-list at lists.ximian.com (Calen Chen (cachen@novell.com)) Date: Mon, 1 Dec 2008 02:55:12 -0500 (EST) Subject: [Mono-patches] r120337 - in trunk/uia2atk/test: . samples testers testers/progressbar testers/toolstripprogressbar Message-ID: <20081201075512.BBC069472C@mono-cvs.ximian.com> Author: cachen Date: 2008-12-01 02:55:11 -0500 (Mon, 01 Dec 2008) New Revision: 120337 Added: trunk/uia2atk/test/testers/toolstripprogressbar/ trunk/uia2atk/test/testers/toolstripprogressbar/__init__.py trunk/uia2atk/test/testers/toolstripprogressbar/toolstripprogressbarframe.py trunk/uia2atk/test/testers/toolstripprogressbar_basic_ops.py Modified: trunk/uia2atk/test/ChangeLog trunk/uia2atk/test/samples/toolstripprogressbar.py trunk/uia2atk/test/testers/progressbar/progressbarframe.py Log: update probressbar test scrip to modify __getattr__ and __setattr__ method. samples/toolstripprogressbar.py: modify Step value to 20. add new test for toolstripprogressbar Modified: trunk/uia2atk/test/ChangeLog =================================================================== --- trunk/uia2atk/test/ChangeLog 2008-12-01 05:13:19 UTC (rev 120336) +++ trunk/uia2atk/test/ChangeLog 2008-12-01 07:55:11 UTC (rev 120337) @@ -1,5 +1,18 @@ 2008-12-01 Calen Chen + * samples/toolstripprogressbar.py: modify Step value to 20 + * testers/toolstripprogressbar_basic_ops.py, + * testers/toolstripprogressbar/__init__.py, + * testers/toolstripprogressbar/toolstripprogressbarframe.py, + * testers/toolstripprogressbar: add new test to check states, to check + if progressbar's value and label's text is changed when clicking + button, to check maximum value and minimum value + * testers/progressbar/progressbarframe.py: change + self.progressbar.__getattr__() and self.progressbar.__setattr__() to + self.progressbar.value + +2008-12-01 Calen Chen + * samples/toolstripprogressbar.py: reduce windows size. delete extraneous widget except for statusstrip and toolstripprogressbar. add button1 to process the progressbar value, add label to show the Modified: trunk/uia2atk/test/samples/toolstripprogressbar.py =================================================================== --- trunk/uia2atk/test/samples/toolstripprogressbar.py 2008-12-01 05:13:19 UTC (rev 120336) +++ trunk/uia2atk/test/samples/toolstripprogressbar.py 2008-12-01 07:55:11 UTC (rev 120337) @@ -66,7 +66,7 @@ self.toolstripprogressbar1.Minimum = 0 self.toolstripprogressbar1.Maximum = 100 self.toolstripprogressbar1.Value = 0 - self.toolstripprogressbar1.Step = 10 + self.toolstripprogressbar1.Step = 20 self.statusstrip1.Items.Add(self.toolstripprogressbar1) Modified: trunk/uia2atk/test/testers/progressbar/progressbarframe.py =================================================================== --- trunk/uia2atk/test/testers/progressbar/progressbarframe.py 2008-12-01 05:13:19 UTC (rev 120336) +++ trunk/uia2atk/test/testers/progressbar/progressbarframe.py 2008-12-01 07:55:11 UTC (rev 120337) @@ -44,7 +44,7 @@ #insert value def value(self, newValue=None): procedurelogger.action('set ProgressBar value to "%s"' % newValue) - self.progressbar.__setattr__('value', newValue) + self.progressbar.value = newValue #assert maximumValue and minimumValue def assertValueImplemented(self, valueType): @@ -64,8 +64,8 @@ def assertCurrnetValue(self, accessible, value): procedurelogger.expectedResult('ProgressBar\'s current value is "%s"' % value) - assert accessible.__getattr__('value') == value, \ - "progressbar's current value is %s:" % accessible.__getattr__('value') + assert accessible.value == value, \ + "progressbar's current value is %s:" % accessible.value #close application window Added: trunk/uia2atk/test/testers/toolstripprogressbar/__init__.py =================================================================== --- trunk/uia2atk/test/testers/toolstripprogressbar/__init__.py 2008-12-01 05:13:19 UTC (rev 120336) +++ trunk/uia2atk/test/testers/toolstripprogressbar/__init__.py 2008-12-01 07:55:11 UTC (rev 120337) @@ -0,0 +1,48 @@ + +############################################################################## +# Written by: Cachen Chen +# Date: 09/04/2008 +# Description: Application wrapper for toolstripprogressbar.py +# Used by the toolstripprogressbar-*.py tests +##############################################################################$ + +'Application wrapper for toolstripprogressbar' + +from strongwind import * + +from os.path import exists +from sys import path + +def launchToolStripProgressBar(exe=None): + 'Launch toolstripprogressbar with accessibility enabled and return a toolstripprogressbar object. Log an error and return None if something goes wrong' + + if exe is None: + # make sure we can find the sample application + harness_dir = path[0] + i = harness_dir.rfind("/") + uiaqa_path = harness_dir[:i] + exe = '%s/samples/toolstripprogressbar.py' % uiaqa_path + if not exists(exe): + raise IOError, "Could not find file %s" % exe + + args = [exe] + + (app, subproc) = cache.launchApplication(args=args, name='ipy', wait=config.LONG_DELAY) + + toolstripprogressbar = ToolStripProgressBar(app, subproc) + + cache.addApplication(toolstripprogressbar) + + toolstripprogressbar.toolStripProgressBarFrame.app = toolstripprogressbar + + return toolstripprogressbar + +# class to represent the application +class ToolStripProgressBar(accessibles.Application): + #checkShowing=False + def __init__(self, accessible, subproc=None): + 'Get a reference to the toolstripprogressbar window' + super(ToolStripProgressBar, self).__init__(accessible, subproc) + + self.findFrame(re.compile('^ToolStripProgressBar control'), logName='Tool Strip Progress Bar') + Added: trunk/uia2atk/test/testers/toolstripprogressbar/toolstripprogressbarframe.py =================================================================== --- trunk/uia2atk/test/testers/toolstripprogressbar/toolstripprogressbarframe.py 2008-12-01 05:13:19 UTC (rev 120336) +++ trunk/uia2atk/test/testers/toolstripprogressbar/toolstripprogressbarframe.py 2008-12-01 07:55:11 UTC (rev 120337) @@ -0,0 +1,73 @@ + +############################################################################## +# Written by: Cachen Chen +# Date: 09/04/2008 +# Description: toolstripprogressbar.py wrapper script +# Used by the toolstripprogressbar-*.py tests +##############################################################################$ + +import sys +import os +import actions +import states + +from strongwind import * +from toolstripprogressbar import * + + +# class to represent the main window. +class ToolStripProgressBarFrame(accessibles.Frame): + + # constants + # the available widgets on the window + LABEL = "It is 0% of 100%" + BUTTON = "button1" + + def __init__(self, accessible): + super(ToolStripProgressBarFrame, self).__init__(accessible) + self.label = self.findLabel(self.LABEL) + self.button = self.findPushButton(self.BUTTON) + self.progressbar = self.findProgressBar(None) + + #give 'click' action + def click(self, button): + button.click() + + #assert the toolstripprogress's percent after click button + def assertLabel(self, newlabel): + procedurelogger.expectedResult('label shows "%s"' % newlabel) + + def resultMatches(): + return self.label.text == newlabel + assert retryUntilTrue(resultMatches) + + #insert value + def value(self, newValue=None): + procedurelogger.action('set ProgressBar value to "%s"' % newValue) + self.progressbar.value = newValue + + #assert maximumValue and minimumValue + def assertValueImplemented(self, valueType): + maximumValue = self.progressbar._accessible.queryValue().maximumValue + minimumValue = self.progressbar._accessible.queryValue().minimumValue + + procedurelogger.action('check for %s' % valueType) + + if valueType == "maximumValue": + procedurelogger.expectedResult('%s is 100' % valueType) + assert maximumValue == 100, "maximumValue is %s:" % maximumValue + if valueType == "minimumValue": + procedurelogger.expectedResult('%s is 0' % valueType) + assert minimumValue == 0, "minimumValue is %s:" % minimumValue + + #assert progressbar's value + def assertCurrnetValue(self, accessible, value): + procedurelogger.expectedResult('ProgressBar\'s current value is "%s"' % value) + + assert accessible.value == value, \ + "progressbar's current value is %s:" % accessible.value + + + #close application window + def quit(self): + self.altF4() Added: trunk/uia2atk/test/testers/toolstripprogressbar_basic_ops.py =================================================================== --- trunk/uia2atk/test/testers/toolstripprogressbar_basic_ops.py 2008-12-01 05:13:19 UTC (rev 120336) +++ trunk/uia2atk/test/testers/toolstripprogressbar_basic_ops.py 2008-12-01 07:55:11 UTC (rev 120337) @@ -0,0 +1,110 @@ +#!/usr/bin/env python + +############################################################################## +# Written by: Cachen Chen +# Date: 09/04/2008 +# Description: Test accessibility of toolstripprogressbar widget +# Use the toolstripprogressbarframe.py wrapper script +# Test the samples/toolstripprogressbar.py script +############################################################################## + +# The docstring below is used in the generated log file +""" +Test accessibility of toolstripprogressbar widget +""" + +# imports +import sys +import os + +from strongwind import * +from toolstripprogressbar import * +from helpers import * +from sys import argv +from os import path + +app_path = None +try: + app_path = argv[1] +except IndexError: + pass #expected + +# open the toolstripprogressbar sample application +try: + app = launchToolStripProgressBar(app_path) +except IOError, msg: + print "ERROR: %s" % msg + exit(2) + +# make sure we got the app back +if app is None: + exit(4) + +# just an alias to make things shorter +tspbFrame = app.toolStripProgressBarFrame + +#check progressbar's states list +statesCheck(tspbFrame.progressbar, "ToolStripProgressBar") + +#click button1 each time, current value would increase 20, when it runout to 100 +#label would shows "Done" +tspbFrame.click(tspbFrame.button) +sleep(config.SHORT_DELAY) +tspbFrame.assertLabel("It is 20% of 100%") +tspbFrame.assertCurrnetValue(tspbFrame.progressbar, 20) + +tspbFrame.click(tspbFrame.button) +sleep(config.SHORT_DELAY) +tspbFrame.assertLabel("It is 40% of 100%") +tspbFrame.assertCurrnetValue(tspbFrame.progressbar, 40) + +tspbFrame.click(tspbFrame.button) +sleep(config.SHORT_DELAY) +tspbFrame.assertLabel("It is 60% of 100%") +tspbFrame.assertCurrnetValue(tspbFrame.progressbar, 60) + +tspbFrame.click(tspbFrame.button) +sleep(config.SHORT_DELAY) +tspbFrame.assertLabel("It is 80% of 100%") +tspbFrame.assertCurrnetValue(tspbFrame.progressbar, 80) + +tspbFrame.click(tspbFrame.button) +sleep(config.SHORT_DELAY) +tspbFrame.assertLabel("It is 100% of 100%") +tspbFrame.assertCurrnetValue(tspbFrame.progressbar, 100) +#label shows "Done" when you click button again after the value rise 100% +tspbFrame.click(tspbFrame.button) +sleep(config.SHORT_DELAY) +tspbFrame.assertLabel("Done") +tspbFrame.assertCurrnetValue(tspbFrame.progressbar, 100) + +#if yo enter number under Value in accerciser you would still get the lastest +#value, you can't change the progress by give value +tspbFrame.value(10) +sleep(config.SHORT_DELAY) +tspbFrame.assertCurrnetValue(tspbFrame.progressbar, 100) + +tspbFrame.value(100) +sleep(config.SHORT_DELAY) +tspbFrame.assertCurrnetValue(tspbFrame.progressbar, 100) + +tspbFrame.value(-1) +sleep(config.SHORT_DELAY) +tspbFrame.assertCurrnetValue(tspbFrame.progressbar, 100) + +tspbFrame.value(101) +sleep(config.SHORT_DELAY) +tspbFrame.assertCurrnetValue(tspbFrame.progressbar, 100) + +#maximumValue is 100 and minimumValue is 0 +tspbFrame.assertValueImplemented("maximumValue") + +tspbFrame.assertValueImplemented("minimumValue") + +#check progressbar's states list again +statesCheck(tspbFrame.progressbar, "ProgressBar") + +print "INFO: Log written to: %s" % config.OUTPUT_DIR + +#close application frame window +tspbFrame.quit() Property changes on: trunk/uia2atk/test/testers/toolstripprogressbar_basic_ops.py ___________________________________________________________________ Name: svn:executable + * From mono-patches-list at lists.ximian.com Mon Dec 1 04:01:41 2008 From: mono-patches-list at lists.ximian.com (Stephane Delcroix (stephane@delcroix.org)) Date: Mon, 1 Dec 2008 04:01:41 -0500 (EST) Subject: [Mono-patches] r120338 - in trunk/moon/class: Microsoft.SilverlightControls Microsoft.SilverlightControls/Controls/Src/HyperlinkButton System.Windows Message-ID: <20081201090141.AABDB9472C@mono-cvs.ximian.com> Author: stephane Date: 2008-12-01 04:01:40 -0500 (Mon, 01 Dec 2008) New Revision: 120338 Modified: trunk/moon/class/Microsoft.SilverlightControls/ChangeLog trunk/moon/class/Microsoft.SilverlightControls/Controls/Src/HyperlinkButton/HyperlinkButton.cs trunk/moon/class/System.Windows/ChangeLog trunk/moon/class/System.Windows/Makefile.am Log: add HyperlinkButton.cs to the build 2008-12-01 Stephane Delcroix * Controls/Src/HyperlinkButton/HyperlinkButton.cs: comment out the internal Navigate (), throws NotImplemented instead 2008-12-01 Stephane Delcroix * Makefile.am: add HyperlinkButton from MSCONTROLS in the build Modified: trunk/moon/class/Microsoft.SilverlightControls/ChangeLog =================================================================== --- trunk/moon/class/Microsoft.SilverlightControls/ChangeLog 2008-12-01 07:55:11 UTC (rev 120337) +++ trunk/moon/class/Microsoft.SilverlightControls/ChangeLog 2008-12-01 09:01:40 UTC (rev 120338) @@ -1,3 +1,8 @@ +2008-12-01 Stephane Delcroix + + * Controls/Src/HyperlinkButton/HyperlinkButton.cs: comment out the + internal Navigate (), throws NotImplemented instead + 2008-11-28 Sebastien Pouliot * Controls/Extended/Src/Slider/Slider.cs: Slider default values are Modified: trunk/moon/class/Microsoft.SilverlightControls/Controls/Src/HyperlinkButton/HyperlinkButton.cs =================================================================== --- trunk/moon/class/Microsoft.SilverlightControls/Controls/Src/HyperlinkButton/HyperlinkButton.cs 2008-12-01 07:55:11 UTC (rev 120337) +++ trunk/moon/class/Microsoft.SilverlightControls/Controls/Src/HyperlinkButton/HyperlinkButton.cs 2008-12-01 09:01:40 UTC (rev 120338) @@ -7,7 +7,7 @@ using System.ComponentModel; using System.Diagnostics; using System.Globalization; -using System.Windows.Browser; +//using System.Windows.Browser; using System.Windows.Controls.Primitives; using System.Windows.Media.Animation; @@ -267,28 +267,29 @@ /// private void Navigate() { - Uri destination = GetAbsoluteUri(); - - string target = TargetName; - try - { - if (!string.IsNullOrEmpty(target)) - { - HtmlPage.Window.Navigate(destination, target); - } - else - { - HtmlPage.Window.Navigate(destination); - } - } - catch (InvalidOperationException ex) - { - throw new InvalidOperationException( - string.Format(CultureInfo.InvariantCulture, - Resource.HyperlinkButton_Navigate_Failed, - destination.ToString()), - ex); - } + throw new NotImplementedException (); +// Uri destination = GetAbsoluteUri(); +// +// string target = TargetName; +// try +// { +// if (!string.IsNullOrEmpty(target)) +// { +// HtmlPage.Window.Navigate(destination, target); +// } +// else +// { +// HtmlPage.Window.Navigate(destination); +// } +// } +// catch (InvalidOperationException ex) +// { +// throw new InvalidOperationException( +// string.Format(CultureInfo.InvariantCulture, +// Resource.HyperlinkButton_Navigate_Failed, +// destination.ToString()), +// ex); +// } } } } Modified: trunk/moon/class/System.Windows/ChangeLog =================================================================== --- trunk/moon/class/System.Windows/ChangeLog 2008-12-01 07:55:11 UTC (rev 120337) +++ trunk/moon/class/System.Windows/ChangeLog 2008-12-01 09:01:40 UTC (rev 120338) @@ -1,3 +1,7 @@ +2008-12-01 Stephane Delcroix + + * Makefile.am: add HyperlinkButton from MSCONTROLS in the build + 2008-11-28 Alan McGovern * System.Windows.Data/Binding.cs: Modified: trunk/moon/class/System.Windows/Makefile.am =================================================================== --- trunk/moon/class/System.Windows/Makefile.am 2008-12-01 07:55:11 UTC (rev 120337) +++ trunk/moon/class/System.Windows/Makefile.am 2008-12-01 09:01:40 UTC (rev 120338) @@ -379,6 +379,7 @@ $(MSCONTROLS)/Src/ContentControl/ContentControl.cs \ $(MSCONTROLS)/Src/ContentControl/ContentPresenter.cs \ $(MSCONTROLS)/Src/GlobalSuppressions.cs \ + $(MSCONTROLS)/Src/HyperlinkButton/HyperlinkButton.cs \ $(MSCONTROLS)/Src/ListBox/DisplayMemberValueConverter.cs \ $(MSCONTROLS)/Src/ListBox/ListBox.cs \ $(MSCONTROLS)/Src/ListBox/ListBoxItem.cs \ From mono-patches-list at lists.ximian.com Mon Dec 1 05:51:50 2008 From: mono-patches-list at lists.ximian.com (Alan McGovern (alan.mcgovern@gmail.com)) Date: Mon, 1 Dec 2008 05:51:50 -0500 (EST) Subject: [Mono-patches] r120339 - in trunk/moon/class/System.Windows: . System.Windows System.Windows.Data Message-ID: <20081201105150.BFEC29472C@mono-cvs.ximian.com> Author: alanmc Date: 2008-12-01 05:51:50 -0500 (Mon, 01 Dec 2008) New Revision: 120339 Modified: trunk/moon/class/System.Windows/ChangeLog trunk/moon/class/System.Windows/System.Windows.Data/BindingExpression.cs trunk/moon/class/System.Windows/System.Windows.Data/BindingExpressionBase.cs trunk/moon/class/System.Windows/System.Windows/ChangeLog trunk/moon/class/System.Windows/System.Windows/FrameworkElement.cs Log: * moon/class/System.Windows/System.Windows/FrameworkElement.cs: * moon/class/System.Windows/System.Windows.Data/BindingExpression.cs: * moon/class/System.Windows/System.Windows.Data/BindingExpressionBase.cs: Rename variables to match the unmanaged API. Modified: trunk/moon/class/System.Windows/ChangeLog =================================================================== --- trunk/moon/class/System.Windows/ChangeLog 2008-12-01 09:01:40 UTC (rev 120338) +++ trunk/moon/class/System.Windows/ChangeLog 2008-12-01 10:51:50 UTC (rev 120339) @@ -1,3 +1,9 @@ +2008-12-01 Alan McGovern + + * System.Windows.Data/BindingExpression.cs: + * System.Windows.Data/BindingExpressionBase.cs: Rename variables to + match the unmanaged API. + 2008-12-01 Stephane Delcroix * Makefile.am: add HyperlinkButton from MSCONTROLS in the build Modified: trunk/moon/class/System.Windows/System.Windows/ChangeLog =================================================================== --- trunk/moon/class/System.Windows/System.Windows/ChangeLog 2008-12-01 09:01:40 UTC (rev 120338) +++ trunk/moon/class/System.Windows/System.Windows/ChangeLog 2008-12-01 10:51:50 UTC (rev 120339) @@ -1,3 +1,7 @@ +2008-12-01 Alan McGovern + + * FrameworkElement.cs: Rename variables to match the unmanaged API. + 2008-11-28 Alan McGovern * DependencyObject.cs: DataBinding now works for one-way, one-time and Modified: trunk/moon/class/System.Windows/System.Windows/FrameworkElement.cs =================================================================== --- trunk/moon/class/System.Windows/System.Windows/FrameworkElement.cs 2008-12-01 09:01:40 UTC (rev 120338) +++ trunk/moon/class/System.Windows/System.Windows/FrameworkElement.cs 2008-12-01 10:51:50 UTC (rev 120339) @@ -55,7 +55,7 @@ { BindingExpression e = new BindingExpression { Binding = binding, - Element = this, + Target = this, Property = dp }; binding.Seal (); Modified: trunk/moon/class/System.Windows/System.Windows.Data/BindingExpression.cs =================================================================== --- trunk/moon/class/System.Windows/System.Windows.Data/BindingExpression.cs 2008-12-01 09:01:40 UTC (rev 120338) +++ trunk/moon/class/System.Windows/System.Windows.Data/BindingExpression.cs 2008-12-01 10:51:50 UTC (rev 120339) @@ -56,12 +56,9 @@ Value v; object o; if (base.TryGetValue (out o)) { - Console.WriteLine ("Databound value is: {0}", o); v = DependencyObject.GetAsValue (o); } else { - Console.WriteLine ("Couldn't get databound value"); - v = new Value(); - v.k = Kind.INVALID; + v = new Value { k = Kind.INVALID }; } return v; Modified: trunk/moon/class/System.Windows/System.Windows.Data/BindingExpressionBase.cs =================================================================== --- trunk/moon/class/System.Windows/System.Windows.Data/BindingExpressionBase.cs 2008-12-01 09:01:40 UTC (rev 120338) +++ trunk/moon/class/System.Windows/System.Windows.Data/BindingExpressionBase.cs 2008-12-01 10:51:50 UTC (rev 120339) @@ -59,7 +59,7 @@ } } - internal FrameworkElement Element { + internal FrameworkElement Target { get; set; } @@ -67,18 +67,19 @@ get; set; } + // This is the object we're databound to internal object DataSource { get { - object target = Binding.Source; - FrameworkElement element = Element; + object source = Binding.Source; + FrameworkElement target = Target; - while (target == null && element != null) { - if (element.DataContext != null) - target = element.DataContext; + while (source == null && target != null) { + if (target.DataContext != null) + source = target.DataContext; else - element = element.Parent as FrameworkElement; + target = target.Parent as FrameworkElement; } - return target; + return source; } } @@ -97,6 +98,7 @@ } } + // This is the object at the end of the PropertyPath internal object PropertyTarget { get; private set; } @@ -151,7 +153,7 @@ if (Binding.Mode == BindingMode.OneWay && target is INotifyPropertyChanged) { ((INotifyPropertyChanged)target).PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) { if (p.Name.EndsWith (e.PropertyName)) - Element.SetValue (Property, PropertyInfo.GetValue (PropertyTarget, null)); + Target.SetValue (Property, PropertyInfo.GetValue (PropertyTarget, null)); }; } From mono-patches-list at lists.ximian.com Mon Dec 1 06:21:43 2008 From: mono-patches-list at lists.ximian.com (Ray Wang (rawang@novell.com)) Date: Mon, 1 Dec 2008 06:21:43 -0500 (EST) Subject: [Mono-patches] r120340 - in trunk/uia2atk/test: . samples testers testers/numericupdown Message-ID: <20081201112143.D30A69472C@mono-cvs.ximian.com> Author: raywang Date: 2008-12-01 06:21:43 -0500 (Mon, 01 Dec 2008) New Revision: 120340 Added: trunk/uia2atk/test/testers/numericupdown_basic_ops.py Removed: trunk/uia2atk/test/testers/numericupdown_bsic_ops.py Modified: trunk/uia2atk/test/ChangeLog trunk/uia2atk/test/samples/splitter.py trunk/uia2atk/test/testers/listbox_basic_ops.py trunk/uia2atk/test/testers/numericupdown/__init__.py trunk/uia2atk/test/testers/numericupdown/numericupdownframe.py Log: update NumericUpDown strongwind test Modified: trunk/uia2atk/test/ChangeLog =================================================================== --- trunk/uia2atk/test/ChangeLog 2008-12-01 10:51:50 UTC (rev 120339) +++ trunk/uia2atk/test/ChangeLog 2008-12-01 11:21:43 UTC (rev 120340) @@ -1,3 +1,13 @@ +2008-12-01 Ray Wang + + * samples/splitter.py: make the bottom label fill the form + * testers/listbox_basic_ops.py: code clean up + * testers/numericupdown_basic_ops.py: rename from + numericupdown_bsic_ops.py + * testers/numericupdown/numericupdownframe.py, + testers/numericupdown/__init__.py, testers/numericupdown_basic_ops.py: + update NumericUpDown strongwind test + 2008-12-01 Calen Chen * samples/toolstripprogressbar.py: modify Step value to 20 Modified: trunk/uia2atk/test/samples/splitter.py =================================================================== --- trunk/uia2atk/test/samples/splitter.py 2008-12-01 10:51:50 UTC (rev 120339) +++ trunk/uia2atk/test/samples/splitter.py 2008-12-01 11:21:43 UTC (rev 120340) @@ -35,7 +35,7 @@ self.label1.Text = "label1 on one side against splitter" self.label2 = Label() - self.label2.Dock = DockStyle.Top + self.label2.Dock = DockStyle.Fill self.label2.Text = "label2 on the other side against splitter" self.label2.BackColor = Color.Coral Modified: trunk/uia2atk/test/testers/listbox_basic_ops.py =================================================================== --- trunk/uia2atk/test/testers/listbox_basic_ops.py 2008-12-01 10:51:50 UTC (rev 120339) +++ trunk/uia2atk/test/testers/listbox_basic_ops.py 2008-12-01 11:21:43 UTC (rev 120340) @@ -12,13 +12,7 @@ """ Test accessibility of listbox widget """ - # imports - -#import sys -#import os -#from os import path -#from strongwind import * from listbox import * from helpers import * from states import * @@ -72,20 +66,22 @@ #listitem19 still focused but not selected statesCheck(lbFrame.listitem[19], "ListItem") -#check list selection implementation +#check first listitem selection implementation lbFrame.assertSelectionChild(lbFrame.listbox, 0) sleep(config.SHORT_DELAY) statesCheck(lbFrame.listitem[0], "ListItem", add_states=["focused", "selected"]) -#clear selection +#clear first listitem selection lbFrame.assertClearSelection(lbFrame.listbox) sleep(config.SHORT_DELAY) statesCheck(lbFrame.listitem[0], "ListItem", add_states=["focused"]) -# +#check last listitem selection implemention lbFrame.assertSelectionChild(lbFrame.listbox, 19) sleep(config.SHORT_DELAY) statesCheck(lbFrame.listitem[19], "ListItem", add_states=["focused", "selected"]) + +#clear last listitem selection lbFrame.assertClearSelection(lbFrame.listbox) sleep(config.SHORT_DELAY) statesCheck(lbFrame.listitem[19], "ListItem", add_states=["focused"]) Modified: trunk/uia2atk/test/testers/numericupdown/__init__.py =================================================================== --- trunk/uia2atk/test/testers/numericupdown/__init__.py 2008-12-01 10:51:50 UTC (rev 120339) +++ trunk/uia2atk/test/testers/numericupdown/__init__.py 2008-12-01 11:21:43 UTC (rev 120340) @@ -1,4 +1,4 @@ - +# vim: set tabstop=4 shiftwidth=4 expandtab ############################################################################## # Written by: Cachen Chen # Date: 09/08/2008 @@ -6,15 +6,17 @@ # Used by the numericupdown-*.py tests ##############################################################################$ -'Application wrapper for numericupdown' +'''Application wrapper for numericupdown''' from strongwind import * - from os.path import exists from sys import path def launchNumericUpDown(exe=None): - 'Launch numericupdown with accessibility enabled and return a numericupdown object. Log an error and return None if something goes wrong' + ''' + Launch numericupdown with accessibility enabled and return a numericupdown object. + Log an error and return None if something goes wrong + ''' if exe is None: # make sure we can find the sample application @@ -39,10 +41,9 @@ # class to represent the application class NumericUpDown(accessibles.Application): - #checkShowing=False - def __init__(self, accessible, subproc=None): - 'Get a reference to the numericupdown window' + + def __init__(self, accessible, subproc=None): + '''Get a reference to the numericupdown window''' super(NumericUpDown, self).__init__(accessible, subproc) - - self.findFrame(re.compile('^NumericUpDown Example'), logName='Numeric Up Down') + self.findFrame(re.compile('^NumericUpDown'), logName='Numeric Up Down') Modified: trunk/uia2atk/test/testers/numericupdown/numericupdownframe.py =================================================================== --- trunk/uia2atk/test/testers/numericupdown/numericupdownframe.py 2008-12-01 10:51:50 UTC (rev 120339) +++ trunk/uia2atk/test/testers/numericupdown/numericupdownframe.py 2008-12-01 11:21:43 UTC (rev 120340) @@ -1,4 +1,4 @@ - +# vim: set tabstop=4 shiftwidth=4 expandtab ############################################################################## # Written by: Cachen Chen # Date: 09/08/2008 @@ -6,67 +6,62 @@ # Used by the numericupdown-*.py tests ##############################################################################$ -import sys -import os -import actions -import states +'''Application wrapper for numericupdown.py''' from strongwind import * -from numericupdown import * - # class to represent the main window. class NumericUpDownFrame(accessibles.Frame): - # constants - # the available widgets on the window - def __init__(self, accessible): super(NumericUpDownFrame, self).__init__(accessible) self.numericupdown = self.findAllSpinButtons(None) - #editable - self.numericupdown0 = self.numericupdown[0] - #uneditable - self.numericupdown1 = self.numericupdown[1] + # editable + self.editable_numericupdown = self.numericupdown[0] + # uneditable + self.uneditable_numericupdown = self.numericupdown[1] - #assert numericupdown's Text value - def assertText(self, accessible, value): - procedurelogger.expectedResult('the %s\'s Text value is "%s"' % (accessible, value)) - assert accessible.text == value, 'Text value not match %s' % value - - #set numericupdown's value + # set numericupdown's value def valueNumericUpDown(self, accessible, newValue): procedurelogger.action('set %s value to "%s"' % (accessible, newValue)) - sleep(config.SHORT_DELAY) - accessible.__setattr__('value', newValue) + accessible.value = newValue - #enter Text Value for EditableText + + # enter Text Value for EditableText def enterTextValue(self, accessible, values): procedurelogger.action('in %s enter %s "' % (accessible, values)) - - if accessible == self.numericupdown0: - accessible.__setattr__('text', values) - elif accessible == self.numericupdown1: + if accessible == self.editable_numericupdown: + accessible.text = values + elif accessible == self.uneditable_numericupdown: try: - accessible.__setattr__('text', values) + accessible.text = values except NotImplementedError: pass - #assert numericupdown's value + # assert numericupdown's Text value + def assertText(self, accessible, value): + procedurelogger.expectedResult('the %s\'s Text value is "%s"' % \ + (accessible, value)) + assert accessible.text == value, 'Text value not match %s' % value + + + # assert numericupdown's value def assertValue(self, accessible, newValue): self.maximumValue = accessible._accessible.queryValue().maximumValue self.minimumValue = accessible._accessible.queryValue().minimumValue - if self.minimumValue <= newValue <= self.maximumValue: - procedurelogger.expectedResult('the %s\'s current value is "%s"' % (accessible, newValue)) - assert accessible.__getattr__('value') == newValue, \ - "numericupdown's current value is %s:" % accessible.__getattr__('value') + procedurelogger.expectedResult('the %s\'s current value is "%d"' % \ + (accessible, newValue)) + assert accessible.value == newValue, \ + "numericupdown's current value is %s:" % \ + accessible.value else: procedurelogger.expectedResult('value "%s" out of run' % newValue) - assert not accessible.__getattr__('value') == newValue, \ - "scrollbar's current value is %s:" % accessible.__getattr__('value') + assert not accessible.value == newValue, \ + "numericupdown's current value is %s:" % accessible.value + #close application window def quit(self): Copied: trunk/uia2atk/test/testers/numericupdown_basic_ops.py (from rev 120208, trunk/uia2atk/test/testers/numericupdown_bsic_ops.py) =================================================================== --- trunk/uia2atk/test/testers/numericupdown_bsic_ops.py 2008-11-28 06:36:16 UTC (rev 120208) +++ trunk/uia2atk/test/testers/numericupdown_basic_ops.py 2008-12-01 11:21:43 UTC (rev 120340) @@ -0,0 +1,146 @@ +#!/usr/bin/env python +# vim: set tabstop=4 shiftwidth=4 expandtab +############################################################################## +# Written by: Cachen Chen +# Date: 09/08/2008 +# Description: Test accessibility of numericupdown widget +# Use the numericupdownframe.py wrapper script +# Test the samples/numericupdown.py script +############################################################################## + +# The docstring below is used in the generated log file +""" +Test accessibility of numericupdown widget +""" +# imports +from numericupdown import * +from helpers import * +from states import * +from actions import * +from sys import argv +import pdb +app_path = None +try: + app_path = argv[1] +except IndexError: + pass #expected + +# open the numericupdown sample application +try: + app = launchNumericUpDown(app_path) +except IOError, msg: + print "ERROR: %s" % msg + exit(2) + +pdb.set_trace() +# make sure we got the app back +if app is None: + exit(4) + +# just an alias to make things shorter +nudFrame = app.numericUpDownFrame + +# check numericupdown's states +statesCheck(nudFrame.editable_numericupdown, "NumericUpDown", add_states=["focused"]) +statesCheck(nudFrame.uneditable_numericupdown, "NumericUpDown") +# move the focused to uneditable_numericupdown then check the states again +nudFrame.uneditable_numericupdown.mouseClick() +statesCheck(nudFrame.editable_numericupdown, "NumericUpDown") +statesCheck(nudFrame.uneditable_numericupdown, "NumericUpDown", add_states=["focused"]) + +# move focused back to editable_numericupdown, +# type numerber into editable_numericupdown which is editable, +# check Value and Text +nudFrame.editable_numericupdown.mouseClick() +nudFrame.editable_numericupdown.typeText("20") +nudFrame.keyCombo("Return", grabFocus=False) +sleep(config.SHORT_DELAY) +nudFrame.assertValue(nudFrame.editable_numericupdown, 1020) +nudFrame.assertText(nudFrame.editable_numericupdown, "1020") +# enter text from accerciser, press 'return' in app widget to confirm enter to +# update Value and Text +#nudFrame.enterTextValue(nudFrame.editable_numericupdown, "10") +#sleep(config.SHORT_DELAY) +#nudFrame.assertValue(nudFrame.editable_numericupdown, 10) +#nudFrame.assertText(nudFrame.editable_numericupdown, "10") + +# movo focused to uneditable_numericupdown, +# type numerber into uneditable_numericupdown which is uneditable +nudFrame.uneditable_numericupdown.mouseClick() +nudFrame.uneditable_numericupdown.typeText("20") +nudFrame.keyCombo("Return", grabFocus=False) +sleep(config.SHORT_DELAY) +nudFrame.assertValue(nudFrame.uneditable_numericupdown, 10) +nudFrame.assertText(nudFrame.uneditable_numericupdown, "10") +# can't enter text from accerciser, Value and Text unchanged +#nudFrame.enterTextValue(nudFrame.uneditable_numericupdown, "50") +#sleep(config.SHORT_DELAY) +#nudFrame.assertValue(nudFrame.uneditable_numericupdown, 10) +#nudFrame.assertText(nudFrame.uneditable_numericupdown, "10") + +# movo focused to editable_numericupdown, set numericupdown's value to 0 +nudFrame.editable_numericupdown.mouseClick() +nudFrame.valueNumericUpDown(nudFrame.editable_numericupdown, 0) +sleep(config.SHORT_DELAY) +nudFrame.assertValue(nudFrame.editable_numericupdown, 0) +nudFrame.assertText(nudFrame.editable_numericupdown, "0") + +# set numericupdown's value to 100 +nudFrame.valueNumericUpDown(nudFrame.editable_numericupdown, 100) +sleep(config.SHORT_DELAY) +nudFrame.assertValue(nudFrame.editable_numericupdown, 100) +nudFrame.assertText(nudFrame.editable_numericupdown, "100") + +# set numericupdown's value to maximumValue +nudFrame.valueNumericUpDown(nudFrame.editable_numericupdown, nudFrame.maximumValue) +sleep(config.SHORT_DELAY) +nudFrame.assertValue(nudFrame.editable_numericupdown, nudFrame.maximumValue) +nudFrame.assertText(nudFrame.editable_numericupdown, str(int(nudFrame.maximumValue))) + +# set numericupdown's value to maximumValue + 1 +nudFrame.valueNumericUpDown(nudFrame.editable_numericupdown, nudFrame.maximumValue + 1) +sleep(config.SHORT_DELAY) +nudFrame.assertValue(nudFrame.editable_numericupdown, nudFrame.maximumValue + 1) +nudFrame.assertText(nudFrame.editable_numericupdown, str(int(nudFrame.maximumValue))) + +# set numericupdown's value to minimumValue +nudFrame.valueNumericUpDown(nudFrame.editable_numericupdown, nudFrame.minimumValue) +sleep(config.SHORT_DELAY) +nudFrame.assertValue(nudFrame.editable_numericupdown, nudFrame.minimumValue) +nudFrame.assertText(nudFrame.editable_numericupdown, str(int(nudFrame.minimumValue))) + +#set numericupdown's value to minimumValue-1 +nudFrame.valueNumericUpDown(nudFrame.editable_numericupdown, nudFrame.minimumValue - 1) +sleep(config.SHORT_DELAY) +nudFrame.assertValue(nudFrame.editable_numericupdown, nudFrame.minimumValue - 1) +nudFrame.assertText(nudFrame.editable_numericupdown, str(int(nudFrame.minimumValue))) + +# test press Up/Down action to check Text and Value by keyCombo to +# editable_numericupdown which increment value is 20 +nudFrame.keyCombo("Up", grabFocus=False) +sleep(config.SHORT_DELAY) +nudFrame.assertValue(nudFrame.editable_numericupdown, nudFrame.minimumValue + 20) +nudFrame.assertText(nudFrame.editable_numericupdown, str(int(nudFrame.minimumValue + 20))) + +nudFrame.keyCombo("Down", grabFocus=False) +sleep(config.SHORT_DELAY) +nudFrame.assertValue(nudFrame.editable_numericupdown, nudFrame.minimumValue) +nudFrame.assertText(nudFrame.editable_numericupdown, str(int(nudFrame.minimumValue))) + +# test press Up/Down action to check Text and Value of +# uneditable_numericupdown which increment value is 1 +nudFrame.uneditable_numericupdown.mouseClick() +nudFrame.uneditable_numericupdown.keyCombo("Up", grabFocus=True) +sleep(config.SHORT_DELAY) +nudFrame.assertValue(nudFrame.uneditable_numericupdown, 11) +nudFrame.assertText(nudFrame.uneditable_numericupdown, "11") + +nudFrame.uneditable_numericupdown.keyCombo("Down", grabFocus=False) +sleep(config.SHORT_DELAY) +nudFrame.assertValue(nudFrame.uneditable_numericupdown, 10) +nudFrame.assertText(nudFrame.uneditable_numericupdown, "10") + +# close application frame window +nudFrame.quit() + +print "INFO: Log written to: %s" % config.OUTPUT_DIR Property changes on: trunk/uia2atk/test/testers/numericupdown_basic_ops.py ___________________________________________________________________ Name: svn:executable + * Name: svn:mergeinfo + Deleted: trunk/uia2atk/test/testers/numericupdown_bsic_ops.py =================================================================== --- trunk/uia2atk/test/testers/numericupdown_bsic_ops.py 2008-12-01 10:51:50 UTC (rev 120339) +++ trunk/uia2atk/test/testers/numericupdown_bsic_ops.py 2008-12-01 11:21:43 UTC (rev 120340) @@ -1,150 +0,0 @@ -#!/usr/bin/env python - -############################################################################## -# Written by: Cachen Chen -# Date: 09/08/2008 -# Description: Test accessibility of numericupdown widget -# Use the numericupdownframe.py wrapper script -# Test the samples/numericupdown.py script -############################################################################## - -# The docstring below is used in the generated log file -""" -Test accessibility of numericupdown widget -""" - -# imports -import sys -import os - -from strongwind import * -from numericupdown import * -from helpers import * -from sys import argv -from os import path - -app_path = None -try: - app_path = argv[1] -except IndexError: - pass #expected - -# open the numericupdown sample application -try: - app = launchNumericUpDown(app_path) -except IOError, msg: - print "ERROR: %s" % msg - exit(2) - -# make sure we got the app back -if app is None: - exit(4) - -# just an alias to make things shorter -nudFrame = app.numericUpDownFrame - -#check numericupdown's states list -statesCheck(nudFrame.numericupdown0, "NumericUpDown", add_states=["focused"]) -statesCheck(nudFrame.numericupdown1, "NumericUpDown") -#move the focused to numericupdown1 then check the states again -nudFrame.numericupdown1.mouseClick() -statesCheck(nudFrame.numericupdown0, "NumericUpDown") -statesCheck(nudFrame.numericupdown1, "NumericUpDown", add_states=["focused"]) - -#move focused back to numericupdown0, type numerber into numericupdown0 which -#is editable, check Value and Text -nudFrame.numericupdown0.mouseClick() -nudFrame.numericupdown0.typeText("20") -nudFrame.keyCombo("Return", grabFocus=False) -sleep(config.SHORT_DELAY) -nudFrame.assertValue(nudFrame.numericupdown0, 1020) -nudFrame.assertText(nudFrame.numericupdown0, "1020.00") -#enter text from accerciser, press 'return' in app widget to confirm enter to -#update Value and Text -nudFrame.enterTextValue(nudFrame.numericupdown0, "10") -nudFrame.keyCombo("Return", grabFocus=False) -sleep(config.SHORT_DELAY) -nudFrame.assertValue(nudFrame.numericupdown0, 10) -nudFrame.assertText(nudFrame.numericupdown0, "10.00") - -#movo focused to numericupdown1, then type numerber into numericupdown1 which -#is uneditable -nudFrame.numericupdown1.mouseClick() -nudFrame.numericupdown1.typeText("20") -nudFrame.keyCombo("Return", grabFocus=False) -sleep(config.SHORT_DELAY) -nudFrame.assertValue(nudFrame.numericupdown1, 10) -nudFrame.assertText(nudFrame.numericupdown1, "10.00") -#can't enter text from accerciser, Value and Text unchanged -nudFrame.enterTextValue(nudFrame.numericupdown1, "50") -nudFrame.keyCombo("Return", grabFocus=False) -sleep(config.SHORT_DELAY) -nudFrame.assertValue(nudFrame.numericupdown1, 10) -nudFrame.assertText(nudFrame.numericupdown1, "10.00") - -#movo focused to numericupdown0, then set numericupdown's value to 0 -nudFrame.numericupdown0.mouseClick() -nudFrame.valueNumericUpDown(nudFrame.numericupdown0, 0) -sleep(config.SHORT_DELAY) -nudFrame.assertValue(nudFrame.numericupdown0, 0) -nudFrame.assertText(nudFrame.numericupdown0, "0.00") - -#set numericupdown's value to 100 -nudFrame.valueNumericUpDown(nudFrame.numericupdown0, 100) -sleep(config.SHORT_DELAY) -nudFrame.assertValue(nudFrame.numericupdown0, 100) -nudFrame.assertText(nudFrame.numericupdown0, "100.00") - -#set numericupdown's value to maximumValue -nudFrame.valueNumericUpDown(nudFrame.numericupdown0, nudFrame.maximumValue) -sleep(config.SHORT_DELAY) -nudFrame.assertValue(nudFrame.numericupdown0, nudFrame.maximumValue) -nudFrame.assertText(nudFrame.numericupdown0, str(nudFrame.maximumValue) + "0") - -#set numericupdown's value to maximumValue+1 -nudFrame.valueNumericUpDown(nudFrame.numericupdown0, nudFrame.maximumValue + 1) -sleep(config.SHORT_DELAY) -nudFrame.assertValue(nudFrame.numericupdown0, nudFrame.maximumValue + 1) -nudFrame.assertText(nudFrame.numericupdown0, str(nudFrame.maximumValue) + "0") - -#set numericupdown's value to minimumValue -nudFrame.valueNumericUpDown(nudFrame.numericupdown0, nudFrame.minimumValue) -sleep(config.SHORT_DELAY) -nudFrame.assertValue(nudFrame.numericupdown0, nudFrame.minimumValue) -nudFrame.assertText(nudFrame.numericupdown0, str(nudFrame.minimumValue) + "0") - -#set numericupdown's value to minimumValue-1 -nudFrame.valueNumericUpDown(nudFrame.numericupdown0, nudFrame.minimumValue - 1) -sleep(config.SHORT_DELAY) -nudFrame.assertValue(nudFrame.numericupdown0, nudFrame.minimumValue - 1) -nudFrame.assertText(nudFrame.numericupdown0, str(nudFrame.minimumValue) + "0") - -#test press Up/Down action to check Text and Value by keyCombo to -#numericupdown0 which increment value is 20 -nudFrame.keyCombo("Up", grabFocus=False) -sleep(config.SHORT_DELAY) -nudFrame.assertValue(nudFrame.numericupdown0, nudFrame.minimumValue + 20) -nudFrame.assertText(nudFrame.numericupdown0, str(nudFrame.minimumValue + 20) + "0") - -nudFrame.keyCombo("Down", grabFocus=False) -sleep(config.SHORT_DELAY) -nudFrame.assertValue(nudFrame.numericupdown0, nudFrame.minimumValue) -nudFrame.assertText(nudFrame.numericupdown0, str(nudFrame.minimumValue) + "0") - -#test press Up/Down action to check Text and Value by keyCombo to -#numericupdown1 which increment value is 1 -nudFrame.numericupdown1.mouseClick() -nudFrame.numericupdown1.keyCombo("Up", grabFocus=True) -sleep(config.SHORT_DELAY) -nudFrame.assertValue(nudFrame.numericupdown1, 11) -nudFrame.assertText(nudFrame.numericupdown1, "11.00") - -nudFrame.keyCombo("Down", grabFocus=False) -sleep(config.SHORT_DELAY) -nudFrame.assertValue(nudFrame.numericupdown1, 10) -nudFrame.assertText(nudFrame.numericupdown1, "10.00") - -print "INFO: Log written to: %s" % config.OUTPUT_DIR - -#close application frame window -nudFrame.quit() From mono-patches-list at lists.ximian.com Mon Dec 1 06:50:35 2008 From: mono-patches-list at lists.ximian.com (Marek Safar (msafar@novell.com)) Date: Mon, 1 Dec 2008 06:50:35 -0500 (EST) Subject: [Mono-patches] r120341 - trunk/mcs/mcs Message-ID: <20081201115035.632B09472C@mono-cvs.ximian.com> Author: marek Date: 2008-12-01 06:50:34 -0500 (Mon, 01 Dec 2008) New Revision: 120341 Modified: trunk/mcs/mcs/ChangeLog trunk/mcs/mcs/expression.cs Log: 2008-12-01 Marek Safar A fix for bug #448560 * expression.cs (As): Box any generic type arguments to be verifiable. Modified: trunk/mcs/mcs/ChangeLog =================================================================== --- trunk/mcs/mcs/ChangeLog 2008-12-01 11:21:43 UTC (rev 120340) +++ trunk/mcs/mcs/ChangeLog 2008-12-01 11:50:34 UTC (rev 120341) @@ -1,3 +1,9 @@ +2008-12-01 Marek Safar + + A fix for bug #448560 + * expression.cs (As): Box any generic type arguments to be + verifiable. + 2008-11-29 Raja R Harinath Add tripwire for implicit conversion bugs Modified: trunk/mcs/mcs/expression.cs =================================================================== --- trunk/mcs/mcs/expression.cs 2008-12-01 11:21:43 UTC (rev 120340) +++ trunk/mcs/mcs/expression.cs 2008-12-01 11:50:34 UTC (rev 120341) @@ -1372,10 +1372,10 @@ expr.Emit (ec); if (do_isinst) - ig.Emit (OpCodes.Isinst, probe_type_expr.Type); + ig.Emit (OpCodes.Isinst, type); #if GMCS_SOURCE - if (TypeManager.IsNullableType (type)) + if (TypeManager.IsGenericParameter (type) || TypeManager.IsNullableType (type)) ig.Emit (OpCodes.Unbox_Any, type); #endif } From mono-patches-list at lists.ximian.com Mon Dec 1 06:50:48 2008 From: mono-patches-list at lists.ximian.com (Marek Safar (msafar@novell.com)) Date: Mon, 1 Dec 2008 06:50:48 -0500 (EST) Subject: [Mono-patches] r120342 - trunk/mcs/tests Message-ID: <20081201115048.83C1A9472C@mono-cvs.ximian.com> Author: marek Date: 2008-12-01 06:50:48 -0500 (Mon, 01 Dec 2008) New Revision: 120342 Modified: trunk/mcs/tests/ver-il-gmcs.xml Log: 2008-12-01 Marek Safar A fix for bug #448560 * expression.cs (As): Box any generic type arguments to be verifiable. Modified: trunk/mcs/tests/ver-il-gmcs.xml =================================================================== --- trunk/mcs/tests/ver-il-gmcs.xml 2008-12-01 11:50:34 UTC (rev 120341) +++ trunk/mcs/tests/ver-il-gmcs.xml 2008-12-01 11:50:48 UTC (rev 120342) @@ -5632,7 +5632,7 @@ 7 - 30 + 35 @@ -5835,7 +5835,7 @@ 7 - 7 + 12 @@ -8317,7 +8317,7 @@ 7 - 26 + 31 From mono-patches-list at lists.ximian.com Mon Dec 1 06:57:32 2008 From: mono-patches-list at lists.ximian.com (Alan McGovern (alan.mcgovern@gmail.com)) Date: Mon, 1 Dec 2008 06:57:32 -0500 (EST) Subject: [Mono-patches] r120343 - in trunk/moon/test/2.0/moon-unit: . System.Windows.Data Message-ID: <20081201115732.6A5259472C@mono-cvs.ximian.com> Author: alanmc Date: 2008-12-01 06:57:32 -0500 (Mon, 01 Dec 2008) New Revision: 120343 Modified: trunk/moon/test/2.0/moon-unit/ChangeLog trunk/moon/test/2.0/moon-unit/System.Windows.Data/BindingTest.cs Log: * moon-unit/System.Windows.Data/BindingTest.cs: If a null value is being set to a DP when using databinding, clear the value instead. Makes test pass. Modified: trunk/moon/test/2.0/moon-unit/ChangeLog =================================================================== --- trunk/moon/test/2.0/moon-unit/ChangeLog 2008-12-01 11:50:48 UTC (rev 120342) +++ trunk/moon/test/2.0/moon-unit/ChangeLog 2008-12-01 11:57:32 UTC (rev 120343) @@ -1,3 +1,8 @@ +2008-12-01 Alan McGovern + + * System.Windows.Data/BindingTest.cs: If a null value is being set to a + DP when using databinding, clear the value instead. Makes test pass. + 2008-11-28 Sebastien Pouliot * moon-unit.csproj: Add SliderTest.cs and OpenFileDialogTest.cs to Modified: trunk/moon/test/2.0/moon-unit/System.Windows.Data/BindingTest.cs =================================================================== --- trunk/moon/test/2.0/moon-unit/System.Windows.Data/BindingTest.cs 2008-12-01 11:50:48 UTC (rev 120342) +++ trunk/moon/test/2.0/moon-unit/System.Windows.Data/BindingTest.cs 2008-12-01 11:57:32 UTC (rev 120343) @@ -351,7 +351,6 @@ } [TestMethod] - [Ignore ("I don't know how to find the default value that a DP has")] public void PathNotValid() { Binding binding = new Binding { From mono-patches-list at lists.ximian.com Mon Dec 1 06:59:36 2008 From: mono-patches-list at lists.ximian.com (Alan McGovern (alan.mcgovern@gmail.com)) Date: Mon, 1 Dec 2008 06:59:36 -0500 (EST) Subject: [Mono-patches] r120344 - trunk/moon/src Message-ID: <20081201115936.4841C9472C@mono-cvs.ximian.com> Author: alanmc Date: 2008-12-01 06:59:35 -0500 (Mon, 01 Dec 2008) New Revision: 120344 Modified: trunk/moon/src/ChangeLog trunk/moon/src/frameworkelement.cpp Log: * moon/src/frameworkelement.cpp: If a null value is being set to a DP when using databinding, clear the value instead. Makes test pass. (left this out of the last commit) Modified: trunk/moon/src/ChangeLog =================================================================== --- trunk/moon/src/ChangeLog 2008-12-01 11:57:32 UTC (rev 120343) +++ trunk/moon/src/ChangeLog 2008-12-01 11:59:35 UTC (rev 120344) @@ -1,3 +1,9 @@ +2008-12-01 Alan McGovern + + * frameworkelement.cpp: If a null value is being set to a DP when using + databinding, clear the value instead. Makes test pass. (left this out + of the last commit) + 2008-11-28 Alan McGovern * binding.h: Modified: trunk/moon/src/frameworkelement.cpp =================================================================== --- trunk/moon/src/frameworkelement.cpp 2008-12-01 11:57:32 UTC (rev 120343) +++ trunk/moon/src/frameworkelement.cpp 2008-12-01 11:59:35 UTC (rev 120344) @@ -164,6 +164,7 @@ FrameworkElement::SetValueWithErrorImpl (DependencyProperty *property, Value *value, MoonError *error) { #if SL_2_0 + bool activeBinding = false; BindingExpressionBase *cur_binding = GetBindingExpression (property); BindingExpressionBase *new_binding = NULL; @@ -173,6 +174,7 @@ if (new_binding) { // We are setting a new data binding; replace the // existing binding if there is one. + activeBinding = true; SetBindingExpression (property, new_binding); value = new_binding->GetValue (); } else if (cur_binding) { @@ -181,6 +183,7 @@ // We have a two way binding, so we update the // source object cur_binding->UpdateSource (value); + activeBinding = true; break; default: // Remove the current binding @@ -195,7 +198,12 @@ return false; } - bool result = UIElement::SetValueWithErrorImpl (property, value, error); + bool result = true; + if (value == NULL && activeBinding) + UIElement::ClearValue (property); + else + result = UIElement::SetValueWithErrorImpl (property, value, error); + if (result && g_hash_table_lookup (styles, property)) g_hash_table_remove (styles, property); From mono-patches-list at lists.ximian.com Mon Dec 1 07:34:45 2008 From: mono-patches-list at lists.ximian.com (Marek Habersack (grendello@gmail.com)) Date: Mon, 1 Dec 2008 07:34:45 -0500 (EST) Subject: [Mono-patches] r120345 - trunk/mcs/class/System.Web/System.Web.UI.WebControls Message-ID: <20081201123445.BD8229472C@mono-cvs.ximian.com> Author: mhabersack Date: 2008-12-01 07:34:45 -0500 (Mon, 01 Dec 2008) New Revision: 120345 Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog trunk/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs Log: 2008-12-01 Marek Habersack * Style.cs: WriteStyleAttributes must not use the fontinfo field directly, it has to be done via the Font property. Fixes bug #449793 Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog =================================================================== --- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog 2008-12-01 11:59:35 UTC (rev 120344) +++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog 2008-12-01 12:34:45 UTC (rev 120345) @@ -1,3 +1,9 @@ +2008-12-01 Marek Habersack + + * Style.cs: WriteStyleAttributes must not use the fontinfo field + directly, it has to be done via the Font property. Fixes bug + #449793 + 2008-11-15 Marek Habersack * ContentPlaceHolder.cs, Content.cs, FormViewPagerRow.cs, Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs =================================================================== --- trunk/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs 2008-12-01 11:59:35 UTC (rev 120344) +++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs 2008-12-01 12:34:45 UTC (rev 120345) @@ -487,32 +487,33 @@ if (CheckBit ((int) Style.Styles.FontAll)) { // Fonts are a bit weird - if (fontinfo.Name != string.Empty) { - s = fontinfo.Names[0]; - for (int i = 1; i < fontinfo.Names.Length; i++) - s += "," + fontinfo.Names[i]; + FontInfo font = Font; + if (font.Name != string.Empty) { + s = font.Names[0]; + for (int i = 1; i < font.Names.Length; i++) + s += "," + font.Names[i]; writer.AddStyleAttribute (HtmlTextWriterStyle.FontFamily, s); } - if (fontinfo.Bold) + if (font.Bold) writer.AddStyleAttribute (HtmlTextWriterStyle.FontWeight, "bold"); - if (fontinfo.Italic) + if (font.Italic) writer.AddStyleAttribute (HtmlTextWriterStyle.FontStyle, "italic"); - if (!fontinfo.Size.IsEmpty) - writer.AddStyleAttribute (HtmlTextWriterStyle.FontSize, fontinfo.Size.ToString()); + if (!font.Size.IsEmpty) + writer.AddStyleAttribute (HtmlTextWriterStyle.FontSize, font.Size.ToString()); // These styles are munged into a attribute decoration s = string.Empty; - if (fontinfo.Overline) + if (font.Overline) s += "overline "; - if (fontinfo.Strikeout) + if (font.Strikeout) s += "line-through "; - if (fontinfo.Underline) + if (font.Underline) s += "underline "; s = (s != "") ? s : AlwaysRenderTextDecoration ? "none" : ""; From mono-patches-list at lists.ximian.com Mon Dec 1 07:35:03 2008 From: mono-patches-list at lists.ximian.com (Marek Habersack (grendello@gmail.com)) Date: Mon, 1 Dec 2008 07:35:03 -0500 (EST) Subject: [Mono-patches] r120346 - branches/mono-2-2/mcs/class/System.Web/System.Web.UI.WebControls Message-ID: <20081201123503.C9FA39472C@mono-cvs.ximian.com> Author: mhabersack Date: 2008-12-01 07:35:03 -0500 (Mon, 01 Dec 2008) New Revision: 120346 Modified: branches/mono-2-2/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog branches/mono-2-2/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs Log: Backport of r120345. Modified: branches/mono-2-2/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog =================================================================== --- branches/mono-2-2/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog 2008-12-01 12:34:45 UTC (rev 120345) +++ branches/mono-2-2/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog 2008-12-01 12:35:03 UTC (rev 120346) @@ -1,3 +1,9 @@ +2008-12-01 Marek Habersack + + * Style.cs: WriteStyleAttributes must not use the fontinfo field + directly, it has to be done via the Font property. Fixes bug + #449793 + 2008-11-15 Marek Habersack * ContentPlaceHolder.cs, Content.cs, FormViewPagerRow.cs, Modified: branches/mono-2-2/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs =================================================================== --- branches/mono-2-2/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs 2008-12-01 12:34:45 UTC (rev 120345) +++ branches/mono-2-2/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs 2008-12-01 12:35:03 UTC (rev 120346) @@ -487,32 +487,33 @@ if (CheckBit ((int) Style.Styles.FontAll)) { // Fonts are a bit weird - if (fontinfo.Name != string.Empty) { - s = fontinfo.Names[0]; - for (int i = 1; i < fontinfo.Names.Length; i++) - s += "," + fontinfo.Names[i]; + FontInfo font = Font; + if (font.Name != string.Empty) { + s = font.Names[0]; + for (int i = 1; i < font.Names.Length; i++) + s += "," + font.Names[i]; writer.AddStyleAttribute (HtmlTextWriterStyle.FontFamily, s); } - if (fontinfo.Bold) + if (font.Bold) writer.AddStyleAttribute (HtmlTextWriterStyle.FontWeight, "bold"); - if (fontinfo.Italic) + if (font.Italic) writer.AddStyleAttribute (HtmlTextWriterStyle.FontStyle, "italic"); - if (!fontinfo.Size.IsEmpty) - writer.AddStyleAttribute (HtmlTextWriterStyle.FontSize, fontinfo.Size.ToString()); + if (!font.Size.IsEmpty) + writer.AddStyleAttribute (HtmlTextWriterStyle.FontSize, font.Size.ToString()); // These styles are munged into a attribute decoration s = string.Empty; - if (fontinfo.Overline) + if (font.Overline) s += "overline "; - if (fontinfo.Strikeout) + if (font.Strikeout) s += "line-through "; - if (fontinfo.Underline) + if (font.Underline) s += "underline "; s = (s != "") ? s : AlwaysRenderTextDecoration ? "none" : ""; From mono-patches-list at lists.ximian.com Mon Dec 1 07:44:57 2008 From: mono-patches-list at lists.ximian.com (Sebastien Pouliot (sebastien@ximian.com)) Date: Mon, 1 Dec 2008 07:44:57 -0500 (EST) Subject: [Mono-patches] r120347 - in trunk/mcs/class/Mono.Cecil: . Mono.Cecil Message-ID: <20081201124457.43A5C9472C@mono-cvs.ximian.com> Author: spouliot Date: 2008-12-01 07:44:56 -0500 (Mon, 01 Dec 2008) New Revision: 120347 Modified: trunk/mcs/class/Mono.Cecil/ChangeLog trunk/mcs/class/Mono.Cecil/Mono.Cecil/MethodReference.cs trunk/mcs/class/Mono.Cecil/Mono.Cecil/MethodSpecification.cs trunk/mcs/class/Mono.Cecil/Mono.Cecil/PropertyDefinition.cs trunk/mcs/class/Mono.Cecil/Mono.Cecil/PropertyReference.cs Log: 2008-12-01 Sebastien Pouliot * Mono.Cecil/MethodReference.cs: Make HasParameters virtual * Mono.Cecil/MethodSpecification.cs: Override HasParameters to make sure we're tracking the same object as the Parameters property does. * Mono.Cecil/PropertyDefinition.cs: Implement HasParameters based on the GetMethod, SetMethod or its own parameter collection. * Mono.Cecil/PropertyReference.cs: Add abstract HasParameters property Modified: trunk/mcs/class/Mono.Cecil/ChangeLog =================================================================== --- trunk/mcs/class/Mono.Cecil/ChangeLog 2008-12-01 12:35:03 UTC (rev 120346) +++ trunk/mcs/class/Mono.Cecil/ChangeLog 2008-12-01 12:44:56 UTC (rev 120347) @@ -1,3 +1,12 @@ +2008-12-01 Sebastien Pouliot + + * Mono.Cecil/MethodReference.cs: Make HasParameters virtual + * Mono.Cecil/MethodSpecification.cs: Override HasParameters to make + sure we're tracking the same object as the Parameters property does. + * Mono.Cecil/PropertyDefinition.cs: Implement HasParameters based on + the GetMethod, SetMethod or its own parameter collection. + * Mono.Cecil/PropertyReference.cs: Add abstract HasParameters property + 2008-11-27 Jb Evain * Mono.Cecil/ExternTypeCollection.cs: don't attach types as they Modified: trunk/mcs/class/Mono.Cecil/Mono.Cecil/MethodReference.cs =================================================================== --- trunk/mcs/class/Mono.Cecil/Mono.Cecil/MethodReference.cs 2008-12-01 12:35:03 UTC (rev 120346) +++ trunk/mcs/class/Mono.Cecil/Mono.Cecil/MethodReference.cs 2008-12-01 12:44:56 UTC (rev 120347) @@ -55,7 +55,7 @@ set { m_callConv = value; } } - public bool HasParameters { + public virtual bool HasParameters { get { return (m_parameters == null) ? false : (m_parameters.Count > 0); } } Modified: trunk/mcs/class/Mono.Cecil/Mono.Cecil/MethodSpecification.cs =================================================================== --- trunk/mcs/class/Mono.Cecil/Mono.Cecil/MethodSpecification.cs 2008-12-01 12:35:03 UTC (rev 120346) +++ trunk/mcs/class/Mono.Cecil/Mono.Cecil/MethodSpecification.cs 2008-12-01 12:44:56 UTC (rev 120347) @@ -69,6 +69,10 @@ set { throw new InvalidOperationException (); } } + public override bool HasParameters { + get { return m_elementMethod.HasParameters; } + } + public override ParameterDefinitionCollection Parameters { get { return m_elementMethod.Parameters; } } Modified: trunk/mcs/class/Mono.Cecil/Mono.Cecil/PropertyDefinition.cs =================================================================== --- trunk/mcs/class/Mono.Cecil/Mono.Cecil/PropertyDefinition.cs 2008-12-01 12:35:03 UTC (rev 120346) +++ trunk/mcs/class/Mono.Cecil/Mono.Cecil/PropertyDefinition.cs 2008-12-01 12:44:56 UTC (rev 120347) @@ -62,6 +62,19 @@ } } + public override bool HasParameters { + get { + if (m_getMeth != null) + return m_getMeth.HasParameters; + else if (m_setMeth != null) + return m_setMeth.HasParameters; + else if (m_parameters == null) + return false; + else + return m_parameters.Count > 0; + } + } + public override ParameterDefinitionCollection Parameters { get { if (this.GetMethod != null) Modified: trunk/mcs/class/Mono.Cecil/Mono.Cecil/PropertyReference.cs =================================================================== --- trunk/mcs/class/Mono.Cecil/Mono.Cecil/PropertyReference.cs 2008-12-01 12:35:03 UTC (rev 120346) +++ trunk/mcs/class/Mono.Cecil/Mono.Cecil/PropertyReference.cs 2008-12-01 12:44:56 UTC (rev 120347) @@ -38,6 +38,10 @@ set { m_propertyType = value; } } + public abstract bool HasParameters { + get; + } + public abstract ParameterDefinitionCollection Parameters { get; } From mono-patches-list at lists.ximian.com Mon Dec 1 07:45:52 2008 From: mono-patches-list at lists.ximian.com (Sebastien Pouliot (sebastien@ximian.com)) Date: Mon, 1 Dec 2008 07:45:52 -0500 (EST) Subject: [Mono-patches] r120348 - in trunk/mcs/class/Mono.Cecil: . Mono.Cecil.Signatures Message-ID: <20081201124552.B10729472C@mono-cvs.ximian.com> Author: spouliot Date: 2008-12-01 07:45:52 -0500 (Mon, 01 Dec 2008) New Revision: 120348 Modified: trunk/mcs/class/Mono.Cecil/ChangeLog trunk/mcs/class/Mono.Cecil/Mono.Cecil.Signatures/CustomAttrib.cs trunk/mcs/class/Mono.Cecil/Mono.Cecil.Signatures/SignatureReader.cs Log: 2008-12-01 Sebastien Pouliot * Mono.Cecil.Signatures/CustomAttrib.cs: Define reusable Empty arrays for both FixedArg and NamedArg. * Mono.Cecil.Signatures/SignatureReader.cs: Avoid creating empty ParameterDefinitionCollection on constructors. Use the new Empty arrays when possible. Modified: trunk/mcs/class/Mono.Cecil/ChangeLog =================================================================== --- trunk/mcs/class/Mono.Cecil/ChangeLog 2008-12-01 12:44:56 UTC (rev 120347) +++ trunk/mcs/class/Mono.Cecil/ChangeLog 2008-12-01 12:45:52 UTC (rev 120348) @@ -1,3 +1,11 @@ +2008-12-01 Sebastien Pouliot + + * Mono.Cecil.Signatures/CustomAttrib.cs: Define reusable Empty + arrays for both FixedArg and NamedArg. + * Mono.Cecil.Signatures/SignatureReader.cs: Avoid creating empty + ParameterDefinitionCollection on constructors. Use the new Empty + arrays when possible. + 2008-12-01 Sebastien Pouliot * Mono.Cecil/MethodReference.cs: Make HasParameters virtual Modified: trunk/mcs/class/Mono.Cecil/Mono.Cecil.Signatures/CustomAttrib.cs =================================================================== --- trunk/mcs/class/Mono.Cecil/Mono.Cecil.Signatures/CustomAttrib.cs 2008-12-01 12:44:56 UTC (rev 120347) +++ trunk/mcs/class/Mono.Cecil/Mono.Cecil.Signatures/CustomAttrib.cs 2008-12-01 12:45:52 UTC (rev 120348) @@ -52,6 +52,8 @@ public bool SzArray; public uint NumElem; public Elem [] Elems; + + internal static FixedArg [] Empty = new FixedArg [0]; } public struct Elem { @@ -75,6 +77,8 @@ public ElementType FieldOrPropType; public string FieldOrPropName; public FixedArg FixedArg; + + internal static NamedArg [] Empty = new NamedArg [0]; } } } Modified: trunk/mcs/class/Mono.Cecil/Mono.Cecil.Signatures/SignatureReader.cs =================================================================== --- trunk/mcs/class/Mono.Cecil/Mono.Cecil.Signatures/SignatureReader.cs 2008-12-01 12:44:56 UTC (rev 120347) +++ trunk/mcs/class/Mono.Cecil/Mono.Cecil.Signatures/SignatureReader.cs 2008-12-01 12:45:52 UTC (rev 120348) @@ -617,8 +617,8 @@ { CustomAttrib ca = new CustomAttrib (ctor); if (data.Length == 0) { - ca.FixedArgs = new CustomAttrib.FixedArg [0]; - ca.NamedArgs = new CustomAttrib.NamedArg [0]; + ca.FixedArgs = CustomAttrib.FixedArg.Empty; + ca.NamedArgs = CustomAttrib.NamedArg.Empty; return ca; } @@ -628,10 +628,14 @@ if (ca.Prolog != CustomAttrib.StdProlog) throw new MetadataFormatException ("Non standard prolog for custom attribute"); - ca.FixedArgs = new CustomAttrib.FixedArg [ctor.Parameters.Count]; - for (int i = 0; i < ca.FixedArgs.Length && read; i++) - ca.FixedArgs [i] = ReadFixedArg (data, br, - ctor.Parameters [i].ParameterType, ref read, resolve); + if (ctor.HasParameters) { + ca.FixedArgs = new CustomAttrib.FixedArg [ctor.Parameters.Count]; + for (int i = 0; i < ca.FixedArgs.Length && read; i++) + ca.FixedArgs [i] = ReadFixedArg (data, br, + ctor.Parameters [i].ParameterType, ref read, resolve); + } else { + ca.FixedArgs = CustomAttrib.FixedArg.Empty; + } if (br.BaseStream.Position == br.BaseStream.Length) read = false; @@ -642,9 +646,13 @@ } ca.NumNamed = br.ReadUInt16 (); - ca.NamedArgs = new CustomAttrib.NamedArg [ca.NumNamed]; - for (int i = 0; i < ca.NumNamed && read; i++) - ca.NamedArgs [i] = ReadNamedArg (data, br, ref read, resolve); + if (ca.NumNamed > 0) { + ca.NamedArgs = new CustomAttrib.NamedArg [ca.NumNamed]; + for (int i = 0; i < ca.NumNamed && read; i++) + ca.NamedArgs [i] = ReadNamedArg (data, br, ref read, resolve); + } else { + ca.NamedArgs = CustomAttrib.NamedArg.Empty; + } ca.Read = read; return ca; From mono-patches-list at lists.ximian.com Mon Dec 1 07:48:26 2008 From: mono-patches-list at lists.ximian.com (Marek Habersack (grendello@gmail.com)) Date: Mon, 1 Dec 2008 07:48:26 -0500 (EST) Subject: [Mono-patches] r120349 - in trunk/xsp: . src/Mono.WebServer Message-ID: <20081201124826.14E5D9472C@mono-cvs.ximian.com> Author: mhabersack Date: 2008-12-01 07:48:25 -0500 (Mon, 01 Dec 2008) New Revision: 120349 Modified: trunk/xsp/ChangeLog trunk/xsp/src/Mono.WebServer/BaseApplicationHost.cs Log: 2008-12-01 Marek Habersack * src/Mono.WebServer/BaseApplicationHost.cs: check if the key exists in the handlers cache after acquiring the lock and update it instead of adding. Modified: trunk/xsp/ChangeLog =================================================================== --- trunk/xsp/ChangeLog 2008-12-01 12:45:52 UTC (rev 120348) +++ trunk/xsp/ChangeLog 2008-12-01 12:48:25 UTC (rev 120349) @@ -1,3 +1,9 @@ +2008-12-01 Marek Habersack + + * src/Mono.WebServer/BaseApplicationHost.cs: check if the key + exists in the handlers cache after acquiring the lock and update + it instead of adding. + 2008-11-28 Marek Habersack * src/Mono.WebServer/BaseApplicationHost.cs: add locking to avoid Modified: trunk/xsp/src/Mono.WebServer/BaseApplicationHost.cs =================================================================== --- trunk/xsp/src/Mono.WebServer/BaseApplicationHost.cs 2008-12-01 12:45:52 UTC (rev 120348) +++ trunk/xsp/src/Mono.WebServer/BaseApplicationHost.cs 2008-12-01 12:48:25 UTC (rev 120349) @@ -218,7 +218,10 @@ bool handlerFound = LocateHandler (verb, uri); lock (handlersCacheLock) { - handlersCache.Add (cacheKey, handlerFound); + if (handlersCache.ContainsKey (cacheKey)) + handlersCache [cacheKey] = handlerFound; + else + handlersCache.Add (cacheKey, handlerFound); } return handlerFound; From mono-patches-list at lists.ximian.com Mon Dec 1 07:48:39 2008 From: mono-patches-list at lists.ximian.com (Marek Habersack (grendello@gmail.com)) Date: Mon, 1 Dec 2008 07:48:39 -0500 (EST) Subject: [Mono-patches] r120350 - in branches/mono-2-2/xsp: . src/Mono.WebServer Message-ID: <20081201124839.F0B289472C@mono-cvs.ximian.com> Author: mhabersack Date: 2008-12-01 07:48:39 -0500 (Mon, 01 Dec 2008) New Revision: 120350 Modified: branches/mono-2-2/xsp/ChangeLog branches/mono-2-2/xsp/src/Mono.WebServer/BaseApplicationHost.cs Log: Backport of r120349. Modified: branches/mono-2-2/xsp/ChangeLog =================================================================== --- branches/mono-2-2/xsp/ChangeLog 2008-12-01 12:48:25 UTC (rev 120349) +++ branches/mono-2-2/xsp/ChangeLog 2008-12-01 12:48:39 UTC (rev 120350) @@ -1,3 +1,9 @@ +2008-12-01 Marek Habersack + + * src/Mono.WebServer/BaseApplicationHost.cs: check if the key + exists in the handlers cache after acquiring the lock and update + it instead of adding. + 2008-11-28 Marek Habersack * src/Mono.WebServer/BaseApplicationHost.cs: add locking to avoid Modified: branches/mono-2-2/xsp/src/Mono.WebServer/BaseApplicationHost.cs =================================================================== --- branches/mono-2-2/xsp/src/Mono.WebServer/BaseApplicationHost.cs 2008-12-01 12:48:25 UTC (rev 120349) +++ branches/mono-2-2/xsp/src/Mono.WebServer/BaseApplicationHost.cs 2008-12-01 12:48:39 UTC (rev 120350) @@ -218,7 +218,10 @@ bool handlerFound = LocateHandler (verb, uri); lock (handlersCacheLock) { - handlersCache.Add (cacheKey, handlerFound); + if (handlersCache.ContainsKey (cacheKey)) + handlersCache [cacheKey] = handlerFound; + else + handlersCache.Add (cacheKey, handlerFound); } return handlerFound; From mono-patches-list at lists.ximian.com Mon Dec 1 08:22:57 2008 From: mono-patches-list at lists.ximian.com (Alan McGovern (alan.mcgovern@gmail.com)) Date: Mon, 1 Dec 2008 08:22:57 -0500 (EST) Subject: [Mono-patches] r120351 - in trunk/moon: class/System.Windows/System.Windows src Message-ID: <20081201132257.2AB149472C@mono-cvs.ximian.com> Author: alanmc Date: 2008-12-01 08:22:56 -0500 (Mon, 01 Dec 2008) New Revision: 120351 Modified: trunk/moon/class/System.Windows/System.Windows/ChangeLog trunk/moon/class/System.Windows/System.Windows/DependencyProperty.g.cs trunk/moon/src/ChangeLog trunk/moon/src/border.h Log: * moon/src/border.h: * moon/class/System.Windows/System.Windows/DependencyProperty.g.cs: ChildProperty should not be exposed Modified: trunk/moon/class/System.Windows/System.Windows/ChangeLog =================================================================== --- trunk/moon/class/System.Windows/System.Windows/ChangeLog 2008-12-01 12:48:39 UTC (rev 120350) +++ trunk/moon/class/System.Windows/System.Windows/ChangeLog 2008-12-01 13:22:56 UTC (rev 120351) @@ -1,5 +1,9 @@ 2008-12-01 Alan McGovern + * DependencyProperty.g.cs: ChildProperty should not be exposed + +2008-12-01 Alan McGovern + * FrameworkElement.cs: Rename variables to match the unmanaged API. 2008-11-28 Alan McGovern Modified: trunk/moon/class/System.Windows/System.Windows/DependencyProperty.g.cs =================================================================== --- trunk/moon/class/System.Windows/System.Windows/DependencyProperty.g.cs 2008-12-01 12:48:39 UTC (rev 120350) +++ trunk/moon/class/System.Windows/System.Windows/DependencyProperty.g.cs 2008-12-01 13:22:56 UTC (rev 120351) @@ -295,7 +295,7 @@ public static readonly DependencyProperty BackgroundProperty = DependencyProperty.Lookup (Kind.BORDER, "Background", typeof (Brush)); public static readonly DependencyProperty BorderBrushProperty = DependencyProperty.Lookup (Kind.BORDER, "BorderBrush", typeof (Brush)); public static readonly DependencyProperty BorderThicknessProperty = DependencyProperty.Lookup (Kind.BORDER, "BorderThickness", typeof (Thickness)); - public static readonly DependencyProperty ChildProperty = DependencyProperty.Lookup (Kind.BORDER, "Child", typeof (UIElement)); + internal static readonly DependencyProperty ChildProperty = DependencyProperty.Lookup (Kind.BORDER, "Child", typeof (UIElement)); public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Lookup (Kind.BORDER, "CornerRadius", typeof (CornerRadius)); public static readonly DependencyProperty PaddingProperty = DependencyProperty.Lookup (Kind.BORDER, "Padding", typeof (Thickness)); Modified: trunk/moon/src/ChangeLog =================================================================== --- trunk/moon/src/ChangeLog 2008-12-01 12:48:39 UTC (rev 120350) +++ trunk/moon/src/ChangeLog 2008-12-01 13:22:56 UTC (rev 120351) @@ -1,5 +1,9 @@ 2008-12-01 Alan McGovern + * border.h: ChildProperty should not be exposed + +2008-12-01 Alan McGovern + * frameworkelement.cpp: If a null value is being set to a DP when using databinding, clear the value instead. Makes test pass. (left this out of the last commit) Modified: trunk/moon/src/border.h =================================================================== --- trunk/moon/src/border.h 2008-12-01 12:48:39 UTC (rev 120350) +++ trunk/moon/src/border.h 2008-12-01 13:22:56 UTC (rev 120351) @@ -34,7 +34,7 @@ static DependencyProperty *BorderBrushProperty; /* @PropertyType=Thickness,DefaultValue=Thickness(0),GenerateAccessors */ static DependencyProperty *BorderThicknessProperty; - /* @PropertyType=UIElement,GenerateAccessors */ + /* @PropertyType=UIElement,GenerateAccessors,ManagedFieldAccess=Internal */ static DependencyProperty *ChildProperty; /* @PropertyType=CornerRadius,GenerateAccessors */ static DependencyProperty *CornerRadiusProperty; From mono-patches-list at lists.ximian.com Mon Dec 1 09:11:41 2008 From: mono-patches-list at lists.ximian.com (Mario Carrion (mcarrion@novell.com)) Date: Mon, 1 Dec 2008 09:11:41 -0500 (EST) Subject: [Mono-patches] r120352 - trunk/uia2atk/UiaAtkBridge/UiaAtkBridge Message-ID: <20081201141141.28B3F9472C@mono-cvs.ximian.com> Author: mcarrion Date: 2008-12-01 09:11:40 -0500 (Mon, 01 Dec 2008) New Revision: 120352 Modified: trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ChangeLog trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/Window.cs Log: * UiaAtkBridge/Window.cs: Setting Atk.Rol.Dialog when Window's Parent is different to Window and null. [Fixes bug: #444325] Modified: trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ChangeLog =================================================================== --- trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ChangeLog 2008-12-01 13:22:56 UTC (rev 120351) +++ trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ChangeLog 2008-12-01 14:11:40 UTC (rev 120352) @@ -1,3 +1,10 @@ +2008-12-01 Mario Carrion + + * Window.cs: Setting Atk.Rol.Dialog when Window's Parent is different to + Window and null. + +[Fixes bug: #444325] + 2008-11-27 Neville Gao * TextBoxEntryView.cs: Implemented StreamableContentImplementor Modified: trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/Window.cs =================================================================== --- trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/Window.cs 2008-12-01 13:22:56 UTC (rev 120351) +++ trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/Window.cs 2008-12-01 14:11:40 UTC (rev 120352) @@ -36,9 +36,18 @@ public Window (IRawElementProviderSimple provider) : base (provider) { rootProvider = (IRawElementProviderFragmentRoot) provider; - Role = Atk.Role.Frame; - if (rootProvider != null) + if (rootProvider != null) { Name = (string) rootProvider.GetPropertyValue (AutomationElementIdentifiers.NameProperty.Id); + IRawElementProviderFragment rootOfRootProvider + = (IRawElementProviderFragment) rootProvider.Navigate (NavigateDirection.Parent); + //NavigateDirection.Parent in IRawElementProviderFragmentRoot-based provider + //return FragmentRoot and FragmentRoot is the same reference. + if (rootOfRootProvider != null && rootOfRootProvider != rootProvider) + Role = Atk.Role.Dialog; + else + Role = Atk.Role.Frame; + } else + Role = Atk.Role.Frame; } internal Window () : base (null) From mono-patches-list at lists.ximian.com Mon Dec 1 09:45:17 2008 From: mono-patches-list at lists.ximian.com (Marek Habersack (grendello@gmail.com)) Date: Mon, 1 Dec 2008 09:45:17 -0500 (EST) Subject: [Mono-patches] r120353 - in trunk/mcs/class/System.Web: System.Web.Compilation System.Web.UI Message-ID: <20081201144517.127E09472C@mono-cvs.ximian.com> Author: mhabersack Date: 2008-12-01 09:45:16 -0500 (Mon, 01 Dec 2008) New Revision: 120353 Modified: trunk/mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs trunk/mcs/class/System.Web/System.Web.UI/ChangeLog trunk/mcs/class/System.Web/System.Web.UI/MasterPage.cs Log: 2008-12-01 Marek Habersack * TemplateControlCompiler.cs: instead of adding ContentPlaceHolder instances to the ContentPlaceHolders collection when the placeholder is instantiated in the control build method, collect the ids and store them in ContentPlaceHolders inside the constructor. Fixes bug #449970 For each content placeholder generate a public virtual property named "Template_PLACEHOLDERID", this is compatible with what .NET does. * BaseCompiler.cs: added new virtual method, AddStatementsToConstructor, which is called just before CreateConstructor returns. 2008-12-01 Marek Habersack * MasterPage.cs: use List for ContentPlaceHolders instead of ArrayList. CreateMasterPage now directly accesses the ContentPlaceHolders as it is now a list of strings Modified: trunk/mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs =================================================================== --- trunk/mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs 2008-12-01 14:11:40 UTC (rev 120352) +++ trunk/mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs 2008-12-01 14:45:16 UTC (rev 120353) @@ -361,9 +361,13 @@ if (trueStmt != null) cond.TrueStatements.AddRange (trueStmt); cond.TrueStatements.Add (assign); - ctor.Statements.Add (cond); + AddStatementsToConstructor (ctor); } + + protected virtual void AddStatementsToConstructor (CodeConstructor ctor) + { + } void AddScripts () { Modified: trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog =================================================================== --- trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog 2008-12-01 14:11:40 UTC (rev 120352) +++ trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog 2008-12-01 14:45:16 UTC (rev 120353) @@ -1,3 +1,18 @@ +2008-12-01 Marek Habersack + + * TemplateControlCompiler.cs: instead of adding ContentPlaceHolder + instances to the ContentPlaceHolders collection when the + placeholder is instantiated in the control build method, collect + the ids and store them in ContentPlaceHolders inside the + constructor. Fixes bug #449970 + For each content placeholder generate a public virtual property + named "Template_PLACEHOLDERID", this is compatible with what .NET + does. + + * BaseCompiler.cs: added new virtual method, + AddStatementsToConstructor, which is called just before + CreateConstructor returns. + 2008-11-25 Marek Habersack * AspComponentFoundry.cs: GetComponentType methods replaced with Modified: trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs =================================================================== --- trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs 2008-12-01 14:11:40 UTC (rev 120352) +++ trunk/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs 2008-12-01 14:45:16 UTC (rev 120353) @@ -66,11 +66,21 @@ internal static CodeVariableReferenceExpression ctrlVar = new CodeVariableReferenceExpression ("__ctrl"); #if NET_2_0 + List masterPageContentPlaceHolders; static Regex bindRegex = new Regex (@"Bind\s*\(\s*[""']+(.*?)[""']+((\s*,\s*[""']+(.*?)[""']+)?)\s*\)\s*%>", RegexOptions.Compiled | RegexOptions.IgnoreCase); static Regex bindRegexInValue = new Regex (@"Bind\s*\(\s*[""']+(.*?)[""']+((\s*,\s*[""']+(.*?)[""']+)?)\s*\)\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase); #endif static Regex evalRegexInValue = new Regex (@"(.*)Eval\s*\(\s*[""']+(.*?)[""']+((\s*,\s*[""']+(.*?)[""']+)?)\s*\)(.*)", RegexOptions.Compiled | RegexOptions.IgnoreCase); - + +#if NET_2_0 + List MasterPageContentPlaceHolders { + get { + if (masterPageContentPlaceHolders == null) + masterPageContentPlaceHolders = new List (); + return masterPageContentPlaceHolders; + } + } +#endif public TemplateControlCompiler (TemplateControlParser parser) : base (parser) { @@ -316,23 +326,26 @@ #if NET_2_0 if (typeof (ContentPlaceHolder).IsAssignableFrom (type)) { - CodePropertyReferenceExpression prop = new CodePropertyReferenceExpression (thisRef, "ContentPlaceHolders"); - CodeMethodInvokeExpression addPlaceholder = new CodeMethodInvokeExpression (prop, "Add"); - addPlaceholder.Parameters.Add (ctrlVar); - method.Statements.Add (addPlaceholder); + List placeHolderIds = MasterPageContentPlaceHolders; + string cphID = builder.ID; + + if (!placeHolderIds.Contains (cphID)) + placeHolderIds.Add (cphID); - CodeConditionStatement condStatement; // Add the __Template_* field - CodeMemberField fld = new CodeMemberField (typeof (ITemplate), "__Template_" + builder.ID); + string templateField = "__Template_" + cphID; + CodeMemberField fld = new CodeMemberField (typeof (ITemplate), templateField); fld.Attributes = MemberAttributes.Private; mainClass.Members.Add (fld); CodeFieldReferenceExpression templateID = new CodeFieldReferenceExpression (); templateID.TargetObject = thisRef; - templateID.FieldName = "__Template_" + builder.ID; + templateID.FieldName = templateField; + CreateContentPlaceHolderTemplateProperty (templateField, "Template_" + cphID); + // if ((this.ContentTemplates != null)) { // this.__Template_$builder.ID = ((System.Web.UI.ITemplate)(this.ContentTemplates["$builder.ID"])); // } @@ -343,7 +356,7 @@ CodeIndexerExpression indexer = new CodeIndexerExpression (); indexer.TargetObject = new CodePropertyReferenceExpression (thisRef, "ContentTemplates"); - indexer.Indices.Add (new CodePrimitiveExpression (builder.ID)); + indexer.Indices.Add (new CodePrimitiveExpression (cphID)); assign = new CodeAssignStatement (); assign.Left = templateID; @@ -1535,6 +1548,30 @@ if (!childrenAsProperties && typeof (Control).IsAssignableFrom (builder.ControlType)) builder.method.Statements.Add (new CodeMethodReturnStatement (ctrlVar)); } + +#if NET_2_0 + protected override void AddStatementsToConstructor (CodeConstructor ctor) + { + if (masterPageContentPlaceHolders == null || masterPageContentPlaceHolders.Count == 0) + return; + + var ilist = new CodeVariableDeclarationStatement (); + ilist.Name = "__contentPlaceHolders"; + ilist.Type = new CodeTypeReference (typeof (IList)); + ilist.InitExpression = new CodePropertyReferenceExpression (thisRef, "ContentPlaceHolders"); + + var ilistRef = new CodeVariableReferenceExpression ("__contentPlaceHolders"); + CodeStatementCollection statements = ctor.Statements; + statements.Add (ilist); + + CodeMethodInvokeExpression mcall; + foreach (string id in masterPageContentPlaceHolders) { + mcall = new CodeMethodInvokeExpression (ilistRef, "Add"); + mcall.Parameters.Add (new CodePrimitiveExpression (id)); + statements.Add (mcall); + } + } +#endif protected internal override void CreateMethods () { @@ -1659,6 +1696,37 @@ mainClass.Members.Add (prop); } +#if NET_2_0 + void CreateContentPlaceHolderTemplateProperty (string backingField, string name) + { + CodeMemberProperty prop = new CodeMemberProperty (); + prop.Type = new CodeTypeReference (typeof (ITemplate)); + prop.Name = name; + prop.Attributes = MemberAttributes.Public; + + var ret = new CodeMethodReturnStatement (); + var fldRef = new CodeFieldReferenceExpression (thisRef, backingField); + ret.Expression = fldRef; + prop.GetStatements.Add (ret); + prop.SetStatements.Add (new CodeAssignStatement (fldRef, new CodePropertySetValueReferenceExpression ())); + + prop.CustomAttributes.Add (new CodeAttributeDeclaration ("TemplateContainer", new CodeAttributeArgument [] { + new CodeAttributeArgument (new CodeTypeOfExpression (new CodeTypeReference (typeof (MasterPage)))) + } + ) + ); + + var enumValueRef = new CodeFieldReferenceExpression (new CodeTypeReferenceExpression (typeof (TemplateInstance)), "Single"); + prop.CustomAttributes.Add (new CodeAttributeDeclaration ("TemplateInstanceAttribute", new CodeAttributeArgument [] { + new CodeAttributeArgument (enumValueRef) + } + ) + ); + + mainClass.Members.Add (prop); + } +#endif + void CreateAutoHandlers () { // Create AutoHandlers property Modified: trunk/mcs/class/System.Web/System.Web.UI/ChangeLog =================================================================== --- trunk/mcs/class/System.Web/System.Web.UI/ChangeLog 2008-12-01 14:11:40 UTC (rev 120352) +++ trunk/mcs/class/System.Web/System.Web.UI/ChangeLog 2008-12-01 14:45:16 UTC (rev 120353) @@ -1,3 +1,10 @@ +2008-12-01 Marek Habersack + + * MasterPage.cs: use List for ContentPlaceHolders instead + of ArrayList. + CreateMasterPage now directly accesses the ContentPlaceHolders as + it is now a list of strings. + 2008-11-28 Marek Habersack * DataBinder.cs: do the proper thing in Eval when a non-indexed Modified: trunk/mcs/class/System.Web/System.Web.UI/MasterPage.cs =================================================================== --- trunk/mcs/class/System.Web/System.Web.UI/MasterPage.cs 2008-12-01 14:11:40 UTC (rev 120352) +++ trunk/mcs/class/System.Web/System.Web.UI/MasterPage.cs 2008-12-01 14:45:16 UTC (rev 120353) @@ -50,7 +50,7 @@ { Hashtable definedContentTemplates = new Hashtable (); Hashtable templates = new Hashtable (); - ArrayList placeholders = new ArrayList (); + List placeholders; string parentMasterPageFile = null; MasterPage parentMasterPage; @@ -67,7 +67,11 @@ [Browsable (false)] [EditorBrowsable (EditorBrowsableState.Advanced)] protected internal IList ContentPlaceHolders { - get { return placeholders; } + get { + if (placeholders == null) + placeholders = new List (); + return placeholders; + } } [Browsable (false)] @@ -119,33 +123,15 @@ masterPage.Page = owner.Page; masterPage.InitializeAsUserControlInternal (); - if (contentTemplateCollection != null) { - Dictionary phids = null; - ContentPlaceHolder cph; - string id; - foreach (object ph in masterPage.placeholders) { - cph = ph as ContentPlaceHolder; - if (cph == null) - continue; - if (phids == null) - phids = new Dictionary (); - - id = cph.ID; - if (phids.ContainsKey (id)) - continue; - - phids.Add (id, true); - } - + List placeholders = masterPage.placeholders; + if (contentTemplateCollection != null && placeholders != null && placeholders.Count > 0) { foreach (string templateName in contentTemplateCollection.Keys) { - if (phids != null && !phids.ContainsKey (templateName)) { - phids = null; + if (!placeholders.Contains (templateName)) { throw new HttpException ( String.Format ("Cannot find ContentPlaceHolder '{0}' in the master page '{1}'", templateName, masterPageFile)); } } - phids = null; } return masterPage; From mono-patches-list at lists.ximian.com Mon Dec 1 09:45:33 2008 From: mono-patches-list at lists.ximian.com (Marek Habersack (grendello@gmail.com)) Date: Mon, 1 Dec 2008 09:45:33 -0500 (EST) Subject: [Mono-patches] r120354 - in branches/mono-2-2/mcs/class/System.Web: System.Web.Compilation System.Web.UI Message-ID: <20081201144533.B890A9472C@mono-cvs.ximian.com> Author: mhabersack Date: 2008-12-01 09:45:31 -0500 (Mon, 01 Dec 2008) New Revision: 120354 Modified: branches/mono-2-2/mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs branches/mono-2-2/mcs/class/System.Web/System.Web.Compilation/ChangeLog branches/mono-2-2/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs branches/mono-2-2/mcs/class/System.Web/System.Web.UI/ChangeLog branches/mono-2-2/mcs/class/System.Web/System.Web.UI/MasterPage.cs Log: Backport of r120353. Modified: branches/mono-2-2/mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs =================================================================== --- branches/mono-2-2/mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs 2008-12-01 14:45:16 UTC (rev 120353) +++ branches/mono-2-2/mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs 2008-12-01 14:45:31 UTC (rev 120354) @@ -361,9 +361,13 @@ if (trueStmt != null) cond.TrueStatements.AddRange (trueStmt); cond.TrueStatements.Add (assign); - ctor.Statements.Add (cond); + AddStatementsToConstructor (ctor); } + + protected virtual void AddStatementsToConstructor (CodeConstructor ctor) + { + } void AddScripts () { Modified: branches/mono-2-2/mcs/class/System.Web/System.Web.Compilation/ChangeLog =================================================================== --- branches/mono-2-2/mcs/class/System.Web/System.Web.Compilation/ChangeLog 2008-12-01 14:45:16 UTC (rev 120353) +++ branches/mono-2-2/mcs/class/System.Web/System.Web.Compilation/ChangeLog 2008-12-01 14:45:31 UTC (rev 120354) @@ -1,3 +1,18 @@ +2008-12-01 Marek Habersack + + * TemplateControlCompiler.cs: instead of adding ContentPlaceHolder + instances to the ContentPlaceHolders collection when the + placeholder is instantiated in the control build method, collect + the ids and store them in ContentPlaceHolders inside the + constructor. Fixes bug #449970 + For each content placeholder generate a public virtual property + named "Template_PLACEHOLDERID", this is compatible with what .NET + does. + + * BaseCompiler.cs: added new virtual method, + AddStatementsToConstructor, which is called just before + CreateConstructor returns. + 2008-11-25 Marek Habersack * AspComponentFoundry.cs: GetComponentType methods replaced with Modified: branches/mono-2-2/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs =================================================================== --- branches/mono-2-2/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs 2008-12-01 14:45:16 UTC (rev 120353) +++ branches/mono-2-2/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs 2008-12-01 14:45:31 UTC (rev 120354) @@ -66,11 +66,21 @@ internal static CodeVariableReferenceExpression ctrlVar = new CodeVariableReferenceExpression ("__ctrl"); #if NET_2_0 + List masterPageContentPlaceHolders; static Regex bindRegex = new Regex (@"Bind\s*\(\s*[""']+(.*?)[""']+((\s*,\s*[""']+(.*?)[""']+)?)\s*\)\s*%>", RegexOptions.Compiled | RegexOptions.IgnoreCase); static Regex bindRegexInValue = new Regex (@"Bind\s*\(\s*[""']+(.*?)[""']+((\s*,\s*[""']+(.*?)[""']+)?)\s*\)\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase); #endif static Regex evalRegexInValue = new Regex (@"(.*)Eval\s*\(\s*[""']+(.*?)[""']+((\s*,\s*[""']+(.*?)[""']+)?)\s*\)(.*)", RegexOptions.Compiled | RegexOptions.IgnoreCase); - + +#if NET_2_0 + List MasterPageContentPlaceHolders { + get { + if (masterPageContentPlaceHolders == null) + masterPageContentPlaceHolders = new List (); + return masterPageContentPlaceHolders; + } + } +#endif public TemplateControlCompiler (TemplateControlParser parser) : base (parser) { @@ -316,23 +326,26 @@ #if NET_2_0 if (typeof (ContentPlaceHolder).IsAssignableFrom (type)) { - CodePropertyReferenceExpression prop = new CodePropertyReferenceExpression (thisRef, "ContentPlaceHolders"); - CodeMethodInvokeExpression addPlaceholder = new CodeMethodInvokeExpression (prop, "Add"); - addPlaceholder.Parameters.Add (ctrlVar); - method.Statements.Add (addPlaceholder); + List placeHolderIds = MasterPageContentPlaceHolders; + string cphID = builder.ID; + + if (!placeHolderIds.Contains (cphID)) + placeHolderIds.Add (cphID); - CodeConditionStatement condStatement; // Add the __Template_* field - CodeMemberField fld = new CodeMemberField (typeof (ITemplate), "__Template_" + builder.ID); + string templateField = "__Template_" + cphID; + CodeMemberField fld = new CodeMemberField (typeof (ITemplate), templateField); fld.Attributes = MemberAttributes.Private; mainClass.Members.Add (fld); CodeFieldReferenceExpression templateID = new CodeFieldReferenceExpression (); templateID.TargetObject = thisRef; - templateID.FieldName = "__Template_" + builder.ID; + templateID.FieldName = templateField; + CreateContentPlaceHolderTemplateProperty (templateField, "Template_" + cphID); + // if ((this.ContentTemplates != null)) { // this.__Template_$builder.ID = ((System.Web.UI.ITemplate)(this.ContentTemplates["$builder.ID"])); // } @@ -343,7 +356,7 @@ CodeIndexerExpression indexer = new CodeIndexerExpression (); indexer.TargetObject = new CodePropertyReferenceExpression (thisRef, "ContentTemplates"); - indexer.Indices.Add (new CodePrimitiveExpression (builder.ID)); + indexer.Indices.Add (new CodePrimitiveExpression (cphID)); assign = new CodeAssignStatement (); assign.Left = templateID; @@ -1535,6 +1548,30 @@ if (!childrenAsProperties && typeof (Control).IsAssignableFrom (builder.ControlType)) builder.method.Statements.Add (new CodeMethodReturnStatement (ctrlVar)); } + +#if NET_2_0 + protected override void AddStatementsToConstructor (CodeConstructor ctor) + { + if (masterPageContentPlaceHolders == null || masterPageContentPlaceHolders.Count == 0) + return; + + var ilist = new CodeVariableDeclarationStatement (); + ilist.Name = "__contentPlaceHolders"; + ilist.Type = new CodeTypeReference (typeof (IList)); + ilist.InitExpression = new CodePropertyReferenceExpression (thisRef, "ContentPlaceHolders"); + + var ilistRef = new CodeVariableReferenceExpression ("__contentPlaceHolders"); + CodeStatementCollection statements = ctor.Statements; + statements.Add (ilist); + + CodeMethodInvokeExpression mcall; + foreach (string id in masterPageContentPlaceHolders) { + mcall = new CodeMethodInvokeExpression (ilistRef, "Add"); + mcall.Parameters.Add (new CodePrimitiveExpression (id)); + statements.Add (mcall); + } + } +#endif protected internal override void CreateMethods () { @@ -1659,6 +1696,37 @@ mainClass.Members.Add (prop); } +#if NET_2_0 + void CreateContentPlaceHolderTemplateProperty (string backingField, string name) + { + CodeMemberProperty prop = new CodeMemberProperty (); + prop.Type = new CodeTypeReference (typeof (ITemplate)); + prop.Name = name; + prop.Attributes = MemberAttributes.Public; + + var ret = new CodeMethodReturnStatement (); + var fldRef = new CodeFieldReferenceExpression (thisRef, backingField); + ret.Expression = fldRef; + prop.GetStatements.Add (ret); + prop.SetStatements.Add (new CodeAssignStatement (fldRef, new CodePropertySetValueReferenceExpression ())); + + prop.CustomAttributes.Add (new CodeAttributeDeclaration ("TemplateContainer", new CodeAttributeArgument [] { + new CodeAttributeArgument (new CodeTypeOfExpression (new CodeTypeReference (typeof (MasterPage)))) + } + ) + ); + + var enumValueRef = new CodeFieldReferenceExpression (new CodeTypeReferenceExpression (typeof (TemplateInstance)), "Single"); + prop.CustomAttributes.Add (new CodeAttributeDeclaration ("TemplateInstanceAttribute", new CodeAttributeArgument [] { + new CodeAttributeArgument (enumValueRef) + } + ) + ); + + mainClass.Members.Add (prop); + } +#endif + void CreateAutoHandlers () { // Create AutoHandlers property Modified: branches/mono-2-2/mcs/class/System.Web/System.Web.UI/ChangeLog =================================================================== --- branches/mono-2-2/mcs/class/System.Web/System.Web.UI/ChangeLog 2008-12-01 14:45:16 UTC (rev 120353) +++ branches/mono-2-2/mcs/class/System.Web/System.Web.UI/ChangeLog 2008-12-01 14:45:31 UTC (rev 120354) @@ -1,3 +1,10 @@ +2008-12-01 Marek Habersack + + * MasterPage.cs: use List for ContentPlaceHolders instead + of ArrayList. + CreateMasterPage now directly accesses the ContentPlaceHolders as + it is now a list of strings. + 2008-11-28 Marek Habersack * DataBinder.cs: do the proper thing in Eval when a non-indexed Modified: branches/mono-2-2/mcs/class/System.Web/System.Web.UI/MasterPage.cs =================================================================== --- branches/mono-2-2/mcs/class/System.Web/System.Web.UI/MasterPage.cs 2008-12-01 14:45:16 UTC (rev 120353) +++ branches/mono-2-2/mcs/class/System.Web/System.Web.UI/MasterPage.cs 2008-12-01 14:45:31 UTC (rev 120354) @@ -50,7 +50,7 @@ { Hashtable definedContentTemplates = new Hashtable (); Hashtable templates = new Hashtable (); - ArrayList placeholders = new ArrayList (); + List placeholders; string parentMasterPageFile = null; MasterPage parentMasterPage; @@ -67,7 +67,11 @@ [Browsable (false)] [EditorBrowsable (EditorBrowsableState.Advanced)] protected internal IList ContentPlaceHolders { - get { return placeholders; } + get { + if (placeholders == null) + placeholders = new List (); + return placeholders; + } } [Browsable (false)] @@ -119,33 +123,15 @@ masterPage.Page = owner.Page; masterPage.InitializeAsUserControlInternal (); - if (contentTemplateCollection != null) { - Dictionary phids = null; - ContentPlaceHolder cph; - string id; - foreach (object ph in masterPage.placeholders) { - cph = ph as ContentPlaceHolder; - if (cph == null) - continue; - if (phids == null) - phids = new Dictionary (); - - id = cph.ID; - if (phids.ContainsKey (id)) - continue; - - phids.Add (id, true); - } - + List placeholders = masterPage.placeholders; + if (contentTemplateCollection != null && placeholders != null && placeholders.Count > 0) { foreach (string templateName in contentTemplateCollection.Keys) { - if (phids != null && !phids.ContainsKey (templateName)) { - phids = null; + if (!placeholders.Contains (templateName)) { throw new HttpException ( String.Format ("Cannot find ContentPlaceHolder '{0}' in the master page '{1}'", templateName, masterPageFile)); } } - phids = null; } return masterPage; From mono-patches-list at lists.ximian.com Mon Dec 1 09:52:19 2008 From: mono-patches-list at lists.ximian.com (Kornél Pál (kornelpal@kornelpal.h)) Date: Mon, 1 Dec 2008 09:52:19 -0500 (EST) Subject: [Mono-patches] r120355 - trunk/mcs/class/corlib/System.Runtime.Remoting.Channels Message-ID: <20081201145219.C76D79472C@mono-cvs.ximian.com> Author: kornelpal Date: 2008-12-01 09:52:19 -0500 (Mon, 01 Dec 2008) New Revision: 120355 Modified: trunk/mcs/class/corlib/System.Runtime.Remoting.Channels/ChangeLog trunk/mcs/class/corlib/System.Runtime.Remoting.Channels/CrossAppDomainChannel.cs Log: CrossAppDomainChannel.cs: Make _ContextID an object that fixes bug #422491. Modified: trunk/mcs/class/corlib/System.Runtime.Remoting.Channels/ChangeLog =================================================================== --- trunk/mcs/class/corlib/System.Runtime.Remoting.Channels/ChangeLog 2008-12-01 14:45:31 UTC (rev 120354) +++ trunk/mcs/class/corlib/System.Runtime.Remoting.Channels/ChangeLog 2008-12-01 14:52:19 UTC (rev 120355) @@ -1,3 +1,8 @@ +2008-12-01 Korn?l P?l + + * CrossAppDomainChannel.cs: Make _ContextID an object that fixes bug #422491. + Credits to Robert Jordan and Steffen Enni. + 2008-07-02 Andreas Nahr * IChannelReceiver.cs: Modified: trunk/mcs/class/corlib/System.Runtime.Remoting.Channels/CrossAppDomainChannel.cs =================================================================== --- trunk/mcs/class/corlib/System.Runtime.Remoting.Channels/CrossAppDomainChannel.cs 2008-12-01 14:45:31 UTC (rev 120354) +++ trunk/mcs/class/corlib/System.Runtime.Remoting.Channels/CrossAppDomainChannel.cs 2008-12-01 14:52:19 UTC (rev 120355) @@ -48,17 +48,15 @@ [Serializable] internal class CrossAppDomainData { -#pragma warning disable 169 // TODO: Add context support - // Never used but possible required for .NET compatibility - private int _ContextID; -#pragma warning restore 169 - + // Required for .NET compatibility + private object _ContextID; private int _DomainID; private string _processGuid; internal CrossAppDomainData(int domainId) { + _ContextID = (int) 0; _DomainID = domainId; _processGuid = RemotingConfiguration.ProcessId; } From mono-patches-list at lists.ximian.com Mon Dec 1 11:10:11 2008 From: mono-patches-list at lists.ximian.com (Rolf Bjarne Kvinge (rolfkvinge@ya.com)) Date: Mon, 1 Dec 2008 11:10:11 -0500 (EST) Subject: [Mono-patches] r120356 - trunk/moon/class/System.Windows Message-ID: <20081201161011.2A92E9472C@mono-cvs.ximian.com> Author: rolf Date: 2008-12-01 11:10:10 -0500 (Mon, 01 Dec 2008) New Revision: 120356 Removed: trunk/moon/class/System.Windows/System/ Modified: trunk/moon/class/System.Windows/ChangeLog trunk/moon/class/System.Windows/System.Windows.mdp Log: * System, System/ChangeLog: Deleted empty directory. * System.Windows.mdp: Updated with new files. Modified: trunk/moon/class/System.Windows/ChangeLog =================================================================== --- trunk/moon/class/System.Windows/ChangeLog 2008-12-01 14:52:19 UTC (rev 120355) +++ trunk/moon/class/System.Windows/ChangeLog 2008-12-01 16:10:10 UTC (rev 120356) @@ -1,3 +1,8 @@ +2008-12-01 Rolf Bjarne Kvinge + + * System, System/ChangeLog: Deleted empty directory. + * System.Windows.mdp: Updated with new files. + 2008-12-01 Alan McGovern * System.Windows.Data/BindingExpression.cs: Modified: trunk/moon/class/System.Windows/System.Windows.mdp =================================================================== --- trunk/moon/class/System.Windows/System.Windows.mdp 2008-12-01 14:52:19 UTC (rev 120355) +++ trunk/moon/class/System.Windows/System.Windows.mdp 2008-12-01 16:10:10 UTC (rev 120356) @@ -211,7 +211,6 @@ - @@ -260,7 +259,6 @@ - @@ -320,6 +318,7 @@ + @@ -335,6 +334,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From mono-patches-list at lists.ximian.com Mon Dec 1 11:15:59 2008 From: mono-patches-list at lists.ximian.com (Rolf Bjarne Kvinge (rolfkvinge@ya.com)) Date: Mon, 1 Dec 2008 11:15:59 -0500 (EST) Subject: [Mono-patches] r120357 - trunk/moon/test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness Message-ID: <20081201161559.7A62A9472C@mono-cvs.ximian.com> Author: rolf Date: 2008-12-01 11:15:59 -0500 (Mon, 01 Dec 2008) New Revision: 120357 Modified: trunk/moon/test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/ChangeLog trunk/moon/test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/TestClassManager.cs trunk/moon/test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/TestMethodManager.cs trunk/moon/test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/UnitTestLogMessageWriter.cs Log: * test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/TestMethodManager.cs, test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/TestClassManager.cs, test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/UnitTestLogMessageWriter.cs: Provide class or method in the log message for ignored tests. Modified: trunk/moon/test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/ChangeLog =================================================================== --- trunk/moon/test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/ChangeLog 2008-12-01 16:10:10 UTC (rev 120356) +++ trunk/moon/test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/ChangeLog 2008-12-01 16:15:59 UTC (rev 120357) @@ -1,3 +1,9 @@ +2008-12-01 Rolf Bjarne Kvinge + + * TestMethodManager.cs, TestClassManager.cs, + UnitTestLogMessageWriter.cs: Provide class or method in the log + message for ignored tests. + 2008-11-20 Rolf Bjarne Kvinge * VisualStudioLogProvider.Writer.cs, VisualStudioLogProvider.cs: Remove Modified: trunk/moon/test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/TestClassManager.cs =================================================================== --- trunk/moon/test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/TestClassManager.cs 2008-12-01 16:10:10 UTC (rev 120356) +++ trunk/moon/test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/TestClassManager.cs 2008-12-01 16:15:59 UTC (rev 120357) @@ -59,7 +59,7 @@ { if (Provider.HasCapability(UnitTestProviderCapabilities.ClassCanIgnore) && _testClass.Ignore) { - LogWriter.Ignore(TestGranularity.Test, _testClass.Name); + LogWriter.Ignore(TestGranularity.Test, _testClass.Name, _testClass); return; } Modified: trunk/moon/test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/TestMethodManager.cs =================================================================== --- trunk/moon/test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/TestMethodManager.cs 2008-12-01 16:10:10 UTC (rev 120356) +++ trunk/moon/test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/TestMethodManager.cs 2008-12-01 16:15:59 UTC (rev 120357) @@ -92,7 +92,7 @@ // [Ignore] if (Provider.HasCapability(UnitTestProviderCapabilities.MethodCanIgnore) && _testMethod.Ignore) { - LogWriter.Ignore(TestGranularity.TestScenario, _testMethod.Name); + LogWriter.Ignore(TestGranularity.TestScenario, _testMethod.Name, _testMethod); return; } Modified: trunk/moon/test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/UnitTestLogMessageWriter.cs =================================================================== --- trunk/moon/test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/UnitTestLogMessageWriter.cs 2008-12-01 16:10:10 UTC (rev 120356) +++ trunk/moon/test/2.0/Microsoft.Silverlight.Testing/UnitTestHarness/UnitTesting/Harness/UnitTestLogMessageWriter.cs 2008-12-01 16:15:59 UTC (rev 120357) @@ -96,7 +96,7 @@ /// /// The granularity of the ignore operation. /// The name of the test skipped. - public void Ignore(TestGranularity granularity, string name) + public void Ignore(TestGranularity granularity, string name, ITestMethod method) { string message = String.Format(System.Globalization.CultureInfo.CurrentCulture, Properties.UnitTestMessage.LogIgnore, name); LogMessage m = Create(LogMessageType.TestExecution, message); @@ -104,10 +104,28 @@ DecorateNameProperty(m, name); DecorateTestGranularity(m, granularity); m[UnitTestLogDecorator.IgnoreMessage] = true; + m[UnitTestLogDecorator.TestMethodMetadata] = method; Enqueue(m); } /// + /// Enqueues a Ignore message. + /// + /// The granularity of the ignore operation. + /// The name of the test skipped. + public void Ignore(TestGranularity granularity, string name, ITestClass test) + { + string message = String.Format(System.Globalization.CultureInfo.CurrentCulture, Properties.UnitTestMessage.LogIgnore, name); + LogMessage m = Create(LogMessageType.TestExecution, message); + MarkUnitTestMessage(m); + DecorateNameProperty(m, name); + DecorateTestGranularity(m, granularity); + m[UnitTestLogDecorator.IgnoreMessage] = true; + m[UnitTestLogDecorator.TestClassMetadata] = test; + Enqueue(m); + } + + /// /// Enqueues a message containing a test run filter. /// /// The test run filter. @@ -212,4 +230,4 @@ Enqueue(m); } } -} \ No newline at end of file +} From mono-patches-list at lists.ximian.com Mon Dec 1 11:17:28 2008 From: mono-patches-list at lists.ximian.com (Mario Carrion (mcarrion@novell.com)) Date: Mon, 1 Dec 2008 11:17:28 -0500 (EST) Subject: [Mono-patches] r120358 - trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsClientTests Message-ID: <20081201161728.5EB369472C@mono-cvs.ximian.com> Author: mcarrion Date: 2008-12-01 11:17:28 -0500 (Mon, 01 Dec 2008) New Revision: 120358 Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsClientTests/ChangeLog trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsClientTests/ListBoxTest.cs Log: 2008-12-01 Mario Carrion * ListBoxTest.cs: Tests implemented: MsdnNamePropertyTest and MsdnNamePropertyTest, to confirm Bug #448020. Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsClientTests/ChangeLog =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsClientTests/ChangeLog 2008-12-01 16:15:59 UTC (rev 120357) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsClientTests/ChangeLog 2008-12-01 16:17:28 UTC (rev 120358) @@ -1,3 +1,8 @@ +2008-12-01 Mario Carrion + + * ListBoxTest.cs: Tests implemented: MsdnNamePropertyTest and + MsdnNamePropertyTest, to confirm Bug #448020. + 2008-11-19 Mario Carrion * LinkLabelTest.cs: File added. Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsClientTests/ListBoxTest.cs =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsClientTests/ListBoxTest.cs 2008-12-01 16:15:59 UTC (rev 120357) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsClientTests/ListBoxTest.cs 2008-12-01 16:17:28 UTC (rev 120358) @@ -50,13 +50,30 @@ [Test] public override void MsdnNamePropertyTest () { - throw new NotImplementedException (); + ListBox listbox = GetControl () as ListBox; + AutomationElement element = GetAutomationElementFromControl (listbox); + + listbox.Text = "listbox text"; + Assert.AreEqual ("listbox text", + element.GetCurrentPropertyValue (AutomationElementIdentifiers.NameProperty, true), + "NameProperty"); + + listbox.Text = "other listbox text"; + Assert.AreEqual ("other listbox text", + element.GetCurrentPropertyValue (AutomationElementIdentifiers.NameProperty, true), + "NameProperty"); } [Test] public override void MsdnLabeledByPropertyTest () { - throw new NotImplementedException (); + ListBox listbox = GetControl () as ListBox; + AutomationElement element = GetAutomationElementFromControl (listbox); + + listbox.Text = "listbox text"; + Assert.AreEqual (null, + element.GetCurrentPropertyValue (AutomationElementIdentifiers.LabeledByProperty, true), + "LabeledByProperty"); } [Test] From mono-patches-list at lists.ximian.com Mon Dec 1 11:17:49 2008 From: mono-patches-list at lists.ximian.com (Rolf Bjarne Kvinge (rolfkvinge@ya.com)) Date: Mon, 1 Dec 2008 11:17:49 -0500 (EST) Subject: [Mono-patches] r120359 - in trunk/moon/test/2.0/moon-unit: . System.Windows System.Windows.Controls System.Windows.Shapes Message-ID: <20081201161749.1E55C9472C@mono-cvs.ximian.com> Author: rolf Date: 2008-12-01 11:17:48 -0500 (Mon, 01 Dec 2008) New Revision: 120359 Modified: trunk/moon/test/2.0/moon-unit/ChangeLog trunk/moon/test/2.0/moon-unit/System.Windows.Controls/ControlTemplateTest.cs trunk/moon/test/2.0/moon-unit/System.Windows.Controls/MediaElementTest.cs trunk/moon/test/2.0/moon-unit/System.Windows.Shapes/PathTest.cs trunk/moon/test/2.0/moon-unit/System.Windows/StyleTest.cs trunk/moon/test/2.0/moon-unit/System.Windows/VisualStateTest.cs Log: * test/2.0/moon-unit/System.Windows.Controls/ControlTemplateTest.cs, test/2.0/moon-unit/System.Windows.Controls/MediaElementTest.cs, test/2.0/moon-unit/System.Windows.Shapes/PathTest.cs, test/2.0/moon-unit/System.Windows/StyleTest.cs, test/2.0/moon-unit/System.Windows/VisualStateTest.cs: Sprinkle a few KnownFailure attributes. Modified: trunk/moon/test/2.0/moon-unit/ChangeLog =================================================================== --- trunk/moon/test/2.0/moon-unit/ChangeLog 2008-12-01 16:17:28 UTC (rev 120358) +++ trunk/moon/test/2.0/moon-unit/ChangeLog 2008-12-01 16:17:48 UTC (rev 120359) @@ -1,3 +1,11 @@ +2008-12-01 Rolf Bjarne Kvinge + + * System.Windows.Controls/ControlTemplateTest.cs, + System.Windows.Controls/MediaElementTest.cs, + System.Windows.Shapes/PathTest.cs, System.Windows/StyleTest.cs, + System.Windows/VisualStateTest.cs: Sprinkle a few KnownFailure + attributes. + 2008-12-01 Alan McGovern * System.Windows.Data/BindingTest.cs: If a null value is being set to a Modified: trunk/moon/test/2.0/moon-unit/System.Windows/StyleTest.cs =================================================================== --- trunk/moon/test/2.0/moon-unit/System.Windows/StyleTest.cs 2008-12-01 16:17:28 UTC (rev 120358) +++ trunk/moon/test/2.0/moon-unit/System.Windows/StyleTest.cs 2008-12-01 16:17:48 UTC (rev 120359) @@ -101,6 +101,7 @@ } [TestMethod] + [KnownFailure] public void MismatchTargetType () { Style s = (Style)XamlReader.Load (@""); @@ -135,6 +136,7 @@ } [TestMethod] + [KnownFailure] public void UseSetterTwice() { Style s1 = new Style(typeof(Rectangle)); Modified: trunk/moon/test/2.0/moon-unit/System.Windows/VisualStateTest.cs =================================================================== --- trunk/moon/test/2.0/moon-unit/System.Windows/VisualStateTest.cs 2008-12-01 16:17:28 UTC (rev 120358) +++ trunk/moon/test/2.0/moon-unit/System.Windows/VisualStateTest.cs 2008-12-01 16:17:48 UTC (rev 120359) @@ -28,6 +28,7 @@ } [TestMethod] + [KnownFailure] public void TestParse_NoManagedNamespace () { Assert.Throws (delegate { Modified: trunk/moon/test/2.0/moon-unit/System.Windows.Controls/ControlTemplateTest.cs =================================================================== --- trunk/moon/test/2.0/moon-unit/System.Windows.Controls/ControlTemplateTest.cs 2008-12-01 16:17:28 UTC (rev 120358) +++ trunk/moon/test/2.0/moon-unit/System.Windows.Controls/ControlTemplateTest.cs 2008-12-01 16:17:48 UTC (rev 120359) @@ -90,6 +90,7 @@ } [TestMethod] + [KnownFailure] public void TemplateInStaticResource () { Console.WriteLine ("TemplateInStaticResource"); @@ -118,6 +119,7 @@ [TestMethod] + [KnownFailure] public void TemplateBindingTest () { Console.WriteLine ("TemplateBindingTest"); Modified: trunk/moon/test/2.0/moon-unit/System.Windows.Controls/MediaElementTest.cs =================================================================== --- trunk/moon/test/2.0/moon-unit/System.Windows.Controls/MediaElementTest.cs 2008-12-01 16:17:28 UTC (rev 120358) +++ trunk/moon/test/2.0/moon-unit/System.Windows.Controls/MediaElementTest.cs 2008-12-01 16:17:48 UTC (rev 120359) @@ -50,6 +50,8 @@ void client_OpenReadCompleted (object sender, OpenReadCompletedEventArgs e) { completed = true; try { + // Accessing e.Result causes a security exception in SL which makes the harness stop working + // if we don't handle the exception Console.WriteLine ("client_OpenRead: e.Result: {0}, e.ex: {1}", e.Result, e.Error); if (e.Result != null) media.SetSource (new SlowStream (e.Result)); Modified: trunk/moon/test/2.0/moon-unit/System.Windows.Shapes/PathTest.cs =================================================================== --- trunk/moon/test/2.0/moon-unit/System.Windows.Shapes/PathTest.cs 2008-12-01 16:17:28 UTC (rev 120358) +++ trunk/moon/test/2.0/moon-unit/System.Windows.Shapes/PathTest.cs 2008-12-01 16:17:48 UTC (rev 120359) @@ -64,6 +64,7 @@ } [TestMethod] + [KnownFailure] public void Measure_StretchFill_Test1 () { Border b = new Border (); From mono-patches-list at lists.ximian.com Mon Dec 1 11:19:36 2008 From: mono-patches-list at lists.ximian.com (Brad Taylor (brad@getcoded.net)) Date: Mon, 1 Dec 2008 11:19:36 -0500 (EST) Subject: [Mono-patches] r120360 - trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests Message-ID: <20081201161936.ED1099472C@mono-cvs.ximian.com> Author: btaylor Date: 2008-12-01 11:19:36 -0500 (Mon, 01 Dec 2008) New Revision: 120360 Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/Makefile.am trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/RichTextBoxProviderTest.cs trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/TextBoxProviderTest.cs trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ToolStripTextBoxProviderTest.cs Log: 2008-12-01 Brad Taylor * UIAutomationWinforms/Makefile.am: * UIAutomationWinformsTests/Makefile.am: * UIAutomationWinformsTests/TextBoxProviderTest.cs: * UIAutomationWinformsTests/TextBoxBaseProviderTest.cs: * UIAutomationWinformsTests/RichTextBoxProviderTest.cs: * UIAutomationWinformsTests/ToolStripTextBoxProviderTest.cs: Refactor the TextBox* tests so that they share code better. * UIAutomationWinformsTests/MaskedTextBoxProviderTest.cs: Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/Makefile.am =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/Makefile.am 2008-12-01 16:17:48 UTC (rev 120359) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/Makefile.am 2008-12-01 16:19:36 UTC (rev 120360) @@ -66,6 +66,7 @@ LinkLabelProviderTest.cs \ ListBoxProviderTest.cs \ ListViewProviderTest.cs \ + MaskedTextBoxProviderTest.cs \ MenuStripProviderTest.cs \ MockBridge.cs \ NumericUpDownProviderTest.cs \ @@ -80,6 +81,7 @@ TabControlProviderTest.cs \ TabPageProviderTest.cs \ TestHelper.cs \ + TextBoxBaseProviderTest.cs \ TextBoxProviderTest.cs \ TextRangeProviderTest.cs \ ToolStripComboBoxProviderTest.cs \ Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/RichTextBoxProviderTest.cs =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/RichTextBoxProviderTest.cs 2008-12-01 16:17:48 UTC (rev 120359) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/RichTextBoxProviderTest.cs 2008-12-01 16:19:36 UTC (rev 120360) @@ -35,226 +35,61 @@ namespace MonoTests.Mono.UIAutomation.Winforms { [TestFixture] - public class RichTextBoxProviderTest : BaseProviderTest + public class RichTextBoxProviderTest + : TextBoxBaseProviderTest { - [Test] - public void EditPropertiesTest () + protected override RichTextBox GetTextBoxBase () { - RichTextBox textbox = new RichTextBox (); - textbox.Multiline = false; - IRawElementProviderSimple provider = ProviderFactory.GetProvider (textbox); - - TestProperty (provider, - AutomationElementIdentifiers.ControlTypeProperty, - ControlType.Edit.Id); - - TestProperty (provider, - AutomationElementIdentifiers.LocalizedControlTypeProperty, - "edit"); - - TestProperty (provider, - AutomationElementIdentifiers.IsPasswordProperty, - false); + return new RichTextBox (); } - - public void DocumentPropertiesTest () - { - RichTextBox textbox = new RichTextBox (); - IRawElementProviderSimple provider = ProviderFactory.GetProvider (textbox); - textbox.Multiline = true; - - TestProperty (provider, - AutomationElementIdentifiers.ControlTypeProperty, - ControlType.Document.Id); - - TestProperty (provider, - AutomationElementIdentifiers.LocalizedControlTypeProperty, - "document"); - - TestProperty (provider, - AutomationElementIdentifiers.IsContentElementProperty, - true); - - TestProperty (provider, - AutomationElementIdentifiers.IsControlElementProperty, - true); - } - - [Test] - public void ValuePatternTest () - { - RichTextBox textbox = new RichTextBox (); - textbox.Multiline = false; - IRawElementProviderSimple provider = ProviderFactory.GetProvider (textbox); - - object valueProvider = provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id); - Assert.IsNotNull (valueProvider, "Not returning ValuePatternIdentifiers."); - Assert.IsTrue (valueProvider is IValueProvider, "Not returning ValuePatternIdentifiers"); - } - - [Test] - public void TextPatternTest () - { - RichTextBox textbox = new RichTextBox (); - IRawElementProviderSimple provider = ProviderFactory.GetProvider (textbox); - - ITextProvider textProvider - = provider.GetPatternProvider (TextPatternIdentifiers.Pattern.Id) - as ITextProvider; - Assert.IsNotNull (textProvider, "Not returning TextPatternIdentifiers."); - Assert.IsTrue (textProvider is ITextProvider, "Not returning TextPatternIdentifiers."); - textbox.Text = "abc123"; - textbox.Multiline = true; - - ITextRangeProvider range = textProvider.RangeFromPoint (new Point (0, 0)); - Assert.IsNotNull (range); - - // should always return a degenerate range - Assert.AreEqual (String.Empty, range.GetText (-1)); - - // TODO: Actually check the value, instead of just - // making sure it doesn't crash - range.MoveEndpointByUnit (TextPatternRangeEndpoint.End, TextUnit.Character, 1); - - // TODO: Actually check the value, instead of just - // making sure it doesn't crash - ITextRangeProvider[] ranges = textProvider.GetVisibleRanges (); - Assert.AreEqual (1, ranges.Length); - } - - [Test] - public void RangeValuePatternTest () - { - RichTextBox textbox = new RichTextBox (); - IRawElementProviderSimple provider = ProviderFactory.GetProvider (textbox); - - object rangeProvider = provider.GetPatternProvider (RangeValuePatternIdentifiers.Pattern.Id); - Assert.IsNull (rangeProvider, "Returned RangeValuePatternIdentifiers."); - } - - [Test] - public void IsNotIValueProviderTest () - { - RichTextBox textbox = new RichTextBox (); - textbox.Multiline = true; - - IRawElementProviderSimple provider = ProviderFactory.GetProvider (textbox); - - object valueProvider = - provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id); - Assert.IsNull (valueProvider, "Is returning ValuePatternIdentifiers."); - - textbox.Multiline = false; - valueProvider = provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id); - Assert.IsNotNull (valueProvider, "Is not returning ValuePatternIdentifiers."); - } +#region IScrollProvider Tests + // No good way to share this: + // Copied from TextBoxProviderTest [Test] - public void IValueProviderIsReadOnlyTest () - { - RichTextBox textbox = new RichTextBox (); - textbox.Multiline = false; - - IRawElementProviderSimple provider = ProviderFactory.GetProvider (textbox); - - IValueProvider valueProvider = (IValueProvider) - provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id); - Assert.IsNotNull (valueProvider, "Not returning ValuePatternIdentifiers."); - - textbox.ReadOnly = true; - Assert.AreEqual (valueProvider.IsReadOnly, true, "Is read only"); - - textbox.ReadOnly = false; - Assert.AreEqual (valueProvider.IsReadOnly, false, "Is not only"); - } - - [Test] - public void IValueProviderValueTest () - { - RichTextBox textbox = new RichTextBox (); - textbox.Multiline = false; - - IRawElementProviderSimple provider = ProviderFactory.GetProvider (textbox); - - IValueProvider valueProvider = (IValueProvider) - provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id); - Assert.IsNotNull (valueProvider, "Not returning ValuePatternIdentifiers."); - - Assert.AreEqual (valueProvider.Value, string.Empty, "Empty value"); - - string value = "Hello world"; - - textbox.Text = value; - Assert.AreEqual (valueProvider.Value, value, "HelloWorld value"); - } - - [Test] - public void IValueProviderSetValueTest () - { - RichTextBox textbox = new RichTextBox (); - textbox.Multiline = false; - - IRawElementProviderSimple provider = ProviderFactory.GetProvider (textbox); - - IValueProvider valueProvider = (IValueProvider) - provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id); - Assert.IsNotNull (valueProvider, "Not returning ValuePatternIdentifiers."); - - string value = "Hello world"; - - valueProvider.SetValue (value); - Assert.AreEqual (valueProvider.Value, value, "Different value"); - - try { - textbox.ReadOnly = true; - valueProvider.SetValue (value); - Assert.Fail ("ElementNotEnabledException not thrown."); - } catch (ElementNotEnabledException) { } - } - - [Test] public void IScrollProviderTest () { - RichTextBox textbox = new RichTextBox (); - textbox.Size = new System.Drawing.Size (30, 30); - Form.Controls.Add (textbox); + RichTextBox textBox; + IRawElementProviderSimple provider; + GetProviderAndControl (out provider, out textBox); - IRawElementProviderSimple prov - = ProviderFactory.GetProvider (textbox); + textBox.Size = new System.Drawing.Size (30, 30); + Form.Controls.Add (textBox); + textBox.ScrollBars = RichTextBoxScrollBars.Both; IRawElementProviderFragmentRoot root_prov - = (IRawElementProviderFragmentRoot)prov; + = (IRawElementProviderFragmentRoot)provider; // Case #1: Edit with no text - textbox.Text = String.Empty; - textbox.Multiline = false; + textBox.Text = String.Empty; + textBox.Multiline = false; - IScrollProvider scroll = prov.GetPatternProvider ( + IScrollProvider scroll = provider.GetPatternProvider ( ScrollPatternIdentifiers.Pattern.Id) as IScrollProvider; Assert.IsNull (scroll, "Edit mode with no text incorrectly supports ScrollProvider"); // Case #2: Edit with large amount of text - textbox.Text = TEST_MESSAGE; - textbox.Multiline = false; + textBox.Text = TEST_MESSAGE; + textBox.Multiline = false; - scroll = prov.GetPatternProvider ( + scroll = provider.GetPatternProvider ( ScrollPatternIdentifiers.Pattern.Id) as IScrollProvider; Assert.IsNull (scroll, "Edit mode with text incorrectly supports ScrollProvider"); // Case #3: Document with no text - textbox.Text = String.Empty; - textbox.Multiline = true; + textBox.Text = String.Empty; + textBox.Multiline = true; - scroll = prov.GetPatternProvider ( + scroll = provider.GetPatternProvider ( ScrollPatternIdentifiers.Pattern.Id) as IScrollProvider; Assert.IsNull (scroll, "Document mode with no text incorrectly supports ScrollProvider"); // Case #4: Document with large amount of text - textbox.Text = TEST_MESSAGE; - textbox.Multiline = true; + textBox.Text = TEST_MESSAGE; + textBox.Multiline = true; - scroll = prov.GetPatternProvider ( + scroll = provider.GetPatternProvider ( ScrollPatternIdentifiers.Pattern.Id) as IScrollProvider; Assert.IsNotNull (scroll, "Document mode with text doesn't support ScrollProvider"); @@ -273,45 +108,14 @@ IRawElementProviderFragment child; child = root_prov.Navigate (NavigateDirection.FirstChild); - Assert.IsNotNull (child, "TextBox has no children"); + Assert.IsNotNull (child, "textBox has no children"); TestProperty (child, AutomationElementIdentifiers.ControlTypeProperty, ControlType.ScrollBar.Id); child = child.Navigate (NavigateDirection.NextSibling); - Assert.IsNull (child, "TextBox has more than one scrollbar"); + Assert.IsNull (child, "textBox has more than one scrollbar"); } - - [Test] - [Ignore ("Current failure needs investigation")] - public void TextChangedEventTest () - { - RichTextBox textbox = new RichTextBox (); - - bridge.ResetEventLists (); - textbox.Text = "Changed!"; - - Assert.AreEqual (1, - bridge.AutomationEvents.Count, - "Event count"); - } - - protected override Control GetControlInstance () - { - return new RichTextBox (); - } - - // TODO: Move this somewhere else - private const string TEST_MESSAGE = "One morning, when Gregor Samsa woke from troubled dreams, "+ - "he found himself transformed in his bed into a horrible vermin.He lay on his armour-like back, "+ - "and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches "+ - "into stiff sections. The bedding was hardly able to cover it and seemed ready to slide off any moment. "+ - "His many legs, pitifully thin compared with the size of the rest of him, waved about helplessly as he "+ - "looked. \"What's happened to me? \" he thought. It wasn't a dream. His room, a proper human room although "+ - "a little too small, lay peacefully between its four familiar walls. A collection of textile samples lay "+ - "spread out on the table - Samsa was a travelling salesman - and above it there hung a picture that he had "+ - "recently cut out of an illustrated magazine and housed in a nice, gilded frame. It showed a lady "+ - "fitted out with a fur hat and fur boa who sat upright, raising a heavy fur muff that covered the whole "+ - "of her lower arm towards the viewer. Gregor then turned to look out the window at the dull weather. Drops "; +#endregion } } Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/TextBoxProviderTest.cs =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/TextBoxProviderTest.cs 2008-12-01 16:17:48 UTC (rev 120359) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/TextBoxProviderTest.cs 2008-12-01 16:19:36 UTC (rev 120360) @@ -36,234 +36,61 @@ namespace MonoTests.Mono.UIAutomation.Winforms { [TestFixture] - public class TextBoxProviderTest : BaseProviderTest + public class TextBoxProviderTest + : TextBoxBaseProviderTest { -#region Tests - - [Test] - public void EditPropertiesTest () + protected override TextBox GetTextBoxBase () { - TextBox textbox = CreateTextBox (); - IRawElementProviderSimple provider = ProviderFactory.GetProvider (textbox); - - TestProperty (provider, - AutomationElementIdentifiers.ControlTypeProperty, - ControlType.Edit.Id); - - TestProperty (provider, - AutomationElementIdentifiers.LocalizedControlTypeProperty, - "edit"); - - TestProperty (provider, - AutomationElementIdentifiers.IsPasswordProperty, - false); + return new TextBox (); } - - public void DocumentPropertiesTest () - { - TextBox textbox = CreateTextBox (); - IRawElementProviderSimple provider = ProviderFactory.GetProvider (textbox); - textbox.Multiline = true; - - TestProperty (provider, - AutomationElementIdentifiers.ControlTypeProperty, - ControlType.Document.Id); - - TestProperty (provider, - AutomationElementIdentifiers.LocalizedControlTypeProperty, - "document"); - - TestProperty (provider, - AutomationElementIdentifiers.IsContentElementProperty, - true); - - TestProperty (provider, - AutomationElementIdentifiers.IsControlElementProperty, - true); - } - - [Test] - public void ValuePatternTest () - { - TextBox textbox = CreateTextBox (); - IRawElementProviderSimple provider = ProviderFactory.GetProvider (textbox); - - object valueProvider = provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id); - Assert.IsNotNull (valueProvider, "Not returning ValuePatternIdentifiers."); - Assert.IsTrue (valueProvider is IValueProvider, "Not returning ValuePatternIdentifiers"); - } - - [Test] - public void TextPatternTest () - { - TextBox textbox = CreateTextBox (); - IRawElementProviderSimple provider = ProviderFactory.GetProvider (textbox); - - ITextProvider textProvider - = provider.GetPatternProvider (TextPatternIdentifiers.Pattern.Id) - as ITextProvider; - Assert.IsNotNull (textProvider, "Not returning TextPatternIdentifiers."); - Assert.IsTrue (textProvider is ITextProvider, "Not returning TextPatternIdentifiers."); - textbox.Text = "abc123"; - textbox.Multiline = true; - - ITextRangeProvider range = textProvider.RangeFromPoint (new Point (0, 0)); - Assert.IsNotNull (range); - - // should always return a degenerate range - Assert.AreEqual (String.Empty, range.GetText (-1)); - - // TODO: Actually check the value, instead of just - // making sure it doesn't crash - range.MoveEndpointByUnit (TextPatternRangeEndpoint.End, TextUnit.Character, 1); - - // TODO: Actually check the value, instead of just - // making sure it doesn't crash - ITextRangeProvider[] ranges = textProvider.GetVisibleRanges (); - Assert.AreEqual (1, ranges.Length); - } - - [Test] - public void RangeValuePatternTest () - { - TextBox textbox = CreateTextBox (); - IRawElementProviderSimple provider = ProviderFactory.GetProvider (textbox); - - object rangeProvider = provider.GetPatternProvider (RangeValuePatternIdentifiers.Pattern.Id); - Assert.IsNull (rangeProvider, "Returned RangeValuePatternIdentifiers."); - } - -#endregion - -#region IValueProvider Tests - - [Test] - public void IsNotIValueProviderTest () - { - TextBox textbox = CreateTextBox (); - IRawElementProviderSimple provider = ProviderFactory.GetProvider (textbox); - - object valueProvider; - /* NOTDOTNET: We diverge from the spec here, as we - * provide ValueProvider in Document mode so folks can - * subscribe to an event to see if text has changed. - textbox.Multiline = true; - - object valueProvider = - provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id); - Assert.IsNull (valueProvider, "Is returning ValuePatternIdentifiers."); - */ - - textbox.Multiline = false; - valueProvider = provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id); - Assert.IsNotNull (valueProvider, "Is not returning ValuePatternIdentifiers."); - } - - [Test] - public void IValueProviderIsReadOnlyTest () - { - TextBox textbox = CreateTextBox (); - IRawElementProviderSimple provider = ProviderFactory.GetProvider (textbox); - - IValueProvider valueProvider = (IValueProvider) - provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id); - Assert.IsNotNull (valueProvider, "Not returning ValuePatternIdentifiers."); - - textbox.ReadOnly = true; - Assert.AreEqual (valueProvider.IsReadOnly, true, "Is read only"); - - textbox.ReadOnly = false; - Assert.AreEqual (valueProvider.IsReadOnly, false, "Is not only"); - } - - [Test] - public void IValueProviderValueTest () - { - TextBox textbox = CreateTextBox (); - IRawElementProviderSimple provider = ProviderFactory.GetProvider (textbox); - - IValueProvider valueProvider = (IValueProvider) - provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id); - Assert.IsNotNull (valueProvider, "Not returning ValuePatternIdentifiers."); - - Assert.AreEqual (valueProvider.Value, string.Empty, "Empty value"); - - string value = "Hello world"; - - textbox.Text = value; - Assert.AreEqual (valueProvider.Value, value, "HelloWorld value"); - } - - [Test] - public void IValueProviderSetValueTest () - { - TextBox textbox = CreateTextBox (); - IRawElementProviderSimple provider = ProviderFactory.GetProvider (textbox); - - IValueProvider valueProvider = (IValueProvider) - provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id); - Assert.IsNotNull (valueProvider, "Not returning ValuePatternIdentifiers."); - - string value = "Hello world"; - - valueProvider.SetValue (value); - Assert.AreEqual (valueProvider.Value, value, "Different value"); - - try { - textbox.ReadOnly = true; - valueProvider.SetValue (value); - Assert.Fail ("ElementNotEnabledException not thrown."); - } catch (ElementNotEnabledException) { } - } - -#endregion - #region IScrollProvider Tests + // No good way to share this: + // Copied to RichTextBoxProviderTest [Test] public void IScrollProviderTest () { - TextBox textbox = CreateTextBox (); - textbox.Size = new System.Drawing.Size (30, 30); - Form.Controls.Add (textbox); - textbox.ScrollBars = ScrollBars.Both; + TextBox textBox; + IRawElementProviderSimple provider; + GetProviderAndControl (out provider, out textBox); - IRawElementProviderSimple prov - = ProviderFactory.GetProvider (textbox); + textBox.Size = new System.Drawing.Size (30, 30); + Form.Controls.Add (textBox); + textBox.ScrollBars = ScrollBars.Both; IRawElementProviderFragmentRoot root_prov - = (IRawElementProviderFragmentRoot)prov; + = (IRawElementProviderFragmentRoot)provider; // Case #1: Edit with no text - textbox.Text = String.Empty; - textbox.Multiline = false; + textBox.Text = String.Empty; + textBox.Multiline = false; - IScrollProvider scroll = prov.GetPatternProvider ( + IScrollProvider scroll = provider.GetPatternProvider ( ScrollPatternIdentifiers.Pattern.Id) as IScrollProvider; Assert.IsNull (scroll, "Edit mode with no text incorrectly supports ScrollProvider"); // Case #2: Edit with large amount of text - textbox.Text = TEST_MESSAGE; - textbox.Multiline = false; + textBox.Text = TEST_MESSAGE; + textBox.Multiline = false; - scroll = prov.GetPatternProvider ( + scroll = provider.GetPatternProvider ( ScrollPatternIdentifiers.Pattern.Id) as IScrollProvider; Assert.IsNull (scroll, "Edit mode with text incorrectly supports ScrollProvider"); // Case #3: Document with no text - textbox.Text = String.Empty; - textbox.Multiline = true; + textBox.Text = String.Empty; + textBox.Multiline = true; - scroll = prov.GetPatternProvider ( + scroll = provider.GetPatternProvider ( ScrollPatternIdentifiers.Pattern.Id) as IScrollProvider; Assert.IsNull (scroll, "Document mode with no text incorrectly supports ScrollProvider"); // Case #4: Document with large amount of text - textbox.Text = TEST_MESSAGE; - textbox.Multiline = true; + textBox.Text = TEST_MESSAGE; + textBox.Multiline = true; - scroll = prov.GetPatternProvider ( + scroll = provider.GetPatternProvider ( ScrollPatternIdentifiers.Pattern.Id) as IScrollProvider; Assert.IsNotNull (scroll, "Document mode with text doesn't support ScrollProvider"); @@ -282,102 +109,15 @@ IRawElementProviderFragment child; child = root_prov.Navigate (NavigateDirection.FirstChild); - Assert.IsNotNull (child, "TextBox has no children"); + Assert.IsNotNull (child, "textBox has no children"); TestProperty (child, AutomationElementIdentifiers.ControlTypeProperty, ControlType.ScrollBar.Id); child = child.Navigate (NavigateDirection.NextSibling); - Assert.IsNull (child, "TextBox has more than one scrollbar"); + Assert.IsNull (child, "textBox has more than one scrollbar"); } #endregion - -#region Events tests - - [Test] - public void TextChangedEventTest () - { - TextBox textbox = CreateTextBox (); - Form.Controls.Add (textbox); - bridge.ResetEventLists (); - - textbox.Text = "lfesalhafew"; - - Assert.AreEqual (1, - bridge.AutomationPropertyChangedEvents.Count, - "Event count"); - } - - // NOTDOTNET: We diverge from the spec here, as we provide - // ValueProvider in Document mode so folks can subscribe to an - // event to see if text has changed. - [Test] - public void TextChangedEventTestMultiLine () - { - TextBox textbox = CreateTextBox (); - Form.Controls.Add (textbox); - textbox.Multiline = true; - - bridge.ResetEventLists (); - - textbox.Text = "lifewauhfewa"; - - Assert.AreEqual (1, - bridge.AutomationPropertyChangedEvents.Count, - "Event count"); - } - - [Test] - public void TextChangedEventTestMultiLineBeforeFormShow () - { - TextBox textbox = CreateTextBox (); - textbox.Multiline = true; - - Form form = new Form (); - form.Controls.Add (textbox); - form.Show (); - - bridge.ResetEventLists (); - - textbox.Text = "lifewauhfewa\nsokksooks"; - - Assert.AreEqual (1, - bridge.AutomationPropertyChangedEvents.Count, - "Event count"); - } - -#endregion - -#region BaseProviderTest Overrides - - protected override Control GetControlInstance () - { - return CreateTextBox (); - } - -#endregion - - #region Protected Methods - - protected virtual TextBox CreateTextBox () - { - return new TextBox (); - } - - #endregion - - // TODO: Move this somewhere else - private const string TEST_MESSAGE = "One morning, when Gregor Samsa woke from troubled dreams, "+ - "he found himself transformed in his bed into a horrible vermin.He lay on his armour-like back, "+ - "and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches "+ - "into stiff sections. The bedding was hardly able to cover it and seemed ready to slide off any moment. "+ - "His many legs, pitifully thin compared with the size of the rest of him, waved about helplessly as he "+ - "looked. \"What's happened to me? \" he thought. It wasn't a dream. His room, a proper human room although "+ - "a little too small, lay peacefully between its four familiar walls. A collection of textile samples lay "+ - "spread out on the table - Samsa was a travelling salesman - and above it there hung a picture that he had "+ - "recently cut out of an illustrated magazine and housed in a nice, gilded frame. It showed a lady "+ - "fitted out with a fur hat and fur boa who sat upright, raising a heavy fur muff that covered the whole "+ - "of her lower arm towards the viewer. Gregor then turned to look out the window at the dull weather. Drops "; } } Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ToolStripTextBoxProviderTest.cs =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ToolStripTextBoxProviderTest.cs 2008-12-01 16:17:48 UTC (rev 120359) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ToolStripTextBoxProviderTest.cs 2008-12-01 16:19:36 UTC (rev 120360) @@ -35,7 +35,8 @@ namespace MonoTests.Mono.UIAutomation.Winforms { [TestFixture] - public class ToolStripTextBoxProviderTest : TextBoxProviderTest + public class ToolStripTextBoxProviderTest + : TextBoxBaseProviderTest { [Test] public void NavigationTest () @@ -66,7 +67,7 @@ box2Provider.Navigate (NavigateDirection.Parent)); } - protected override TextBox CreateTextBox () + protected override TextBox GetTextBoxBase () { ToolStripTextBox stripTextBox = new ToolStripTextBox (); return stripTextBox.TextBox; From mono-patches-list at lists.ximian.com Mon Dec 1 11:22:08 2008 From: mono-patches-list at lists.ximian.com (Brad Taylor (brad@getcoded.net)) Date: Mon, 1 Dec 2008 11:22:08 -0500 (EST) Subject: [Mono-patches] r120361 - in trunk/uia2atk/UIAutomationWinforms: UIAutomationWinforms UIAutomationWinforms/Mono.UIAutomation.Winforms UIAutomationWinformsTests Message-ID: <20081201162208.473A79472C@mono-cvs.ximian.com> Author: btaylor Date: 2008-12-01 11:22:07 -0500 (Mon, 01 Dec 2008) New Revision: 120361 Added: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Mono.UIAutomation.Winforms/MaskedTextBoxProvider.cs Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/ChangeLog trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Makefile.am trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Mono.UIAutomation.Winforms/ProviderFactory.cs trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Mono.UIAutomation.Winforms/RichTextBoxProvider.cs trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ChangeLog Log: 2008-12-01 Brad Taylor * Makefile.am: * Mono.UIAutomation.Winforms/ProviderFactory.cs: * Mono.UIAutomation.Winforms/MaskedTextBoxProvider.cs: Add MaskedTextBox implementation. * Mono.UIAutomation.Winforms/RichTextBoxProvider.cs: Removed unused method. * UIAutomationWinforms/Makefile.am: * UIAutomationWinformsTests/Makefile.am: * UIAutomationWinformsTests/TextBoxProviderTest.cs: * UIAutomationWinformsTests/TextBoxBaseProviderTest.cs: * UIAutomationWinformsTests/RichTextBoxProviderTest.cs: * UIAutomationWinformsTests/ToolStripTextBoxProviderTest.cs: Refactor the TextBox* tests so that they share code better. * UIAutomationWinformsTests/MaskedTextBoxProviderTest.cs: Add test for MaskedTextBox. Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/ChangeLog =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/ChangeLog 2008-12-01 16:19:36 UTC (rev 120360) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/ChangeLog 2008-12-01 16:22:07 UTC (rev 120361) @@ -1,3 +1,13 @@ +2008-12-01 Brad Taylor + + * Makefile.am: + * Mono.UIAutomation.Winforms/ProviderFactory.cs: + * Mono.UIAutomation.Winforms/MaskedTextBoxProvider.cs: Add + MaskedTextBox implementation. + + * Mono.UIAutomation.Winforms/RichTextBoxProvider.cs: Removed unused + method. + 2008-11-26 Sandy Armstrong * Makefile.am: Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Makefile.am =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Makefile.am 2008-12-01 16:19:36 UTC (rev 120360) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Makefile.am 2008-12-01 16:22:07 UTC (rev 120361) @@ -251,6 +251,7 @@ Mono.UIAutomation.Winforms/ListItemProvider.cs \ Mono.UIAutomation.Winforms/ListProvider.cs \ Mono.UIAutomation.Winforms/ListViewProvider.cs \ + Mono.UIAutomation.Winforms/MaskedTextBoxProvider.cs \ Mono.UIAutomation.Winforms/MenuStripProvider.cs \ Mono.UIAutomation.Winforms/NumericUpDownProvider.cs \ Mono.UIAutomation.Winforms/PanelProvider.cs \ Added: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Mono.UIAutomation.Winforms/MaskedTextBoxProvider.cs =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Mono.UIAutomation.Winforms/MaskedTextBoxProvider.cs 2008-12-01 16:19:36 UTC (rev 120360) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Mono.UIAutomation.Winforms/MaskedTextBoxProvider.cs 2008-12-01 16:22:07 UTC (rev 120361) @@ -0,0 +1,40 @@ +// 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. +// +// Copyright (c) 2008 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Brad Taylor +// + +using System; +using System.Windows; +using System.Windows.Automation; +using System.Windows.Automation.Provider; +using System.Windows.Forms; + +namespace Mono.UIAutomation.Winforms +{ + internal class MaskedTextBoxProvider : TextBoxProvider + { + public MaskedTextBoxProvider (TextBoxBase textBoxBase) : base (textBoxBase) + { + } + } +} Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Mono.UIAutomation.Winforms/ProviderFactory.cs =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Mono.UIAutomation.Winforms/ProviderFactory.cs 2008-12-01 16:19:36 UTC (rev 120360) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Mono.UIAutomation.Winforms/ProviderFactory.cs 2008-12-01 16:22:07 UTC (rev 120361) @@ -107,6 +107,7 @@ SWF.ListView lv; SWF.WebBrowser wb; SWF.Panel p; + SWF.MaskedTextBox mtb; SWF.StatusStrip ss; SWF.MenuStrip ms; @@ -214,6 +215,8 @@ provider = new PanelProvider (p); else if ((lv = component as SWF.ListView) != null) provider = new ListViewProvider (lv); + else if ((mtb = component as SWF.MaskedTextBox) != null) + provider = new MaskedTextBoxProvider (mtb); else { //TODO: We have to solve the problem when there's a Custom control // Ideally the first thing we do is send a wndproc message to Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Mono.UIAutomation.Winforms/RichTextBoxProvider.cs =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Mono.UIAutomation.Winforms/RichTextBoxProvider.cs 2008-12-01 16:19:36 UTC (rev 120360) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Mono.UIAutomation.Winforms/RichTextBoxProvider.cs 2008-12-01 16:22:07 UTC (rev 120361) @@ -38,11 +38,5 @@ public RichTextBoxProvider (TextBoxBase textBoxBase) : base (textBoxBase) { } - - public override void Initialize () - { - base.Initialize (); - - } } } Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ChangeLog =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ChangeLog 2008-12-01 16:19:36 UTC (rev 120360) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ChangeLog 2008-12-01 16:22:07 UTC (rev 120361) @@ -1,3 +1,16 @@ +2008-12-01 Brad Taylor + + * UIAutomationWinforms/Makefile.am: + * UIAutomationWinformsTests/Makefile.am: + * UIAutomationWinformsTests/TextBoxProviderTest.cs: + * UIAutomationWinformsTests/TextBoxBaseProviderTest.cs: + * UIAutomationWinformsTests/RichTextBoxProviderTest.cs: + * UIAutomationWinformsTests/ToolStripTextBoxProviderTest.cs: Refactor + the TextBox* tests so that they share code better. + + * UIAutomationWinformsTests/MaskedTextBoxProviderTest.cs: Add test for + MaskedTextBox. + 2008-11-26 Sandy Armstrong * StatusBarProviderTest.cs: Add test for Name property change. From mono-patches-list at lists.ximian.com Mon Dec 1 11:25:58 2008 From: mono-patches-list at lists.ximian.com (Rolf Bjarne Kvinge (rolfkvinge@ya.com)) Date: Mon, 1 Dec 2008 11:25:58 -0500 (EST) Subject: [Mono-patches] r120362 - in trunk/moon/test/2.0/moon-unit: . Mono.Moonlight.UnitTesting site Message-ID: <20081201162558.6B1649472C@mono-cvs.ximian.com> Author: rolf Date: 2008-12-01 11:25:58 -0500 (Mon, 01 Dec 2008) New Revision: 120362 Added: trunk/moon/test/2.0/moon-unit/site/moon-unit-log.xsl Modified: trunk/moon/test/2.0/moon-unit/App.xaml.cs trunk/moon/test/2.0/moon-unit/ChangeLog trunk/moon/test/2.0/moon-unit/Mono.Moonlight.UnitTesting/MoonLogProvider.cs trunk/moon/test/2.0/moon-unit/moon-unit.csproj trunk/moon/test/2.0/moon-unit/moon-unit.mdp trunk/moon/test/2.0/moon-unit/site/MoonLogProvider.aspx.cs Log: * test/2.0/moon-unit/site/moon-unit-log.xsl: Added, shows html for our unit test results. * test/2.0/moon-unit/moon-unit.mdp, test/2.0/moon-unit/moon-unit.csproj: Updated. * test/2.0/moon-unit/Mono.Moonlight.UnitTesting/MoonLogProvider.cs, test/2.0/moon-unit/App.xaml.cs: Instead of sending one request for each message, add them all to an xml document and when the test harness has finished send the entire xml document. This fixes issues where the messages would reach the logfile in another order than they were sent. Modified: trunk/moon/test/2.0/moon-unit/App.xaml.cs =================================================================== --- trunk/moon/test/2.0/moon-unit/App.xaml.cs 2008-12-01 16:22:07 UTC (rev 120361) +++ trunk/moon/test/2.0/moon-unit/App.xaml.cs 2008-12-01 16:25:58 UTC (rev 120362) @@ -20,6 +20,7 @@ public partial class App : Application { MoonLogProvider moonlog; + UIElement test_page; public App() { @@ -38,20 +39,34 @@ settings.TestAssemblies.Add (Assembly.GetExecutingAssembly ()); UnitTestSystem.PrepareCustomLogProviders (settings); settings.LogProviders.Add (moonlog); - this.RootVisual = UnitTestSystem.CreateTestPage (settings); + test_page = UnitTestSystem.CreateTestPage (settings); settings.TestHarness.TestHarnessCompleted += new EventHandler (Harness_Completed); + this.RootVisual = test_page; } void Harness_Completed (object sender, TestHarnessCompletedEventArgs e) { try { - moonlog.ProcessCompleted (e); - HtmlPage.Window.Eval ("try { ShutdownHarness (); } catch (e) { }"); + if (moonlog.ProcessCompleted (e, ShutdownHarness)) { + ShutdownHarness (); + } } catch (Exception ex) { Console.WriteLine (ex.Message); } } + void ShutdownHarness () + { + try { + if (!test_page.CheckAccess ()) + test_page.Dispatcher.BeginInvoke (ShutdownHarness); + else + HtmlPage.Window.Eval ("try { ShutdownHarness (); } catch (e) { }"); + } catch (Exception ex) { + Console.WriteLine (ex.Message); + } + } + private void Application_Exit(object sender, EventArgs e) { Modified: trunk/moon/test/2.0/moon-unit/ChangeLog =================================================================== --- trunk/moon/test/2.0/moon-unit/ChangeLog 2008-12-01 16:22:07 UTC (rev 120361) +++ trunk/moon/test/2.0/moon-unit/ChangeLog 2008-12-01 16:25:58 UTC (rev 120362) @@ -1,5 +1,15 @@ 2008-12-01 Rolf Bjarne Kvinge + * site/moon-unit-log.xsl: Added, shows html for our unit test results. + * moon-unit.mdp, moon-unit.csproj: Updated. + * Mono.Moonlight.UnitTesting/MoonLogProvider.cs, App.xaml.cs: Instead + of sending one request for each message, add them all to an xml + document and when the test harness has finished send the entire xml + document. This fixes issues where the messages would reach the + logfile in another order than they were sent. + +2008-12-01 Rolf Bjarne Kvinge + * System.Windows.Controls/ControlTemplateTest.cs, System.Windows.Controls/MediaElementTest.cs, System.Windows.Shapes/PathTest.cs, System.Windows/StyleTest.cs, Modified: trunk/moon/test/2.0/moon-unit/Mono.Moonlight.UnitTesting/MoonLogProvider.cs =================================================================== --- trunk/moon/test/2.0/moon-unit/Mono.Moonlight.UnitTesting/MoonLogProvider.cs 2008-12-01 16:22:07 UTC (rev 120361) +++ trunk/moon/test/2.0/moon-unit/Mono.Moonlight.UnitTesting/MoonLogProvider.cs 2008-12-01 16:25:58 UTC (rev 120362) @@ -3,6 +3,8 @@ using System.Globalization; using System.Net; using System.IO; +using System.Reflection; +using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; @@ -12,6 +14,7 @@ using System.Windows.Media.Animation; using System.Windows.Shapes; using System.Windows.Browser; +using System.Xml; using Microsoft.Silverlight.Testing; using Microsoft.Silverlight.Testing.Harness; @@ -22,12 +25,18 @@ { public class MoonLogProvider : LogProvider { + private XmlWriter writer; + private StringBuilder text = new StringBuilder (); + private string filename; - private int sequence; private string baseuri; + private Action on_completed; + private int[] totals; public MoonLogProvider () { + XmlWriterSettings settings; + DateTime now = DateTime.Now; Uri docuri = HtmlPage.Document.DocumentUri; @@ -36,104 +45,197 @@ return; } - baseuri = string.Concat (docuri.Scheme, "://", docuri.Host, ":", docuri.Port.ToString (), System.IO.Path.GetDirectoryName (docuri.LocalPath)); + baseuri = string.Concat (docuri.Scheme, "://", docuri.Host, ":", docuri.Port.ToString (), docuri.LocalPath.Substring (0, docuri.LocalPath.Length - System.IO.Path.GetFileName (docuri.LocalPath).Length)); // Create a unique filename filename = string.Format ("moon-unit-log-{0}-{1}.xml", now.ToUniversalTime ().ToString ("yyyy-MM-dd-HH-mm-ss", CultureInfo.InvariantCulture.DateTimeFormat), DateTime.Now.Ticks.ToString (CultureInfo.InvariantCulture.NumberFormat)); + + settings = new XmlWriterSettings (); + settings.Indent = true; + settings.Encoding = Encoding.UTF8; + writer = XmlWriter.Create (text, settings); + writer.WriteStartDocument (); + writer.WriteProcessingInstruction ("xml-stylesheet", "type='text/xsl' href='moon-unit-log.xsl'"); + + totals = new int [typeof (TestOutcome).GetFields (BindingFlags.Static | BindingFlags.Public).Length]; } - public void ProcessCompleted (TestHarnessCompletedEventArgs e) + /// + /// Returns true to indicate that the process can be shut down. + /// + /// + /// + public bool ProcessCompleted (TestHarnessCompletedEventArgs e, Action onCompleted) { + string msg; + + try { + if (filename == null) + return true; + + if (writer != null) + writer.Flush (); + + msg = text.ToString (); + + if (string.IsNullOrEmpty (msg)) + return true; + + LogRequest request = new LogRequest (); + request.provider = this; + request.uri = new Uri (baseuri + "MoonLogProvider.aspx?filename=" + filename, UriKind.Absolute); + request.httprequest = (HttpWebRequest) WebRequest.Create (request.uri); + request.httprequest.Method = "POST"; + request.httprequest.ContentType = "text/xml";// "application/x-www-form-urlencoded"; + request.message = msg + Environment.NewLine; + request.httprequest.BeginGetRequestStream (RequestCallback, request); + + on_completed = onCompleted; + + return false; + } catch (Exception ex) { + Console.WriteLine ("Exception while trying to send result: {0}", ex.ToString ()); + return true; + } } - private string MessageToXml (LogMessage logMessage) + public override void Process (LogMessage logMessage) { + try { + ProcessMessage (logMessage); + } catch (Exception ex) { + Console.WriteLine (ex.ToString ()); + } + } + + private void ProcessMessage (LogMessage logMessage) { TestClass c; TestMethod m; + Exception e; string name; TestOutcome outcome; TestGranularity granularity; TestStage stage; + ScenarioResult result; - Debug.WriteLine (logMessage.ToString ()); + if (filename == null) + return; + Debug.WriteLine (logMessage); + try { switch (logMessage.MessageType) { + case LogMessageType.Error: + // Ignore this + break; case LogMessageType.TestResult: - c = (TestClass) logMessage.Decorators [UnitTestLogDecorator.TestClassMetadata]; - m = (TestMethod) logMessage.Decorators [UnitTestLogDecorator.TestMethodMetadata]; - name = (string) logMessage.Decorators [LogDecorator.NameProperty]; - outcome = (TestOutcome) logMessage.Decorators [LogDecorator.TestOutcome]; + result = (ScenarioResult) logMessage.Decorators [UnitTestLogDecorator.ScenarioResult]; + outcome = result.Result; - return string.Format ("", c.Name, name, outcome); + if (outcome == TestOutcome.Failed) { + m = (TestMethod) logMessage.Decorators [UnitTestLogDecorator.TestMethodMetadata]; + if (m.Method.IsDefined (typeof (KnownFailureAttribute), false)) + outcome = TestOutcome.Pending; // Overload 'Pending' to be 'KnownFailure' + } + + writer.WriteAttributeString ("Result", outcome == TestOutcome.Pending ? "KnownFailure" : outcome.ToString ()); + writer.WriteAttributeString ("StartTime", result.Started.ToUniversalTime ().ToString ("yyyy/MM/dd HH:mm:ss.fffffff")); + writer.WriteAttributeString ("EndTime", result.Finished.ToUniversalTime ().ToString ("yyyy/MM/dd HH:mm:ss.fffffff")); + if (result.Exception != null) { + writer.WriteAttributeString ("Message", result.Exception.Message); + writer.WriteStartElement ("Exception"); + writer.WriteAttributeString ("Type", result.Exception.GetType ().FullName); + writer.WriteAttributeString ("Message", result.Exception.Message); + writer.WriteElementString ("StackTrace", result.Exception.StackTrace); + writer.WriteEndElement (); + } + totals [(int) outcome]++; + break; case LogMessageType.TestExecution: granularity = (TestGranularity) logMessage.Decorators [LogDecorator.TestGranularity]; - stage = (TestStage) logMessage.Decorators [LogDecorator.TestStage]; switch (granularity) { case TestGranularity.TestGroup: + stage = (TestStage) logMessage.Decorators [LogDecorator.TestStage]; switch (stage) { case TestStage.Starting: - return ""; + writer.WriteStartElement ("MoonLog"); + break; case TestStage.Finishing: case TestStage.Canceling: - return ""; + + writer.WriteStartElement ("Totals"); + for (int i = 0; i < totals.Length; i++) { + if (i == (int) TestOutcome.Pending) { + writer.WriteAttributeString ("KnownFailure", totals [i].ToString ()); + } else { + writer.WriteAttributeString (((TestOutcome) i).ToString (), totals [i].ToString ()); + } + } + writer.WriteEndElement (); + + writer.WriteEndElement (); + break; case TestStage.Running: - return null; + break; } break; case TestGranularity.TestScenario: + if (logMessage.Decorators.HasDecorator (UnitTestLogDecorator.IgnoreMessage) && (bool) logMessage.Decorators [UnitTestLogDecorator.IgnoreMessage]) { + m = (TestMethod) logMessage.Decorators [UnitTestLogDecorator.TestMethodMetadata]; + writer.WriteStartElement ("Test"); + writer.WriteAttributeString ("Class", m.Method.DeclaringType.FullName); + writer.WriteAttributeString ("Name", m.Method.Name); + writer.WriteAttributeString ("FullName", m.Method.DeclaringType.FullName + "." + m.Method.Name); + writer.WriteAttributeString ("Result", "NotExecuted"); + writer.WriteAttributeString ("Ignored", "True"); + writer.WriteEndElement (); + totals [(int) TestOutcome.NotExecuted]++; + } else { + stage = (TestStage) logMessage.Decorators [LogDecorator.TestStage]; + switch (stage) { + case TestStage.Starting: + m = (TestMethod) logMessage.Decorators [UnitTestLogDecorator.TestMethodMetadata]; + writer.WriteStartElement ("Test"); + writer.WriteAttributeString ("Class", m.Method.DeclaringType.FullName); + writer.WriteAttributeString ("Name", m.Method.Name); + writer.WriteAttributeString ("FullName", m.Method.DeclaringType.FullName + "." + m.Method.Name); + break; + case TestStage.Finishing: + case TestStage.Canceling: + writer.WriteEndElement (); + break; + } + } + break; case TestGranularity.Test: - return null; + case TestGranularity.Harness: + break; + default: + writer.WriteComment (string.Format ("Unknown test execution granularity: {0}", granularity)); + break; } - return string.Format ("", granularity, stage); + break; + case LogMessageType.TestInfrastructure: + break; default: - return string.Format ("", logMessage.ToString (), logMessage.MessageType); + writer.WriteComment (string.Format ("Unknown log type '{1}': {0}", logMessage.ToString (), logMessage.MessageType)); + break; } } catch (Exception ex) { - return string.Format ("", ex.Message); + writer.WriteComment (string.Format ("Exception while converting message to xml ({0})", ex.ToString ())); } } - public override void Process (LogMessage logMessage) + private void RequestCallback (IAsyncResult ar) { - string msg; - try { - - if (filename == null) - return; - - // Console.WriteLine ("Process {0}", logMessage); - - msg = MessageToXml (logMessage); - - if (string.IsNullOrEmpty (msg)) - return; - - LogRequest request = new LogRequest (); - request.provider = this; - request.sequence = sequence++; - request.uri = new Uri (baseuri + "/MoonLogProvider.aspx?filename=" + filename + "&sequence=" + request.sequence.ToString (), UriKind.Absolute); - request.httprequest = (HttpWebRequest) WebRequest.Create (request.uri); - request.httprequest.Method = "POST"; - //request.httprequest.ContentType = "application/x-www-form-urlencoded"; - request.message = msg + Environment.NewLine; - request.httprequest.BeginGetRequestStream (RequestCallback, request); - } catch (Exception ex) { - Console.WriteLine ("Exception while trying to send message: {0}", ex.ToString ()); - } - } - - private static void RequestCallback (IAsyncResult ar) - { - try { // Console.WriteLine ("RequestCallback"); LogRequest request = (LogRequest) ar.AsyncState; Stream stream = request.httprequest.EndGetRequestStream (ar); - StreamWriter writer = new StreamWriter (stream); + StreamWriter writer = new StreamWriter (stream, this.writer.Settings.Encoding); writer.Write (request.message); writer.Close (); stream.Close (); @@ -143,15 +245,17 @@ } } - private static void ResponseCallback (IAsyncResult ar) + private void ResponseCallback (IAsyncResult ar) { try { LogRequest request = (LogRequest) ar.AsyncState; HttpWebResponse response = (HttpWebResponse) request.httprequest.EndGetResponse (ar); - // Do nothing, we don't care about the response. - // Console.WriteLine ("ResponseCallback"); + // We don't care about the response } catch (Exception ex) { - Console.WriteLine ("Exception in ResponseCallback sequence: {1}: {0}", ex.Message, ((LogRequest) ar.AsyncState).sequence); + Console.WriteLine ("Exception in ResponseCallback: {0}", ex.Message); + } finally { + if (on_completed != null) + on_completed (); } } @@ -161,7 +265,6 @@ public MoonLogProvider provider; public Uri uri; public string message; - public int sequence; } } } Modified: trunk/moon/test/2.0/moon-unit/moon-unit.csproj =================================================================== --- trunk/moon/test/2.0/moon-unit/moon-unit.csproj 2008-12-01 16:22:07 UTC (rev 120361) +++ trunk/moon/test/2.0/moon-unit/moon-unit.csproj 2008-12-01 16:25:58 UTC (rev 120362) @@ -81,6 +81,7 @@ + @@ -94,7 +95,9 @@ - + + Code + @@ -104,7 +107,6 @@ - @@ -166,4 +168,4 @@ - + \ No newline at end of file Modified: trunk/moon/test/2.0/moon-unit/moon-unit.mdp =================================================================== --- trunk/moon/test/2.0/moon-unit/moon-unit.mdp 2008-12-01 16:22:07 UTC (rev 120361) +++ trunk/moon/test/2.0/moon-unit/moon-unit.mdp 2008-12-01 16:25:58 UTC (rev 120362) @@ -68,6 +68,7 @@ + Modified: trunk/moon/test/2.0/moon-unit/site/MoonLogProvider.aspx.cs =================================================================== --- trunk/moon/test/2.0/moon-unit/site/MoonLogProvider.aspx.cs 2008-12-01 16:22:07 UTC (rev 120361) +++ trunk/moon/test/2.0/moon-unit/site/MoonLogProvider.aspx.cs 2008-12-01 16:25:58 UTC (rev 120362) @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; Added: trunk/moon/test/2.0/moon-unit/site/moon-unit-log.xsl =================================================================== --- trunk/moon/test/2.0/moon-unit/site/moon-unit-log.xsl 2008-12-01 16:22:07 UTC (rev 120361) +++ trunk/moon/test/2.0/moon-unit/site/moon-unit-log.xsl 2008-12-01 16:25:58 UTC (rev 120362) @@ -0,0 +1,57 @@ + + + + + + + + + + lightgreen + red + + + + + + + + + + #BBFFBB + #FFCCCC + + + + + + + + + + + + lightgreen + red + + + + +
Total: + Passed: , + KnownFailure: , + NotExecuted: , + Failed: +
+ + + +
Total: + Passed: , + KnownFailure: , + NotExecuted: , + Failed: +
+ + + From mono-patches-list at lists.ximian.com Mon Dec 1 11:27:48 2008 From: mono-patches-list at lists.ximian.com (Mario Carrion (mcarrion@novell.com)) Date: Mon, 1 Dec 2008 11:27:48 -0500 (EST) Subject: [Mono-patches] r120363 - in trunk/uia2atk/UIAutomationWinforms: UIAutomationWinforms UIAutomationWinforms/Mono.UIAutomation.Winforms UIAutomationWinformsTests Message-ID: <20081201162748.B641D9472C@mono-cvs.ximian.com> Author: mcarrion Date: 2008-12-01 11:27:48 -0500 (Mon, 01 Dec 2008) New Revision: 120363 Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/ChangeLog trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Mono.UIAutomation.Winforms/ListBoxProvider.cs trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ChangeLog trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/CheckedListBoxProviderTest.cs trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ListBoxProviderTest.cs Log: * UIAutomationWinforms/UIAutomationWinforms/Mono.UIAutomation.Winforms/ListBoxProvider.cs: Returning valid value when requesting NameProperty. [Fixes Bug #448020] * UIAutomationWinforms/UIAutomationWinformsTests/ListBoxProviderTest.cs: * UIAutomationWinforms/UIAutomationWinformsTests/CheckedListBoxProviderTest.cs: Testing NameProperty. [Fixes Bug #448020] Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/ChangeLog =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/ChangeLog 2008-12-01 16:25:58 UTC (rev 120362) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/ChangeLog 2008-12-01 16:27:48 UTC (rev 120363) @@ -1,3 +1,9 @@ +2008-12-01 Mario Carrion + + * Mono.UIAutomation.Winforms/ListBoxProvider.cs: Returning valid value + when requesting NameProperty. +[Fixes Bug #448020] + 2008-12-01 Brad Taylor * Makefile.am: Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Mono.UIAutomation.Winforms/ListBoxProvider.cs =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Mono.UIAutomation.Winforms/ListBoxProvider.cs 2008-12-01 16:25:58 UTC (rev 120362) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinforms/Mono.UIAutomation.Winforms/ListBoxProvider.cs 2008-12-01 16:27:48 UTC (rev 120363) @@ -112,6 +112,8 @@ return true; else if (propertyId == AutomationElementIdentifiers.LocalizedControlTypeProperty.Id) return "list"; + else if (propertyId == AutomationElementIdentifiers.NameProperty.Id) + return listboxControl.Text; else return base.GetProviderPropertyValue (propertyId); } Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ChangeLog =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ChangeLog 2008-12-01 16:25:58 UTC (rev 120362) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ChangeLog 2008-12-01 16:27:48 UTC (rev 120363) @@ -1,3 +1,10 @@ +2008-12-01 Mario Carrion + + * ListBoxProviderTest.cs: + * CheckedListBoxProviderTest.cs: Testing NameProperty. +[Fixes Bug + #448020] + 2008-12-01 Brad Taylor * UIAutomationWinforms/Makefile.am: Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/CheckedListBoxProviderTest.cs =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/CheckedListBoxProviderTest.cs 2008-12-01 16:25:58 UTC (rev 120362) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/CheckedListBoxProviderTest.cs 2008-12-01 16:27:48 UTC (rev 120363) @@ -39,6 +39,27 @@ { #region Tests + + [Test] + public override void LabeledByAndNamePropertyTest () + { + CheckedListBox checkedListbox = new CheckedListBox (); + IRawElementProviderSimple provider = ProviderFactory.GetProvider (checkedListbox); + + checkedListbox.Text = "checkedlistbox text set"; + TestProperty (provider, + AutomationElementIdentifiers.NameProperty, + "checkedlistbox text set"); + + checkedListbox.Text = "hello world"; + TestProperty (provider, + AutomationElementIdentifiers.NameProperty, + "hello world"); + + TestProperty (provider, + AutomationElementIdentifiers.LabeledByProperty, + null); + } [Test] public void BasicPropertiesTest () Modified: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ListBoxProviderTest.cs =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ListBoxProviderTest.cs 2008-12-01 16:25:58 UTC (rev 120362) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/ListBoxProviderTest.cs 2008-12-01 16:27:48 UTC (rev 120363) @@ -39,6 +39,27 @@ { #region Tests + + [Test] + public override void LabeledByAndNamePropertyTest () + { + ListBox listbox = new ListBox (); + IRawElementProviderSimple provider = ProviderFactory.GetProvider (listbox); + + listbox.Text = "listbox text set"; + TestProperty (provider, + AutomationElementIdentifiers.NameProperty, + "listbox text set"); + + listbox.Text = "hello world"; + TestProperty (provider, + AutomationElementIdentifiers.NameProperty, + "hello world"); + + TestProperty (provider, + AutomationElementIdentifiers.LabeledByProperty, + null); + } [Test] public void BasicPropertiesTest () @@ -57,12 +78,12 @@ TestProperty (provider, AutomationElementIdentifiers.IsKeyboardFocusableProperty, true); + + //TODO: AutomationElementIdentifiers.BoundingRectangleProperty //TODO: AutomationElementIdentifiers.ClickablePointProperty //TODO: AutomationElementIdentifiers.IsKeyboardFocusableProperty - //TODO: AutomationElementIdentifiers.NameProperty - //TODO: AutomationElementIdentifiers.LabeledByProperty //TODO: AutomationElementIdentifiers.HelpTextProperty } From mono-patches-list at lists.ximian.com Mon Dec 1 11:31:33 2008 From: mono-patches-list at lists.ximian.com (Brad Taylor (brad@getcoded.net)) Date: Mon, 1 Dec 2008 11:31:33 -0500 (EST) Subject: [Mono-patches] r120364 - trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests Message-ID: <20081201163133.4F8879472C@mono-cvs.ximian.com> Author: btaylor Date: 2008-12-01 11:31:33 -0500 (Mon, 01 Dec 2008) New Revision: 120364 Added: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/MaskedTextBoxProviderTest.cs trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/TextBoxBaseProviderTest.cs Log: forgot to add Added: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/MaskedTextBoxProviderTest.cs =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/MaskedTextBoxProviderTest.cs 2008-12-01 16:27:48 UTC (rev 120363) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/MaskedTextBoxProviderTest.cs 2008-12-01 16:31:33 UTC (rev 120364) @@ -0,0 +1,46 @@ +// 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. +// +// Copyright (c) 2008 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Brad Taylor +// + +using System; +using System.Windows; +using System.Windows.Forms; +using System.Windows.Automation; +using System.Windows.Automation.Text; +using System.Windows.Automation.Provider; +using Mono.UIAutomation.Winforms; +using NUnit.Framework; + +namespace MonoTests.Mono.UIAutomation.Winforms +{ + [TestFixture] + public class MaskedTextBoxProviderTest + : TextBoxBaseProviderTest + { + protected override MaskedTextBox GetTextBoxBase () + { + return new MaskedTextBox (); + } + } +} Added: trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/TextBoxBaseProviderTest.cs =================================================================== --- trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/TextBoxBaseProviderTest.cs 2008-12-01 16:27:48 UTC (rev 120363) +++ trunk/uia2atk/UIAutomationWinforms/UIAutomationWinformsTests/TextBoxBaseProviderTest.cs 2008-12-01 16:31:33 UTC (rev 120364) @@ -0,0 +1,340 @@ +// 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. +// +// Copyright (c) 2008 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Mario Carrion +// Brad Taylor +// + +using System; +using System.Windows; +using System.Windows.Forms; +using System.Windows.Automation; +using System.Windows.Automation.Text; +using System.Windows.Automation.Provider; +using Mono.UIAutomation.Winforms; +using NUnit.Framework; + +namespace MonoTests.Mono.UIAutomation.Winforms +{ + public abstract class TextBoxBaseProviderTest : BaseProviderTest + where T : TextBoxBase + { + +#region Tests + + [Test] + public void EditPropertiesTest () + { + T textBoxBase; + IRawElementProviderSimple provider; + GetProviderAndControl (out provider, out textBoxBase); + + textBoxBase.Multiline = false; + + TestProperty (provider, + AutomationElementIdentifiers.ControlTypeProperty, + ControlType.Edit.Id); + + TestProperty (provider, + AutomationElementIdentifiers.LocalizedControlTypeProperty, + "edit"); + + TestProperty (provider, + AutomationElementIdentifiers.IsPasswordProperty, + false); + } + + public void DocumentPropertiesTest () + { + T textBoxBase; + IRawElementProviderSimple provider; + GetProviderAndControl (out provider, out textBoxBase); + + textBoxBase.Multiline = true; + + TestProperty (provider, + AutomationElementIdentifiers.ControlTypeProperty, + ControlType.Document.Id); + + TestProperty (provider, + AutomationElementIdentifiers.LocalizedControlTypeProperty, + "document"); + + TestProperty (provider, + AutomationElementIdentifiers.IsContentElementProperty, + true); + + TestProperty (provider, + AutomationElementIdentifiers.IsControlElementProperty, + true); + } + + [Test] + public void ValuePatternTest () + { + T textBoxBase; + IRawElementProviderSimple provider; + GetProviderAndControl (out provider, out textBoxBase); + + textBoxBase.Multiline = false; + + object valueProvider = provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id); + Assert.IsNotNull (valueProvider, "Not returning ValuePatternIdentifiers."); + Assert.IsTrue (valueProvider is IValueProvider, "Not returning ValuePatternIdentifiers"); + } + + [Test] + public void TextPatternTest () + { + T textBoxBase; + IRawElementProviderSimple provider; + GetProviderAndControl (out provider, out textBoxBase); + + ITextProvider textProvider + = provider.GetPatternProvider (TextPatternIdentifiers.Pattern.Id) + as ITextProvider; + Assert.IsNotNull (textProvider, "Not returning TextPatternIdentifiers."); + Assert.IsTrue (textProvider is ITextProvider, "Not returning TextPatternIdentifiers."); + + textBoxBase.Text = "abc123"; + textBoxBase.Multiline = true; + + ITextRangeProvider range = textProvider.RangeFromPoint (new Point (0, 0)); + Assert.IsNotNull (range); + + // should always return a degenerate range + Assert.AreEqual (String.Empty, range.GetText (-1)); + + // TODO: Actually check the value, instead of just + // making sure it doesn't crash + range.MoveEndpointByUnit (TextPatternRangeEndpoint.End, TextUnit.Character, 1); + + // TODO: Actually check the value, instead of just + // making sure it doesn't crash + ITextRangeProvider[] ranges = textProvider.GetVisibleRanges (); + Assert.AreEqual (1, ranges.Length); + } + + [Test] + public void RangeValuePatternTest () + { + T textBoxBase; + IRawElementProviderSimple provider; + GetProviderAndControl (out provider, out textBoxBase); + + object rangeProvider = provider.GetPatternProvider (RangeValuePatternIdentifiers.Pattern.Id); + Assert.IsNull (rangeProvider, "Returned RangeValuePatternIdentifiers."); + } + +#endregion + +#region IValueProvider Tests + + [Test] + public void IsNotIValueProviderTest () + { + T textBoxBase; + IRawElementProviderSimple provider; + GetProviderAndControl (out provider, out textBoxBase); + + object valueProvider; + /* NOTDOTNET: We diverge from the spec here, as we + * provide ValueProvider in Document mode so folks can + * subscribe to an event to see if text has changed. + textBoxBase.Multiline = true; + + object valueProvider = + provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id); + Assert.IsNull (valueProvider, "Is returning ValuePatternIdentifiers."); + */ + + textBoxBase.Multiline = false; + valueProvider = provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id); + Assert.IsNotNull (valueProvider, "Is not returning ValuePatternIdentifiers."); + } + + [Test] + public void IValueProviderIsReadOnlyTest () + { + T textBoxBase; + IRawElementProviderSimple provider; + GetProviderAndControl (out provider, out textBoxBase); + + //textBoxBase.Multiline = false; + + IValueProvider valueProvider = (IValueProvider) + provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id); + Assert.IsNotNull (valueProvider, "Not returning ValuePatternIdentifiers."); + + textBoxBase.ReadOnly = true; + Assert.AreEqual (valueProvider.IsReadOnly, true, "Is read only"); + + textBoxBase.ReadOnly = false; + Assert.AreEqual (valueProvider.IsReadOnly, false, "Is not only"); + } + + [Test] + public void IValueProviderValueTest () + { + T textBoxBase; + IRawElementProviderSimple provider; + GetProviderAndControl (out provider, out textBoxBase); + + textBoxBase.Multiline = false; + + IValueProvider valueProvider = (IValueProvider) + provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id); + Assert.IsNotNull (valueProvider, "Not returning ValuePatternIdentifiers."); + + Assert.AreEqual (valueProvider.Value, string.Empty, "Empty value"); + + string value = "Hello world"; + + textBoxBase.Text = value; + Assert.AreEqual (valueProvider.Value, value, "HelloWorld value"); + } + + [Test] + public void IValueProviderSetValueTest () + { + T textBoxBase; + IRawElementProviderSimple provider; + GetProviderAndControl (out provider, out textBoxBase); + + textBoxBase.Multiline = false; + + IValueProvider valueProvider = (IValueProvider) + provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id); + Assert.IsNotNull (valueProvider, "Not returning ValuePatternIdentifiers."); + + string value = "Hello world"; + + valueProvider.SetValue (value); + Assert.AreEqual (valueProvider.Value, value, "Different value"); + + try { + textBoxBase.ReadOnly = true; + valueProvider.SetValue (value); + Assert.Fail ("ElementNotEnabledException not thrown."); + } catch (ElementNotEnabledException) { } + } + +#endregion + +#region Events tests + + [Test] + public void TextChangedEventTest () + { + T textBoxBase; + IRawElementProviderSimple provider; + GetProviderAndControl (out provider, out textBoxBase); + Form.Controls.Add (textBoxBase); + + bridge.ResetEventLists (); + + textBoxBase.Text = "lfesalhafew"; + + Assert.AreEqual (1, + bridge.AutomationPropertyChangedEvents.Count, + "Event count"); + } + + // NOTDOTNET: We diverge from the spec here, as we provide + // ValueProvider in Document mode so folks can subscribe to an + // event to see if text has changed. + [Test] + public void TextChangedEventTestMultiLine () + { + T textBoxBase; + IRawElementProviderSimple provider; + GetProviderAndControl (out provider, out textBoxBase); + Form.Controls.Add (textBoxBase); + textBoxBase.Multiline = true; + + bridge.ResetEventLists (); + + textBoxBase.Text = "lifewauhfewa"; + + Assert.AreEqual (1, + bridge.AutomationPropertyChangedEvents.Count, + "Event count"); + } + + [Test] + public void TextChangedEventTestMultiLineBeforeFormShow () + { + T textBoxBase; + IRawElementProviderSimple provider; + GetProviderAndControl (out provider, out textBoxBase); + textBoxBase.Multiline = true; + + Form form = new Form (); + form.Controls.Add (textBoxBase); + form.Show (); + + bridge.ResetEventLists (); + + textBoxBase.Text = "lifewauhfewa\nsokksooks"; + + Assert.AreEqual (1, + bridge.AutomationPropertyChangedEvents.Count, + "Event count"); + } + +#endregion + +#region BaseProviderTest Overrides + + protected override Control GetControlInstance () + { + return GetTextBoxBase (); + } + +#endregion + +#region Protected Methods + + protected abstract T GetTextBoxBase (); + + protected void GetProviderAndControl (out IRawElementProviderSimple provider, + out T textBoxBase) + { + textBoxBase = GetTextBoxBase (); + provider = ProviderFactory.GetProvider (textBoxBase); + } +#endregion + + // TODO: Move this somewhere else + protected const string TEST_MESSAGE = "One morning, when Gregor Samsa woke from troubled dreams, "+ + "he found himself transformed in his bed into a horrible vermin.He lay on his armour-like back, "+ + "and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches "+ + "into stiff sections. The bedding was hardly able to cover it and seemed ready to slide off any moment. "+ + "His many legs, pitifully thin compared with the size of the rest of him, waved about helplessly as he "+ + "looked. \"What's happened to me? \" he thought. It wasn't a dream. His room, a proper human room although "+ + "a little too small, lay peacefully between its four familiar walls. A collection of textile samples lay "+ + "spread out on the table - Samsa was a travelling salesman - and above it there hung a picture that he had "+ + "recently cut out of an illustrated magazine and housed in a nice, gilded frame. It showed a lady "+ + "fitted out with a fur hat and fur boa who sat upright, raising a heavy fur muff that covered the whole "+ + "of her lower arm towards the viewer. Gregor then turned to look out the window at the dull weather. Drops "; + } +} From mono-patches-list at lists.ximian.com Mon Dec 1 12:06:02 2008 From: mono-patches-list at lists.ximian.com (Ivan N. Zlatev (contact@i-nz.net)) Date: Mon, 1 Dec 2008 12:06:02 -0500 (EST) Subject: [Mono-patches] r120365 - trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms Message-ID: <20081201170602.53CF19472C@mono-cvs.ximian.com> Author: ivanz Date: 2008-12-01 12:05:48 -0500 (Mon, 01 Dec 2008) New Revision: 120365 Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs Log: 2008-12-01 Ivan N. Zlatev * DataGridView.cs: Refresh the data if the data list is reset, etc. Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog =================================================================== --- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog 2008-12-01 16:31:33 UTC (rev 120364) +++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog 2008-12-01 17:05:48 UTC (rev 120365) @@ -1,5 +1,9 @@ 2008-12-01 Ivan N. Zlatev + * DataGridView.cs: Refresh the data if the data list is reset, etc. + +2008-12-01 Ivan N. Zlatev + * DataGridView.cs: Handle datasource state changes: - IBindingList - list changes - BindingSource - list changed and datasource changes Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs =================================================================== --- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs 2008-12-01 16:31:33 UTC (rev 120364) +++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs 2008-12-01 17:05:48 UTC (rev 120365) @@ -6014,6 +6014,10 @@ case ListChangedType.ItemDeleted: Rows.RemoveAt (args.NewIndex); break; + default: + ClearBinding (); + DoBinding (); + break; } Invalidate (); From mono-patches-list at lists.ximian.com Mon Dec 1 12:52:24 2008 From: mono-patches-list at lists.ximian.com (Fernando Herrera (fherrera@novell.com)) Date: Mon, 1 Dec 2008 12:52:24 -0500 (EST) Subject: [Mono-patches] r120366 - trunk/moon/src Message-ID: <20081201175224.ED7B99472C@mono-cvs.ximian.com> Author: fherrera Date: 2008-12-01 12:52:22 -0500 (Mon, 01 Dec 2008) New Revision: 120366 Modified: trunk/moon/src/ChangeLog trunk/moon/src/mediaelement.cpp trunk/moon/src/mediaplayer.cpp trunk/moon/src/pipeline.cpp trunk/moon/src/playlist.cpp trunk/moon/src/playlist.h Log: 2008-12-01 Fernando Herrera * mediaelement.cpp: * mediaplayer.cpp: * pipeline.cpp: * playlist.cpp: * playlist.h: Implement Server side playlists. Still missing * duration based constraints. Modified: trunk/moon/src/ChangeLog =================================================================== --- trunk/moon/src/ChangeLog 2008-12-01 17:05:48 UTC (rev 120365) +++ trunk/moon/src/ChangeLog 2008-12-01 17:52:22 UTC (rev 120366) @@ -1,3 +1,12 @@ +2008-12-01 Fernando Herrera + + * mediaelement.cpp: + * mediaplayer.cpp: + * pipeline.cpp: + * playlist.cpp: + * playlist.h: Implement Server side playlists. Still missing duration based + constraints. + 2008-12-01 Alan McGovern * border.h: ChildProperty should not be exposed Modified: trunk/moon/src/mediaelement.cpp =================================================================== --- trunk/moon/src/mediaelement.cpp 2008-12-01 17:05:48 UTC (rev 120365) +++ trunk/moon/src/mediaelement.cpp 2008-12-01 17:52:22 UTC (rev 120366) @@ -696,6 +696,9 @@ DownloaderAbort (); Emit (MediaFailedEvent, args); + + if (playlist) + playlist->OnEntryFailed (); } Point Modified: trunk/moon/src/mediaplayer.cpp =================================================================== --- trunk/moon/src/mediaplayer.cpp 2008-12-01 17:05:48 UTC (rev 120365) +++ trunk/moon/src/mediaplayer.cpp 2008-12-01 17:52:22 UTC (rev 120366) @@ -220,6 +220,7 @@ LOG_MEDIAPLAYER ("MediaPlayer::NotifyFinished (): Element: %p\n", element); Stop (); + if (element) element->MediaFinished (); } @@ -454,13 +455,14 @@ return false; } - if (entry != NULL && entry->HasDuration ()) { - asx_duration = TimeSpan_ToPts (entry->GetDuration ()); + if (entry != NULL && entry->HasDuration () && entry->GetDuration ()->HasTimeSpan ()) { + asx_duration = TimeSpan_ToPts (entry->GetDuration ()->GetTimeSpan ()); if (asx_duration < duration || element->IsLive ()) { duration = asx_duration; SetBit (FixedDuration); } } + // FIME handle here repeat and infinite durations and so... if (start_pts <= duration) duration -= start_pts; Modified: trunk/moon/src/pipeline.cpp =================================================================== --- trunk/moon/src/pipeline.cpp 2008-12-01 17:05:48 UTC (rev 120365) +++ trunk/moon/src/pipeline.cpp 2008-12-01 17:52:22 UTC (rev 120366) @@ -1046,7 +1046,8 @@ return MEDIA_FAIL; result = !g_ascii_strncasecmp (buffer, "duration = duration; @@ -256,6 +262,21 @@ } } +Duration* +PlaylistEntry::GetRepeatDuration () +{ + return repeat_duration; +} + +void +PlaylistEntry::SetRepeatDuration (Duration *duration) +{ + this->repeat_duration = duration; +} + + + + const char * PlaylistEntry::GetInfoTarget () { @@ -457,11 +478,43 @@ } } +static gboolean +playlist_check_duration (void *data) +{ + ((PlaylistEntry*)data)->CheckDuration (); + return false; +} + +void +PlaylistEntry::CheckDuration () +{ + element->Stop (); +} + + + +static gboolean +element_play (void *data) +{ + MediaElement *element = (MediaElement*) data; + element->PlayInternal (); + return false; +} + + bool PlaylistEntry::Play () { LOG_PLAYLIST ("PlaylistEntry::Play (), play_when_available: %s, media: %p, source name: %s\n", play_when_available ? "true" : "false", media, source_name ? source_name->ToString () : "NULL"); + // FIXME we should set the timeout when the playing starts not when we request it + if (HasDuration ()) { + if (GetDuration ()->HasTimeSpan ()) + element->GetTimeManager ()->AddTimeout (G_PRIORITY_DEFAULT - 10, + 1000 * TimeSpan_ToSeconds (GetDuration ()->GetTimeSpan ()), + playlist_check_duration, this); + } + if (media == NULL) { play_when_available = true; Open (); @@ -469,7 +522,7 @@ } element->SetMedia (media); - element->PlayInternal (); + element->GetTimeManager ()->AddTimeout (G_PRIORITY_DEFAULT - 10, 10000, element_play, element); play_when_available = false; @@ -531,11 +584,13 @@ * Playlist */ -Playlist::Playlist (MediaElement *element, IMediaSource *source) - : PlaylistEntry (element, NULL) +Playlist::Playlist (MediaElement *element, Playlist *parent, IMediaSource *source) + : PlaylistEntry (element, parent, NULL) { is_single_file = false; autoplayed = false; + is_sequential = false; + is_switch = false; Init (element); this->source = source; } @@ -636,26 +691,79 @@ } void -Playlist::OnEntryEnded () +Playlist::PlayNext (bool fail) { PlaylistEntry *current_entry; + int count; - LOG_PLAYLIST ("Playlist::OnEntryEnded () current_node: %p\n", current_node); + LOG_PLAYLIST ("Playlist::PlayNext () current_node: %p\n", current_node); if (!current_node) return; - - current_node = (PlaylistNode *) current_node->next; - + + SetWaiting (false); + current_entry = GetCurrentEntry (); - if (current_entry) { + + if (fail) + current_entry->SetRepeatCount (0); + + count = current_entry->GetRepeatCount (); + if (count > 1) { + current_entry->SetRepeatCount (count - 1); element->SetPlayRequested (); current_entry->Play (); + return; } + + if (HasDuration() && current_entry->GetDuration()->IsForever ()) { + element->SetPlayRequested (); + current_entry->Play (); + return; + } + + + if (current_entry->IsPlaylist ()) { + ((Playlist*)current_entry)->PlayNext (fail); + if (((Playlist*)current_entry)->GetWaiting()) + return; + } + - LOG_PLAYLIST ("Playlist::OnEntryEnded () current_node: %p [Done]\n", current_node); + if (current_node->next) { + current_node = (PlaylistNode *) current_node->next; + + current_entry = GetCurrentEntry (); + if (current_entry && (current_entry->GetParent ()->GetSequential() || + !current_entry->GetParent ()->GetSwitch() || + fail)) { + element->SetPlayRequested (); + if (!current_entry->Play ()) + current_entry->GetParent ()->SetWaiting(true); + } + } + + return; + + + LOG_PLAYLIST ("Playlist::PlayNext () current_node: %p [Done]\n", current_node); } +void +Playlist::OnEntryEnded () +{ + LOG_PLAYLIST ("Playlist::OnEntryEnded ()\n"); + PlayNext (false); +} +void +Playlist::OnEntryFailed () +{ + + LOG_PLAYLIST ("Playlist::OnEntryFailed ()\n"); + PlayNext (true); +} + + bool Playlist::Play () { @@ -802,7 +910,7 @@ } void -PlaylistParser::Setup () +PlaylistParser::Setup (XmlType type) { playlist = NULL; current_entry = NULL; @@ -814,9 +922,15 @@ kind_stack = new List (); PushCurrentKind (PlaylistNode::Root); - XML_SetUserData (internal->parser, this); - XML_SetElementHandler (internal->parser, on_start_element, on_end_element); - XML_SetCharacterDataHandler (internal->parser, on_text); + if (type == XML_TYPE_ASX3) { + XML_SetUserData (internal->parser, this); + XML_SetElementHandler (internal->parser, on_asx_start_element, on_asx_end_element); + XML_SetCharacterDataHandler (internal->parser, on_asx_text); + } else if (type == XML_TYPE_SMIL) { + XML_SetUserData (internal->parser, this); + XML_SetElementHandler (internal->parser, on_smil_start_element, on_smil_end_element); + } + } void @@ -841,23 +955,36 @@ } void -PlaylistParser::on_start_element (gpointer user_data, const char *name, const char **attrs) +PlaylistParser::on_asx_start_element (gpointer user_data, const char *name, const char **attrs) { - ((PlaylistParser *) user_data)->OnStartElement (name, attrs); + ((PlaylistParser *) user_data)->OnASXStartElement (name, attrs); } void -PlaylistParser::on_end_element (gpointer user_data, const char *name) +PlaylistParser::on_asx_end_element (gpointer user_data, const char *name) { - ((PlaylistParser *) user_data)->OnEndElement (name); + ((PlaylistParser *) user_data)->OnASXEndElement (name); } void -PlaylistParser::on_text (gpointer user_data, const char *data, int len) +PlaylistParser::on_asx_text (gpointer user_data, const char *data, int len) { - ((PlaylistParser *) user_data)->OnText (data, len); + ((PlaylistParser *) user_data)->OnASXText (data, len); } +void +PlaylistParser::on_smil_start_element (gpointer user_data, const char *name, const char **attrs) +{ + ((PlaylistParser *) user_data)->OnSMILStartElement (name, attrs); +} + +void +PlaylistParser::on_smil_end_element (gpointer user_data, const char *name) +{ + ((PlaylistParser *) user_data)->OnSMILEndElement (name); +} + + static bool is_all_whitespace (const char *str) { @@ -911,7 +1038,7 @@ } static bool -time_value_from_str (PlaylistParser *parser, const char *str, TimeSpan *res) +duration_from_asx_str (PlaylistParser *parser, const char *str, Duration **res) { const char *end = str + strlen (str); const char *p; @@ -973,14 +1100,101 @@ gint64 ms = ((hh * 3600) + (mm * 60) + ss) * 1000 + milliseconds; TimeSpan result = TimeSpan_FromPts (MilliSeconds_ToPts (ms)); + Duration *duration = new Duration (result); - *res = result; + *res = duration; return true; } +static bool +duration_from_smil_clock_str (PlaylistParser *parser, const char *str, Duration **res) +{ + const char *end = str + strlen (str); + const char *p; + + int hh = 0, mm = 0, ss = 0; + int milliseconds = 0; + + if (str_match ("indefinite", str)) { + Duration *duration = new Duration (Duration::FOREVER); + *res = duration; + return true; + } + + if (index (str, ':')) { + // Full or partial clock + return duration_from_asx_str (parser, str, res); + } + + + // Timecount + // http://www.w3.org/TR/2005/REC-SMIL2-20050107/smil-timing.html#Timing-ClockValueSyntax + + p = str; + + if (g_str_has_suffix (str, "h")) { + if (!parse_int (&p, end, &hh)) { + parser->ParsingError (new ErrorEventArgs (MediaError, 2210, "AG_E_INVALID_ARGUMENT")); + return false; + } + if (*p == '.') { + double fraction = atof (p); + mm = 60 * fraction; + } + } else if (g_str_has_suffix (str, "min")) { + if (!parse_int (&p, end, &mm)) { + parser->ParsingError (new ErrorEventArgs (MediaError, 2210, "AG_E_INVALID_ARGUMENT")); + return false; + } + if (*p == '.') { + double fraction = atof (p); + ss = 60 * fraction; + } + } else if (g_str_has_suffix (str, "ms")) { + if (!parse_int (&p, end, &milliseconds)) { + parser->ParsingError (new ErrorEventArgs (MediaError, 2210, "AG_E_INVALID_ARGUMENT")); + return false; + } + } else if (g_str_has_suffix (str, "s") || g_ascii_isdigit (str [strlen (str) - 1])) { + if (!parse_int (&p, end, &ss)) { + parser->ParsingError (new ErrorEventArgs (MediaError, 2210, "AG_E_INVALID_ARGUMENT")); + return false; + } + if (*p == '.') { + double fraction = atof (p); + milliseconds = 1000 * fraction; + } + } else { + parser->ParsingError (new ErrorEventArgs (MediaError, 2210, "AG_E_INVALID_ARGUMENT")); + return false; + } + + gint64 ms = ((hh * 3600) + (mm * 60) + ss) * 1000 + milliseconds; + TimeSpan result = TimeSpan_FromPts (MilliSeconds_ToPts (ms)); + Duration *duration = new Duration (result); + + *res = duration; + + return true; +} + +static bool +count_from_smil_str (PlaylistParser *parser, const char *str, int *res) +{ + if (str_match ("indefinite", str)) { + *res = -1; + return true; + } + + double value = strtod (str, NULL); + *res = (int) ceil (value); + + return true; +} + void -PlaylistParser::OnStartElement (const char *name, const char **attrs) +PlaylistParser::OnASXStartElement (const char *name, const char **attrs) { PlaylistNode::Kind kind = StringToKind (name); Uri *uri; @@ -1005,7 +1219,8 @@ return; } - playlist = new Playlist (element, source); + playlist = new Playlist (element, NULL, source); + playlist->SetSequential (true); for (int i = 0; attrs [i] != NULL; i += 2) { if (str_match (attrs [i], "VERSION")) { @@ -1071,13 +1286,13 @@ ParsingError (new ErrorEventArgs (MediaError, 3005, "Invalid ASX attribute")); break; case PlaylistNode::Duration: { - TimeSpan ts; + Duration *dur; for (int i = 0; attrs [i] != NULL; i += 2) { if (str_match (attrs [i], "VALUE")) { - if (time_value_from_str (this, attrs [i+1], &ts)) { + if (duration_from_asx_str (this, attrs [i+1], &dur)) { if (GetCurrentEntry () != NULL && GetParentKind () != PlaylistNode::Ref) { - LOG_PLAYLIST ("PlaylistParser::OnStartElement (%s, %p), found VALUE/timespan = %f s\n", name, attrs, TimeSpan_ToSecondsFloat (ts)); - GetCurrentEntry ()->SetDuration (ts); + LOG_PLAYLIST ("PlaylistParser::OnStartElement (%s, %p), found VALUE/timespan = %f s\n", name, attrs, TimeSpan_ToSecondsFloat (dur->GetTimeSpan())); + GetCurrentEntry ()->SetDuration (dur); } } } else { @@ -1165,13 +1380,13 @@ } break; case PlaylistNode::StartTime: { - TimeSpan ts; + Duration *dur; for (int i = 0; attrs [i] != NULL; i += 2) { if (str_match (attrs [i], "VALUE")) { - if (time_value_from_str (this, attrs [i+1], &ts)) { + if (duration_from_asx_str (this, attrs [i+1], &dur) && dur->HasTimeSpan ()) { if (GetCurrentEntry () != NULL && GetParentKind () != PlaylistNode::Ref) { - LOG_PLAYLIST ("PlaylistParser::OnStartElement (%s, %p), found VALUE/timespan = %f s\n", name, attrs, TimeSpan_ToSecondsFloat (ts)); - GetCurrentEntry ()->SetStartTime (ts); + LOG_PLAYLIST ("PlaylistParser::OnStartElement (%s, %p), found VALUE/timespan = %f s\n", name, attrs, TimeSpan_ToSecondsFloat (dur->GetTimeSpan())); + GetCurrentEntry ()->SetStartTime (dur->GetTimeSpan ()); } } } else { @@ -1223,10 +1438,10 @@ } void -PlaylistParser::OnEndElement (const char *name) +PlaylistParser::OnASXEndElement (const char *name) { PlaylistNode::Kind kind = GetCurrentKind (); - TimeSpan ts; + Duration *dur; LOG_PLAYLIST ("PlaylistParser::OnEndElement (%s), GetCurrentKind (): %d, GetCurrentKind () to string: %s\n", name, kind, KindToString (kind)); @@ -1261,9 +1476,9 @@ break; if (current_text == NULL) break; - time_span_from_str (current_text, &ts); + duration_from_asx_str (this, current_text, &dur); if (GetCurrentEntry () != NULL) - GetCurrentEntry ()->SetDuration (ts); + GetCurrentEntry ()->SetDuration (dur); break; case PlaylistNode::Entry: if (!AssertParentKind (PlaylistNode::Asx)) @@ -1329,7 +1544,7 @@ } void -PlaylistParser::OnText (const char *text, int len) +PlaylistParser::OnASXText (const char *text, int len) { char *a = g_strndup (text, len); @@ -1352,6 +1567,257 @@ } } + +void +PlaylistParser::GetSMILCommonAttrs (PlaylistEntry *entry, const char *name, const char **attrs) +{ + PlaylistNode::Kind kind = StringToKind (name); + + for (int i = 0; attrs [i] != NULL; i += 2) { + if (str_match (attrs [i], "id")) { + if (attrs [i+1] == NULL || !g_ascii_isalpha (attrs [i+1][0])) { + ParsingError (new ErrorEventArgs (MediaError, 3005, "Invalid ASX attribute")); + } + } else if (str_match (attrs [i], "repeatDur")) { + Duration *dur; + if (duration_from_smil_clock_str (this, attrs [i+1], &dur)) { + if (dur->HasTimeSpan()) { + LOG_PLAYLIST ("PlaylistParser::GetSMILCommonAttrs (%p), found repeatDur/timespan = %f s\n", attrs, TimeSpan_ToSecondsFloat (dur->GetTimeSpan())); + } else { + LOG_PLAYLIST ("PlaylistParser::GetSMILCommonAttrs, found repeatDur/indefinite"); + } + entry->SetRepeatDuration (dur); + } + } else if (str_match (attrs [i], "dur")) { + Duration *dur; + if (duration_from_smil_clock_str (this, attrs [i+1], &dur)) { + if (dur->HasTimeSpan()) { + LOG_PLAYLIST ("PlaylistParser::GetSMILCommonAttrs (%p), found dur/timespan = %f s\n", attrs, TimeSpan_ToSecondsFloat (dur->GetTimeSpan())); + } else { + LOG_PLAYLIST ("PlaylistParser::GetSMILCommonAttrs, found dur/indefinite"); + } + entry->SetDuration (dur); + } + } else if (str_match (attrs [i], "repeatCount")) { + int count; + if (count_from_smil_str (this, attrs [i+1], &count)) { + LOG_PLAYLIST ("PlaylistParser::GetSMILCommonAttrs (%p), found repeatCount = %d\n", attrs, count); + entry->SetRepeatCount (count); + } + } else if (kind == PlaylistNode::Media && (str_match (attrs [i], "src") || + str_match (attrs [i], "clipBegin") || + str_match (attrs [i], "clipBegin"))) { + // These are valid only for the media case, but we don't hanlde them here + } else { + ParsingError (new ErrorEventArgs (MediaError, 3005, "Invalid ASX attribute")); + } + } +} + + +void +PlaylistParser::OnSMILStartElement (const char *name, const char **attrs) +{ + PlaylistNode::Kind kind = StringToKind (name); + Uri *uri; + bool failed; + + LOG_PLAYLIST ("PlaylistParser::OnSMILStartElement (%s, %p), kind = %d\n", name, attrs, kind); + + PushCurrentKind (kind); + + switch (kind) { + case PlaylistNode::Smil: + // Here the kind stack should be: Root+Smil + if (kind_stack->Length () != 2 || !AssertParentKind (PlaylistNode::Root)) { + // FIXME: no specific error codes for SMIL found at + // http://msdn.microsoft.com/en-us/library/cc189020(VS.95).aspx + // Check on SL 2.0 which one they throw + ParsingError (new ErrorEventArgs (MediaError, 3008, "ASX parse error")); + return; + } + playlist = new Playlist (element, NULL, source); + playlist->SetSwitch (false); + playlist->SetSequential (true); + GetSMILCommonAttrs (playlist, name, attrs); + current_entry = playlist; + break; + case PlaylistNode::Switch: { + Playlist *newplaylist; + + for (int i = 0; attrs [i] != NULL; i += 2) { + if (str_match (attrs [i], "id")) { + if (attrs [i+1] == NULL || !g_ascii_isalpha (attrs [i+1][0])) { + ParsingError (new ErrorEventArgs (MediaError, 3005, "Invalid ASX attribute")); + } + } else { + ParsingError (new ErrorEventArgs (MediaError, 3005, "Invalid ASX attribute")); + } + } + + if (current_entry->IsPlaylist ()) { + newplaylist = new Playlist (element, (Playlist*)current_entry, source); + ((Playlist*)current_entry)->AddEntry (newplaylist); + } else { + newplaylist = new Playlist (element, current_entry->GetParent (), source); + current_entry->GetParent ()->AddEntry (newplaylist); + } + newplaylist->SetSwitch (true); + newplaylist->SetSequential (false); + + current_entry = newplaylist; + break; + } + case PlaylistNode::Excl: { + Playlist *newplaylist; + + if (current_entry->IsPlaylist ()) { + newplaylist = new Playlist (element, (Playlist*)current_entry, source); + ((Playlist*)current_entry)->AddEntry (newplaylist); + } else { + newplaylist = new Playlist (element, current_entry->GetParent (), source); + current_entry->GetParent ()->AddEntry (newplaylist); + } + newplaylist->SetSequential (false); + newplaylist->SetSwitch (false); + GetSMILCommonAttrs (newplaylist, name, attrs); + current_entry = newplaylist; + break; + } + case PlaylistNode::Seq: { + Playlist *newplaylist; + + if (current_entry->IsPlaylist ()) { + newplaylist = new Playlist (element, (Playlist*)current_entry, source); + ((Playlist*)current_entry)->AddEntry (newplaylist); + } else { + newplaylist = new Playlist (element, current_entry->GetParent (), source); + current_entry->GetParent ()->AddEntry (newplaylist); + } + newplaylist->SetSequential (true); + newplaylist->SetSwitch (false); + GetSMILCommonAttrs (newplaylist, name, attrs); + current_entry = newplaylist; + break; + } + case PlaylistNode::Media: { + PlaylistEntry *entry; + if (current_entry->IsPlaylist ()) { + entry = new PlaylistEntry (element, (Playlist*)current_entry); + ((Playlist*)current_entry)->AddEntry (entry); + } else { + entry = new PlaylistEntry (element, current_entry->GetParent ()); + current_entry->GetParent ()->AddEntry (entry); + } + current_entry = entry; + GetSMILCommonAttrs (entry, name, attrs); + for (int i = 0; attrs [i] != NULL; i += 2) { + if (str_match (attrs [i], "role") && attrs [i+1] != NULL) { + entry->SetRole (attrs [i+1]); + } else if (str_match (attrs [i], "src") && attrs [i+1] != NULL) { + if (GetCurrentContent () != NULL) { + failed = false; + uri = new Uri (); + if (!uri->Parse (attrs [i+1], true)) { + failed = true; + } else if (uri->protocol == NULL) { + failed = true; + } else if (g_strcasecmp (uri->protocol, "http") && + g_strcasecmp (uri->protocol, "https") && + g_strcasecmp (uri->protocol, "mms") && + g_strcasecmp (uri->protocol, "rtsp") && + g_strcasecmp (uri->protocol, "rstpt")) { + failed = true; + } + + if (!failed) { + current_entry->SetSourceName (uri); + } else { + delete uri; + ParsingError (new ErrorEventArgs (MediaError, 1001, "AG_E_UNKNOWN_ERROR")); + } + uri = NULL; + } + } + } + break; + } + case PlaylistNode::Root: + case PlaylistNode::Unknown: + default: + LOG_PLAYLIST ("PlaylistParser::OnStartElement ('%s', %p): Unknown kind: %d\n", name, attrs, kind); + ParsingError (new ErrorEventArgs (MediaError, 3004, "Invalid ASX element")); + break; + } +} + +void +PlaylistEntry::Print (int depth) +{ + for (int i = 0; i <= depth; i++) printf (" "); + printf("media %s\n", ((PlaylistEntry*)this)->GetFullSourceName()); +} + +void +Playlist::Print (int depth) +{ + current_node = (PlaylistNode *) entries->First (); + + for (int i = 0; i <= depth; i++) printf (" "); + PlaylistEntry *entry; + if (GetSequential()) + printf("seq\n"); + else if (GetSwitch()) + printf("switch\n"); + else + printf("excl\n"); + while (current_node) { + entry = GetCurrentEntry(); + if (entry) { + if (entry->IsPlaylist()) + ((Playlist*)entry)->Print (depth+1); + else + entry->Print (depth+1); + } + current_node = (PlaylistNode*)current_node->next; + } + current_node = (PlaylistNode*) entries->First(); +} + + + + + + +void +PlaylistParser::OnSMILEndElement (const char *name) +{ + PlaylistNode::Kind kind = GetCurrentKind (); + + LOG_PLAYLIST ("PlaylistParser::OnSMILEndElement (%s), GetCurrentKind (): %d, GetCurrentKind () to string: %s\n", name, kind, KindToString (kind)); + + switch (kind) { + case PlaylistNode::Switch: + case PlaylistNode::Seq: + case PlaylistNode::Excl: + if (current_entry->IsPlaylist()) + current_entry = current_entry->GetParent(); + else + current_entry = current_entry->GetParent ()->GetParent(); + break; + case PlaylistNode::Smil: + if (debug_flags & RUNTIME_DEBUG_PLAYLIST) { + playlist->Print (0); + } + break; + default: + break; + } + + + PopCurrentKind (); +} + bool PlaylistParser::IsASX3 (IMediaSource *source) { @@ -1379,6 +1845,20 @@ } bool +PlaylistParser::IsSMIL (IMediaSource *source) +{ + static const char *smil_header = "Peek (buffer, smil_header_length)) + return false; + + return strncmp (smil_header, buffer, smil_header_length) == 0; +} + + +bool PlaylistParser::ParseASX2 () { const int BUFFER_SIZE = 1024; @@ -1424,7 +1904,7 @@ g_key_file_free (key_file); - playlist = new Playlist (element, source); + playlist = new Playlist (element, NULL, source); PlaylistEntry *entry = new PlaylistEntry (element, playlist); uri = new Uri (); @@ -1515,19 +1995,24 @@ LOG_PLAYLIST ("PlaylistParser::Parse ()\n"); do { - Setup (); - // Don't try to parse anything until we have all the data. size = source->GetSize (); last_available_pos = source->GetLastAvailablePosition (); if (size != -1 && last_available_pos != -1 && size != last_available_pos) return MEDIA_NOT_ENOUGH_DATA; - if (!this->IsASX3 (source) && this->IsASX2 (source)) { + if (this->IsASX2 (source)) { /* Parse as a asx2 mms file */ + Setup (XML_TYPE_NONE); result = this->ParseASX2 (); + } else if (this->IsASX3 (source)) { + Setup (XML_TYPE_ASX3); + result = this->ParseASX3 (); + } else if (this->IsSMIL (source)) { + Setup (XML_TYPE_SMIL); + result = this->ParseSMIL (); } else { - result = this->ParseASX3 (); + result = false; } if (internal->reparse) @@ -1576,6 +2061,12 @@ return playlist != NULL; } +bool +PlaylistParser::ParseSMIL () { + //FIXME actually it's the same, but redo it to get nice error strings + return PlaylistParser::ParseASX3 (); +} + PlaylistEntry * PlaylistParser::GetCurrentContent () { @@ -1649,6 +2140,7 @@ PlaylistParser::PlaylistKind PlaylistParser::playlist_kinds [] = { + /* ASX3 */ PlaylistParser::PlaylistKind ("ABSTRACT", PlaylistNode::Abstract), PlaylistParser::PlaylistKind ("ASX", PlaylistNode::Asx), PlaylistParser::PlaylistKind ("ROOT", PlaylistNode::Root), @@ -1669,6 +2161,13 @@ PlaylistParser::PlaylistKind ("ENDMARKER", PlaylistNode::EndMarker), PlaylistParser::PlaylistKind ("PARAM", PlaylistNode::Param), PlaylistParser::PlaylistKind ("EVENT", PlaylistNode::Event), + /* SMIL */ + PlaylistParser::PlaylistKind ("smil", PlaylistNode::Smil), + PlaylistParser::PlaylistKind ("switch", PlaylistNode::Switch), + PlaylistParser::PlaylistKind ("media", PlaylistNode::Media), + PlaylistParser::PlaylistKind ("excl", PlaylistNode::Excl), + PlaylistParser::PlaylistKind ("seq", PlaylistNode::Seq), + PlaylistParser::PlaylistKind (NULL, PlaylistNode::Unknown) }; Modified: trunk/moon/src/playlist.h =================================================================== --- trunk/moon/src/playlist.h 2008-12-01 17:05:48 UTC (rev 120365) +++ trunk/moon/src/playlist.h 2008-12-01 17:52:22 UTC (rev 120366) @@ -23,6 +23,7 @@ #include "error.h" #include "dependencyobject.h" #include "uri.h" +#include "clock.h" class PlaylistNode : public List::Node { private: @@ -34,6 +35,7 @@ PlaylistEntry *GetEntry () { return entry; } enum Kind { + /* ASX3 playlists */ Unknown = 0, Root = 1 << 0, Abstract = 1 << 1, @@ -55,6 +57,12 @@ EndMarker = 1 << 17, Param = 1 << 18, Event = 1 << 19, + /* SMIL playlists */ + Smil = 1 << 20, + Switch = 1 << 21, + Media = 1 << 22, + Excl = 1 << 23, + Seq = 1 << 24, }; }; @@ -71,7 +79,10 @@ char *info_url; bool client_skip; TimeSpan start_time; - TimeSpan duration; + Duration *duration; + Duration *repeat_duration; + int repeat_count; + char *role; PlaylistNode::Kind set_values; @@ -116,10 +127,24 @@ TimeSpan GetStartTime (); void SetStartTime (TimeSpan start_time); - TimeSpan GetDuration (); - void SetDuration (TimeSpan duration); + Duration *GetDuration (); + void SetDuration (Duration *duration); bool HasDuration () { return (set_values & PlaylistNode::Duration); } + Duration *GetRepeatDuration (); + void SetRepeatDuration (Duration *duration); + // FIXME these are attributes from smil not nodes + // bool HasRepeatDuration () { return (set_values & PlaylistNode::RepeatDuration); } + + int GetRepeatCount () { return repeat_count; } + void SetRepeatCount (int count) { repeat_count = count; } + // FIXME these are attributes from smil not nodes + // bool HasRepeatCount () { return (set_values & PlaylistNode::RepeatDuration); } + + + void SetRole (const char *value) { role = g_strdup (role); } + char *GetRole (void) { return role; } + const char *GetInfoTarget (); void SetInfoTarget (char *info_target); @@ -154,6 +179,9 @@ virtual bool IsSingleFile (); virtual const char *GetTypeName () { return "PlaylistEntry"; } + void Print (int depth); + void CheckDuration (); + }; class Playlist : public PlaylistEntry { @@ -164,6 +192,9 @@ IMediaSource *source; bool is_single_file; bool autoplayed; + bool is_sequential; + bool is_switch; + bool waiting; void Init (MediaElement *element); @@ -172,12 +203,13 @@ static void on_media_ended (EventObject *sender, EventArgs *calldata, gpointer userdata); void MergeWith (PlaylistEntry *entry); + void PlayNext (bool fail); protected: virtual ~Playlist (); public: - Playlist (MediaElement *element, IMediaSource *source); + Playlist (MediaElement *element, Playlist *parent, IMediaSource *source); Playlist (MediaElement *element, Media *media); void Dispose (); @@ -198,10 +230,19 @@ virtual bool IsSingleFile () { return is_single_file; } bool GetAutoPlayed () { return autoplayed; } void SetAutoPlayed (bool value) { autoplayed = value; } + void SetSequential (bool value) { is_sequential = value; } + bool GetSequential (void) { return is_sequential; } + void SetSwitch (bool value) { is_switch = value; } + bool GetSwitch (void) { return is_switch; } + void SetWaiting (bool value) { waiting = value; } + bool GetWaiting (void) { return waiting; } + bool IsCurrentEntryLastEntry (); void OnEntryEnded (); + void OnEntryFailed (); virtual const char *GetTypeName () { return "PlaylistEntry"; } + void Print (int depth); }; class ParserInternal; @@ -220,6 +261,13 @@ // was parsed correctly. int playlist_version; + enum XmlType { + XML_TYPE_NONE, + XML_TYPE_ASX3, + XML_TYPE_SMIL + }; + + char *current_text; struct PlaylistKind { @@ -245,14 +293,22 @@ static PlaylistParser::PlaylistKind playlist_kinds []; List *kind_stack; - void OnStartElement (const char *name, const char **attrs); - void OnEndElement (const char *name); - void OnText (const char *text, int len); + void OnASXStartElement (const char *name, const char **attrs); + void OnASXEndElement (const char *name); + void OnASXText (const char *text, int len); - static void on_start_element (gpointer user_data, const char *name, const char **attrs); - static void on_end_element (gpointer user_data, const char *name); - static void on_text (gpointer user_data, const char *text, int len); + void GetSMILCommonAttrs (PlaylistEntry *entry, const char *name, const char **attrs); + void OnSMILStartElement (const char *name, const char **attrs); + void OnSMILEndElement (const char *name); + + static void on_asx_start_element (gpointer user_data, const char *name, const char **attrs); + static void on_asx_end_element (gpointer user_data, const char *name); + static void on_asx_text (gpointer user_data, const char *text, int len); + + static void on_smil_start_element (gpointer user_data, const char *name, const char **attrs); + static void on_smil_end_element (gpointer user_data, const char *name); + void EndEntry (); PlaylistEntry *GetCurrentEntry (); @@ -264,7 +320,7 @@ PlaylistNode::Kind GetParentKind (); bool AssertParentKind (int kind); - void Setup (); + void Setup (XmlType type); void Cleanup (); void SetSource (IMediaSource *source); bool TryFixError (gint8 *buffer, int bytes_read); @@ -278,8 +334,10 @@ MediaResult Parse (); bool ParseASX2 (); bool ParseASX3 (); + bool ParseSMIL (); bool IsASX2 (IMediaSource *source); bool IsASX3 (IMediaSource *source); + bool IsSMIL (IMediaSource *source); // This value determines if the data we parsed // actually was a playlist. It may be true even From mono-patches-list at lists.ximian.com Mon Dec 1 13:14:56 2008 From: mono-patches-list at lists.ximian.com (Mike Kestner) Date: Mon, 1 Dec 2008 13:14:56 -0500 (EST) Subject: [Mono-patches] r120367 - in trunk/monodevelop/main/src/addins/MonoDevelop.GtkCore: . libstetic/wrapper Message-ID: <20081201181456.351919472C@mono-cvs.ximian.com> Author: mkestner Date: 2008-12-01 13:14:55 -0500 (Mon, 01 Dec 2008) New Revision: 120367 Modified: trunk/monodevelop/main/src/addins/MonoDevelop.GtkCore/ChangeLog trunk/monodevelop/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/objects.xml Log: 2008-12-01 Mike Kestner * libstetic/wrapper/objects.xml: move ToggleButton ahead of CheckButton and add ToggleButton signal item group to CheckButton. Remove toggled signal from RadioButton since it inherits it from CheckButton. [Fixes #450237] Modified: trunk/monodevelop/main/src/addins/MonoDevelop.GtkCore/ChangeLog =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.GtkCore/ChangeLog 2008-12-01 17:52:22 UTC (rev 120366) +++ trunk/monodevelop/main/src/addins/MonoDevelop.GtkCore/ChangeLog 2008-12-01 18:14:55 UTC (rev 120367) @@ -1,3 +1,10 @@ +2008-12-01 Mike Kestner + + * libstetic/wrapper/objects.xml: move ToggleButton ahead of CheckButton + and add ToggleButton signal item group to CheckButton. Remove toggled + signal from RadioButton since it inherits it from CheckButton. + [Fixes #450237] + 2008-11-25 Mike Kestner * MonoDevelop.GtkCore/GtkCoreService.cs: refactor the default and Modified: trunk/monodevelop/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/objects.xml =================================================================== --- trunk/monodevelop/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/objects.xml 2008-12-01 17:52:22 UTC (rev 120366) +++ trunk/monodevelop/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/objects.xml 2008-12-01 18:14:55 UTC (rev 120367) @@ -482,6 +482,22 @@ + + + + + + + + + + + + + + + @@ -506,6 +522,7 @@ + @@ -1061,7 +1078,6 @@ - @@ -1438,22 +1454,6 @@ - - - - - - - - - - - - - - - + + + + + + + + + Added: trunk/mcs/class/System.Web/Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.aspx =================================================================== --- trunk/mcs/class/System.Web/Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.aspx 2008-12-01 19:33:13 UTC (rev 120375) +++ trunk/mcs/class/System.Web/Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.aspx 2008-12-01 19:33:35 UTC (rev 120376) @@ -0,0 +1,9 @@ +?<%@ Page Title="" Language="C#" MasterPageFile="~/ContentPlaceHolderInTemplate.master" AutoEventWireup="true" %> + + + Head content + + + Placeholder content. + + Added: trunk/mcs/class/System.Web/Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.master =================================================================== --- trunk/mcs/class/System.Web/Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.master 2008-12-01 19:33:13 UTC (rev 120375) +++ trunk/mcs/class/System.Web/Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.master 2008-12-01 19:33:35 UTC (rev 120376) @@ -0,0 +1,26 @@ +?<%@ Master Language="C#" AutoEventWireup="true" %> + + + + + + + + + + +
+ + + +
+ + + + + + +
+
+ + From mono-patches-list at lists.ximian.com Mon Dec 1 14:33:51 2008 From: mono-patches-list at lists.ximian.com (Marek Habersack (grendello@gmail.com)) Date: Mon, 1 Dec 2008 14:33:51 -0500 (EST) Subject: [Mono-patches] r120377 - in branches/mono-2-2/mcs/class/System.Web: . Test/System.Web.Compilation Test/mainsoft/NunitWeb/NunitWeb/Resources Test/mainsoft/NunitWebResources Message-ID: <20081201193351.0F2D09472C@mono-cvs.ximian.com> Author: mhabersack Date: 2008-12-01 14:33:50 -0500 (Mon, 01 Dec 2008) New Revision: 120377 Added: branches/mono-2-2/mcs/class/System.Web/Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.aspx branches/mono-2-2/mcs/class/System.Web/Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.master Modified: branches/mono-2-2/mcs/class/System.Web/ChangeLog branches/mono-2-2/mcs/class/System.Web/Makefile branches/mono-2-2/mcs/class/System.Web/Test/System.Web.Compilation/ChangeLog branches/mono-2-2/mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs branches/mono-2-2/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/ChangeLog branches/mono-2-2/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Web.mono.config Log: Backport of r120376. Modified: branches/mono-2-2/mcs/class/System.Web/ChangeLog =================================================================== --- branches/mono-2-2/mcs/class/System.Web/ChangeLog 2008-12-01 19:33:35 UTC (rev 120376) +++ branches/mono-2-2/mcs/class/System.Web/ChangeLog 2008-12-01 19:33:50 UTC (rev 120377) @@ -1,3 +1,10 @@ +2008-12-01 Marek Habersack + + * Makefile (TEST_RESOURCE_FILES): added + Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.aspx + Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.master + (TEST_MCS_FLAGS): added reference to System.Web.Extensions + 2008-11-25 Marek Habersack * System.Web.dll.sources: added Modified: branches/mono-2-2/mcs/class/System.Web/Makefile =================================================================== --- branches/mono-2-2/mcs/class/System.Web/Makefile 2008-12-01 19:33:35 UTC (rev 120376) +++ branches/mono-2-2/mcs/class/System.Web/Makefile 2008-12-01 19:33:50 UTC (rev 120377) @@ -153,7 +153,9 @@ Test/mainsoft/NunitWebResources/ValidPropertyBind4.aspx \ Test/mainsoft/NunitWebResources/ReadWritePropertyControl.ascx \ Test/mainsoft/MainsoftWebTest/nunitweb_config.xml \ - Test/mainsoft/NunitWebResources/TemplateControlParsingTest.aspx + Test/mainsoft/NunitWebResources/TemplateControlParsingTest.aspx \ + Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.aspx \ + Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.master RESX_DIST = resources/TranslationResources.resx ifeq (net_2_0, $(PROFILE)) @@ -191,7 +193,7 @@ endif endif -TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml) -nowarn:219,169,1591 $(NUNIT_RESOURCE_FILES:%=/resource:%) +TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:System.Web.Extensions.dll -doc:$(test_lib:.dll=.xml) -nowarn:219,169,1591 $(NUNIT_RESOURCE_FILES:%=/resource:%) EXTRA_DISTFILES = $(RESOURCE_FILES_2) $(RESOURCE_FILES_1) $(TEST_RESOURCE_FILES) UplevelHelperDefinitions.xml $(RESX_DIST) \ SQLiteProviders_DatabaseSchema.sql Modified: branches/mono-2-2/mcs/class/System.Web/Test/System.Web.Compilation/ChangeLog =================================================================== --- branches/mono-2-2/mcs/class/System.Web/Test/System.Web.Compilation/ChangeLog 2008-12-01 19:33:35 UTC (rev 120376) +++ branches/mono-2-2/mcs/class/System.Web/Test/System.Web.Compilation/ChangeLog 2008-12-01 19:33:50 UTC (rev 120377) @@ -1,3 +1,7 @@ +2008-12-01 Marek Habersack + + * TemplateControlCompilerTest.cs: Added test for bug #449970 + 2008-11-21 Marek Habersack * TemplateControlCompilerTest.cs: added simple data source for Modified: branches/mono-2-2/mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs =================================================================== --- branches/mono-2-2/mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs 2008-12-01 19:33:35 UTC (rev 120376) +++ branches/mono-2-2/mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs 2008-12-01 19:33:50 UTC (rev 120377) @@ -62,6 +62,8 @@ WebTest.CopyResource (GetType (), "ValidPropertyBind3.aspx", "ValidPropertyBind3.aspx"); WebTest.CopyResource (GetType (), "ValidPropertyBind4.aspx", "ValidPropertyBind4.aspx"); WebTest.CopyResource (GetType (), "ReadWritePropertyControl.ascx", "ReadWritePropertyControl.ascx"); + WebTest.CopyResource (GetType (), "ContentPlaceHolderInTemplate.aspx", "ContentPlaceHolderInTemplate.aspx"); + WebTest.CopyResource (GetType (), "ContentPlaceHolderInTemplate.master", "ContentPlaceHolderInTemplate.master"); #endif } @@ -76,7 +78,14 @@ } #if NET_2_0 + // Test for bug #449970 [Test] + public void MasterPageContentPlaceHolderInTemplate () + { + new WebTest ("ContentPlaceHolderInTemplate.aspx").Run (); + } + + [Test] [ExpectedException (typeof (CompilationException))] public void InvalidPropertyBindTest1 () { Modified: branches/mono-2-2/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/ChangeLog =================================================================== --- branches/mono-2-2/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/ChangeLog 2008-12-01 19:33:35 UTC (rev 120376) +++ branches/mono-2-2/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/ChangeLog 2008-12-01 19:33:50 UTC (rev 120377) @@ -1,3 +1,7 @@ +2008-12-01 Marek Habersack + + * Web.mono.config: added ASP.NET AJAX 1.0 configuration entries + 2008-11-21 Marek Habersack * Web.config, Web.mono.config: disabled batch compilation. Modified: branches/mono-2-2/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Web.mono.config =================================================================== --- branches/mono-2-2/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Web.mono.config 2008-12-01 19:33:35 UTC (rev 120376) +++ branches/mono-2-2/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Web.mono.config 2008-12-01 19:33:50 UTC (rev 120377) @@ -1,5 +1,17 @@ + + + +
+ +
+
+
+ + + + @@ -7,11 +19,22 @@ + + + + + + + - + + + + + + + + + + + + + + + + + + Added: branches/mono-2-2/mcs/class/System.Web/Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.aspx =================================================================== --- branches/mono-2-2/mcs/class/System.Web/Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.aspx 2008-12-01 19:33:35 UTC (rev 120376) +++ branches/mono-2-2/mcs/class/System.Web/Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.aspx 2008-12-01 19:33:50 UTC (rev 120377) @@ -0,0 +1,9 @@ +?<%@ Page Title="" Language="C#" MasterPageFile="~/ContentPlaceHolderInTemplate.master" AutoEventWireup="true" %> + + + Head content + + + Placeholder content. + + Added: branches/mono-2-2/mcs/class/System.Web/Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.master =================================================================== --- branches/mono-2-2/mcs/class/System.Web/Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.master 2008-12-01 19:33:35 UTC (rev 120376) +++ branches/mono-2-2/mcs/class/System.Web/Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.master 2008-12-01 19:33:50 UTC (rev 120377) @@ -0,0 +1,26 @@ +?<%@ Master Language="C#" AutoEventWireup="true" %> + + + + + + + + + + +
+ + + +
+ + + + + + +
+
+ + From mono-patches-list at lists.ximian.com Mon Dec 1 14:40:31 2008 From: mono-patches-list at lists.ximian.com (Jackson Harper (jackson@ximian.com)) Date: Mon, 1 Dec 2008 14:40:31 -0500 (EST) Subject: [Mono-patches] r120378 - trunk/moon/src Message-ID: <20081201194031.D99F49472C@mono-cvs.ximian.com> Author: jackson Date: 2008-12-01 14:40:31 -0500 (Mon, 01 Dec 2008) New Revision: 120378 Modified: trunk/moon/src/ChangeLog trunk/moon/src/xaml.cpp Log: * xaml.cpp: Value types can not have properties set on them. Modified: trunk/moon/src/ChangeLog =================================================================== --- trunk/moon/src/ChangeLog 2008-12-01 19:33:50 UTC (rev 120377) +++ trunk/moon/src/ChangeLog 2008-12-01 19:40:31 UTC (rev 120378) @@ -1,3 +1,7 @@ +2008-12-01 Jackson Harper + + * xaml.cpp: Value types can not have properties set on them. + 2008-12-01 Fernando Herrera * mediaelement.cpp: Modified: trunk/moon/src/xaml.cpp =================================================================== --- trunk/moon/src/xaml.cpp 2008-12-01 19:33:50 UTC (rev 120377) +++ trunk/moon/src/xaml.cpp 2008-12-01 19:40:31 UTC (rev 120378) @@ -3143,26 +3143,28 @@ DependencyProperty *prop = NULL; bool res; + if (Type::Find (property->info->GetKind ())->IsValueType ()) { + parser_error (p, item->element_name, NULL, -1, g_strdup_printf ("Value types (%s) do not have properties.", property->element_name)); + g_strfreev (prop_name); + return false; + } + + if (!property->IsDependencyObject ()) { + // Kinda an ugly assumption: It's not a DO and it's not a ValueType so it must be Managed. + XamlElementInstanceManaged *mp = (XamlElementInstanceManaged *) property; + g_strfreev (prop_name); + + return mp->SetAttachedProperty (p, item, value); + } + if (!dep) { // FIXME is this really where this check should live parser_error (p, item->element_name, NULL, 2030, g_strdup_printf ("Property element %s cannot be used inside another property element.", property->element_name)); - res = false; - } - if (!property->IsDependencyObject ()) { - // This means we are either setting a managed attached property or value property - - // FIXME: I made this error message up. - // OTHER FIXME: so this doesn't really work because PROPERTY element's have their parent for the kind - /* - if (property->info->GetKind () != Type::MANAGED) { - parser_error (p, item->element_name, NULL, -1, g_strdup_printf ("Value types (%s) do not have properties.", property->element_name)); - } - */ - XamlElementInstanceManaged *mp = (XamlElementInstanceManaged *) property; - res = mp->SetAttachedProperty (p, item, value); + g_strfreev (prop_name); + return false; } prop = DependencyProperty::GetDependencyProperty (item->info->GetKind (), prop_name [1]); From mono-patches-list at lists.ximian.com Mon Dec 1 14:56:40 2008 From: mono-patches-list at lists.ximian.com (Ivan N. Zlatev (contact@i-nz.net)) Date: Mon, 1 Dec 2008 14:56:40 -0500 (EST) Subject: [Mono-patches] r120379 - trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms Message-ID: <20081201195640.5EA249472C@mono-cvs.ximian.com> Author: ivanz Date: 2008-12-01 14:55:38 -0500 (Mon, 01 Dec 2008) New Revision: 120379 Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCell.cs Log: 2008-12-01 Ivan N. Zlatev * DataGridView.cs, DataGridViewCell.cs: Fire CellStateChanged events. * DataGridViewCell.cs: Set the cell as selected prior to setting the new state. [Fixes issue 1 in bug #443560] Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog =================================================================== --- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog 2008-12-01 19:40:31 UTC (rev 120378) +++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog 2008-12-01 19:55:38 UTC (rev 120379) @@ -1,5 +1,12 @@ 2008-12-01 Ivan N. Zlatev + * DataGridView.cs, DataGridViewCell.cs: Fire CellStateChanged events. + * DataGridViewCell.cs: Set the cell as selected prior to setting the + new state. + [Fixes issue 1 in bug #443560] + +2008-12-01 Ivan N. Zlatev + * DataGridView.cs: Invalidate after the current row/column seletion chagnes. [Fixes bug #438434] Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs =================================================================== --- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs 2008-12-01 19:40:31 UTC (rev 120378) +++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs 2008-12-01 19:55:38 UTC (rev 120379) @@ -3539,6 +3539,10 @@ eh (this, e); } + internal void OnCellStateChangedInternal (DataGridViewCellStateChangedEventArgs e) { + this.OnCellStateChanged (e); + } + protected virtual void OnCellStateChanged (DataGridViewCellStateChangedEventArgs e) { DataGridViewCellStateChangedEventHandler eh = (DataGridViewCellStateChangedEventHandler)(Events [CellStateChangedEvent]); Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCell.cs =================================================================== --- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCell.cs 2008-12-01 19:40:31 UTC (rev 120378) +++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCell.cs 2008-12-01 19:55:38 UTC (rev 120379) @@ -325,10 +325,11 @@ return false; } set { + selected = value; + if (value != ((State & DataGridViewElementStates.Selected) != 0)) { SetState(State ^ DataGridViewElementStates.Selected); } - selected = value; // If our row is selected, unselect it and select // the first cell in it that isn't us @@ -421,6 +422,12 @@ } } + internal override void SetState (DataGridViewElementStates state) { + base.SetState (state); + if (DataGridView != null) + DataGridView.OnCellStateChangedInternal (new DataGridViewCellStateChangedEventArgs (this, state)); + } + [EditorBrowsable (EditorBrowsableState.Advanced)] public virtual DataGridViewAdvancedBorderStyle AdjustCellBorderStyle (DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStyleInput, DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStylePlaceholder, bool singleVerticalBorderAdded, bool singleHorizontalBorderAdded, bool isFirstDisplayedColumn, bool isFirstDisplayedRow) { return dataGridViewAdvancedBorderStyleInput; From mono-patches-list at lists.ximian.com Mon Dec 1 15:00:59 2008 From: mono-patches-list at lists.ximian.com (Chris Toshok) Date: Mon, 1 Dec 2008 15:00:59 -0500 (EST) Subject: [Mono-patches] r120380 - trunk/moon/src Message-ID: <20081201200059.340389472C@mono-cvs.ximian.com> Author: toshok Date: 2008-12-01 15:00:58 -0500 (Mon, 01 Dec 2008) New Revision: 120380 Modified: trunk/moon/src/ChangeLog trunk/moon/src/control.cpp trunk/moon/src/frameworkelement.cpp trunk/moon/src/frameworkelement.h trunk/moon/src/template.cpp trunk/moon/src/template.h Log: 2008-12-01 Chris Toshok * template.cpp, template.h: when copying the tree over, register the template element names to their instantiated counterparts. and build up a NameScope object as we go. * frameworkelement.cpp: add a "template_namescope" which maps names that were registered in the template itself to elements in the instantiated visual tree. * control.cpp (Control::GetTemplateChild): look the child up in the template namescope, not against the visual tree. Modified: trunk/moon/src/ChangeLog =================================================================== --- trunk/moon/src/ChangeLog 2008-12-01 19:55:38 UTC (rev 120379) +++ trunk/moon/src/ChangeLog 2008-12-01 20:00:58 UTC (rev 120380) @@ -1,3 +1,16 @@ +2008-12-01 Chris Toshok + + * template.cpp, template.h: when copying the tree over, register + the template element names to their instantiated counterparts. + and build up a NameScope object as we go. + + * frameworkelement.cpp: add a "template_namescope" which maps + names that were registered in the template itself to elements in + the instantiated visual tree. + + * control.cpp (Control::GetTemplateChild): look the child up in + the template namescope, not against the visual tree. + 2008-12-01 Jackson Harper * xaml.cpp: Value types can not have properties set on them. Modified: trunk/moon/src/control.cpp =================================================================== --- trunk/moon/src/control.cpp 2008-12-01 19:55:38 UTC (rev 120379) +++ trunk/moon/src/control.cpp 2008-12-01 20:00:58 UTC (rev 120380) @@ -16,6 +16,7 @@ #include "runtime.h" #include "control.h" #include "canvas.h" +#include "namescope.h" Control::Control () { @@ -211,8 +212,8 @@ DependencyObject * Control::GetTemplateChild (char *name) { - if (template_root) - return template_root->FindName (name); + if (template_namescope) + return template_namescope->FindName (name); return NULL; } Modified: trunk/moon/src/frameworkelement.cpp =================================================================== --- trunk/moon/src/frameworkelement.cpp 2008-12-01 19:55:38 UTC (rev 120379) +++ trunk/moon/src/frameworkelement.cpp 2008-12-01 20:00:58 UTC (rev 120380) @@ -14,6 +14,7 @@ #include #include "runtime.h" +#include "namescope.h" #include "frameworkelement.h" #include "trigger.h" #include "thickness.h" @@ -38,6 +39,7 @@ #endif measure_cb = NULL; arrange_cb = NULL; + template_namescope = NULL; } FrameworkElement::~FrameworkElement () @@ -46,6 +48,11 @@ g_hash_table_destroy (bindings); g_hash_table_destroy (styles); #endif + + if (template_namescope) { + template_namescope->unref(); + template_namescope = NULL; + } } void @@ -487,3 +494,10 @@ this->measure_cb = measure_cb; this->arrange_cb = arrange_cb; } + +void +FrameworkElement::SetTemplateNameScope (NameScope *namescope) +{ + template_namescope = namescope; + template_namescope->ref(); +} Modified: trunk/moon/src/frameworkelement.h =================================================================== --- trunk/moon/src/frameworkelement.h 2008-12-01 19:55:38 UTC (rev 120379) +++ trunk/moon/src/frameworkelement.h 2008-12-01 20:00:58 UTC (rev 120380) @@ -141,10 +141,13 @@ VerticalAlignment GetVerticalAlignment (); void SetVerticalAlignment (VerticalAlignment value); + void SetTemplateNameScope (NameScope *namescope); + virtual Value *GetLocalValue (DependencyProperty *property); virtual void ClearValue (DependencyProperty *property, bool notify_listeners = true); protected: + NameScope *template_namescope; GHashTable *bindings; GHashTable *styles; Modified: trunk/moon/src/template.cpp =================================================================== --- trunk/moon/src/template.cpp 2008-12-01 19:55:38 UTC (rev 120379) +++ trunk/moon/src/template.cpp 2008-12-01 20:00:58 UTC (rev 120380) @@ -14,6 +14,7 @@ #include #include "template.h" +#include "namescope.h" class XamlTemplateBindingNode : public List::Node { public: @@ -102,6 +103,7 @@ ControlTemplate *t; Control *source; DependencyObject *dob; + NameScope *template_namescope; List *bindings; }; @@ -114,17 +116,18 @@ ControlTemplate *t = closure->t; Control *source = closure->source; DependencyObject *dob = closure->dob; + NameScope *template_namescope = closure->template_namescope; List *bindings = closure->bindings; if (value->Is (Type::DEPENDENCY_OBJECT)) - dob->SetValue (key, Value (t->DuplicateObject (source, value->AsDependencyObject(), bindings))); + dob->SetValue (key, Value (t->DuplicateObject (source, template_namescope, value->AsDependencyObject(), bindings))); else dob->SetValue (key, new Value (*value)); } DependencyObject* -ControlTemplate::DuplicateObject (Control *source, DependencyObject *dob, List* bindings) +ControlTemplate::DuplicateObject (Control *source, NameScope *template_namescope, DependencyObject *dob, List* bindings) { DependencyObject *new_dob = dob->GetType()->CreateInstance (); @@ -144,7 +147,7 @@ if (Type::Find(c->GetElementType())->IsSubclassOf(Type::DEPENDENCY_OBJECT)) { for (int i = 0; i < c->GetCount(); i ++) - new_c->Add(Value (DuplicateObject(source, c->GetValueAt(i)->AsDependencyObject(), bindings))); + new_c->Add(Value (DuplicateObject(source, template_namescope, c->GetValueAt(i)->AsDependencyObject(), bindings))); } else { for (int i = 0; i < c->GetCount(); i ++) @@ -154,7 +157,7 @@ else if (dob->Is (Type::FRAMEWORKTEMPLATE)) { FrameworkTemplate *t = (FrameworkTemplate*)dob; FrameworkTemplate *new_t = (FrameworkTemplate*)new_dob; - new_t->SetVisualTree ((FrameworkElement*)DuplicateObject (source, t->GetVisualTree(), bindings)); + new_t->SetVisualTree ((FrameworkElement*)DuplicateObject (source, template_namescope, t->GetVisualTree(), bindings)); } /* check if dob exists in the xaml binding hash. */ @@ -174,6 +177,10 @@ } } + /* check if the dob has an Name, and if so, register it in the returned namescope */ + if (new_dob->GetName()) + template_namescope->RegisterName (new_dob->GetName(), new_dob); + return new_dob; } @@ -183,9 +190,15 @@ if (!visual_tree) return NULL; - DependencyObject *instantiated_tree = DuplicateObject (control, visual_tree, bindings); + NameScope *template_namescope = new NameScope (); - return (FrameworkElement *)instantiated_tree; + DependencyObject *instantiated_tree = DuplicateObject (control, template_namescope, visual_tree, bindings); + + FrameworkElement* fwe = (FrameworkElement*)instantiated_tree; + fwe->SetTemplateNameScope (template_namescope); + template_namescope->unref (); + + return (FrameworkElement *)fwe; } XamlTemplateBinding::XamlTemplateBinding (FrameworkElement *target, Modified: trunk/moon/src/template.h =================================================================== --- trunk/moon/src/template.h 2008-12-01 19:55:38 UTC (rev 120379) +++ trunk/moon/src/template.h 2008-12-01 20:00:58 UTC (rev 120380) @@ -63,7 +63,7 @@ protected: virtual ~ControlTemplate () {} - DependencyObject* DuplicateObject (Control *source, DependencyObject *dob, List* bindings); + DependencyObject* DuplicateObject (Control *source, NameScope *template_namescope, DependencyObject *dob, List* bindings); static void duplicate_value (DependencyProperty *key, Value *value, gpointer closure); }; From mono-patches-list at lists.ximian.com Mon Dec 1 15:10:53 2008 From: mono-patches-list at lists.ximian.com (Andres Aragoneses (aaragoneses@novell.com)) Date: Mon, 1 Dec 2008 15:10:53 -0500 (EST) Subject: [Mono-patches] r120381 - trunk/uia2atk/UiaAtkBridge/UiaAtkBridge Message-ID: <20081201201053.F0C8C9472C@mono-cvs.ximian.com> Author: knocte Date: 2008-12-01 15:10:53 -0500 (Mon, 01 Dec 2008) New Revision: 120381 Modified: trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ChangeLog trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/RadioButton.cs Log: * UiaAtkBridge/RadioButton.cs: Identation and coding guidelines. Modified: trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ChangeLog =================================================================== --- trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ChangeLog 2008-12-01 20:00:58 UTC (rev 120380) +++ trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ChangeLog 2008-12-01 20:10:53 UTC (rev 120381) @@ -1,5 +1,9 @@ 2008-12-01 Andr?s G. Aragoneses + * RadioButton.cs: Identation and coding guidelines. + +2008-12-01 Andr?s G. Aragoneses + * RadioButton.cs: * ComponentParentAdapter.cs: Trying to fix threading issues introduced in r120088. Modified: trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/RadioButton.cs =================================================================== --- trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/RadioButton.cs 2008-12-01 20:00:58 UTC (rev 120380) +++ trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/RadioButton.cs 2008-12-01 20:10:53 UTC (rev 120381) @@ -62,14 +62,13 @@ if (action != 0) return false; - bool enabled = - (bool) Provider.GetPropertyValue (AutomationElementIdentifiers.IsEnabledProperty.Id); - if (!enabled) - return false; + bool enabled = + (bool) Provider.GetPropertyValue (AutomationElementIdentifiers.IsEnabledProperty.Id); + if (!enabled) + return false; - if (!selProvider.IsSelected) { + if (!selProvider.IsSelected) selProvider.Select (); - } return true; } From mono-patches-list at lists.ximian.com Mon Dec 1 15:23:41 2008 From: mono-patches-list at lists.ximian.com (Jackson Harper (jackson@ximian.com)) Date: Mon, 1 Dec 2008 15:23:41 -0500 (EST) Subject: [Mono-patches] r120382 - trunk/moon/src Message-ID: <20081201202341.605D99472C@mono-cvs.ximian.com> Author: jackson Date: 2008-12-01 15:23:41 -0500 (Mon, 01 Dec 2008) New Revision: 120382 Modified: trunk/moon/src/xaml.cpp Log: Fix typo. Modified: trunk/moon/src/xaml.cpp =================================================================== --- trunk/moon/src/xaml.cpp 2008-12-01 20:10:53 UTC (rev 120381) +++ trunk/moon/src/xaml.cpp 2008-12-01 20:23:41 UTC (rev 120382) @@ -2929,7 +2929,7 @@ return false; } - p->loader->SetProperty (p->top_element ? p->top_element->GetManagedPointer () : NULL, ((XamlElementInfoManaged *) info)->xmlns, target->GetManagedPointer (), element_name, value->GetAsValue ()); + return p->loader->SetProperty (p->top_element ? p->top_element->GetManagedPointer () : NULL, ((XamlElementInfoManaged *) info)->xmlns, target->GetManagedPointer (), element_name, value->GetAsValue ()); } XamlElementInstance * From mono-patches-list at lists.ximian.com Mon Dec 1 15:25:24 2008 From: mono-patches-list at lists.ximian.com (Larry Ewing (lewing@ximian.com)) Date: Mon, 1 Dec 2008 15:25:24 -0500 (EST) Subject: [Mono-patches] r120383 - in trunk/moon: . test/xaml Message-ID: <20081201202524.CFA7A9472C@mono-cvs.ximian.com> Author: lewing Date: 2008-12-01 15:25:24 -0500 (Mon, 01 Dec 2008) New Revision: 120383 Modified: trunk/moon/ChangeLog trunk/moon/test/xaml/drtlist.xml Log: 2008-12-01 Larry Ewing * test/xaml/drtlist.xml: remove failure tag from a bunch of tests that are passing. Modified: trunk/moon/ChangeLog =================================================================== --- trunk/moon/ChangeLog 2008-12-01 20:23:41 UTC (rev 120382) +++ trunk/moon/ChangeLog 2008-12-01 20:25:24 UTC (rev 120383) @@ -1,3 +1,8 @@ +2008-12-01 Larry Ewing + + * test/xaml/drtlist.xml: remove failure tag from a bunch of tests + that are passing. + 2008-11-25 Rolf Bjarne Kvinge * tools/unsign, tools/unsign/Makefile, tools/unsign/unsign.cs: Added, Modified: trunk/moon/test/xaml/drtlist.xml =================================================================== --- trunk/moon/test/xaml/drtlist.xml 2008-12-01 20:23:41 UTC (rev 120382) +++ trunk/moon/test/xaml/drtlist.xml 2008-12-01 20:25:24 UTC (rev 120383) @@ -86,17 +86,14 @@ Author: knocte Date: 2008-12-01 15:52:05 -0500 (Mon, 01 Dec 2008) New Revision: 120384 Modified: trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ChangeLog trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/RadioButton.cs Log: * UiaAtkBridge/RadioButton.cs: More null guarding. Modified: trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ChangeLog =================================================================== --- trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ChangeLog 2008-12-01 20:25:24 UTC (rev 120383) +++ trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ChangeLog 2008-12-01 20:52:05 UTC (rev 120384) @@ -1,5 +1,9 @@ 2008-12-01 Andr?s G. Aragoneses + * RadioButton.cs: More null guarding. + +2008-12-01 Andr?s G. Aragoneses + * RadioButton.cs: Identation and coding guidelines. 2008-12-01 Andr?s G. Aragoneses Modified: trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/RadioButton.cs =================================================================== --- trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/RadioButton.cs 2008-12-01 20:25:24 UTC (rev 120383) +++ trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/RadioButton.cs 2008-12-01 20:52:05 UTC (rev 120384) @@ -51,9 +51,11 @@ protected override Atk.RelationSet OnRefRelationSet () { Atk.RelationSet relSet = base.OnRefRelationSet (); - var rel = ((ComponentParentAdapter)Parent).RadioButsRelation; - if (rel != null) - relSet.Add (((ComponentParentAdapter)Parent).RadioButsRelation); + if (Parent != null) { + var rel = ((ComponentParentAdapter)Parent).RadioButsRelation; + if (rel != null) + relSet.Add (((ComponentParentAdapter)Parent).RadioButsRelation); + } return relSet; } From mono-patches-list at lists.ximian.com Mon Dec 1 15:57:34 2008 From: mono-patches-list at lists.ximian.com (Rodrigo Kumpera (kumpera@gmail.com)) Date: Mon, 1 Dec 2008 15:57:34 -0500 (EST) Subject: [Mono-patches] r120385 - trunk/mono/mono/metadata Message-ID: <20081201205734.842379472C@mono-cvs.ximian.com> Author: kumpera Date: 2008-12-01 15:57:26 -0500 (Mon, 01 Dec 2008) New Revision: 120385 Modified: trunk/mono/mono/metadata/ChangeLog trunk/mono/mono/metadata/verify.c Log: 2008-12-01 Rodrigo Kumpera * verify.c (is_compatible_boxed_valuetype): Rewrite function to work properly with targets that require strict compatibility between the types. * verify.c (verify_stack_type_compatibility_full): Boxed values are not compatible to unboxed types. All cases that this is true are checked by is_compatible_boxed_valuetype. Kill the strict argument and create a new one valuetype_must_be_boxed. * verify.c (verify_delegate_compatibility): Use verify_stack_type_compatibility_full to state that all valuetypes must be boxed. Fixes #448560. Modified: trunk/mono/mono/metadata/ChangeLog =================================================================== --- trunk/mono/mono/metadata/ChangeLog 2008-12-01 20:52:05 UTC (rev 120384) +++ trunk/mono/mono/metadata/ChangeLog 2008-12-01 20:57:26 UTC (rev 120385) @@ -1,3 +1,17 @@ +2008-12-01 Rodrigo Kumpera + + * verify.c (is_compatible_boxed_valuetype): Rewrite function to work properly with + targets that require strict compatibility between the types. + + * verify.c (verify_stack_type_compatibility_full): Boxed values are not compatible + to unboxed types. All cases that this is true are checked by is_compatible_boxed_valuetype. + Kill the strict argument and create a new one valuetype_must_be_boxed. + + * verify.c (verify_delegate_compatibility): Use verify_stack_type_compatibility_full to + state that all valuetypes must be boxed. + + Fixes #448560. + 2008-11-29 Korn?l P?l * coree.c (MonoFixupExe): Use sizeof(IMAGE_BASE_RELOCATION) instead of Modified: trunk/mono/mono/metadata/verify.c =================================================================== --- trunk/mono/mono/metadata/verify.c 2008-12-01 20:52:05 UTC (rev 120384) +++ trunk/mono/mono/metadata/verify.c 2008-12-01 20:57:26 UTC (rev 120385) @@ -2554,13 +2554,18 @@ * @type The source type. It it tested to be of the proper type. * @candidate type of the boxed valuetype. * @stack stack slot of the boxed valuetype, separate from @candidade since one could be changed before calling this function - * @type_must_be_object if TRUE @type must be System.Object, otherwise can be any reference type. + * @strict if TRUE candidate must be boxed compatible to type otherwise it's enough * */ static gboolean -is_compatible_boxed_valuetype (VerifyContext *ctx, MonoType *type, MonoType *candidate, ILStackDesc *stack, gboolean type_must_be_object) +is_compatible_boxed_valuetype (VerifyContext *ctx, MonoType *type, MonoType *candidate, ILStackDesc *stack, gboolean strict) { - if (mono_type_is_generic_argument (candidate) && stack_slot_is_boxed_value (stack) && !type->byref) { + if (!stack_slot_is_boxed_value (stack)) + return FALSE; + if (type->byref || candidate->byref) + return FALSE; + + if (mono_type_is_generic_argument (candidate)) { MonoGenericParam *param = get_generic_param (ctx, candidate); MonoClass **class; for (class = param->constraints; class && *class; ++class) { @@ -2568,14 +2573,19 @@ return TRUE; } } - - if (!type_must_be_object && !MONO_TYPE_IS_REFERENCE (type)) + + if (mono_type_is_generic_argument (type)) return FALSE; - return !type->byref && !candidate->byref && stack_slot_is_boxed_value (stack); + + if (!strict) + return MONO_TYPE_IS_REFERENCE (type); + + /*All boxed valuetypes are compatible to System.Object*/ + return MONO_TYPE_IS_REFERENCE (type) && (type->type == MONO_TYPE_OBJECT || verify_type_compatibility_full (ctx, type, candidate, FALSE)); } static int -verify_stack_type_compatibility_full (VerifyContext *ctx, MonoType *type, ILStackDesc *stack, gboolean strict, gboolean drop_byref) +verify_stack_type_compatibility_full (VerifyContext *ctx, MonoType *type, ILStackDesc *stack, gboolean drop_byref, gboolean valuetype_must_be_boxed) { MonoType *candidate = mono_type_from_stack_slot (stack); if (MONO_TYPE_IS_REFERENCE (type) && !type->byref && stack_slot_is_null_literal (stack)) @@ -2584,10 +2594,16 @@ if (is_compatible_boxed_valuetype (ctx, type, candidate, stack, TRUE)) return TRUE; + if (valuetype_must_be_boxed && !stack_slot_is_boxed_value (stack) && !MONO_TYPE_IS_REFERENCE (candidate)) + return FALSE; + + if (!valuetype_must_be_boxed && stack_slot_is_boxed_value (stack)) + return FALSE; + if (drop_byref) - return verify_type_compatibility_full (ctx, type, mono_type_get_type_byval (candidate), strict); + return verify_type_compatibility_full (ctx, type, mono_type_get_type_byval (candidate), FALSE); - return verify_type_compatibility_full (ctx, type, candidate, strict); + return verify_type_compatibility_full (ctx, type, candidate, FALSE); } static int @@ -2805,7 +2821,7 @@ ctx->code [ip_offset].flags |= IL_CODE_DELEGATE_SEQUENCE; //general tests - if (!verify_stack_type_compatibility (ctx, &method->klass->byval_arg, value) && !stack_slot_is_null_literal (value)) + if (!verify_stack_type_compatibility_full (ctx, &method->klass->byval_arg, value, FALSE, TRUE) && !stack_slot_is_null_literal (value)) CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("This object not compatible with function pointer for delegate creation at 0x%04x", ctx->ip_offset)); if (stack_slot_get_type (value) != TYPE_COMPLEX) @@ -3370,7 +3386,7 @@ if (field->parent->valuetype && stack_slot_is_boxed_value (obj)) CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Type at stack is a boxed valuetype and is not compatible to reference the field at 0x%04x", ctx->ip_offset)); - if (!stack_slot_is_null_literal (obj) && !verify_stack_type_compatibility_full (ctx, &field->parent->byval_arg, obj, FALSE, TRUE)) + if (!stack_slot_is_null_literal (obj) && !verify_stack_type_compatibility_full (ctx, &field->parent->byval_arg, obj, TRUE, FALSE)) CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Type at stack is not compatible to reference the field at 0x%04x", ctx->ip_offset)); if (!IS_SKIP_VISIBILITY (ctx) && !mono_method_can_access_field_full (ctx->method, field, mono_class_from_mono_type (obj->type))) From mono-patches-list at lists.ximian.com Mon Dec 1 15:57:36 2008 From: mono-patches-list at lists.ximian.com (Rodrigo Kumpera (kumpera@gmail.com)) Date: Mon, 1 Dec 2008 15:57:36 -0500 (EST) Subject: [Mono-patches] r120386 - trunk/mono/mono/tests/verifier Message-ID: <20081201205736.34A2A9472C@mono-cvs.ximian.com> Author: kumpera Date: 2008-12-01 15:57:35 -0500 (Mon, 01 Dec 2008) New Revision: 120386 Added: trunk/mono/mono/tests/verifier/unverifiable_boxed_type_not_compatible_with_string.il trunk/mono/mono/tests/verifier/unverifiable_boxed_type_not_compatible_with_valuetype.il trunk/mono/mono/tests/verifier/unverifiable_ret_with_boxed_value_on_stack.il Modified: trunk/mono/mono/tests/verifier/ChangeLog Log: 2008-12-01 Rodrigo Kumpera * unverifiable_boxed_type_not_compatible_with_string.il: * unverifiable_boxed_type_not_compatible_with_valuetype.il: * unverifiable_ret_with_boxed_value_on_stack.il: Regression tests for #448560. Modified: trunk/mono/mono/tests/verifier/ChangeLog =================================================================== --- trunk/mono/mono/tests/verifier/ChangeLog 2008-12-01 20:57:26 UTC (rev 120385) +++ trunk/mono/mono/tests/verifier/ChangeLog 2008-12-01 20:57:35 UTC (rev 120386) @@ -1,3 +1,10 @@ +2008-12-01 Rodrigo Kumpera + + * unverifiable_boxed_type_not_compatible_with_string.il: + * unverifiable_boxed_type_not_compatible_with_valuetype.il: + * unverifiable_ret_with_boxed_value_on_stack.il: Regression tests + for #448560. + 2008-09-03 Rodrigo Kumpera * strict_native_int_converts_to_unamanged_pointer.cs: It turns Added: trunk/mono/mono/tests/verifier/unverifiable_boxed_type_not_compatible_with_string.il =================================================================== --- trunk/mono/mono/tests/verifier/unverifiable_boxed_type_not_compatible_with_string.il 2008-12-01 20:57:26 UTC (rev 120385) +++ trunk/mono/mono/tests/verifier/unverifiable_boxed_type_not_compatible_with_string.il 2008-12-01 20:57:35 UTC (rev 120386) @@ -0,0 +1,32 @@ +.assembly extern mscorlib +{ + .ver 2:0:0:0 + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) +} + +.assembly 'boxing_tests' { +} + +.module 'boxing_tests' + +.class public auto ansi beforefieldinit Driver extends [mscorlib]System.Object +{ + .method private static hidebysig default string Foo () cil managed + { + .maxstack 8 + ldc.i4.s 0x0a + box [mscorlib]System.Int32 + ret + } + + .method private static hidebysig default int32 Main () cil managed + { + .entrypoint + .maxstack 8 + call string class Driver::Foo() + pop + ldc.i4.0 + ret + } +} + Added: trunk/mono/mono/tests/verifier/unverifiable_boxed_type_not_compatible_with_valuetype.il =================================================================== --- trunk/mono/mono/tests/verifier/unverifiable_boxed_type_not_compatible_with_valuetype.il 2008-12-01 20:57:26 UTC (rev 120385) +++ trunk/mono/mono/tests/verifier/unverifiable_boxed_type_not_compatible_with_valuetype.il 2008-12-01 20:57:35 UTC (rev 120386) @@ -0,0 +1,32 @@ +.assembly extern mscorlib +{ + .ver 2:0:0:0 + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) +} + +.assembly 'boxing_tests' { +} + +.module 'boxing_tests' + +.class public auto ansi beforefieldinit Driver extends [mscorlib]System.Object +{ + .method private static hidebysig default int32 Foo () cil managed + { + .maxstack 8 + ldc.i4.s 0x0a + box [mscorlib]System.Int32 + ret + } + + .method public static hidebysig default int32 Main () cil managed + { + .entrypoint + .maxstack 8 + call int32 class Driver::Foo() + pop + ldc.i4.0 + ret + } +} + Added: trunk/mono/mono/tests/verifier/unverifiable_ret_with_boxed_value_on_stack.il =================================================================== --- trunk/mono/mono/tests/verifier/unverifiable_ret_with_boxed_value_on_stack.il 2008-12-01 20:57:26 UTC (rev 120385) +++ trunk/mono/mono/tests/verifier/unverifiable_ret_with_boxed_value_on_stack.il 2008-12-01 20:57:35 UTC (rev 120386) @@ -0,0 +1,35 @@ +.assembly extern mscorlib +{ + .ver 2:0:0:0 + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) +} + +.assembly 'boxing_tests' { +} + +.module 'boxing_tests' + + +.class public auto ansi beforefieldinit Driver extends [mscorlib]System.Object +{ + .method public static hidebysig default !!T Foo (object o) cil managed + { + .maxstack 8 + ldarg.0 + isinst !!0 + ret + } + + .method public static hidebysig default int32 Main () cil managed + { + .entrypoint + .maxstack 4 + .locals init () + ldnull + call !!0 class Driver::Foo (object) + pop + ldc.i4.0 + ret + } +} + From mono-patches-list at lists.ximian.com Mon Dec 1 16:04:58 2008 From: mono-patches-list at lists.ximian.com (Andres Aragoneses (aaragoneses@novell.com)) Date: Mon, 1 Dec 2008 16:04:58 -0500 (EST) Subject: [Mono-patches] r120387 - trunk/uia2atk/UiaAtkBridge/UiaAtkBridge Message-ID: <20081201210458.986C99472C@mono-cvs.ximian.com> Author: knocte Date: 2008-12-01 16:04:58 -0500 (Mon, 01 Dec 2008) New Revision: 120387 Modified: trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ChangeLog trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ComponentParentAdapter.cs trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/RadioButton.cs Log: * UiaAtkBridge/RadioButton.cs: * UiaAtkBridge/ComponentParentAdapter.cs: Fix ref issues with Atk.Relation. Modified: trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ChangeLog =================================================================== --- trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ChangeLog 2008-12-01 20:57:35 UTC (rev 120386) +++ trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ChangeLog 2008-12-01 21:04:58 UTC (rev 120387) @@ -1,5 +1,10 @@ 2008-12-01 Andr?s G. Aragoneses + * RadioButton.cs: + * ComponentParentAdapter.cs: Fix ref issues with Atk.Relation. + +2008-12-01 Andr?s G. Aragoneses + * RadioButton.cs: More null guarding. 2008-12-01 Andr?s G. Aragoneses Modified: trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ComponentParentAdapter.cs =================================================================== --- trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ComponentParentAdapter.cs 2008-12-01 20:57:35 UTC (rev 120386) +++ trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/ComponentParentAdapter.cs 2008-12-01 21:04:58 UTC (rev 120387) @@ -35,12 +35,13 @@ //FIXME: should we receive a IRawElementProviderFragment instead? this way we can drop ArgumentExceptions in derived classes' ctors public ComponentParentAdapter (IRawElementProviderSimple provider) : base (provider) { + RadioButtons = new SCG.List (); componentExpert = new ComponentImplementorHelper (this); } private ComponentImplementorHelper componentExpert; - internal Atk.Relation RadioButsRelation { get; private set; } + internal SCG.List RadioButtons { get; private set; } internal override void AddOneChild (Atk.Object child) { @@ -50,27 +51,17 @@ if (rad == null) return; - if (RadioButsRelation == null) - RadioButsRelation = new Atk.Relation (new Atk.Object [] { rad }, Atk.RelationType.MemberOf); - else - RadioButsRelation.AddTarget (rad); + RadioButtons.Add (rad); } internal override void RemoveChild (Atk.Object childToRemove) { RadioButton rad = childToRemove as RadioButton; - if (rad != null) { - Atk.Relation newRelation = null; - SCG.List restRads = new SCG.List (RadioButsRelation.Target); - restRads.Remove ((Atk.Object)rad); - if (restRads.Count > 0) - newRelation = new Atk.Relation (restRads.ToArray (), Atk.RelationType.MemberOf); - RadioButsRelation = newRelation; - } + if (rad != null) + RadioButtons.Remove (rad); base.RemoveChild (childToRemove); } - #region ComponentImplementor Methods Modified: trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/RadioButton.cs =================================================================== --- trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/RadioButton.cs 2008-12-01 20:57:35 UTC (rev 120386) +++ trunk/uia2atk/UiaAtkBridge/UiaAtkBridge/RadioButton.cs 2008-12-01 21:04:58 UTC (rev 120387) @@ -52,9 +52,9 @@ { Atk.RelationSet relSet = base.OnRefRelationSet (); if (Parent != null) { - var rel = ((ComponentParentAdapter)Parent).RadioButsRelation; - if (rel != null) - relSet.Add (((ComponentParentAdapter)Parent).RadioButsRelation); + var rel = new Atk.Relation (((ComponentParentAdapter)Parent).RadioButtons.ToArray (), + Atk.RelationType.MemberOf); + relSet.Add (rel); } return relSet; } From mono-patches-list at lists.ximian.com Mon Dec 1 16:18:49 2008 From: mono-patches-list at lists.ximian.com (Geoff Norton (gnorton@novell.com)) Date: Mon, 1 Dec 2008 16:18:49 -0500 (EST) Subject: [Mono-patches] r120388 - branches/moon-1-0/src Message-ID: <20081201211849.703FA9472C@mono-cvs.ximian.com> Author: gnorton Date: 2008-12-01 16:18:39 -0500 (Mon, 01 Dec 2008) New Revision: 120388 Modified: branches/moon-1-0/src/ChangeLog branches/moon-1-0/src/audio.cpp Log: 2008-12-01 Geoff Norton * audio.cpp: Fix a logic bug making it impossible to use Alsa support r: toshok Modified: branches/moon-1-0/src/ChangeLog =================================================================== --- branches/moon-1-0/src/ChangeLog 2008-12-01 21:04:58 UTC (rev 120387) +++ branches/moon-1-0/src/ChangeLog 2008-12-01 21:18:39 UTC (rev 120388) @@ -1,3 +1,10 @@ +2008-12-01 Geoff Norton + + * audio.cpp: Fix a logic bug making it impossible to use Alsa + support + + r: toshok + 2008-11-28 Rolf Bjarne Kvinge * audio.cpp: Remove a print_stack_trace. Backport of r120211. Modified: branches/moon-1-0/src/audio.cpp =================================================================== --- branches/moon-1-0/src/audio.cpp 2008-12-01 21:04:58 UTC (rev 120387) +++ branches/moon-1-0/src/audio.cpp 2008-12-01 21:18:39 UTC (rev 120388) @@ -887,13 +887,15 @@ result = new PulsePlayer (); } - if (result && !result->Initialize ()) { - LOG_AUDIO ("AudioPlayer: Failed initialization.\n"); - result->ShutdownImpl (); - delete result; - result = NULL; - } else { - return result; + if (result != NULL) { + if (!result->Initialize ()) { + LOG_AUDIO ("AudioPlayer: Failed initialization.\n"); + result->ShutdownImpl (); + delete result; + result = NULL; + } else { + return result; + } } #else LOG_AUDIO ("AudioPlayer: Built without support for pulseaudio.\n"); @@ -911,13 +913,15 @@ result = new AlsaPlayer (); } - if (result && !result->Initialize ()) { - LOG_AUDIO ("AudioPlayer: Failed initialization.\n"); - result->ShutdownImpl (); - delete result; - result = NULL; - } else { - return result; + if (result != NULL) { + if (!result->Initialize ()) { + LOG_AUDIO ("AudioPlayer: Failed initialization.\n"); + result->ShutdownImpl (); + delete result; + result = NULL; + } else { + return result; + } } #else LOG_AUDIO ("AudioPlayer: Built without support for alsa.\n"); From mono-patches-list at lists.ximian.com Mon Dec 1 16:27:53 2008 From: mono-patches-list at lists.ximian.com (Zoltan Varga (vargaz AT gmail.com)) Date: Mon, 1 Dec 2008 16:27:53 -0500 (EST) Subject: [Mono-patches] r120389 - trunk/mono/mono/mini Message-ID: <20081201212753.1F7039472C@mono-cvs.ximian.com> Author: zoltan Date: 2008-12-01 16:27:52 -0500 (Mon, 01 Dec 2008) New Revision: 120389 Modified: trunk/mono/mono/mini/ChangeLog trunk/mono/mono/mini/generics.cs trunk/mono/mono/mini/method-to-ir.c Log: 2008-12-01 Zoltan Varga * method-to-ir.c (mono_method_to_ir): Set the type of the value pushed on the stack in CEE_LDFLDA. Fixes #450542. * generics.cs: Add a new test. Modified: trunk/mono/mono/mini/ChangeLog =================================================================== --- trunk/mono/mono/mini/ChangeLog 2008-12-01 21:18:39 UTC (rev 120388) +++ trunk/mono/mono/mini/ChangeLog 2008-12-01 21:27:52 UTC (rev 120389) @@ -1,3 +1,10 @@ +2008-12-01 Zoltan Varga + + * method-to-ir.c (mono_method_to_ir): Set the type of the value pushed on + the stack in CEE_LDFLDA. Fixes #450542. + + * generics.cs: Add a new test. + 2008-12-01 Mark Mason * mini-ops.h: updated MIPS opcodes Modified: trunk/mono/mono/mini/generics.cs =================================================================== --- trunk/mono/mono/mini/generics.cs 2008-12-01 21:18:39 UTC (rev 120388) +++ trunk/mono/mono/mini/generics.cs 2008-12-01 21:27:52 UTC (rev 120389) @@ -240,6 +240,10 @@ return 0; } + public static int test_0_nullable_ldflda () { + return GenericClass.BIsAClazz == false ? 0 : 1; + } + public struct GenericStruct { public T t; @@ -285,6 +289,15 @@ { return x [index]; } + + protected static T NullB = default(T); + private static Nullable _BIsA = null; + public static bool BIsAClazz { + get { + _BIsA = false; + return _BIsA.Value; + } + } } public class MRO : MarshalByRefObject { Modified: trunk/mono/mono/mini/method-to-ir.c =================================================================== --- trunk/mono/mono/mini/method-to-ir.c 2008-12-01 21:18:39 UTC (rev 120388) +++ trunk/mono/mono/mini/method-to-ir.c 2008-12-01 21:27:52 UTC (rev 120389) @@ -7895,6 +7895,7 @@ if (*ip == CEE_LDSFLDA) { ins->klass = mono_class_from_mono_type (field->type); + ins->type = STACK_PTR; *sp++ = ins; } else if (*ip == CEE_STSFLD) { MonoInst *store; From mono-patches-list at lists.ximian.com Mon Dec 1 16:39:13 2008 From: mono-patches-list at lists.ximian.com (Chris Toshok) Date: Mon, 1 Dec 2008 16:39:13 -0500 (EST) Subject: [Mono-patches] r120390 - trunk/moon/src Message-ID: <20081201213913.0D0469472C@mono-cvs.ximian.com> Author: toshok Date: 2008-12-01 16:39:12 -0500 (Mon, 01 Dec 2008) New Revision: 120390 Modified: trunk/moon/src/ChangeLog trunk/moon/src/frameworkelement.cpp trunk/moon/src/frameworkelement.h Log: 2008-12-01 Chris Toshok * frameworkelement.h: add decl for ClearBindingExpression. * frameworkelement.cpp (FrameworkElement::ClearBindingExpression): factor out the 2 operations (Detach + hash_remove) here since we'll be calling it in a couple places. (binding_destroy): this should delete value, not call ValueFree. (FrameworkElement::SetBindingExpression): call ClearBindingExpression if there's a current one, and don't ref the expression. Value will hold one. (FrameworkElement::ClearValue): a couple of changes. 1. Call ClearBindingExpression instead of just removing the binding from the hash (and not detaching it...) 2. don't remove the style value from the style has. 3. instead of looping over all the setters in the style just set the value back to the value in the styles hash. 4. if we're going to be resetting the value to the style, don't notify listeners in UIElement::ClearValue. it'll happen in SetValue. Modified: trunk/moon/src/ChangeLog =================================================================== --- trunk/moon/src/ChangeLog 2008-12-01 21:27:52 UTC (rev 120389) +++ trunk/moon/src/ChangeLog 2008-12-01 21:39:12 UTC (rev 120390) @@ -1,5 +1,30 @@ 2008-12-01 Chris Toshok + * frameworkelement.h: add decl for ClearBindingExpression. + + * frameworkelement.cpp (FrameworkElement::ClearBindingExpression): + factor out the 2 operations (Detach + hash_remove) here since + we'll be calling it in a couple places. + (binding_destroy): this should delete value, not call ValueFree. + (FrameworkElement::SetBindingExpression): call + ClearBindingExpression if there's a current one, and don't ref the + expression. Value will hold one. + (FrameworkElement::ClearValue): a couple of changes. + + 1. Call ClearBindingExpression instead of just removing the + binding from the hash (and not detaching it...) + + 2. don't remove the style value from the style has. + + 3. instead of looping over all the setters in the style just set + the value back to the value in the styles hash. + + 4. if we're going to be resetting the value to the style, don't + notify listeners in UIElement::ClearValue. it'll happen in + SetValue. + +2008-12-01 Chris Toshok + * template.cpp, template.h: when copying the tree over, register the template element names to their instantiated counterparts. and build up a NameScope object as we go. Modified: trunk/moon/src/frameworkelement.cpp =================================================================== --- trunk/moon/src/frameworkelement.cpp 2008-12-01 21:27:52 UTC (rev 120389) +++ trunk/moon/src/frameworkelement.cpp 2008-12-01 21:39:12 UTC (rev 120390) @@ -27,7 +27,7 @@ static void binding_destroy (gpointer value) { - ((Value *) value)->FreeValue (); + delete ((Value *) value); } #endif @@ -96,18 +96,14 @@ BindingExpressionBase *cur_expr = GetBindingExpression (property); - if (cur_expr) { - cur_expr->DetachListener (FrameworkElement::bound_property_changed); - ((Value *)g_hash_table_lookup (bindings, property))->FreeValue (); - g_hash_table_remove (bindings, property); - } + if (cur_expr) + ClearBindingExpression (property, cur_expr); if (expr) { expr->AttachListener (FrameworkElement::bound_property_changed, expr); g_hash_table_insert (bindings, property, new Value (expr)); expr->SetTargetProperty (property); expr->SetTarget (this); - expr->ref (); } #endif } @@ -124,22 +120,30 @@ } void +FrameworkElement::ClearBindingExpression (DependencyProperty *property, BindingExpressionBase *expr) +{ + expr->DetachListener (FrameworkElement::bound_property_changed); + g_hash_table_remove (bindings, property); +} + +void FrameworkElement::ClearValue (DependencyProperty *property, bool notify_listeners) { - Value *value = (Value *) g_hash_table_lookup (bindings, property); - if (value) { - g_hash_table_remove (bindings, property); - value->FreeValue (); - } - if (g_hash_table_lookup (styles, property)) - g_hash_table_remove (styles, property); +#if SL_2_0 + BindingExpressionBase *cur_expr = GetBindingExpression (property); + if (cur_expr) + ClearBindingExpression (property, cur_expr); + Value *style_value = (Value*)g_hash_table_lookup (styles, property); + + notify_listeners = notify_listeners && !style_value; +#endif + UIElement::ClearValue (property, notify_listeners); #if SL_2_0 - Value *style = GetValue (FrameworkElement::StyleProperty); - if (style) - UpdateFromStyle (style->AsStyle ()); + if (style_value) + SetValue (property, style_value); #endif } Modified: trunk/moon/src/frameworkelement.h =================================================================== --- trunk/moon/src/frameworkelement.h 2008-12-01 21:27:52 UTC (rev 120389) +++ trunk/moon/src/frameworkelement.h 2008-12-01 21:39:12 UTC (rev 120390) @@ -154,6 +154,7 @@ // Methods for accessing a binding expression on a property void SetBindingExpression (DependencyProperty *property, BindingExpressionBase *expr); BindingExpressionBase *GetBindingExpression (DependencyProperty *property); + void ClearBindingExpression (DependencyProperty *property, BindingExpressionBase *expr); void BoundPropertyChanged (DependencyObject *sender, PropertyChangedEventArgs *args, BindingExpressionBase *expr); static void bound_property_changed (DependencyObject *sender, PropertyChangedEventArgs *args, gpointer user_data); From mono-patches-list at lists.ximian.com Mon Dec 1 16:44:33 2008 From: mono-patches-list at lists.ximian.com (Zoltan Varga (vargaz AT gmail.com)) Date: Mon, 1 Dec 2008 16:44:33 -0500 (EST) Subject: [Mono-patches] r120391 - trunk/mono/mono/mini Message-ID: <20081201214433.947179472C@mono-cvs.ximian.com> Author: zoltan Date: 2008-12-01 16:44:33 -0500 (Mon, 01 Dec 2008) New Revision: 120391 Modified: trunk/mono/mono/mini/ChangeLog trunk/mono/mono/mini/genmdesc.c trunk/mono/mono/mini/genmdesc.pl trunk/mono/mono/mini/mini.h Log: 2008-12-01 Zoltan Varga * genmdesc.c genmdesc.pl mini.h: Don't put the CEE_ opcodes into the cpu description tables, they can't occur in cpu-.md. Modified: trunk/mono/mono/mini/ChangeLog =================================================================== --- trunk/mono/mono/mini/ChangeLog 2008-12-01 21:39:12 UTC (rev 120390) +++ trunk/mono/mono/mini/ChangeLog 2008-12-01 21:44:33 UTC (rev 120391) @@ -1,5 +1,8 @@ 2008-12-01 Zoltan Varga + * genmdesc.c genmdesc.pl mini.h: Don't put the CEE_ opcodes into the + cpu description tables, they can't occur in cpu-.md. + * method-to-ir.c (mono_method_to_ir): Set the type of the value pushed on the stack in CEE_LDFLDA. Fixes #450542. Modified: trunk/mono/mono/mini/genmdesc.c =================================================================== --- trunk/mono/mono/mini/genmdesc.c 2008-12-01 21:39:12 UTC (rev 120390) +++ trunk/mono/mono/mini/genmdesc.c 2008-12-01 21:44:33 UTC (rev 120391) @@ -119,14 +119,6 @@ table = g_hash_table_new (g_str_hash, g_str_equal); opcodes = g_new0 (OpDesc, OP_LAST); -#ifndef MONO_ARCH_ENABLE_NORMALIZE_OPCODES - for (i = 0; i < MONO_CEE_LAST; ++i) { - desc = opcodes + i; - desc->num = i; - desc->name = mono_inst_name (i); - g_hash_table_insert (table, (char *)desc->name, desc); - } -#endif for (i = OP_LOAD; i < OP_LAST; ++i) { desc = opcodes + i; desc->num = i; @@ -163,7 +155,7 @@ idx = 1; g_string_append_printf (idx_array, "const guint16 %s_idx [] = {\n", name); - for (i = 0; i < OP_LAST; ++i) { + for (i = OP_LOAD; i < OP_LAST; ++i) { desc = opcodes + i; if (!desc->desc) g_string_append_printf (idx_array, "\t0,\t/* %s */\n", desc->name ? desc->name : ""); Modified: trunk/mono/mono/mini/genmdesc.pl =================================================================== --- trunk/mono/mono/mini/genmdesc.pl 2008-12-01 21:39:12 UTC (rev 120390) +++ trunk/mono/mono/mini/genmdesc.pl 2008-12-01 21:44:33 UTC (rev 120391) @@ -27,15 +27,6 @@ my $i = 0; my $arch_found = 0; - open (OPS, "$opcodes_def") || die "Cannot open $opcodes_def: $!"; - while () { - next unless /OPDEF\s*\(\s*(\S+?)\s*,\s*"(.*?)"/; - my ($sym, $name) = ($1, $2); - push @opcodes, [$sym, $name]; - $table{$name} = {num => $i, name => $name}; - $i++; - } - close (OPS); my $cpp = $ENV{"CPP"}; $cpp = "cpp" unless defined $cpp; $cpp .= " -undef "; Modified: trunk/mono/mono/mini/mini.h =================================================================== --- trunk/mono/mono/mini/mini.h 2008-12-01 21:39:12 UTC (rev 120390) +++ trunk/mono/mono/mini/mini.h 2008-12-01 21:44:33 UTC (rev 120391) @@ -1039,7 +1039,7 @@ #define MONO_ARCH_CPU_SPEC_IDX_COMBINE(a) a ## _idx #define MONO_ARCH_CPU_SPEC_IDX(a) MONO_ARCH_CPU_SPEC_IDX_COMBINE(a) extern const guint16 MONO_ARCH_CPU_SPEC_IDX(MONO_ARCH_CPU_SPEC) [] MONO_INTERNAL; -#define ins_get_spec(op) ((const char*)&MONO_ARCH_CPU_SPEC + MONO_ARCH_CPU_SPEC_IDX(MONO_ARCH_CPU_SPEC)[(op)]) +#define ins_get_spec(op) ((const char*)&MONO_ARCH_CPU_SPEC + MONO_ARCH_CPU_SPEC_IDX(MONO_ARCH_CPU_SPEC)[(op) - OP_LOAD]) enum { MONO_COMP_DOM = 1, From mono-patches-list at lists.ximian.com Mon Dec 1 16:45:05 2008 From: mono-patches-list at lists.ximian.com (Rusty Howell (rhowell@novell.com)) Date: Mon, 1 Dec 2008 16:45:05 -0500 (EST) Subject: [Mono-patches] r120392 - branches/moon-1-0 Message-ID: <20081201214505.D8FAA9472C@mono-cvs.ximian.com> Author: rhowell Date: 2008-12-01 16:45:05 -0500 (Mon, 01 Dec 2008) New Revision: 120392 Modified: branches/moon-1-0/ChangeLog Log: * Retagging for Beta 1 Modified: branches/moon-1-0/ChangeLog =================================================================== --- branches/moon-1-0/ChangeLog 2008-12-01 21:44:33 UTC (rev 120391) +++ branches/moon-1-0/ChangeLog 2008-12-01 21:45:05 UTC (rev 120392) @@ -1,3 +1,6 @@ +2008-12-1 Rusty Howell + * Retag for 1.0b1 + 2008-11-19 Geoff Norton * configure.ac: Don't link our plugin against unnecessary things. From mono-patches-list at lists.ximian.com Mon Dec 1 16:46:36 2008 From: mono-patches-list at lists.ximian.com (Zoltan Varga (vargaz AT gmail.com)) Date: Mon, 1 Dec 2008 16:46:36 -0500 (EST) Subject: [Mono-patches] r120393 - trunk/mono/mono/mini Message-ID: <20081201214636.818D29472C@mono-cvs.ximian.com> Author: zoltan Date: 2008-12-01 16:46:35 -0500 (Mon, 01 Dec 2008) New Revision: 120393 Modified: trunk/mono/mono/mini/ChangeLog trunk/mono/mono/mini/mini-amd64.h trunk/mono/mono/mini/mini-arm.h trunk/mono/mono/mini/mini-ia64.h trunk/mono/mono/mini/mini-mips.h trunk/mono/mono/mini/mini-ppc.h trunk/mono/mono/mini/mini-ppc64.h trunk/mono/mono/mini/mini-s390.h trunk/mono/mono/mini/mini-s390x.h trunk/mono/mono/mini/mini-sparc.h trunk/mono/mono/mini/mini-x86.h Log: 2008-12-01 Zoltan Varga * mini-.h: Kill MONO_ARCH_HAVE_NORMALIZE_OPCODES define. Modified: trunk/mono/mono/mini/ChangeLog =================================================================== --- trunk/mono/mono/mini/ChangeLog 2008-12-01 21:45:05 UTC (rev 120392) +++ trunk/mono/mono/mini/ChangeLog 2008-12-01 21:46:35 UTC (rev 120393) @@ -1,5 +1,7 @@ 2008-12-01 Zoltan Varga + * mini-.h: Kill MONO_ARCH_HAVE_NORMALIZE_OPCODES define. + * genmdesc.c genmdesc.pl mini.h: Don't put the CEE_ opcodes into the cpu description tables, they can't occur in cpu-.md. Modified: trunk/mono/mono/mini/mini-amd64.h =================================================================== --- trunk/mono/mono/mini/mini-amd64.h 2008-12-01 21:45:05 UTC (rev 120392) +++ trunk/mono/mono/mini/mini-amd64.h 2008-12-01 21:46:35 UTC (rev 120393) @@ -312,7 +312,6 @@ #define MONO_ARCH_COMMON_VTABLE_TRAMPOLINE 1 #define MONO_ARCH_HAVE_CMOV_OPS 1 #define MONO_ARCH_HAVE_NOTIFY_PENDING_EXC 1 -#define MONO_ARCH_ENABLE_NORMALIZE_OPCODES 1 #define MONO_ARCH_ENABLE_GLOBAL_RA 1 #define MONO_ARCH_HAVE_GENERALIZED_IMT_THUNK 1 #if !defined(PLATFORM_WIN32) && !defined(HAVE_MOVING_COLLECTOR) Modified: trunk/mono/mono/mini/mini-arm.h =================================================================== --- trunk/mono/mono/mini/mini-arm.h 2008-12-01 21:45:05 UTC (rev 120392) +++ trunk/mono/mono/mini/mini-arm.h 2008-12-01 21:46:35 UTC (rev 120393) @@ -136,8 +136,6 @@ #define MONO_ARCH_HAVE_CREATE_DELEGATE_TRAMPOLINE #define MONO_ARCH_COMMON_VTABLE_TRAMPOLINE 1 -#define MONO_ARCH_ENABLE_NORMALIZE_OPCODES 1 - #define ARM_NUM_REG_ARGS (ARM_LAST_ARG_REG-ARM_FIRST_ARG_REG+1) #define ARM_NUM_REG_FPARGS 0 Modified: trunk/mono/mono/mini/mini-ia64.h =================================================================== --- trunk/mono/mono/mini/mini-ia64.h 2008-12-01 21:45:05 UTC (rev 120392) +++ trunk/mono/mono/mini/mini-ia64.h 2008-12-01 21:46:35 UTC (rev 120393) @@ -191,6 +191,5 @@ #define MONO_ARCH_HAVE_ATOMIC_EXCHANGE 1 #define MONO_ARCH_HAVE_IMT 1 #define MONO_ARCH_COMMON_VTABLE_TRAMPOLINE 1 -#define MONO_ARCH_ENABLE_NORMALIZE_OPCODES 1 #endif /* __MONO_MINI_IA64_H__ */ Modified: trunk/mono/mono/mini/mini-mips.h =================================================================== --- trunk/mono/mono/mini/mini-mips.h 2008-12-01 21:45:05 UTC (rev 120392) +++ trunk/mono/mono/mini/mini-mips.h 2008-12-01 21:46:35 UTC (rev 120393) @@ -185,7 +185,6 @@ #define MONO_ARCH_USE_SIGACTION #define MONO_ARCH_NEED_DIV_CHECK 1 -#define MONO_ARCH_ENABLE_NORMALIZE_OPCODES 1 #define MIPS_NUM_REG_ARGS (MIPS_LAST_ARG_REG-MIPS_FIRST_ARG_REG+1) #define MIPS_NUM_REG_FPARGS (MIPS_LAST_FPARG_REG-MIPS_FIRST_FPARG_REG+1) Modified: trunk/mono/mono/mini/mini-ppc.h =================================================================== --- trunk/mono/mono/mini/mini-ppc.h 2008-12-01 21:45:05 UTC (rev 120392) +++ trunk/mono/mono/mini/mini-ppc.h 2008-12-01 21:46:35 UTC (rev 120393) @@ -118,7 +118,6 @@ #define MONO_ARCH_VTABLE_REG ppc_r12 #define MONO_ARCH_RGCTX_REG ppc_r12 -#define MONO_ARCH_ENABLE_NORMALIZE_OPCODES 1 #define MONO_ARCH_NO_IOV_CHECK 1 #define MONO_ARCH_HAVE_DECOMPOSE_OPTS 1 Modified: trunk/mono/mono/mini/mini-ppc64.h =================================================================== --- trunk/mono/mono/mini/mini-ppc64.h 2008-12-01 21:45:05 UTC (rev 120392) +++ trunk/mono/mono/mini/mini-ppc64.h 2008-12-01 21:46:35 UTC (rev 120393) @@ -124,7 +124,6 @@ #define MONO_ARCH_VTABLE_REG ppc_r12 #define MONO_ARCH_RGCTX_REG ppc_r12 -#define MONO_ARCH_ENABLE_NORMALIZE_OPCODES 1 #define MONO_ARCH_NO_IOV_CHECK 1 #define MONO_ARCH_HAVE_DECOMPOSE_OPTS 1 #define MONO_ARCH_HAVE_ATOMIC_ADD 1 Modified: trunk/mono/mono/mini/mini-s390.h =================================================================== --- trunk/mono/mono/mini/mini-s390.h 2008-12-01 21:45:05 UTC (rev 120392) +++ trunk/mono/mono/mini/mini-s390.h 2008-12-01 21:46:35 UTC (rev 120393) @@ -54,7 +54,6 @@ #define MONO_ARCH_NEED_DIV_CHECK 1 #define MONO_ARCH_HAVE_ATOMIC_ADD 1 #define MONO_ARCH_HAVE_ATOMIC_EXCHANGE 1 -#define MONO_ARCH_ENABLE_NORMALIZE_OPCODES 1 #define MONO_ARCH_HAVE_DECOMPOSE_OPTS 1 #define MONO_ARCH_HAVE_DECOMPOSE_LONG_OPTS 1 // #define MONO_ARCH_SIGSEGV_ON_ALTSTACK 1 Modified: trunk/mono/mono/mini/mini-s390x.h =================================================================== --- trunk/mono/mono/mini/mini-s390x.h 2008-12-01 21:45:05 UTC (rev 120392) +++ trunk/mono/mono/mini/mini-s390x.h 2008-12-01 21:46:35 UTC (rev 120393) @@ -73,7 +73,6 @@ #define MONO_ARCH_HAVE_ATOMIC_EXCHANGE 1 #define MONO_ARCH_SIGNAL_STACK_SIZE 256*1024 #define MONO_ARCH_HAVE_DECOMPOSE_OPTS 1 -#define MONO_ARCH_ENABLE_NORMALIZE_OPCODES 1 // #define MONO_ARCH_HAVE_THROW_CORLIB_EXCEPTION 1 #define MONO_ARCH_USE_SIGACTION 1 Modified: trunk/mono/mono/mini/mini-sparc.h =================================================================== --- trunk/mono/mono/mini/mini-sparc.h 2008-12-01 21:45:05 UTC (rev 120392) +++ trunk/mono/mono/mini/mini-sparc.h 2008-12-01 21:46:35 UTC (rev 120393) @@ -126,7 +126,6 @@ #define MONO_ARCH_HAVE_IMT 1 #define MONO_ARCH_IMT_REG sparc_g1 #define MONO_ARCH_COMMON_VTABLE_TRAMPOLINE 1 -#define MONO_ARCH_ENABLE_NORMALIZE_OPCODES 1 #ifdef SPARCV9 #define MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS Modified: trunk/mono/mono/mini/mini-x86.h =================================================================== --- trunk/mono/mono/mini/mini-x86.h 2008-12-01 21:45:05 UTC (rev 120392) +++ trunk/mono/mono/mini/mini-x86.h 2008-12-01 21:46:35 UTC (rev 120393) @@ -282,7 +282,6 @@ #define MONO_ARCH_VTABLE_REG X86_EDX #define MONO_ARCH_COMMON_VTABLE_TRAMPOLINE 1 #define MONO_ARCH_RGCTX_REG X86_EDX -#define MONO_ARCH_ENABLE_NORMALIZE_OPCODES 1 #define MONO_ARCH_HAVE_GENERALIZED_IMT_THUNK 1 #if defined(__linux__) && !defined(HAVE_MOVING_COLLECTOR) #define MONO_ARCH_MONITOR_OBJECT_REG X86_EAX From mono-patches-list at lists.ximian.com Mon Dec 1 16:48:31 2008 From: mono-patches-list at lists.ximian.com (Zoltan Varga (vargaz AT gmail.com)) Date: Mon, 1 Dec 2008 16:48:31 -0500 (EST) Subject: [Mono-patches] r120394 - trunk/mono/mono/mini Message-ID: <20081201214831.4CCF09472C@mono-cvs.ximian.com> Author: zoltan Date: 2008-12-01 16:48:30 -0500 (Mon, 01 Dec 2008) New Revision: 120394 Modified: trunk/mono/mono/mini/ChangeLog trunk/mono/mono/mini/aot-compiler.c Log: 2008-12-01 Zoltan Varga * aot-compiler.c: Rename the function names for the binary and asm writers so they can coexist in the same process. Rework the xdebug code to use the asm writer. This avoids the need to call into the runtime to dump the debugging info. Add more debugging info for types. Modified: trunk/mono/mono/mini/ChangeLog =================================================================== --- trunk/mono/mono/mini/ChangeLog 2008-12-01 21:46:35 UTC (rev 120393) +++ trunk/mono/mono/mini/ChangeLog 2008-12-01 21:48:30 UTC (rev 120394) @@ -1,5 +1,10 @@ 2008-12-01 Zoltan Varga + * aot-compiler.c: Rename the function names for the binary and asm writers + so they can coexist in the same process. Rework the xdebug code to use the + asm writer. This avoids the need to call into the runtime to dump the + debugging info. Add more debugging info for types. + * mini-.h: Kill MONO_ARCH_HAVE_NORMALIZE_OPCODES define. * genmdesc.c genmdesc.pl mini.h: Don't put the CEE_ opcodes into the Modified: trunk/mono/mono/mini/aot-compiler.c =================================================================== --- trunk/mono/mono/mini/aot-compiler.c 2008-12-01 21:46:35 UTC (rev 120393) +++ trunk/mono/mono/mini/aot-compiler.c 2008-12-01 21:48:30 UTC (rev 120394) @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -153,7 +154,7 @@ typedef struct _BinReloc BinReloc; typedef struct _BinSection BinSection; -#else +#endif /* emit mode */ enum { @@ -163,8 +164,6 @@ EMIT_LONG }; -#endif - typedef struct MonoAotCompile { MonoImage *image; GPtrArray *methods; @@ -197,19 +196,22 @@ int method_index; char *static_linking_symbol; CRITICAL_SECTION mutex; -#ifdef USE_BIN_WRITER + gboolean use_bin_writer; + /* Bin writer */ BinSymbol *symbols; BinSection *sections; BinSection *cur_section; BinReloc *relocations; GHashTable *labels; int num_relocs; -#else + /* Asm writer */ FILE *fp; char *tmpfname; int mode; /* emit mode */ int col_count; /* bytes emitted per .byte line */ -#endif + /* xdebug */ + GHashTable *class_to_die; + int fde_index, tdie_index; } MonoAotCompile; #define mono_acfg_lock(acfg) EnterCriticalSection (&((acfg)->mutex)) @@ -318,13 +320,13 @@ }; static void -emit_start (MonoAotCompile *acfg) +bin_writer_emit_start (MonoAotCompile *acfg) { acfg->labels = g_hash_table_new (g_str_hash, g_str_equal); } static void -emit_section_change (MonoAotCompile *acfg, const char *section_name, int subsection_index) +bin_writer_emit_section_change (MonoAotCompile *acfg, const char *section_name, int subsection_index) { BinSection *section; @@ -348,7 +350,7 @@ } static void -emit_symbol_inner (MonoAotCompile *acfg, const char *name, const char *end_label, gboolean is_global, gboolean func) +bin_writer_emit_symbol_inner (MonoAotCompile *acfg, const char *name, const char *end_label, gboolean is_global, gboolean func) { BinSymbol *symbol = g_new0 (BinSymbol, 1); symbol->name = g_strdup (name); @@ -364,19 +366,19 @@ } static void -emit_global_inner (MonoAotCompile *acfg, const char *name, gboolean func) +bin_writer_emit_global_inner (MonoAotCompile *acfg, const char *name, gboolean func) { - emit_symbol_inner (acfg, name, NULL, TRUE, func); + bin_writer_emit_symbol_inner (acfg, name, NULL, TRUE, func); } static void -emit_local_symbol (MonoAotCompile *acfg, const char *name, const char *end_label, gboolean func) +bin_writer_emit_local_symbol (MonoAotCompile *acfg, const char *name, const char *end_label, gboolean func) { - emit_symbol_inner (acfg, name, end_label, FALSE, func); + bin_writer_emit_symbol_inner (acfg, name, end_label, FALSE, func); } static void -emit_label (MonoAotCompile *acfg, const char *name) +bin_writer_emit_label (MonoAotCompile *acfg, const char *name) { BinLabel *label = g_new0 (BinLabel, 1); label->name = g_strdup (name); @@ -386,7 +388,7 @@ } static void -emit_ensure_buffer (BinSection *section, int size) +bin_writer_emit_ensure_buffer (BinSection *section, int size) { int new_offset = section->cur_offset + size; if (new_offset >= section->data_len) { @@ -403,37 +405,28 @@ } static void -emit_bytes (MonoAotCompile *acfg, const guint8* buf, int size) +bin_writer_emit_bytes (MonoAotCompile *acfg, const guint8* buf, int size) { - emit_ensure_buffer (acfg->cur_section, size); + bin_writer_emit_ensure_buffer (acfg->cur_section, size); memcpy (acfg->cur_section->data + acfg->cur_section->cur_offset, buf, size); acfg->cur_section->cur_offset += size; } static void -emit_string (MonoAotCompile *acfg, const char *value) +bin_writer_emit_string (MonoAotCompile *acfg, const char *value) { int size = strlen (value) + 1; - emit_bytes (acfg, (const guint8*)value, size); + bin_writer_emit_bytes (acfg, (const guint8*)value, size); } static void -emit_line (MonoAotCompile *acfg) +bin_writer_emit_line (MonoAotCompile *acfg) { /* Nothing to do in binary writer */ } -static void -emit_string_symbol (MonoAotCompile *acfg, const char *name, const char *value) -{ - emit_section_change (acfg, ".text", 1); - emit_global (acfg, name, FALSE); - emit_label (acfg, name); - emit_string (acfg, value); -} - static void -emit_alignment (MonoAotCompile *acfg, int size) +bin_writer_emit_alignment (MonoAotCompile *acfg, int size) { int offset = acfg->cur_section->cur_offset; int add; @@ -441,13 +434,13 @@ offset &= ~(size - 1); add = offset - acfg->cur_section->cur_offset; if (add) { - emit_ensure_buffer (acfg->cur_section, add); + bin_writer_emit_ensure_buffer (acfg->cur_section, add); acfg->cur_section->cur_offset += add; } } static void -emit_pointer_unaligned (MonoAotCompile *acfg, const char *target) +bin_writer_emit_pointer_unaligned (MonoAotCompile *acfg, const char *target) { BinReloc *reloc; @@ -468,17 +461,17 @@ } static void -emit_pointer (MonoAotCompile *acfg, const char *target) +bin_writer_emit_pointer (MonoAotCompile *acfg, const char *target) { - emit_alignment (acfg, sizeof (gpointer)); - emit_pointer_unaligned (acfg, target); + bin_writer_emit_alignment (acfg, sizeof (gpointer)); + bin_writer_emit_pointer_unaligned (acfg, target); } static void -emit_int16 (MonoAotCompile *acfg, int value) +bin_writer_emit_int16 (MonoAotCompile *acfg, int value) { guint8 *data; - emit_ensure_buffer (acfg->cur_section, 2); + bin_writer_emit_ensure_buffer (acfg->cur_section, 2); data = acfg->cur_section->data + acfg->cur_section->cur_offset; acfg->cur_section->cur_offset += 2; /* FIXME: little endian */ @@ -487,10 +480,10 @@ } static void -emit_int32 (MonoAotCompile *acfg, int value) +bin_writer_emit_int32 (MonoAotCompile *acfg, int value) { guint8 *data; - emit_ensure_buffer (acfg->cur_section, 4); + bin_writer_emit_ensure_buffer (acfg->cur_section, 4); data = acfg->cur_section->data + acfg->cur_section->cur_offset; acfg->cur_section->cur_offset += 4; /* FIXME: little endian */ @@ -521,7 +514,7 @@ } static void -emit_symbol_diff (MonoAotCompile *acfg, const char *end, const char* start, int offset) +bin_writer_emit_symbol_diff (MonoAotCompile *acfg, const char *end, const char* start, int offset) { create_reloc (acfg, end, start, offset); acfg->cur_section->cur_offset += 4; @@ -536,16 +529,16 @@ * Do not advance PC. */ static G_GNUC_UNUSED void -emit_reloc (MonoAotCompile *acfg, int reloc_type, const char *symbol, int addend) +bin_writer_emit_reloc (MonoAotCompile *acfg, int reloc_type, const char *symbol, int addend) { BinReloc *reloc = create_reloc (acfg, symbol, ".", addend); reloc->reloc_type = reloc_type; } static void -emit_zero_bytes (MonoAotCompile *acfg, int num) +bin_writer_emit_zero_bytes (MonoAotCompile *acfg, int num) { - emit_ensure_buffer (acfg->cur_section, num); + bin_writer_emit_ensure_buffer (acfg->cur_section, num); acfg->cur_section->cur_offset += num; } @@ -657,11 +650,11 @@ offset &= ~(sheaders [sect->shidx].sh_addralign - 1);*/ offset += (8 - 1); offset &= ~(8 - 1); - emit_ensure_buffer (sect, offset); + bin_writer_emit_ensure_buffer (sect, offset); g_print ("section %s aligned to %d from %d\n", sect->name, offset, sect->cur_offset); sect->cur_offset = offset; - emit_ensure_buffer (sect, add->cur_offset); + bin_writer_emit_ensure_buffer (sect, add->cur_offset); memcpy (sect->data + sect->cur_offset, add->data, add->cur_offset); add->parent = sect; sect->cur_offset += add->cur_offset; @@ -1090,7 +1083,7 @@ #endif /* USE_ELF_RELA */ static int -emit_writeout (MonoAotCompile *acfg) +bin_writer_emit_writeout (MonoAotCompile *acfg) { char *outfile_name, *tmp_outfile_name; FILE *file; @@ -1479,10 +1472,12 @@ #endif /* USE_ELF_WRITER */ -#else +#endif /* USE_BIN_WRITER */ +/* ASM WRITER */ + static void -emit_start (MonoAotCompile *acfg) +asm_writer_emit_start (MonoAotCompile *acfg) { if (acfg->aot_opts.asm_only) { if (acfg->aot_opts.outfile) @@ -1498,7 +1493,7 @@ } static void -emit_unset_mode (MonoAotCompile *acfg) +asm_writer_emit_unset_mode (MonoAotCompile *acfg) { if (acfg->mode == EMIT_NONE) return; @@ -1507,9 +1502,9 @@ } static void -emit_section_change (MonoAotCompile *acfg, const char *section_name, int subsection_index) +asm_writer_emit_section_change (MonoAotCompile *acfg, const char *section_name, int subsection_index) { - emit_unset_mode (acfg); + asm_writer_emit_unset_mode (acfg); #if defined(PLATFORM_WIN32) fprintf (acfg->fp, ".section %s\n", section_name); #elif defined(__MACH__) @@ -1531,7 +1526,7 @@ } static void -emit_symbol_type (MonoAotCompile *acfg, const char *name, gboolean func) +asm_writer_emit_symbol_type (MonoAotCompile *acfg, const char *name, gboolean func) { const char *stype; @@ -1540,7 +1535,7 @@ else stype = "object"; - emit_unset_mode (acfg); + asm_writer_emit_unset_mode (acfg); #if defined(__MACH__) #elif defined(sparc) || defined(__arm__) @@ -1555,9 +1550,9 @@ } static void -emit_global_inner (MonoAotCompile *acfg, const char *name, gboolean func) +asm_writer_emit_global_inner (MonoAotCompile *acfg, const char *name, gboolean func) { - emit_unset_mode (acfg); + asm_writer_emit_unset_mode (acfg); #if (defined(__ppc__) && defined(__MACH__)) || defined(PLATFORM_WIN32) // mach-o always uses a '_' prefix. fprintf (acfg->fp, "\t.globl _%s\n", name); @@ -1565,13 +1560,13 @@ fprintf (acfg->fp, "\t.globl %s\n", name); #endif - emit_symbol_type (acfg, name, func); + asm_writer_emit_symbol_type (acfg, name, func); } static void -emit_label (MonoAotCompile *acfg, const char *name) +asm_writer_emit_label (MonoAotCompile *acfg, const char *name) { - emit_unset_mode (acfg); + asm_writer_emit_unset_mode (acfg); #if (defined(__ppc__) && defined(__MACH__)) || defined(PLATFORM_WIN32) // mach-o always uses a '_' prefix. fprintf (acfg->fp, "_%s:\n", name); @@ -1586,33 +1581,23 @@ } static void -emit_string (MonoAotCompile *acfg, const char *value) +asm_writer_emit_string (MonoAotCompile *acfg, const char *value) { - emit_unset_mode (acfg); + asm_writer_emit_unset_mode (acfg); fprintf (acfg->fp, "\t%s \"%s\"\n", AS_STRING_DIRECTIVE, value); } static void -emit_line (MonoAotCompile *acfg) +asm_writer_emit_line (MonoAotCompile *acfg) { - emit_unset_mode (acfg); + asm_writer_emit_unset_mode (acfg); fprintf (acfg->fp, "\n"); } -static void -emit_string_symbol (MonoAotCompile *acfg, const char *name, const char *value) -{ - emit_unset_mode (acfg); - emit_section_change (acfg, ".text", 1); - emit_global (acfg, name, FALSE); - emit_label (acfg, name); - emit_string (acfg, value); -} - static void -emit_alignment (MonoAotCompile *acfg, int size) +asm_writer_emit_alignment (MonoAotCompile *acfg, int size) { - emit_unset_mode (acfg); + asm_writer_emit_unset_mode (acfg); #if defined(__arm__) fprintf (acfg->fp, "\t.align %d\n", ilog2 (size)); #elif defined(__ppc__) && defined(__MACH__) @@ -1626,10 +1611,10 @@ } static void -emit_pointer (MonoAotCompile *acfg, const char *target) +asm_writer_emit_pointer (MonoAotCompile *acfg, const char *target) { - emit_unset_mode (acfg); - emit_alignment (acfg, sizeof (gpointer)); + asm_writer_emit_unset_mode (acfg); + asm_writer_emit_alignment (acfg, sizeof (gpointer)); #if defined(__x86_64__) fprintf (acfg->fp, "\t.quad %s\n", target ? target : "0"); #elif defined(sparc) && SIZEOF_VOID_P == 8 @@ -1642,7 +1627,7 @@ static char *byte_to_str; static void -emit_bytes (MonoAotCompile *acfg, const guint8* buf, int size) +asm_writer_emit_bytes (MonoAotCompile *acfg, const guint8* buf, int size) { int i; if (acfg->mode != EMIT_BYTE) { @@ -1666,7 +1651,7 @@ } static inline void -emit_int16 (MonoAotCompile *acfg, int value) +asm_writer_emit_int16 (MonoAotCompile *acfg, int value) { if (acfg->mode != EMIT_WORD) { acfg->mode = EMIT_WORD; @@ -1687,7 +1672,7 @@ } static inline void -emit_int32 (MonoAotCompile *acfg, int value) +asm_writer_emit_int32 (MonoAotCompile *acfg, int value) { if (acfg->mode != EMIT_LONG) { acfg->mode = EMIT_LONG; @@ -1701,7 +1686,7 @@ } static void -emit_symbol_diff (MonoAotCompile *acfg, const char *end, const char* start, int offset) +asm_writer_emit_symbol_diff (MonoAotCompile *acfg, const char *end, const char* start, int offset) { if (acfg->mode != EMIT_LONG) { acfg->mode = EMIT_LONG; @@ -1720,9 +1705,9 @@ } static void -emit_zero_bytes (MonoAotCompile *acfg, int num) +asm_writer_emit_zero_bytes (MonoAotCompile *acfg, int num) { - emit_unset_mode (acfg); + asm_writer_emit_unset_mode (acfg); #if defined(__MACH__) fprintf (acfg->fp, "\t.space %d\n", num); #else @@ -1731,7 +1716,7 @@ } static int -emit_writeout (MonoAotCompile *acfg) +asm_writer_emit_writeout (MonoAotCompile *acfg) { char *command, *objfile; char *outfile_name, *tmp_outfile_name; @@ -1831,8 +1816,205 @@ return 0; } -#endif /* ASM_WRITER */ +/* EMIT FUNCTIONS */ +static void emit_start (MonoAotCompile *acfg) +{ +#ifdef USE_BIN_WRITER + if (acfg->use_bin_writer) + bin_writer_emit_start (acfg); + else + asm_writer_emit_start (acfg); +#else + asm_writer_emit_start (acfg); +#endif +} + +static void emit_section_change (MonoAotCompile *acfg, const char *section_name, int subsection_index) +{ +#ifdef USE_BIN_WRITER + if (acfg->use_bin_writer) + bin_writer_emit_section_change (acfg, section_name, subsection_index); + else + asm_writer_emit_section_change (acfg, section_name, subsection_index); +#else + asm_writer_emit_section_change (acfg, section_name, subsection_index); +#endif +} + +static void emit_global_inner (MonoAotCompile *acfg, const char *name, gboolean func) +{ +#ifdef USE_BIN_WRITER + if (acfg->use_bin_writer) + bin_writer_emit_global_inner (acfg, name, func); + else + asm_writer_emit_global_inner (acfg, name, func); +#else + asm_writer_emit_global_inner (acfg, name, func); +#endif +} + +static void emit_local_symbol (MonoAotCompile *acfg, const char *name, const char *end_label, gboolean func) +{ +#ifdef USE_BIN_WRITER + if (acfg->use_bin_writer) + bin_writer_emit_local_symbol (acfg, name, end_label, func); + else + g_assert_not_reached (); + //asm_writer_emit_local_symbol (acfg, name, end_label, func); +#else + g_assert_not_reached (); + //asm_writer_emit_local_symbol (acfg, name, end_label, func); +#endif +} + +static void emit_label (MonoAotCompile *acfg, const char *name) +{ +#ifdef USE_BIN_WRITER + if (acfg->use_bin_writer) + bin_writer_emit_label (acfg, name); + else + asm_writer_emit_label (acfg, name); +#else + asm_writer_emit_label (acfg, name); +#endif +} + +static void emit_bytes (MonoAotCompile *acfg, const guint8* buf, int size) +{ +#ifdef USE_BIN_WRITER + if (acfg->use_bin_writer) + bin_writer_emit_bytes (acfg, buf, size); + else + asm_writer_emit_bytes (acfg, buf, size); +#else + asm_writer_emit_bytes (acfg, buf, size); +#endif +} + +static void emit_string (MonoAotCompile *acfg, const char *value) +{ +#ifdef USE_BIN_WRITER + if (acfg->use_bin_writer) + bin_writer_emit_string (acfg, value); + else + asm_writer_emit_string (acfg, value); +#else + asm_writer_emit_string (acfg, value); +#endif +} + +static void emit_line (MonoAotCompile *acfg) +{ +#ifdef USE_BIN_WRITER + if (acfg->use_bin_writer) + bin_writer_emit_line (acfg); + else + asm_writer_emit_line (acfg); +#else + asm_writer_emit_line (acfg); +#endif +} + +static void emit_alignment (MonoAotCompile *acfg, int size) +{ +#ifdef USE_BIN_WRITER + if (acfg->use_bin_writer) + bin_writer_emit_alignment (acfg, size); + else + asm_writer_emit_alignment (acfg, size); +#else + asm_writer_emit_alignment (acfg, size); +#endif +} + +static void emit_pointer_unaligned (MonoAotCompile *acfg, const char *target) +{ +#ifdef USE_BIN_WRITER + if (acfg->use_bin_writer) + bin_writer_emit_pointer_unaligned (acfg, target); + else + g_assert_not_reached (); + //asm_writer_emit_pointer_unaligned (acfg, target); +#else + g_assert_not_reached (); + //asm_writer_emit_pointer_unaligned (acfg, target); +#endif +} + +static void emit_pointer (MonoAotCompile *acfg, const char *target) +{ +#ifdef USE_BIN_WRITER + if (acfg->use_bin_writer) + bin_writer_emit_pointer (acfg, target); + else + asm_writer_emit_pointer (acfg, target); +#else + asm_writer_emit_pointer (acfg, target); +#endif +} + +static void emit_int16 (MonoAotCompile *acfg, int value) +{ +#ifdef USE_BIN_WRITER + if (acfg->use_bin_writer) + bin_writer_emit_int16 (acfg, value); + else + asm_writer_emit_int16 (acfg, value); +#else + asm_writer_emit_int16 (acfg, value); +#endif +} + +static void emit_int32 (MonoAotCompile *acfg, int value) +{ +#ifdef USE_BIN_WRITER + if (acfg->use_bin_writer) + bin_writer_emit_int32 (acfg, value); + else + asm_writer_emit_int32 (acfg, value); +#else + asm_writer_emit_int32 (acfg, value); +#endif +} + +static void emit_symbol_diff (MonoAotCompile *acfg, const char *end, const char* start, int offset) +{ +#ifdef USE_BIN_WRITER + if (acfg->use_bin_writer) + bin_writer_emit_symbol_diff (acfg, end, start, offset); + else + asm_writer_emit_symbol_diff (acfg, end, start, offset); +#else + asm_writer_emit_symbol_diff (acfg, end, start, offset); +#endif +} + +static void emit_zero_bytes (MonoAotCompile *acfg, int num) +{ +#ifdef USE_BIN_WRITER + if (acfg->use_bin_writer) + bin_writer_emit_zero_bytes (acfg, num); + else + asm_writer_emit_zero_bytes (acfg, num); +#else + asm_writer_emit_zero_bytes (acfg, num); +#endif +} + +static int +emit_writeout (MonoAotCompile *acfg) +{ +#ifdef USE_BIN_WRITER + if (acfg->use_bin_writer) + return bin_writer_emit_writeout (acfg); + else + return asm_writer_emit_writeout (acfg); +#else + return asm_writer_emit_writeout (acfg); +#endif +} + static void emit_global (MonoAotCompile *acfg, const char *name, gboolean func) { @@ -1849,6 +2031,17 @@ emit_bytes (acfg, &val, 1); } +static void +emit_string_symbol (MonoAotCompile *acfg, const char *name, const char *value) +{ + emit_section_change (acfg, ".text", 1); + emit_global (acfg, name, FALSE); + emit_label (acfg, name); + emit_string (acfg, value); +} + +/* AOT COMPILER */ + static guint32 mono_get_field_token (MonoClassField *field) { @@ -2830,7 +3023,7 @@ emit_bytes (acfg, buf, 4); } #else - emit_unset_mode (acfg); + asm_writer_emit_unset_mode (acfg); fprintf (acfg->fp, "bl %s\n", direct_call_target); #endif i += 4 - 1; @@ -4996,40 +5189,6 @@ /* Emitting DWARF debug information */ /*****************************************/ -/* Abbrevations */ -#define AB_COMPILE_UNIT 1 -#define AB_SUBPROGRAM 2 -#define AB_PARAM 3 -#define AB_BASE_TYPE 4 - -static int compile_unit_attr [] = { - DW_AT_producer ,DW_FORM_string, - DW_AT_name ,DW_FORM_string, - DW_AT_comp_dir ,DW_FORM_string, - DW_AT_language ,DW_FORM_data1, - DW_AT_low_pc ,DW_FORM_addr, - DW_AT_high_pc ,DW_FORM_addr, -}; - -static int subprogram_attr [] = { - DW_AT_name , DW_FORM_string, - DW_AT_low_pc , DW_FORM_addr, - DW_AT_high_pc , DW_FORM_addr, - DW_AT_frame_base , DW_FORM_block1 -}; - -static int param_attr [] = { - DW_AT_name, DW_FORM_string, - DW_AT_type, DW_FORM_ref4, - DW_AT_location, DW_FORM_block1 -}; - -static int base_type_attr [] = { - DW_AT_byte_size, DW_FORM_data1, - DW_AT_encoding, DW_FORM_data1, - DW_AT_name, DW_FORM_string -}; - static G_GNUC_UNUSED void emit_uleb128 (MonoAotCompile *acfg, guint32 value) { @@ -5043,11 +5202,11 @@ } static G_GNUC_UNUSED void -emit_sleb128 (MonoAotCompile *acfg, gint32 value) +emit_sleb128 (MonoAotCompile *acfg, gint64 value) { gboolean more = 1; gboolean negative = (value < 0); - guint32 size = 32; + guint32 size = 64; guint8 byte; while (more) { @@ -5071,6 +5230,22 @@ } static G_GNUC_UNUSED void +encode_uleb128 (guint32 value, guint8 *buf, guint8 **endbuf) +{ + guint8 *p = buf; + + do { + guint8 b = value & 0x7f; + value >>= 7; + if (value != 0) /* more bytes to come */ + b |= 0x80; + *p ++ = b; + } while (value); + + *endbuf = p; +} + +static G_GNUC_UNUSED void encode_sleb128 (gint32 value, guint8 *buf, guint8 **endbuf) { gboolean more = 1; @@ -5176,7 +5351,7 @@ } static void -emit_die (MonoAotCompile *acfg, int die_index, char *start_symbol, char *end_symbol, +emit_fde (MonoAotCompile *acfg, int fde_index, char *start_symbol, char *end_symbol, guint8 *code, guint32 code_size, GSList *unwind_ops) { #if defined(__x86_64__) @@ -5187,7 +5362,7 @@ emit_section_change (acfg, ".debug_frame", 0); - sprintf (symbol, ".Ldie%d_end", die_index); + sprintf (symbol, ".Lfde%d_end", fde_index); emit_symbol_diff (acfg, symbol, ".", -4); /* length */ emit_int32 (acfg, 0); /* CIE_pointer */ if (start_symbol) { @@ -5248,11 +5423,82 @@ } emit_alignment (acfg, sizeof (gpointer)); - sprintf (symbol, ".Ldie%d_end", die_index); + sprintf (symbol, ".Lfde%d_end", fde_index); emit_label (acfg, symbol); #endif } +/* Abbrevations */ +#define AB_COMPILE_UNIT 1 +#define AB_SUBPROGRAM 2 +#define AB_PARAM 3 +#define AB_BASE_TYPE 4 +#define AB_STRUCT_TYPE 5 +#define AB_DATA_MEMBER 6 +#define AB_TYPEDEF 7 +#define AB_ENUM_TYPE 8 +#define AB_ENUMERATOR 9 +#define AB_NAMESPACE 10 + +static int compile_unit_attr [] = { + DW_AT_producer ,DW_FORM_string, + DW_AT_name ,DW_FORM_string, + DW_AT_comp_dir ,DW_FORM_string, + DW_AT_language ,DW_FORM_data1, + DW_AT_low_pc ,DW_FORM_addr, + DW_AT_high_pc ,DW_FORM_addr, +}; + +static int subprogram_attr [] = { + DW_AT_name , DW_FORM_string, + DW_AT_low_pc , DW_FORM_addr, + DW_AT_high_pc , DW_FORM_addr, + DW_AT_frame_base , DW_FORM_block1 +}; + +static int param_attr [] = { + DW_AT_name, DW_FORM_string, + DW_AT_type, DW_FORM_ref4, + DW_AT_location, DW_FORM_block1 +}; + +static int base_type_attr [] = { + DW_AT_byte_size, DW_FORM_data1, + DW_AT_encoding, DW_FORM_data1, + DW_AT_name, DW_FORM_string +}; + +static int struct_type_attr [] = { + DW_AT_name, DW_FORM_string, + DW_AT_byte_size, DW_FORM_udata, +}; + +static int data_member_attr [] = { + DW_AT_name, DW_FORM_string, + DW_AT_type, DW_FORM_ref4, + DW_AT_data_member_location, DW_FORM_block1 +}; + +static int typedef_attr [] = { + DW_AT_name, DW_FORM_string, + DW_AT_type, DW_FORM_ref4 +}; + +static int enum_type_attr [] = { + DW_AT_name, DW_FORM_string, + DW_AT_byte_size, DW_FORM_udata, + DW_AT_type, DW_FORM_ref4, +}; + +static int enumerator_attr [] = { + DW_AT_name, DW_FORM_string, + DW_AT_const_value, DW_FORM_sdata, +}; + +static int namespace_attr [] = { + DW_AT_name, DW_FORM_string, +}; + typedef struct DwarfBasicType { const char *die_name, *name; int type; @@ -5274,6 +5520,7 @@ { ".LDIE_BOOLEAN", "boolean", MONO_TYPE_BOOLEAN, 1, DW_ATE_boolean }, { ".LDIE_STRING", "string", MONO_TYPE_STRING, sizeof (gpointer), DW_ATE_address }, { ".LDIE_OBJECT", "object", MONO_TYPE_OBJECT, sizeof (gpointer), DW_ATE_address }, + { ".LDIE_SZARRAY", "object", MONO_TYPE_SZARRAY, sizeof (gpointer), DW_ATE_address }, }; static void @@ -5291,6 +5538,18 @@ param_attr, G_N_ELEMENTS (param_attr)); emit_dwarf_abbrev (acfg, AB_BASE_TYPE, DW_TAG_base_type, FALSE, base_type_attr, G_N_ELEMENTS (base_type_attr)); + emit_dwarf_abbrev (acfg, AB_STRUCT_TYPE, DW_TAG_class_type, TRUE, + struct_type_attr, G_N_ELEMENTS (struct_type_attr)); + emit_dwarf_abbrev (acfg, AB_DATA_MEMBER, DW_TAG_member, FALSE, + data_member_attr, G_N_ELEMENTS (data_member_attr)); + emit_dwarf_abbrev (acfg, AB_TYPEDEF, DW_TAG_typedef, FALSE, + typedef_attr, G_N_ELEMENTS (typedef_attr)); + emit_dwarf_abbrev (acfg, AB_ENUM_TYPE, DW_TAG_enumeration_type, TRUE, + enum_type_attr, G_N_ELEMENTS (enum_type_attr)); + emit_dwarf_abbrev (acfg, AB_ENUMERATOR, DW_TAG_enumerator, FALSE, + enumerator_attr, G_N_ELEMENTS (enumerator_attr)); + emit_dwarf_abbrev (acfg, AB_NAMESPACE, DW_TAG_namespace, TRUE, + namespace_attr, G_N_ELEMENTS (namespace_attr)); emit_byte (acfg, 0); emit_section_change (acfg, ".debug_info", 0); @@ -5302,6 +5561,7 @@ /* Emit this into a separate section so it gets placed at the end */ emit_section_change (acfg, ".debug_info", 1); + emit_int32 (acfg, 0); /* close everything */ emit_label (acfg, ".Ldebug_info_end"); emit_section_change (acfg, ".debug_info", 0); @@ -5314,7 +5574,7 @@ g_free (s); emit_string (acfg, "JITted code"); emit_string (acfg, ""); - emit_byte (acfg, DW_LANG_C89); + emit_byte (acfg, DW_LANG_C); emit_pointer_value (acfg, 0); emit_pointer_value (acfg, 0); @@ -5330,19 +5590,179 @@ emit_cie (acfg); } +/* Returns the local symbol pointing to the emitted debug info */ +static char* +emit_class_dwarf_info (MonoAotCompile *acfg, MonoClass *klass) +{ + char *die; + char *full_name; + gpointer iter; + MonoClassField *field; + const char *fdie; + int k; + gboolean emit_namespace = FALSE; + + // FIXME: Appdomains + if (!acfg->class_to_die) + acfg->class_to_die = g_hash_table_new (NULL, NULL); + + die = g_hash_table_lookup (acfg->class_to_die, klass); + if (die) + return die; + + if (!((klass->byval_arg.type == MONO_TYPE_CLASS) || klass->enumtype)) + return NULL; + + /* + * FIXME: gdb can't handle namespaces in languages it doesn't know about. + */ + /* + if (klass->name_space && klass->name_space [0] != '\0') + emit_namespace = TRUE; + */ + if (emit_namespace) { + emit_uleb128 (acfg, AB_NAMESPACE); + emit_string (acfg, klass->name_space); + } + + full_name = g_strdup_printf ("%s%s%s", klass->name_space, klass->name_space ? "." : "", klass->name); + + die = g_strdup_printf (".LTDIE_%d", acfg->tdie_index); + emit_label (acfg, die); + + if (klass->enumtype) { + int size = mono_class_value_size (mono_class_from_mono_type (klass->enum_basetype), NULL); + + emit_uleb128 (acfg, AB_ENUM_TYPE); + emit_string (acfg, full_name); + emit_uleb128 (acfg, size); + for (k = 0; k < G_N_ELEMENTS (basic_types); ++k) + if (basic_types [k].type == klass->enum_basetype->type) + break; + g_assert (k < G_N_ELEMENTS (basic_types)); + emit_symbol_diff (acfg, basic_types [k].die_name, ".Ldebug_info_start", 0); + + /* Emit enum values */ + iter = NULL; + while ((field = mono_class_get_fields (klass, &iter))) { + const char *p; + int len; + MonoTypeEnum def_type; + + if (strcmp ("value__", mono_field_get_name (field)) == 0) + continue; + if (mono_field_is_deleted (field)) + continue; + + emit_uleb128 (acfg, AB_ENUMERATOR); + emit_string (acfg, mono_field_get_name (field)); + + p = mono_class_get_field_default_value (field, &def_type); + len = mono_metadata_decode_blob_size (p, &p); + switch (klass->enum_basetype->type) { + case MONO_TYPE_U1: + case MONO_TYPE_I1: + emit_sleb128 (acfg, *p); + break; + case MONO_TYPE_CHAR: + case MONO_TYPE_U2: + case MONO_TYPE_I2: + emit_sleb128 (acfg, read16 (p)); + break; + case MONO_TYPE_U4: + case MONO_TYPE_I4: + emit_sleb128 (acfg, read32 (p)); + break; + case MONO_TYPE_U8: + case MONO_TYPE_I8: + emit_sleb128 (acfg, read64 (p)); + break; + default: + g_assert_not_reached (); + } + } + } else { + emit_uleb128 (acfg, AB_STRUCT_TYPE); + emit_string (acfg, full_name); + emit_uleb128 (acfg, klass->instance_size); + + /* Emit fields */ + iter = NULL; + while ((field = mono_class_get_fields (klass, &iter))) { + guint8 buf [128]; + guint8 *p; + + if (field->type->attrs & FIELD_ATTRIBUTE_STATIC) + continue; + + for (k = 0; k < G_N_ELEMENTS (basic_types); ++k) + if (basic_types [k].type == field->type->type) + break; + if (k < G_N_ELEMENTS (basic_types) && field->type->type != MONO_TYPE_SZARRAY && field->type->type != MONO_TYPE_CLASS) { + fdie = basic_types [k].die_name; + + emit_uleb128 (acfg, AB_DATA_MEMBER); + emit_string (acfg, field->name); + emit_symbol_diff (acfg, fdie, ".Ldebug_info_start", 0); + /* location */ + p = buf; + *p ++= DW_OP_plus_uconst; + encode_uleb128 (field->offset, p, &p); + + emit_byte (acfg, p - buf); + emit_bytes (acfg, buf, p - buf); + } + } + } + + /* Type end */ + emit_uleb128 (acfg, 0x0); + + /* Add a typedef, so we can reference the type without a 'struct' in gdb */ + emit_uleb128 (acfg, AB_TYPEDEF); + emit_string (acfg, full_name); + emit_symbol_diff (acfg, die, ".Ldebug_info_start", 0); + + g_free (full_name); + acfg->tdie_index ++; + + + if (emit_namespace) { + /* Namespace end */ + emit_uleb128 (acfg, 0x0); + } + + g_hash_table_insert (acfg->class_to_die, klass, die); + return die; +} + static void emit_method_dwarf_info (MonoAotCompile *acfg, MonoMethod *method, char *start_symbol, char *end_symbol, guint8 *code, guint32 code_size, MonoInst **args, GSList *unwind_info) { char *name; MonoMethodSignature *sig; - char **names; + char **names, **tdies; int i; - static int die_index; emit_section_change (acfg, ".debug_info", 0); + sig = mono_method_signature (method); + + /* Parameter types */ + tdies = g_new0 (char *, sig->param_count + sig->hasthis); + for (i = 0; i < sig->param_count + sig->hasthis; ++i) { + MonoType *t; + + if (i == 0 && sig->hasthis) { + t = &method->klass->this_arg; + } else { + t = sig->params [i - sig->hasthis]; + } + + emit_class_dwarf_info (acfg, mono_class_from_mono_type (t)); + } + /* Subprogram */ - sig = mono_method_signature (method); names = g_new0 (char *, sig->param_count); mono_method_get_param_names (method, (const char **) names); @@ -5367,6 +5787,7 @@ MonoInst *arg = args ? args [i] : NULL; const char *tdie; MonoType *t; + MonoClass *klass; const char *pname; char pname_buf [128]; int j; @@ -5387,6 +5808,7 @@ } emit_string (acfg, pname); /* type */ + klass = mono_class_from_mono_type (t); for (j = 0; j < G_N_ELEMENTS (basic_types); ++j) if (basic_types [j].type == t->type) break; @@ -5398,6 +5820,12 @@ case MONO_TYPE_ARRAY: tdie = ".LDIE_OBJECT"; break; + case MONO_TYPE_VALUETYPE: + if (klass->enumtype) + tdie = emit_class_dwarf_info (acfg, klass); + else + tdie = ".LDIE_I4"; + break; default: tdie = ".LDIE_I4"; break; @@ -5438,9 +5866,8 @@ emit_uleb128 (acfg, 0x0); /* Emit unwind info */ - // FIXME: Allocate labels instead of using die_index - emit_die (acfg, die_index, start_symbol, end_symbol, code, code_size, unwind_info); - die_index ++; + emit_fde (acfg, acfg->fde_index, start_symbol, end_symbol, code, code_size, unwind_info); + acfg->fde_index ++; } static void @@ -5521,6 +5948,9 @@ acfg->mempool = mono_mempool_new (); acfg->extra_methods = g_ptr_array_new (); InitializeCriticalSection (&acfg->mutex); +#ifdef USE_BIN_WRITER + acfg->use_bin_writer = TRUE; +#endif memset (&acfg->aot_opts, 0, sizeof (acfg->aot_opts)); acfg->aot_opts.write_symbols = TRUE; @@ -5714,32 +6144,29 @@ * Support for emitting debug info for JITted code. * * This works as follows: + * - the runtime writes out an xdb.s file containing DWARF debug info. * - the user calls a gdb macro - * - the macro calls mono_xdebug_emit (), which emits a shared library containing - * DWARF debug info. - * - the macro loads this shared library using add-symbol-file. + * - the macro compiles and loads this shared library using add-symbol-file. * * This is based on the xdebug functionality in the Kaffe Java VM. * - * The functionality is in this file so it can reuse the ELF writer. We could - * emit an assembly file instead, which would make calling mono_xdebug_emit () - * unneccesary, but then we would have to emit assembly by hand, since the assembly - * writer is #ifdef-ed out on most platforms. + * We emit assembly code instead of using the ELF writer, so we can emit debug info + * incrementally as each method is JITted, and the debugger doesn't have to call + * into the runtime to emit the shared library, which would cause all kinds of + * complications, like threading issues, and the fact that the ELF writer's + * emit_writeout () function cannot be called more than once. */ /* The recommended gdb macro is: */ /* define xdb - shell rm -f xdb.so - call mono_xdebug_emit () + shell rm -f xdb.so && as --64 -o xdb.o xdb.s && ld -shared -o xdb.so xdb.o add-symbol-file xdb.so 0 end */ static MonoAotCompile *xdebug_acfg; -static gboolean xdebug_emitted; - /* * mono_save_xdebug_info: * @@ -5753,9 +6180,6 @@ // FIXME: Add trampolines too - if (xdebug_emitted) - return; - /* * One time initialization. * This should be called during startup so no need for locking. @@ -5764,8 +6188,11 @@ acfg = g_new0 (MonoAotCompile, 1); acfg->mempool = mono_mempool_new (); InitializeCriticalSection (&acfg->mutex); - acfg->aot_opts.outfile = g_strdup ("xdb.so"); + acfg->aot_opts.asm_only = TRUE; + acfg->aot_opts.outfile = g_strdup ("xdb.s"); + unlink ("xdb.s"); + emit_start (acfg); xdebug_acfg = acfg; @@ -5781,37 +6208,10 @@ mono_acfg_lock (acfg); emit_method_dwarf_info (acfg, method, NULL, NULL, code, code_size, args, unwind_info); + fflush (acfg->fp); mono_acfg_unlock (acfg); } -/* - * mono_xdebug_emit: - * - * Save the debug info for JITted code into a shared object named 'xdb.so'. - * Callable from gdb. - */ -void -mono_xdebug_emit (void) -{ - if (xdebug_acfg == NULL) { - fprintf (stderr, "The runtime is not running in xdebug mode.\n"); - return; - } - - // FIXME: Make this callable multiple times - if (!xdebug_emitted) { - MonoAotCompile *acfg = xdebug_acfg; - - emit_section_change (acfg, ".debug_info", 0); - emit_uleb128 (acfg, 0x0); - emit_line (acfg); - emit_alignment (acfg, 8); - - emit_writeout (xdebug_acfg); - xdebug_emitted = TRUE; - } -} - #else /* AOT disabled */ From mono-patches-list at lists.ximian.com Mon Dec 1 16:52:18 2008 From: mono-patches-list at lists.ximian.com (Andres Aragoneses (aaragoneses@novell.com)) Date: Mon, 1 Dec 2008 16:52:18 -0500 (EST) Subject: [Mono-patches] r120395 - trunk/uia2atk/UiaAtkBridge/Test/AtkTest Message-ID: <20081201215218.2D0059472C@mono-cvs.ximian.com> Author: knocte Date: 2008-12-01 16:52:17 -0500 (Mon, 01 Dec 2008) New Revision: 120395 Modified: trunk/uia2atk/UiaAtkBridge/Test/AtkTest/AtkTests.cs trunk/uia2atk/UiaAtkBridge/Test/AtkTest/ChangeLog Log: * AtkTest/AtkTests.cs: Fix typo. Modified: trunk/uia2atk/UiaAtkBridge/Test/AtkTest/AtkTests.cs =================================================================== --- trunk/uia2atk/UiaAtkBridge/Test/AtkTest/AtkTests.cs 2008-12-01 21:48:30 UTC (rev 120394) +++ trunk/uia2atk/UiaAtkBridge/Test/AtkTest/AtkTests.cs 2008-12-01 21:52:17 UTC (rev 120395) @@ -477,7 +477,7 @@ [Test] public void MaskedTextBoxEntry () { - BasicWidgetType type = BasicWidgetType.TextBoxEntry; + BasicWidgetType type = BasicWidgetType.MaskedTextBoxEntry; Atk.Object accessible = null; accessible = InterfaceText (type, true); Modified: trunk/uia2atk/UiaAtkBridge/Test/AtkTest/ChangeLog =================================================================== --- trunk/uia2atk/UiaAtkBridge/Test/AtkTest/ChangeLog 2008-12-01 21:48:30 UTC (rev 120394) +++ trunk/uia2atk/UiaAtkBridge/Test/AtkTest/ChangeLog 2008-12-01 21:52:17 UTC (rev 120395) @@ -1,3 +1,7 @@ +2008-12-01 Andr?s G. Aragoneses + + * AtkTests.cs: Fix typo. + 2008-11-26 Mike Gorse * AtkTester.cs, AtkTests.cs: Support ToolStripLabel. From mono-patches-list at lists.ximian.com Mon Dec 1 16:55:29 2008 From: mono-patches-list at lists.ximian.com (Rusty Howell (rhowell@novell.com)) Date: Mon, 1 Dec 2008 16:55:29 -0500 (EST) Subject: [Mono-patches] r120396 - tags/moon Message-ID: <20081201215529.A51B59472C@mono-cvs.ximian.com> Author: rhowell Date: 2008-12-01 16:55:29 -0500 (Mon, 01 Dec 2008) New Revision: 120396 Removed: tags/moon/1.0b1/ Log: * deleting old 1.0b1 tag --retagging later From mono-patches-list at lists.ximian.com Mon Dec 1 17:02:10 2008 From: mono-patches-list at lists.ximian.com (Andrew Jorgensen (ajorgensen@novell.com) Date: Mon, 1 Dec 2008 17:02:10 -0500 (EST) Subject: [Mono-patches] r120397 - tags Message-ID: <20081201220210.09B239472C@mono-cvs.ximian.com> Author: ajorg Date: 2008-12-01 17:02:09 -0500 (Mon, 01 Dec 2008) New Revision: 120397 Added: tags/mono-2-2-p1/ Log: tag current 2.2 as p1 Copied: tags/mono-2-2-p1 (from rev 120396, tags/mono-2-2) From mono-patches-list at lists.ximian.com Mon Dec 1 17:03:33 2008 From: mono-patches-list at lists.ximian.com (Sebastien Pouliot (sebastien@ximian.com)) Date: Mon, 1 Dec 2008 17:03:33 -0500 (EST) Subject: [Mono-patches] r120398 - trunk/moon/class/System.Windows/System.Windows Message-ID: <20081201220333.E41BE9472C@mono-cvs.ximian.com> Author: spouliot Date: 2008-12-01 17:03:33 -0500 (Mon, 01 Dec 2008) New Revision: 120398 Modified: trunk/moon/class/System.Windows/System.Windows/ChangeLog trunk/moon/class/System.Windows/System.Windows/DependencyProperty.cs Log: 2008-12-01 Sebastien Pouliot * DependencyProperty.cs: Remove try/catch around custom_property. Metadata.property_changed_callback since throwing exception is valid inside a managed callback. Modified: trunk/moon/class/System.Windows/System.Windows/ChangeLog =================================================================== --- trunk/moon/class/System.Windows/System.Windows/ChangeLog 2008-12-01 22:02:09 UTC (rev 120397) +++ trunk/moon/class/System.Windows/System.Windows/ChangeLog 2008-12-01 22:03:33 UTC (rev 120398) @@ -1,3 +1,9 @@ +2008-12-01 Sebastien Pouliot + + * DependencyProperty.cs: Remove try/catch around custom_property. + Metadata.property_changed_callback since throwing exception is valid + inside a managed callback. + 2008-12-01 Alan McGovern * DependencyProperty.g.cs: ChildProperty should not be exposed Modified: trunk/moon/class/System.Windows/System.Windows/DependencyProperty.cs =================================================================== --- trunk/moon/class/System.Windows/System.Windows/DependencyProperty.cs 2008-12-01 22:02:09 UTC (rev 120397) +++ trunk/moon/class/System.Windows/System.Windows/DependencyProperty.cs 2008-12-01 22:03:33 UTC (rev 120398) @@ -152,15 +152,9 @@ return; // Nothing changed args = new DependencyPropertyChangedEventArgs (old_obj, new_obj, property); - - try { - custom_property.Metadata.property_changed_callback (obj, args); - } - catch (Exception e) { - Console.WriteLine ("Exception calling managed PropertyChangedCallback"); - Console.WriteLine(e); - } - + + // note: since callbacks might throw exceptions but we cannot catch them + custom_property.Metadata.property_changed_callback (obj, args); } internal static DependencyProperty Lookup (Kind declaring_kind, string name, Type property_type) From mono-patches-list at lists.ximian.com Mon Dec 1 17:05:16 2008 From: mono-patches-list at lists.ximian.com (Sebastien Pouliot (sebastien@ximian.com)) Date: Mon, 1 Dec 2008 17:05:16 -0500 (EST) Subject: [Mono-patches] r120399 - trunk/moon/class/System.Windows Message-ID: <20081201220516.1A24C9472C@mono-cvs.ximian.com> Author: spouliot Date: 2008-12-01 17:05:15 -0500 (Mon, 01 Dec 2008) New Revision: 120399 Modified: trunk/moon/class/System.Windows/ChangeLog trunk/moon/class/System.Windows/Makefile.am Log: 2008-12-01 Sebastien Pouliot * Makefile.am: We need to compile and link the MS control resources otherwise we're missing (and throwing) when accessing the exception strings. Modified: trunk/moon/class/System.Windows/ChangeLog =================================================================== --- trunk/moon/class/System.Windows/ChangeLog 2008-12-01 22:03:33 UTC (rev 120398) +++ trunk/moon/class/System.Windows/ChangeLog 2008-12-01 22:05:15 UTC (rev 120399) @@ -1,3 +1,9 @@ +2008-12-01 Sebastien Pouliot + + * Makefile.am: We need to compile and link the MS control resources + otherwise we're missing (and throwing) when accessing the exception + strings. + 2008-12-01 Rolf Bjarne Kvinge * System, System/ChangeLog: Deleted empty directory. Modified: trunk/moon/class/System.Windows/Makefile.am =================================================================== --- trunk/moon/class/System.Windows/Makefile.am 2008-12-01 22:03:33 UTC (rev 120398) +++ trunk/moon/class/System.Windows/Makefile.am 2008-12-01 22:05:15 UTC (rev 120399) @@ -414,11 +414,15 @@ System.Windows.Media/ChangeLog \ System.Windows.Shapes/ChangeLog -$(assemblysl): $(system_windows_sources) Makefile $(top_builddir)/class/lib/2.1/Mono.Moonlight.dll - $(SMCS) $(NET_2_1_ASSEMBLY_DEPS) -target:library -out:$@ $(system_windows_sources) -d:NET_2_1 -keyfile:$(srcdir)/../silverlight.pub -delaysign+ +$(MSCONTROLS)/Resource.resources: $(MSCONTROLS)/Src/Resource.resx + resgen2 $(MSCONTROLS)/Src/Resource.resx $(MSCONTROLS)/Data/src/Resource.resx $(MSCONTROLS)/Extended/Src/Resource.resx $(MSCONTROLS)/Resource.resources + +$(assemblysl): $(system_windows_sources) Makefile $(top_builddir)/class/lib/2.1/Mono.Moonlight.dll $(MSCONTROLS)/Resource.resources + $(SMCS) $(NET_2_1_ASSEMBLY_DEPS) -target:library -out:$@ $(system_windows_sources) -d:NET_2_1 -keyfile:$(srcdir)/../silverlight.pub -delaysign+ \ + -resource:$(MSCONTROLS)/Resource.resources,System.Windows.Controls.Resource.resources sn -q -R $@ $(srcdir)/../mono.snk -$(assemblydesktop): $(system_windows_sources) Makefile $(top_builddir)/class/lib/3.0/Mono.Moonlight.dll +$(assemblydesktop): $(system_windows_sources) Makefile $(top_builddir)/class/lib/3.0/Mono.Moonlight.dll $(MSCONTROLS)/Resource.resources $(GMCS) $(NET_3_0_ASSEMBLY_DEPS) -target:library -out:$@ $(system_windows_sources) -keyfile:$(srcdir)/../mono.snk clean-local: From mono-patches-list at lists.ximian.com Mon Dec 1 17:06:53 2008 From: mono-patches-list at lists.ximian.com (Sebastien Pouliot (sebastien@ximian.com)) Date: Mon, 1 Dec 2008 17:06:53 -0500 (EST) Subject: [Mono-patches] r120400 - in trunk/moon/test/2.0/moon-unit: . System.Windows.Controls.Primitives Message-ID: <20081201220653.054779472C@mono-cvs.ximian.com> Author: spouliot Date: 2008-12-01 17:06:52 -0500 (Mon, 01 Dec 2008) New Revision: 120400 Modified: trunk/moon/test/2.0/moon-unit/ChangeLog trunk/moon/test/2.0/moon-unit/System.Windows.Controls.Primitive