[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenonbeta/kdom/ecma
From:       Nikolas Zimmermann <wildfox () kde ! org>
Date:       2004-03-31 22:29:55
Message-ID: 20040331222955.A7AC490AB () office ! kde ! org
[Download RAW message or body]

CVS commit by wildfox: 

Fixing linking & compilation - sorry forgot to commit...


  M +26 -25    DOMLookup.h   1.7
  M +2 -3      Ecma.cc   1.8
  M +1 -1      Ecma.h   1.6
  M +0 -1      GlobalObject.cc   1.6


--- kdenonbeta/kdom/ecma/DOMLookup.h  #1.6:1.7
@@ -219,11 +219,6 @@ namespace KDOM
 
 // Useful macros for dealing with ecma constructors (enum types, for example)
-#define KDOM_IMPLEMENT_CONSTRUCTOR(ClassName) \
-  namespace KDOM { \
-  const ClassInfo ClassName::s_classInfo = { "ClassName", 0, \
                &ClassName::s_hashTable, 0 }; \
-  class ClassName : public KJS::ObjectImp { \
-  public: \
-    ClassName(KJS::ExecState *exec ) : KJS::ObjectImp() {}\
-    KJS::Value get(KJS::ExecState *exec, const KJS::Identifier &propertyName) const; \
{ \ +#define KDOM_IMPLEMENT_CONSTRUCTOR(ClassName, Class) \
+ KJS::Value ClassName::get(KJS::ExecState *, const KJS::Identifier &propertyName, \
                const KJS::ObjectImp *) const { \
                 const KJS::HashEntry *entry = KJS::Lookup::findEntry(&s_hashTable, \
propertyName); \  if(entry) \
@@ -231,23 +226,29 @@ namespace KDOM
                 return KJS::Undefined(); \
         } \
-    bool hasProperty(KJS::ExecState *exec, const KJS::Identifier &propertyName) \
const; { \ + bool ClassName::hasProperty(KJS::ExecState *exec, const KJS::Identifier \
                &propertyName) const { \
                         return KJS::Lookup::findEntry(&s_hashTable, propertyName); \
         } \
-    KJS::Object prototype(KJS::ExecState *exec) const; { \
+ KJS::Object ClassName::prototype(KJS::ExecState *exec) const { \
             if(exec) return exec->interpreter()->builtinObjectPrototype(); \
                 return KJS::Object::dynamicCast(KJS::Null()); \
         } \
-    static const KJS::ClassInfo s_classInfo; \
-    static const struct KJS::HashTable s_hashTable; \
-  }; \
-  KJS::Value getClassName(KJS::ExecState *exec) { \
-        return cacheGlobalBridge<ClassName>(exec, "[[Class.constructor]]"); \
-  } \
-  };
+ const KJS::ClassInfo ClassName::s_classInfo = { Class "Constructor", 0, \
&s_hashTable, 0 }; \ + KJS::Value get##ClassName(KJS::ExecState *exec) { \
+  return KDOM::cacheGlobalBridge<ClassName>(exec, "[[" Class ".constructor]]"); \
+ }
 
 // Just defines the constructor prototype (which will be called by the GlobalObject)
-#define KDOM_DEFINE_CONSTRUCTOR(ClassName, Class) \
+#define KDOM_DEFINE_CONSTRUCTOR(ClassName) \
   namespace KDOM { \
-  KJS::Value getClassName(KJS::ExecState *exec); \
+  class ClassName : public KJS::ObjectImp { \
+  public: \
+    ClassName(KJS::ExecState *exec) : KJS::ObjectImp() {} \
+    KJS::Value get(KJS::ExecState *exec, const KJS::Identifier &propertyName, const \
KJS::ObjectImp *obj) const; \ +    bool hasProperty(KJS::ExecState *exec, const \
KJS::Identifier &propertyName) const; \ +    KJS::Object prototype(KJS::ExecState \
*exec) const; \ +    static const KJS::ClassInfo s_classInfo; \
+    static const struct KJS::HashTable s_hashTable; \
+  }; \
+  KJS::Value get##ClassName(KJS::ExecState *exec); \
   };
 

--- kdenonbeta/kdom/ecma/Ecma.cc  #1.7:1.8
@@ -24,11 +24,10 @@
 #include <qvariant.h>
 
+#include "Attr.h"
 #include "Ecma.h"
 #include "Element.h"
-#include "Attr.h"
 #include "Document.h"
 #include "GlobalObject.h"
 #include "ScriptInterpreter.h"
-//#include "ksvg_ecmaeventlistener.h"
 
 #include "Ecma.lut.h"
@@ -338,5 +337,5 @@ QVariant KDOM::toVariant(KJS::ExecState 
 */
 
-KDOM_IMPLEMENT_CONSTRUCTOR(NodeConstructor)
+KDOM_IMPLEMENT_CONSTRUCTOR(NodeConstructor, "Node")
 
 // vim:ts=4:noet

--- kdenonbeta/kdom/ecma/Ecma.h  #1.5:1.6
@@ -90,5 +90,5 @@ namespace KDOM
 
 // EcmaScript Constructors
-KDOM_DEFINE_CONSTRUCTOR(NodeConstructor, Node)
+KDOM_DEFINE_CONSTRUCTOR(NodeConstructor)
 
 #endif

--- kdenonbeta/kdom/ecma/GlobalObject.cc  #1.5:1.6
@@ -32,5 +32,4 @@
 #include "Helper.h"
 #include "Document.h"
-#include "DOMBridge.h"
 #include "DOMLookup.h"
 #include "GlobalObject.moc"


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic