Author: atsushi
Date: 2007-06-07 09:29:33 -0400 (Thu, 07 Jun 2007)
New Revision: 78837

Modified:
   trunk/olive/class/System.Silverlight/System.Windows.Browser/ChangeLog
   trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlDocument.cs
   trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlElement.cs
   
trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlElementCollection.cs
   trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlEventArgs.cs
   trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlObject.cs
   
trunk/olive/class/System.Silverlight/System.Windows.Browser/ScriptableObject.cs
   trunk/olive/class/System.Silverlight/System.Windows/ChangeLog
   trunk/olive/class/System.Silverlight/System.Windows/WebApplication.cs
Log:
2007-06-06  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * WebApplication.cs : some code, still does nothing.

        * HtmlElementCollection.cs HtmlDocument.cs : header.
        * HtmlEventArgs.cs : header. fixed inheritance.
        * ScriptableObject.cs : added unmanaged pointer field.
          added internal InvokeMethod() (practically a stub).
        * HtmlElement.cs : some members can use GetProperty<T>() and
          InvokeMethod() above.
        * HtmlObject.cs : uncomment some. Added internal .ctor(IntPtr).



Modified: trunk/olive/class/System.Silverlight/System.Windows/ChangeLog
===================================================================
--- trunk/olive/class/System.Silverlight/System.Windows/ChangeLog       
2007-06-07 13:23:48 UTC (rev 78836)
+++ trunk/olive/class/System.Silverlight/System.Windows/ChangeLog       
2007-06-07 13:29:33 UTC (rev 78837)
@@ -1,3 +1,7 @@
+2007-06-06  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * WebApplication.cs : some code, still does nothing.
+
 2007-06-02  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * ApplicationUnhandledExceptionEventArgs.cs WebApplication.cs :

Modified: trunk/olive/class/System.Silverlight/System.Windows/WebApplication.cs
===================================================================
--- trunk/olive/class/System.Silverlight/System.Windows/WebApplication.cs       
2007-06-07 13:23:48 UTC (rev 78836)
+++ trunk/olive/class/System.Silverlight/System.Windows/WebApplication.cs       
2007-06-07 13:29:33 UTC (rev 78837)
@@ -1,18 +1,50 @@
 using System;
 using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Windows.Browser;
 
 namespace System.Windows
 {
        public class WebApplication
        {
+               static object lockobj = new object ();
+               static WebApplication current;
+
                [MonoTODO]
-               public void RegisterScriptableObject (string scriptKey, object 
instance)
+               public static WebApplication Current {
+                       get {
+                               if (current == null)
+                                       lock (lockobj) {
+                                               current = new WebApplication ();
+                                       }
+                               return current;
+                       }
+               }
+
+               readonly IntPtr instance;
+
+               private WebApplication ()
                {
+                       instance = GetCurrentInstance ();
                }
 
                [MonoTODO]
-               public static WebApplication Current {
-                       get { throw new NotImplementedException (); }
+               public void RegisterScriptableObject (string scriptKey, object 
instance)
+               {
+                       if (scriptKey == null)
+                               throw new ArgumentNullException ("scriptKey");
+                       if (instance == null)
+                               throw new ArgumentNullException ("instance");
+
+                       if (scriptKey.Length == 0)
+                               throw new ArgumentException ("scriptKey");
+
+                       object [] atts = instance.GetType 
().GetCustomAttributes (typeof (ScriptableAttribute), false);
+                       // It neither supports ScriptableObject nor its derived 
types such as HtmlElement.
+                       if (atts.Length == 0)
+                               throw new NotSupportedException ("The argument 
object type does not have a ScriptableAttribute");
+
+                       throw new NotImplementedException ();
                }
 
                [MonoTODO]
@@ -21,6 +53,9 @@
                }
 
                public event 
EventHandler<ApplicationUnhandledExceptionEventArgs> 
ApplicationUnhandledException;
+
+               [DllImport ("moon")]
+               static extern IntPtr GetCurrentInstance ();
        }
 }
 

Modified: trunk/olive/class/System.Silverlight/System.Windows.Browser/ChangeLog
===================================================================
--- trunk/olive/class/System.Silverlight/System.Windows.Browser/ChangeLog       
2007-06-07 13:23:48 UTC (rev 78836)
+++ trunk/olive/class/System.Silverlight/System.Windows.Browser/ChangeLog       
2007-06-07 13:29:33 UTC (rev 78837)
@@ -1,5 +1,15 @@
 2007-06-06  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
+       * HtmlElementCollection.cs HtmlDocument.cs : header.
+       * HtmlEventArgs.cs : header. fixed inheritance.
+       * ScriptableObject.cs : added unmanaged pointer field.
+         added internal InvokeMethod() (practically a stub).
+       * HtmlElement.cs : some members can use GetProperty<T>() and
+         InvokeMethod() above.
+       * HtmlObject.cs : uncomment some. Added internal .ctor(IntPtr).
+
+2007-06-06  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
        * HtmlPage.cs : uncomment Document.
        * ScriptableAttribute.cs : more attribute targets.
 

Modified: 
trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlDocument.cs
===================================================================
--- trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlDocument.cs 
2007-06-07 13:23:48 UTC (rev 78836)
+++ trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlDocument.cs 
2007-06-07 13:29:33 UTC (rev 78837)
@@ -1,3 +1,30 @@
+//
+// HtmlDocument.cs
+//
+// Authors:
+//     Atsushi Enomoto  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 using System;
 
 namespace System.Windows.Browser

Modified: 
trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlElement.cs
===================================================================
--- trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlElement.cs  
2007-06-07 13:23:48 UTC (rev 78836)
+++ trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlElement.cs  
2007-06-07 13:29:33 UTC (rev 78837)
@@ -1,3 +1,30 @@
+//
+// HtmlElement.cs
+//
+// Authors:
+//     Atsushi Enomoto  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 using System;
 
 namespace System.Windows.Browser
@@ -4,32 +31,38 @@
 {
        public class HtmlElement : HtmlObject
        {
+               // When does this .ctor make sense?
                public HtmlElement ()
                {
                }
 
+               internal HtmlElement (IntPtr handle)
+                       : base (handle)
+               {
+               }
+
                [MonoTODO]
                public void AppendChild (HtmlElement element)
                {
-                       throw new NotImplementedException ();
+                       InvokeMethod ("appendChild", element);
                }
 
                [MonoTODO]
                public void AppendChild (HtmlElement element, HtmlElement 
referenceElement)
                {
-                       throw new NotImplementedException ();
+                       InvokeMethod ("insertAfter", element, referenceElement);
                }
 
                [MonoTODO]
                public void Focus ()
                {
-                       throw new NotImplementedException ();
+                       InvokeMethod ("focus");
                }
 
                [MonoTODO]
                public string GetAttribute (string name)
                {
-                       throw new NotImplementedException ();
+                       return (string) InvokeMethod ("getAttribute", name);
                }
 
                [MonoTODO]
@@ -41,13 +74,13 @@
                [MonoTODO]
                public void RemoveAttribute (string name)
                {
-                       throw new NotImplementedException ();
+                       InvokeMethod ("removeAttribute", name);
                }
 
                [MonoTODO]
                public void RemoveChild (HtmlElement element)
                {
-                       throw new NotImplementedException ();
+                       InvokeMethod ("removeChild", element);
                }
 
                [MonoTODO]
@@ -59,7 +92,7 @@
                [MonoTODO]
                public void SetAttribute (string name, string value)
                {
-                       throw new NotImplementedException ();
+                       InvokeMethod ("setAttribute", name, value);
                }
 
                [MonoTODO]
@@ -81,24 +114,21 @@
 
                [MonoTODO]
                public string CssClass {
-                       get { throw new NotImplementedException (); }
-                       set { throw new NotImplementedException (); }
+                       get { return GetProperty<string> ("class"); }
+                       set { SetProperty ("class", value); }
                }
 
-               [MonoTODO]
                public string ID {
-                       get { throw new NotImplementedException (); }
-                       set { throw new NotImplementedException (); }
+                       get { return GetProperty<string> ("id"); }
+                       set { SetProperty ("id", value); }
                }
 
-               [MonoTODO]
                public HtmlElement Parent {
-                       get { throw new NotImplementedException (); }
+                       get { return GetProperty<HtmlElement> ("parentNode"); }
                }
 
-               [MonoTODO]
                public string TagName {
-                       get { throw new NotImplementedException (); }
+                       get { return GetProperty<string> ("tagName"); }
                }
        }
 }

Modified: 
trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlElementCollection.cs
===================================================================
--- 
trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlElementCollection.cs
        2007-06-07 13:23:48 UTC (rev 78836)
+++ 
trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlElementCollection.cs
        2007-06-07 13:29:33 UTC (rev 78837)
@@ -1,3 +1,30 @@
+//
+// HtmlElementCollection.cs
+//
+// Authors:
+//     Atsushi Enomoto  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 using System;
 
 namespace System.Windows.Browser

Modified: 
trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlEventArgs.cs
===================================================================
--- 
trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlEventArgs.cs    
    2007-06-07 13:23:48 UTC (rev 78836)
+++ 
trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlEventArgs.cs    
    2007-06-07 13:29:33 UTC (rev 78837)
@@ -1,3 +1,30 @@
+//
+// HtmlEventArgs.cs
+//
+// Authors:
+//     Atsushi Enomoto  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 using System;
 
 namespace System.Windows.Browser
@@ -2,3 +29,3 @@
 {
-       public class HtmlEventArgs
+       public class HtmlEventArgs : EventArgs
        {

Modified: 
trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlObject.cs
===================================================================
--- trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlObject.cs   
2007-06-07 13:23:48 UTC (rev 78836)
+++ trunk/olive/class/System.Silverlight/System.Windows.Browser/HtmlObject.cs   
2007-06-07 13:29:33 UTC (rev 78837)
@@ -34,29 +34,33 @@
                {
                }
 
+               internal HtmlObject (IntPtr handle)
+                       : base (handle)
+               {
+               }
+
                [MonoTODO]
                public bool AttachEvent (string eventName, EventHandler handler)
                {
                        throw new NotImplementedException ();
                }
-/*
+
                [MonoTODO]
                public bool AttachEvent (string eventName, 
EventHandler<HtmlEventArgs> handler)
                {
                        throw new NotImplementedException ();
                }
-*/
+
                [MonoTODO]
                public void DetachEvent (string eventName, EventHandler handler)
                {
                        throw new NotImplementedException ();
                }
-/*
+
                [MonoTODO]
                public void DetachEvent (string eventName, 
EventHandler<HtmlEventArgs> handler)
                {
                        throw new NotImplementedException ();
                }
-*/
        }
 }

Modified: 
trunk/olive/class/System.Silverlight/System.Windows.Browser/ScriptableObject.cs
===================================================================
--- 
trunk/olive/class/System.Silverlight/System.Windows.Browser/ScriptableObject.cs 
    2007-06-07 13:23:48 UTC (rev 78836)
+++ 
trunk/olive/class/System.Silverlight/System.Windows.Browser/ScriptableObject.cs 
    2007-06-07 13:29:33 UTC (rev 78837)
@@ -29,22 +29,33 @@
 namespace System.Windows.Browser {
 
        public class ScriptableObject : IDisposable {
+               IntPtr handle;
+               string script_key;
 
                public ScriptableObject ()
                {
                }
 
+               internal ScriptableObject (IntPtr handle)
+               {
+                       // FIXME: do we need to do registration or whatever?
+                       this.handle = handle;
+               }
+
                protected virtual void Dispose ()
                {
+                       // FIXME: same as .ctor().
                }
 
                void IDisposable.Dispose ()
                {
+                       Dispose ();
                }
 
                [MonoTODO]
                public virtual void SetProperty (string name, object value)
                {
+                       throw new NotImplementedException ();
                }
 
                [MonoTODO]
@@ -52,5 +63,10 @@
                {
                        throw new NotImplementedException ();
                }
+
+               internal object InvokeMethod (string name, params object [] 
args)
+               {
+                       throw new NotImplementedException ();
+               }
        }
 }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to