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

List:       kde-commits
Subject:    branches/work/khtml-kb-events
From:       Maks Orlovich <maksim () kde ! org>
Date:       2006-01-21 19:00:52
Message-ID: 1137870052.717086.3132.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 500989 by orlovich:

-Implement wrapper code + add missing const = branch now fully builds as is
-Fix a typo
This is pretty much stable now, I think, but someone should test this with gmail or \
something :-)


 M  +17 -3     dom/dom2_events.cpp  
 M  +1 -1      ecma/kjs_events.cpp  
 M  +16 -1     xml/dom2_eventsimpl.h  


--- branches/work/khtml-kb-events/dom/dom2_events.cpp #500988:500989
@@ -526,17 +526,31 @@
         bool canBubbleArg,
         bool cancelableArg,
         const AbstractView &viewArg,
-        long detailArg,
+        long /*detailArg*/,
         const DOMString &outputStringArg,
         unsigned long keyValArg,
         unsigned long virtKeyValArg,
-        bool inputGeneratedArg,
+        bool /*inputGeneratedArg*/,
         bool numPadArg)
 {
     if (!impl)
 	throw DOMException(DOMException::INVALID_STATE_ERR);
 
-    return static_cast<KeyEventBaseImpl*>(impl)->initTextEvent(typeArg, \
canBubbleArg, cancelableArg, viewArg, detailArg, outputStringArg, keyValArg, \
virtKeyValArg, inputGeneratedArg, numPadArg); +    if (impl->isTextInputEvent()) {
+        //Initialize based on the outputStringArg or virtKeyValArg.
+        QString text = outputStringArg.string();
+        if (outputStringArg.length() == 0 && virtKeyValArg) {
+            text += QChar((unsigned short)virtKeyValArg);
+        }
+
+        TextEventImpl* impl = static_cast<TextEventImpl*>(impl);
+        impl->initTextEvent(typeArg, canBubbleArg, cancelableArg, viewArg, text);
+    } else {
+        KeyboardEventImpl* impl = static_cast<KeyboardEventImpl*>(impl);
+        impl->initKeyboardEvent(typeArg, canBubbleArg, cancelableArg, viewArg,
+            keyValArg, virtKeyValArg, 0, numPadArg ?
+                KeyboardEventImpl::DOM_KEY_LOCATION_NUMPAD : \
KeyboardEventImpl::DOM_KEY_LOCATION_STANDARD); +    }
 }
 
 unsigned long TextEvent::keyVal() const
--- branches/work/khtml-kb-events/ecma/kjs_events.cpp #500988:500989
@@ -881,7 +881,7 @@
   DOM_KEY_LOCATION_STANDARD  DOM::KeyboardEventImpl::DOM_KEY_LOCATION_STANDARD \
DontDelete|ReadOnly  DOM_KEY_LOCATION_LEFT      \
DOM::KeyboardEventImpl::DOM_KEY_LOCATION_LEFT     DontDelete|ReadOnly  \
DOM_KEY_LOCATION_RIGHT     DOM::KeyboardEventImpl::DOM_KEY_LOCATION_RIGHT    \
                DontDelete|ReadOnly
-  DOM_KEY_LOCATION_NUMPAP    DOM::KeyboardEventImpl::DOM_KEY_LOCATION_NUMPAD   \
DontDelete|ReadOnly +  DOM_KEY_LOCATION_NUMPAD    \
DOM::KeyboardEventImpl::DOM_KEY_LOCATION_NUMPAD   DontDelete|ReadOnly  @end
 */
 KeyboardEventConstructor::KeyboardEventConstructor(ExecState* exec)
--- branches/work/khtml-kb-events/xml/dom2_eventsimpl.h #500988:500989
@@ -116,7 +116,7 @@
     virtual bool isMutationEvent() const;
     virtual bool isTextInputEvent() const;
     virtual bool isKeyboardEvent() const;
-    bool isKeyRelatedEvent() { return isTextInputEvent() || isKeyboardEvent(); }
+    bool isKeyRelatedEvent() const { return isTextInputEvent() || isKeyboardEvent(); \
}  
     bool propagationStopped() const { return m_propagationStopped; }
     bool defaultPrevented() const { return m_defaultPrevented; }
@@ -412,6 +412,21 @@
                          const DOMString &keyIdentifierArg,
                          unsigned long keyLocationArg,
                          const DOMString& modifiersList);
+
+  //### KDE4: remove this, it's only for compatibility with
+  //the old TextEvent wrapper
+  void initKeyboardEvent(const DOMString &typeArg,
+                         bool canBubbleArg,
+                         bool cancelableArg,
+                         const AbstractView &viewArg,
+                         unsigned long keyVal,
+                         unsigned long virtKeyVal,
+                         unsigned long modifiers,
+                         unsigned long keyLocationArg) {
+     initKeyBaseEvent(typeArg, canBubbleArg, cancelableArg, viewArg,
+        keyVal, virtKeyVal, modifiers);
+     m_keyLocation = keyLocationArg;
+  }
 private:
     unsigned long m_keyLocation;
 };


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

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