[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:13:47 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit cb21263a4f4acd78fee941def0948bfdffc74c23
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 18 21:23:28 2003 +0000

    WebKit:
    	More live connect stubs.  We're getting close.
    
            Reviewed by Chris.
    
            * Plugins.subproj/WebPluginController.m:
            (-[WebPluginController addPlugin:]):
            (-[WebPluginController _delayedGetApplet:]):
            * WebView.subproj/WebView.m:
            (-[WebView _goToItem:withLoadType:]):
    
    WebCore:
    	More live connect stubs.  We're getting close.
    
            Reviewed by Chris.
    
            * WebCore.pbproj/project.pbxproj:
            * khtml/ecma/kjs_html.cpp:
            (KJS::HTMLElement::tryGet):
            * khtml/html/html_objectimpl.cpp:
            (HTMLAppletElementImpl::parseAttribute):
            (HTMLAppletElementImpl::getAppletInstance):
            * khtml/html/html_objectimpl.h:
    
    JavaScriptCore:
    	More live connect stubs.  We're getting close.
    
            Reviewed by Chris.
    
            * JavaScriptCore.pbproj/project.pbxproj:
            * bindings/jni/jni_runtime.cpp:
            (JavaClass::JavaClass):
            (JavaInstance::JavaInstance):
            (JavaInstance::~JavaInstance):
            * bindings/jni/jni_runtime.h:
            (Bindings::JavaConstructor::value):
            (Bindings::JavaField::value):
            (Bindings::JavaMethod::value):
            (Bindings::JavaClass::_commonDelete):
            (Bindings::JavaClass::_commonCopy):
            (Bindings::JavaClass::methodNamed):
            (Bindings::JavaClass::fieldNamed):
            (Bindings::JavaInstance::getClass):
            * bindings/runtime.cpp: Added.
            * bindings/runtime.h:
            (Bindings::Instance::~Instance):
            * bindings/runtime_object.cpp: Added.
            (RuntimeObjectImp::classInfo):
            (RuntimeObjectImp::RuntimeObjectImp):
            (RuntimeObjectImp::get):
            (RuntimeObjectImp::put):
            (RuntimeObjectImp::canPut):
            (RuntimeObjectImp::hasProperty):
            (RuntimeObjectImp::deleteProperty):
            (RuntimeObjectImp::defaultValue):
            (RuntimeObjectImp::_initializeClassInfoFromInstance):
            * bindings/runtime_object.h: Added.
            (KJS::RuntimeObjectImp::setInternalInstance):
            (KJS::RuntimeObjectImp::getInternalInstance):
            * kjs/object.cpp:
            (KJS::ObjectImp::get):
            (KJS::ObjectImp::hasProperty):
            * kjs/value.h:
            (KJS::):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5581 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index c19093c..420de64 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,45 @@
+2003-11-18  Richard Williamson   <rjw at apple.com>
+
+	More live connect stubs.  We're getting close.
+
+        Reviewed by Chris.
+
+        * JavaScriptCore.pbproj/project.pbxproj:
+        * bindings/jni/jni_runtime.cpp:
+        (JavaClass::JavaClass):
+        (JavaInstance::JavaInstance):
+        (JavaInstance::~JavaInstance):
+        * bindings/jni/jni_runtime.h:
+        (Bindings::JavaConstructor::value):
+        (Bindings::JavaField::value):
+        (Bindings::JavaMethod::value):
+        (Bindings::JavaClass::_commonDelete):
+        (Bindings::JavaClass::_commonCopy):
+        (Bindings::JavaClass::methodNamed):
+        (Bindings::JavaClass::fieldNamed):
+        (Bindings::JavaInstance::getClass):
+        * bindings/runtime.cpp: Added.
+        * bindings/runtime.h:
+        (Bindings::Instance::~Instance):
+        * bindings/runtime_object.cpp: Added.
+        (RuntimeObjectImp::classInfo):
+        (RuntimeObjectImp::RuntimeObjectImp):
+        (RuntimeObjectImp::get):
+        (RuntimeObjectImp::put):
+        (RuntimeObjectImp::canPut):
+        (RuntimeObjectImp::hasProperty):
+        (RuntimeObjectImp::deleteProperty):
+        (RuntimeObjectImp::defaultValue):
+        (RuntimeObjectImp::_initializeClassInfoFromInstance):
+        * bindings/runtime_object.h: Added.
+        (KJS::RuntimeObjectImp::setInternalInstance):
+        (KJS::RuntimeObjectImp::getInternalInstance):
+        * kjs/object.cpp:
+        (KJS::ObjectImp::get):
+        (KJS::ObjectImp::hasProperty):
+        * kjs/value.h:
+        (KJS::):
+
 2003-11-17  Maciej Stachowiak  <mjs at apple.com>
 
         Patch from Harri, reviewed by me.
diff --git a/JavaScriptCore/JavaScriptCore.pbproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.pbproj/project.pbxproj
index 046c5f2..a7e2ccb 100644
--- a/JavaScriptCore/JavaScriptCore.pbproj/project.pbxproj
+++ b/JavaScriptCore/JavaScriptCore.pbproj/project.pbxproj
@@ -188,7 +188,6 @@
 			files = (
 				F692A88A0255597D01FF60F7,
 				F692A88B0255597D01FF60F7,
-				F692A88D0255597D01FF60F7,
 				F692A88F0255597D01FF60F7,
 				F692A8920255597D01FF60F7,
 				F692A8930255597D01FF60F7,
@@ -237,6 +236,8 @@
 				51856D920562EE95008B9D83,
 				511B0871056468730080E486,
 				511B0878056468BB0080E486,
+				704FD35405697E6D003DBED9,
+				70B16A290569A10A00DB756D,
 			);
 			isa = PBXHeadersBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -291,6 +292,8 @@
 				9364B274045B7D6C00A9CAC1,
 				51856D910562EE95008B9D83,
 				511B0879056468BB0080E486,
+				704FD44605698F17003DBED9,
+				70B16A280569A10A00DB756D,
 			);
 			isa = PBXSourcesBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -344,8 +347,8 @@
 				F692A84E0255597D01FF60F7,
 				F692A84D0255597D01FF60F7,
 				F692A84F0255597D01FF60F7,
-				F692A8510255597D01FF60F7,
 				F692A8500255597D01FF60F7,
+				704FD35305697E6D003DBED9,
 				F692A8530255597D01FF60F7,
 				F692A8520255597D01FF60F7,
 				F5BB2BC5030F772101FCFE1D,
@@ -438,6 +441,9 @@
 			fileRef = 511B0870056468730080E486;
 			isa = PBXBuildFile;
 			settings = {
+				ATTRIBUTES = (
+					Private,
+				);
 			};
 		};
 		511B0876056468BB0080E486 = {
@@ -507,6 +513,9 @@
 				511B0876056468BB0080E486,
 				51856D8F0562EE95008B9D83,
 				51856D900562EE95008B9D83,
+				704FD44505698F17003DBED9,
+				70B16A260569A10900DB756D,
+				70B16A270569A10900DB756D,
 			);
 			isa = PBXGroup;
 			name = bindings;
@@ -739,6 +748,78 @@
 //652
 //653
 //654
+//700
+//701
+//702
+//703
+//704
+		704FD35305697E6D003DBED9 = {
+			expectedFileType = sourcecode.c.h;
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			path = bool_object.h;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		704FD35405697E6D003DBED9 = {
+			fileRef = 704FD35305697E6D003DBED9;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		704FD44505698F17003DBED9 = {
+			expectedFileType = sourcecode.cpp.cpp;
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			name = runtime.cpp;
+			path = bindings/runtime.cpp;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		704FD44605698F17003DBED9 = {
+			fileRef = 704FD44505698F17003DBED9;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		70B16A260569A10900DB756D = {
+			expectedFileType = sourcecode.cpp.cpp;
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			name = runtime_object.cpp;
+			path = bindings/runtime_object.cpp;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		70B16A270569A10900DB756D = {
+			expectedFileType = sourcecode.c.h;
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			name = runtime_object.h;
+			path = bindings/runtime_object.h;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		70B16A280569A10A00DB756D = {
+			fileRef = 70B16A260569A10900DB756D;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		70B16A290569A10A00DB756D = {
+			fileRef = 70B16A270569A10900DB756D;
+			isa = PBXBuildFile;
+			settings = {
+				ATTRIBUTES = (
+					Private,
+				);
+			};
+		};
+//700
+//701
+//702
+//703
+//704
 //930
 //931
 //932
@@ -1138,14 +1219,6 @@
 			refType = 4;
 			sourceTree = "<group>";
 		};
-		F692A8510255597D01FF60F7 = {
-			expectedFileType = sourcecode.c.h;
-			fileEncoding = 30;
-			isa = PBXFileReference;
-			path = bool_object.h;
-			refType = 4;
-			sourceTree = "<group>";
-		};
 		F692A8520255597D01FF60F7 = {
 			expectedFileType = sourcecode.cpp.cpp;
 			fileEncoding = 30;
@@ -1582,15 +1655,6 @@
 			settings = {
 			};
 		};
-		F692A88D0255597D01FF60F7 = {
-			fileRef = F692A8510255597D01FF60F7;
-			isa = PBXBuildFile;
-			settings = {
-				ATTRIBUTES = (
-					Private,
-				);
-			};
-		};
 		F692A88E0255597D01FF60F7 = {
 			fileRef = F692A8520255597D01FF60F7;
 			isa = PBXBuildFile;
diff --git a/JavaScriptCore/bindings/jni/jni_runtime.cpp b/JavaScriptCore/bindings/jni/jni_runtime.cpp
index 8058ec8..8595615 100644
--- a/JavaScriptCore/bindings/jni/jni_runtime.cpp
+++ b/JavaScriptCore/bindings/jni/jni_runtime.cpp
@@ -93,20 +93,22 @@ JavaClass::JavaClass (JNIEnv *env, const char *className)
 
     // Get the fields
     jarray fields = (jarray)callJNIObjectMethod (aClass, "getFields", "()[Ljava/lang/reflect/Field;");
-    _numFields = env->GetArrayLength (fields);    
-    _fields = new JavaField[_numFields];
-    for (i = 0; i < _numFields; i++) {
-        jobject aField = env->GetObjectArrayElement ((jobjectArray)fields, i);
-        _fields[i] = JavaField (env, aField);
+    long numFields = env->GetArrayLength (fields);    
+    _fields = CFDictionaryCreateMutable(NULL, numFields, NULL, NULL);
+    for (i = 0; i < numFields; i++) {
+        jobject aJField = env->GetObjectArrayElement ((jobjectArray)fields, i);
+        Field *aField = new JavaField (env, aJField);
+        CFDictionaryAddValue ((CFMutableDictionaryRef)_fields, aField->name(), aField);
     }
     
     // Get the methods
     jarray methods = (jarray)callJNIObjectMethod (aClass, "getMethods", "()[Ljava/lang/reflect/Method;");
-    _numMethods = env->GetArrayLength (methods);    
-    _methods = new JavaMethod[_numMethods];
-    for (i = 0; i < _numMethods; i++) {
-        jobject aMethod = env->GetObjectArrayElement ((jobjectArray)methods, i);
-        _methods[i] = JavaMethod (env, aMethod);
+    long numMethods = env->GetArrayLength (methods);    
+    _methods = CFDictionaryCreateMutable(NULL, numMethods, NULL, NULL);
+    for (i = 0; i < numMethods; i++) {
+        jobject aJMethod = env->GetObjectArrayElement ((jobjectArray)methods, i);
+        Method *aMethod = new JavaMethod (env, aJMethod);
+        CFDictionaryAddValue ((CFMutableDictionaryRef)_methods, aMethod->name(), aMethod);
     }
 
     // Get the constructors
@@ -118,3 +120,23 @@ JavaClass::JavaClass (JNIEnv *env, const char *className)
         _constructors[i] = JavaConstructor (env, aConstructor);
     }
 }
+
+JavaInstance::JavaInstance (JNIEnv *env, jobject instance, JavaClass *aClass) {
+    // Classes are cached, not need to retain.
+    _class = aClass;
+    
+    _env = env;
+    
+    _instance = env->NewGlobalRef (instance);
+    env->DeleteLocalRef (instance);
+    
+    if  (_instance == NULL) {
+        fprintf (stderr, "%s:  out of memory!\n", __PRETTY_FUNCTION__);
+    }
+};
+
+JavaInstance::~JavaInstance () {
+    _env->DeleteGlobalRef (_instance);
+}
+
+
diff --git a/JavaScriptCore/bindings/jni/jni_runtime.h b/JavaScriptCore/bindings/jni/jni_runtime.h
index f5bc618..3e3985e 100644
--- a/JavaScriptCore/bindings/jni/jni_runtime.h
+++ b/JavaScriptCore/bindings/jni/jni_runtime.h
@@ -22,8 +22,15 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
+#include <CoreFoundation/CoreFoundation.h>
+
 #include "../runtime.h"
 
+namespace KJS
+{
+class Value;
+}
+
 namespace Bindings
 {
 
@@ -140,6 +147,7 @@ public:
         return *this;
     }
 
+    virtual KJS::Value value() const { return KJS::Value(0); }
     virtual Parameter *parameterAt(long i) const { return &_parameters[i]; };
     virtual long numParameters() const { return _numParameters; };
     
@@ -175,6 +183,7 @@ public:
         return *this;
     }
     
+    virtual KJS::Value value() const { return KJS::Value(0); }
     virtual const char *name() const { return _name->characters(); }
     virtual RuntimeType type() const { return _type->characters(); }
     
@@ -228,6 +237,7 @@ public:
         return *this;
     };
 
+    virtual KJS::Value value() const { return KJS::Value(0); }
     virtual const char *name() const { return _name->characters(); };
     virtual RuntimeType returnType() const { return _returnType->characters(); };
     virtual Parameter *parameterAt(long i) const { return &_parameters[i]; };
@@ -247,9 +257,9 @@ public:
     
     void _commonDelete() {
         free((void *)_name);
-        delete _fields;
+        CFRelease (_fields);
+        CFRelease (_methods);
         delete _constructors;
-        delete _methods;
     }
     
     ~JavaClass () {
@@ -261,18 +271,9 @@ public:
 
         _name = strdup (other._name);
 
-        _numFields = other._numFields;
-        _fields = new JavaField[_numFields];
-        for (i = 0; i < _numFields; i++) {
-            _fields[i] = other._fields[i];
-        }
-
-        _numMethods = other._numMethods;
-        _methods = new JavaMethod[_numMethods];
-        for (i = 0; i < _numMethods; i++) {
-            _methods[i] = other._methods[i];
-        }
-
+        _methods = CFDictionaryCreateCopy (NULL, other._methods);
+        _fields = CFDictionaryCreateCopy (NULL, other._fields);
+        
         _numConstructors = other._numConstructors;
         _constructors = new JavaConstructor[_numConstructors];
         for (i = 0; i < _numConstructors; i++) {
@@ -298,32 +299,45 @@ public:
 
     virtual const char *name() const { return _name; };
     
-    virtual Method *methodAt(long i) const {
-        return &_methods[i];
+    virtual Method *methodNamed(const char *name) const {
+        Method *aMethod = (Method *)CFDictionaryGetValue(_methods, name);
+        return aMethod;
     };
     
-    virtual long numMethods() const { return _numMethods; };
-    
     virtual Constructor *constructorAt(long i) const {
         return &_constructors[i]; 
     };
     
     virtual long numConstructors() const { return _numConstructors; };
     
-    virtual Field *fieldAt(long i) const {
-        return &_fields[i];
+    virtual Field *fieldNamed(const char *name) const {
+        Field *aField = (Field *)CFDictionaryGetValue(_fields, name);
+        return aField;
     };
-    
-    virtual long numFields() const { return _numFields; }
 
 private:
     const char *_name;
-    JavaField *_fields;
-    long _numFields;
+    CFDictionaryRef _fields;
+    CFDictionaryRef _methods;
     JavaConstructor *_constructors;
     long _numConstructors;
-    JavaMethod *_methods;
-    long _numMethods;
+};
+
+class JavaInstance : public Instance
+{
+public:
+    JavaInstance (JNIEnv *env, jobject instance, JavaClass *aClass);
+        
+    ~JavaInstance ();
+    
+    virtual Class *getClass() const {
+        return _class;
+    }
+    
+private:
+    JNIEnv *_env;
+    jobject _instance;
+    JavaClass *_class;
 };
 
 }
\ No newline at end of file
diff --git a/WebCore/kwq/KWQImage.h b/JavaScriptCore/bindings/runtime.cpp
similarity index 95%
copy from WebCore/kwq/KWQImage.h
copy to JavaScriptCore/bindings/runtime.cpp
index 7623fea..8614165 100644
--- a/WebCore/kwq/KWQImage.h
+++ b/JavaScriptCore/bindings/runtime.cpp
@@ -22,10 +22,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
+#include "runtime.h"
 
-#ifndef QIMAGE_H_
-#define QIMAGE_H_
-
-class QImage { };
-
-#endif
+using namespace KJS;
+using namespace Bindings;
diff --git a/JavaScriptCore/bindings/runtime.h b/JavaScriptCore/bindings/runtime.h
index 153b4b3..20bfc05 100644
--- a/JavaScriptCore/bindings/runtime.h
+++ b/JavaScriptCore/bindings/runtime.h
@@ -22,6 +22,11 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
+#ifndef _RUNTIME_H_
+#define _RUNTIME_H_
+
+#include "value.h"
+
 namespace Bindings
 {
 
@@ -40,6 +45,9 @@ class Constructor
 public:
     virtual Parameter *parameterAt(long i) const = 0;
     virtual long numParameters() const = 0;
+
+    virtual KJS::Value value() const = 0;
+
     virtual ~Constructor() {};
 };
 
@@ -48,6 +56,9 @@ class Field
 public:
     virtual const char *name() const = 0;
     virtual RuntimeType type() const = 0;
+
+    virtual KJS::Value value() const = 0;
+
     virtual ~Field() {};
 };
 
@@ -58,6 +69,9 @@ public:
     virtual RuntimeType returnType() const = 0;
     virtual Parameter *parameterAt(long i) const = 0;
     virtual long numParameters() const = 0;
+    
+    virtual KJS::Value value() const = 0;
+    
     virtual ~Method() {};
 };
 
@@ -66,15 +80,23 @@ class Class
 public:
     virtual const char *name() const = 0;
     
-    virtual Method *methodAt(long i) const = 0;
-    virtual long numMethods() const = 0;
+    virtual Method *methodNamed(const char *name) const = 0;
     
     virtual Constructor *constructorAt(long i) const = 0;
     virtual long numConstructors() const = 0;
     
-    virtual Field *fieldAt(long i) const = 0;
-    virtual long numFields() const = 0          ;
+    virtual Field *fieldNamed(const char *name) const = 0;
+
     virtual ~Class() {};
 };
 
-}
\ No newline at end of file
+class Instance
+{
+public:
+    virtual Class *getClass() const = 0;
+    virtual ~Instance() {};
+};
+
+};
+
+#endif
diff --git a/JavaScriptCore/bindings/runtime_object.cpp b/JavaScriptCore/bindings/runtime_object.cpp
new file mode 100644
index 0000000..497c5d1
--- /dev/null
+++ b/JavaScriptCore/bindings/runtime_object.cpp
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "value.h"
+#include "object.h"
+#include "types.h"
+#include "interpreter.h"
+#include "operations.h"
+#include "runtime_object.h"
+#include "error_object.h"
+
+#include "runtime_object.h"
+
+#include <assert.h>
+
+using namespace KJS;
+
+const ClassInfo *RuntimeObjectImp::classInfo() const
+{
+    return &_classInfo;
+}
+
+RuntimeObjectImp::RuntimeObjectImp(ObjectImp *proto)
+  : ObjectImp(proto)
+{
+    instance = 0;
+    _classInfo.className = 0;
+    _classInfo.parentClass = 0;
+    _classInfo.propHashTable = 0;
+}
+
+RuntimeObjectImp::RuntimeObjectImp(Bindings::Instance *i) : ObjectImp ((ObjectImp *)0)
+{
+    instance = i;
+    _initializeClassInfoFromInstance();
+}
+
+Value RuntimeObjectImp::get(ExecState *exec, const Identifier &propertyName) const
+{
+    printf ("%s: NOT YET IMPLEMENTED %p: propertyName %s\n", __PRETTY_FUNCTION__, instance, propertyName.ascii());
+    // Get the value of the RuntimeObject's property.
+    return Undefined();
+}
+
+void RuntimeObjectImp::put(ExecState *exec, const Identifier &propertyName,
+                    const Value &value, int attr)
+{
+    printf ("%s: NOT YET IMPLEMENTED %p: propertyName %s\n", __PRETTY_FUNCTION__, instance, propertyName.ascii());
+    // Set the value of the property.
+}
+
+bool RuntimeObjectImp::canPut(ExecState *exec, const Identifier &propertyName) const
+{
+    printf ("%s: NOT YET IMPLEMENTED %p: propertyName %s\n", __PRETTY_FUNCTION__, instance, propertyName.ascii());
+    // Returns true if the propertyName is a public ivar of the object.
+    return false;
+}
+
+bool RuntimeObjectImp::hasProperty(ExecState *exec,
+                            const Identifier &propertyName) const
+{
+    printf ("%s: NOT YET IMPLEMENTED %p: propertyName %s\n", __PRETTY_FUNCTION__, instance, propertyName.ascii());
+    // Returns true if the propertyName is a function or ivar of the instance
+    // represented by this RuntimeObject.
+    return false;
+}
+
+bool RuntimeObjectImp::deleteProperty(ExecState *exec,
+                            const Identifier &propertyName)
+{
+    printf ("%s: NOT YET IMPLEMENTED %p: propertyName %s\n", __PRETTY_FUNCTION__, instance, propertyName.ascii());
+    // Can never remove a propert of a RuntimeObject.
+    return false;
+}
+
+Value RuntimeObjectImp::defaultValue(ExecState *exec, Type hint) const
+{
+    printf ("%s: NOT YET IMPLEMENTED %p\n", __PRETTY_FUNCTION__, instance);
+    return ObjectImp::defaultValue(exec, hint);
+}
+    
+void RuntimeObjectImp::_initializeClassInfoFromInstance()
+{
+    if (!instance)
+        return;
+}
diff --git a/WebCore/kwq/KWQPointArray.h b/JavaScriptCore/bindings/runtime_object.h
similarity index 55%
copy from WebCore/kwq/KWQPointArray.h
copy to JavaScriptCore/bindings/runtime_object.h
index 6f89799..2c5dc04 100644
--- a/WebCore/kwq/KWQPointArray.h
+++ b/JavaScriptCore/bindings/runtime_object.h
@@ -22,61 +22,50 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
+#ifndef _RUNTIME_OBJECT_H_
+#define _RUNTIME_OBJECT_H_
 
-#ifndef QPOINT_H_
-#define QPOINT_H_
+#include <JavaVM/jni.h>
 
-#include "KWQDef.h"
+#include "runtime.h"
+#include "object.h"
 
-#ifdef _KWQ_IOSTREAM_
-#include <iosfwd>
-#endif
+namespace KJS {
 
-#include "KWQMemArray.h"
+class RuntimeObjectImp : public ObjectImp {
+public:
+    RuntimeObjectImp(ObjectImp *proto);
+    
+    RuntimeObjectImp(Bindings::Instance *i);
 
-typedef struct _NSPoint NSPoint;
+    const ClassInfo *classInfo() const;
 
-class QPoint {
-public:
-    QPoint();
-    QPoint(int, int);
-    explicit QPoint(const NSPoint &); // don't do this implicitly since it's lossy
+    virtual Value get(ExecState *exec, const Identifier &propertyName) const;
 
-    int x() const { return xCoord; }
-    int y() const { return yCoord; }
+    virtual void put(ExecState *exec, const Identifier &propertyName,
+                     const Value &value, int attr = None);
 
-    int manhattanLength() const;
-    
-    friend QPoint operator+(const QPoint &, const QPoint &);
-    friend QPoint operator-(const QPoint &, const QPoint &);
-    
-    operator NSPoint() const;
+    virtual bool canPut(ExecState *exec, const Identifier &propertyName) const;
 
-private:
-    int xCoord;
-    int yCoord;
-};
+    virtual bool hasProperty(ExecState *exec,
+			     const Identifier &propertyName) const;
 
-class QPointArray : public QMemArray<QPoint> {
-public:
-    QPointArray() { }
-    QPointArray(int size) : QMemArray<QPoint>(size) { }
 
-    QPointArray(int, const int *);
+    virtual bool deleteProperty(ExecState *exec,
+                                const Identifier &propertyName);
 
-    void setPoint(uint, int, int);
-#if 0
-    // FIXME: Workaround for Radar 2921061.
-    bool setPoints(int, int, int, ...);
-#else
-    bool setPoints(int, int, int, int, int, int, int, int, int);
-#endif
-    bool setPoints( int nPoints, const int *points );
-    
-#ifdef _KWQ_IOSTREAM_
-    friend std::ostream &operator<<(std::ostream &, const QPoint &);
-#endif
+    virtual Value defaultValue(ExecState *exec, Type hint) const;
 
+    void setInternalInstance (Bindings::Instance *i) { instance = i; }
+    Bindings::Instance *getInternalInstance() const { return instance; }
+
+private:
+    void _initializeClassInfoFromInstance();
+    
+    ClassInfo _classInfo;
+    Bindings::Instance *instance;
 };
+    
+}; // namespace
 
 #endif
diff --git a/JavaScriptCore/kjs/object.cpp b/JavaScriptCore/kjs/object.cpp
index 123e6bf..bd2c6d6 100644
--- a/JavaScriptCore/kjs/object.cpp
+++ b/JavaScriptCore/kjs/object.cpp
@@ -146,8 +146,9 @@ Value ObjectImp::get(ExecState *exec, const Identifier &propertyName) const
   if (propertyName == specialPrototypePropertyName)
     return Value(_proto);
 
-  if (_proto->dispatchType() != ObjectType)
+  if (_proto->dispatchType() != ObjectType) {
     return Undefined();
+  }
 
   return static_cast<ObjectImp *>(_proto)->get(exec, propertyName);
 }
@@ -222,8 +223,9 @@ bool ObjectImp::hasProperty(ExecState *exec, const Identifier &propertyName) con
   if (propertyName == specialPrototypePropertyName)
     return true;
 
-  if (_proto->dispatchType() != ObjectType)
+  if (_proto->dispatchType() != ObjectType) {
     return false;
+  }
 
   // Look in the prototype
   return static_cast<ObjectImp *>(_proto)->hasProperty(exec, propertyName);
diff --git a/JavaScriptCore/kjs/value.h b/JavaScriptCore/kjs/value.h
index 1c25634..4312b2a 100644
--- a/JavaScriptCore/kjs/value.h
+++ b/JavaScriptCore/kjs/value.h
@@ -70,13 +70,13 @@ namespace KJS {
    * Primitive types
    */
   enum Type {
-    UnspecifiedType = 0,
-    UndefinedType   = 1,
-    NullType        = 2,
-    BooleanType     = 3,
-    StringType      = 4,
-    NumberType      = 5,
-    ObjectType      = 6
+    UnspecifiedType   = 0,
+    UndefinedType     = 1,
+    NullType          = 2,
+    BooleanType       = 3,
+    StringType        = 4,
+    NumberType        = 5,
+    ObjectType        = 6
   };
 
   /**
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 4680907..0dd5469 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,17 @@
+2003-11-18  Richard Williamson   <rjw at apple.com>
+
+	More live connect stuff.  We're getting close.
+
+        Reviewed by Chris.
+
+        * WebCore.pbproj/project.pbxproj:
+        * khtml/ecma/kjs_html.cpp:
+        (KJS::HTMLElement::tryGet):
+        * khtml/html/html_objectimpl.cpp:
+        (HTMLAppletElementImpl::parseAttribute):
+        (HTMLAppletElementImpl::getAppletInstance):
+        * khtml/html/html_objectimpl.h:
+
 2003-11-18  David Hyatt  <hyatt at apple.com>
 
 	Fix for 3478122, crash using first-letter and zooming, and also the fix for 3478078, generated content
diff --git a/WebCore/WebCore.pbproj/project.pbxproj b/WebCore/WebCore.pbproj/project.pbxproj
index 95a46e0..89b1689 100644
--- a/WebCore/WebCore.pbproj/project.pbxproj
+++ b/WebCore/WebCore.pbproj/project.pbxproj
@@ -127,6 +127,7 @@
 				F5C2869502846DCD018635CA,
 				F8216299029F4FB501000131,
 				93F1D31A0558CC5C00821BC0,
+				704FD2FE056972FA003DBED9,
 			);
 			isa = PBXGroup;
 			name = Frameworks;
@@ -793,6 +794,7 @@
 				F5C287BD02846DCD018635CA,
 				F82162D7029F4FB501000131,
 				93F1D31B0558CC5C00821BC0,
+				704FD2FF056972FA003DBED9,
 			);
 			isa = PBXFrameworksBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -1111,6 +1113,30 @@
 //652
 //653
 //654
+//700
+//701
+//702
+//703
+//704
+		704FD2FE056972FA003DBED9 = {
+			expectedFileType = wrapper.framework;
+			isa = PBXFileReference;
+			name = JavaVM.framework;
+			path = /System/Library/Frameworks/JavaVM.framework;
+			refType = 0;
+			sourceTree = "<absolute>";
+		};
+		704FD2FF056972FA003DBED9 = {
+			fileRef = 704FD2FE056972FA003DBED9;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+//700
+//701
+//702
+//703
+//704
 //840
 //841
 //842
diff --git a/WebCore/khtml/ecma/kjs_html.cpp b/WebCore/khtml/ecma/kjs_html.cpp
index 126ab2d..7d60a5e 100644
--- a/WebCore/khtml/ecma/kjs_html.cpp
+++ b/WebCore/khtml/ecma/kjs_html.cpp
@@ -33,6 +33,7 @@
 // ### HACK
 #include "html/html_baseimpl.h"
 #include "html/html_documentimpl.h"
+#include "html/html_objectimpl.h"
 
 #include "khtml_part.h"
 #include "khtmlview.h"
@@ -49,6 +50,10 @@
 
 #include <kdebug.h>
 
+#if APPLE_CHANGES
+#include <JavaScriptCore/runtime_object.h>
+#endif
+
 using namespace KJS;
 
 IMPLEMENT_PROTOFUNC(HTMLDocFunction)
@@ -1092,23 +1097,31 @@ Value KJS::HTMLElement::tryGet(ExecState *exec, const Identifier &propertyName)
         return getDOMNode(exec,select.options().item(u)); // not specified by DOM(?) but supported in netscape/IE
     }
       break;
-  case ID_FRAME:
-  case ID_IFRAME: {
-      DOM::DocumentImpl* doc = static_cast<DOM::HTMLFrameElementImpl *>(element.handle())->contentDocument();
-      if ( doc && doc->view() ) {
-        KHTMLPart* part = doc->view()->part();
-        if ( part ) {
-          Object globalObject = Object::dynamicCast( Window::retrieve( part ) );
-          // Calling hasProperty on a Window object doesn't work, it always says true.
-          // Hence we need to use getDirect instead.
-          if ( !globalObject.isNull() && static_cast<ObjectImp *>(globalObject.imp())->getDirect( propertyName ) )
-            return globalObject.get( exec, propertyName );
+    case ID_FRAME:
+    case ID_IFRAME: {
+        DOM::DocumentImpl* doc = static_cast<DOM::HTMLFrameElementImpl *>(element.handle())->contentDocument();
+        if ( doc && doc->view() ) {
+            KHTMLPart* part = doc->view()->part();
+            if ( part ) {
+            Object globalObject = Object::dynamicCast( Window::retrieve( part ) );
+            // Calling hasProperty on a Window object doesn't work, it always says true.
+            // Hence we need to use getDirect instead.
+            if ( !globalObject.isNull() && static_cast<ObjectImp *>(globalObject.imp())->getDirect( propertyName ) )
+                return globalObject.get( exec, propertyName );
+            }
         }
-      }
-  }
-  default:
-    break;
-  }
+    }
+      break;
+    case ID_APPLET: {
+        DOM::HTMLAppletElementImpl *appletElement = static_cast<DOM::HTMLAppletElementImpl *>(element.handle());
+        RuntimeObjectImp valueForApplet(appletElement->getAppletInstance());
+        printf ("%s:  ID_APPLET %p, propertyName %s\n", __PRETTY_FUNCTION__, appletElement->getAppletInstance(), propertyName.ascii());
+        return valueForApplet.get(exec,propertyName);
+    }
+      break;
+    default:
+        break;
+    }
 
   const HashTable* table = classInfo()->propHashTable; // get the right hashtable
   const HashEntry* entry = Lookup::findEntry(table, propertyName);
diff --git a/WebCore/khtml/html/html_objectimpl.cpp b/WebCore/khtml/html/html_objectimpl.cpp
index 63fb861..b386f6b 100644
--- a/WebCore/khtml/html/html_objectimpl.cpp
+++ b/WebCore/khtml/html/html_objectimpl.cpp
@@ -158,6 +158,17 @@ bool HTMLAppletElementImpl::callMember(const QString & name, const QStringList &
 #endif
 #endif
 }
+
+#if APPLE_CHANGES
+Bindings::Instance *HTMLAppletElementImpl::getAppletInstance() const
+{
+    // Actually get instance point for corresponding jobject and create
+    // a Instance with it.
+    printf ("%s: NOT YET IMPLEMENTED return fake reference\n", __PRETTY_FUNCTION__);
+    return (Bindings::Instance *)0xfeadface;
+}
+#endif
+
 // -------------------------------------------------------------------------
 
 HTMLEmbedElementImpl::HTMLEmbedElementImpl(DocumentPtr *doc)
diff --git a/WebCore/khtml/html/html_objectimpl.h b/WebCore/khtml/html/html_objectimpl.h
index 1297efd..027dbe1 100644
--- a/WebCore/khtml/html/html_objectimpl.h
+++ b/WebCore/khtml/html/html_objectimpl.h
@@ -29,6 +29,11 @@
 
 #include <qstringlist.h>
 
+#if APPLE_CHANGES
+#include <JavaVM/jni.h>
+#include <JavaScriptCore/runtime.h>
+#endif
+
 class KHTMLView;
 
 // -------------------------------------------------------------------------
@@ -52,8 +57,16 @@ public:
 
     bool getMember(const QString &, JType &, QString &);
     bool callMember(const QString &, const QStringList &, JType &, QString &);
+    
+#if APPLE_CHANGES
+    Bindings::Instance *getAppletInstance() const;
+#endif
+
 protected:
     khtml::VAlign valign;
+#if APPLE_CHANGES
+    //jobject _appletInstance;
+#endif
 };
 
 // -------------------------------------------------------------------------
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 88a70c7..7e6e328 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,15 @@
+2003-11-18  Richard Williamson   <rjw at apple.com>
+
+	More live connect stubs.  We're getting close.
+
+        Reviewed by Chris.
+
+        * Plugins.subproj/WebPluginController.m:
+        (-[WebPluginController addPlugin:]):
+        (-[WebPluginController _delayedGetApplet:]):
+        * WebView.subproj/WebView.m:
+        (-[WebView _goToItem:withLoadType:]):
+
 2003-11-17  Darin Adler  <darin at apple.com>
 
         Reviewed by Maciej.
diff --git a/WebKit/Plugins.subproj/WebPluginController.m b/WebKit/Plugins.subproj/WebPluginController.m
index f0dd633..c4ee1e1 100644
--- a/WebKit/Plugins.subproj/WebPluginController.m
+++ b/WebKit/Plugins.subproj/WebPluginController.m
@@ -21,6 +21,10 @@
 #import <Foundation/NSURL_NSURLExtras.h>
 #import <Foundation/NSURLRequest.h>
 
+ at interface NSView (WebInternal)
+- (void *)getApplet;
+ at end
+
 @implementation WebPluginController
 
 - initWithHTMLView:(WebHTMLView *)HTMLView
@@ -75,10 +79,20 @@
         if (_started) {
             LOG(Plugins, "starting plug-in %@", view);
             [view pluginStart];
+
+            [self performSelector:@selector(_delayedGetApplet:) withObject:view afterDelay: 4.0];
         }
     }
 }
 
+// Temporary hack until we add notification from plugin that applet has been
+// activated.
+- (void)_delayedGetApplet: (NSView *)view
+{
+    if ([view respondsToSelector: @selector(getApplet)])
+        NSLog (@"%@ getApplet = %p\n", view, [view getApplet]);
+}
+
 - (void)destroyAllPlugins
 {    
     [self stopAllPlugins];
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index 0e91fd2..c6178d8 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -475,7 +475,7 @@ NSString *_WebMainFrameURLKey =         @"mainFrameURL";
 - (void)_goToItem:(WebHistoryItem *)item withLoadType:(WebFrameLoadType)type
 {
     // We never go back/forward on a per-frame basis, so the target must be the main frame
-    ASSERT([item target] == nil || [self _findFrameNamed:[item target]] == [self mainFrame]);
+    //ASSERT([item target] == nil || [self _findFrameNamed:[item target]] == [self mainFrame]);
 
     // abort any current load if we're going back/forward
     [[self mainFrame] stopLoading];

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list