Changeset 23841 in webkit


Ignore:
Timestamp:
Jun 27, 2007 8:34:49 PM (17 years ago)
Author:
weinig
Message:

Reviewed by Maciej.

2nd patch for http://bugs.webkit.org/show_bug.cgi?id=14111
Autogenerate Event JS binding

  • Cleanup kjs_events
  • bindings/js/kjs_events.cpp: (WebCore::JSAbstractEventListener::JSAbstractEventListener): (WebCore::JSAbstractEventListener::handleEvent): (WebCore::JSAbstractEventListener::isHTMLEventListener): (WebCore::JSUnprotectedEventListener::JSUnprotectedEventListener): (WebCore::JSUnprotectedEventListener::~JSUnprotectedEventListener): (WebCore::JSUnprotectedEventListener::listenerObj): (WebCore::JSUnprotectedEventListener::windowObj): (WebCore::JSUnprotectedEventListener::clearWindowObj): (WebCore::JSUnprotectedEventListener::mark): (WebCore::JSEventListener::JSEventListener): (WebCore::JSEventListener::~JSEventListener): (WebCore::JSEventListener::listenerObj): (WebCore::JSEventListener::windowObj): (WebCore::JSEventListener::clearWindowObj): (WebCore::JSLazyEventListener::JSLazyEventListener): (WebCore::JSLazyEventListener::listenerObj): (WebCore::JSLazyEventListener::parseCode): (WebCore::getNodeEventListener): (WebCore::JSClipboard::JSClipboard): (WebCore::JSClipboard::getValueProperty): (WebCore::JSClipboard::putValueProperty): (WebCore::JSClipboardPrototypeFunction::callAsFunction): (WebCore::toJS): (WebCore::toClipboard):
  • bindings/js/kjs_events.h: (WebCore::JSClipboard::classInfo): (WebCore::JSClipboard::impl):
  • bindings/js/kjs_window.h:
  • ksvg2/events/JSSVGLazyEventListener.h:
Location:
trunk/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r23840 r23841  
     12007-06-27  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Maciej.
     4
     5        2nd patch for http://bugs.webkit.org/show_bug.cgi?id=14111
     6        Autogenerate Event JS binding
     7
     8        - Cleanup kjs_events
     9
     10        * bindings/js/kjs_events.cpp:
     11        (WebCore::JSAbstractEventListener::JSAbstractEventListener):
     12        (WebCore::JSAbstractEventListener::handleEvent):
     13        (WebCore::JSAbstractEventListener::isHTMLEventListener):
     14        (WebCore::JSUnprotectedEventListener::JSUnprotectedEventListener):
     15        (WebCore::JSUnprotectedEventListener::~JSUnprotectedEventListener):
     16        (WebCore::JSUnprotectedEventListener::listenerObj):
     17        (WebCore::JSUnprotectedEventListener::windowObj):
     18        (WebCore::JSUnprotectedEventListener::clearWindowObj):
     19        (WebCore::JSUnprotectedEventListener::mark):
     20        (WebCore::JSEventListener::JSEventListener):
     21        (WebCore::JSEventListener::~JSEventListener):
     22        (WebCore::JSEventListener::listenerObj):
     23        (WebCore::JSEventListener::windowObj):
     24        (WebCore::JSEventListener::clearWindowObj):
     25        (WebCore::JSLazyEventListener::JSLazyEventListener):
     26        (WebCore::JSLazyEventListener::listenerObj):
     27        (WebCore::JSLazyEventListener::parseCode):
     28        (WebCore::getNodeEventListener):
     29        (WebCore::JSClipboard::JSClipboard):
     30        (WebCore::JSClipboard::getValueProperty):
     31        (WebCore::JSClipboard::putValueProperty):
     32        (WebCore::JSClipboardPrototypeFunction::callAsFunction):
     33        (WebCore::toJS):
     34        (WebCore::toClipboard):
     35        * bindings/js/kjs_events.h:
     36        (WebCore::JSClipboard::classInfo):
     37        (WebCore::JSClipboard::impl):
     38        * bindings/js/kjs_window.h:
     39        * ksvg2/events/JSSVGLazyEventListener.h:
     40
    1412007-06-27  Sam Weinig  <sam@webkit.org>
    242
  • trunk/WebCore/bindings/js/kjs_events.cpp

    r23795 r23841  
    3535#include "JSEvent.h"
    3636#include "JSEventTargetNode.h"
    37 #include "JSKeyboardEvent.h"
    38 #include "JSMouseEvent.h"
    39 #include "JSMutationEvent.h"
    40 #include "JSOverflowEvent.h"
    41 #include "JSTextEvent.h"
    42 #include "JSWheelEvent.h"
    4337#include "KURL.h"
    44 #include "KeyboardEvent.h"
    45 #include "MouseEvent.h"
    46 #include "MutationEvent.h"
    47 #include "OverflowEvent.h"
    4838#include "Page.h"
    49 #include "TextEvent.h"
    50 #include "UIEvent.h"
    51 #include "WheelEvent.h"
    5239#include "kjs_proxy.h"
    5340#include "kjs_window.h"
     
    5542#include "kjs_events.lut.h"
    5643
    57 using namespace WebCore;
     44namespace WebCore {
     45
     46using namespace KJS;
    5847using namespace EventNames;
    5948using namespace HTMLNames;
    6049
    61 namespace KJS {
    62 
    63 JSAbstractEventListener::JSAbstractEventListener(bool _html)
    64     : html(_html)
     50JSAbstractEventListener::JSAbstractEventListener(bool html)
     51    : m_html(html)
    6552{
    6653}
     
    7360#endif
    7461
    75     Event *event = ele;
     62    Event* event = ele;
    7663
    7764    JSObject* listener = listenerObj();
     
    9279
    9380    JSLock lock;
    94  
     81
    9582    ScriptInterpreter* interpreter = proxy->interpreter();
    9683    ExecState* exec = interpreter->globalExec();
    97  
     84
    9885    JSValue* handleEventFuncValue = listener->get(exec, "handleEvent");
    9986    JSObject* handleEventFunc = 0;
    100     if (handleEventFuncValue->isObject()) {     
     87    if (handleEventFuncValue->isObject()) {
    10188        handleEventFunc = static_cast<JSObject*>(handleEventFuncValue);
    10289        if (!handleEventFunc->implementsCall())
    10390            handleEventFunc = 0;
    10491    }
    105  
     92
    10693    if (handleEventFunc || listener->implementsCall()) {
    10794        ref();
    108      
     95
    10996        List args;
    11097        args.append(toJS(exec, event));
    111      
     98
    11299        // Set the event we're handling in the Window object
    113100        window->setCurrentEvent(event);
    114101        // ... and in the interpreter
    115102        interpreter->setCurrentEvent(event);
    116      
     103
    117104        JSValue* retval;
    118105        if (handleEventFunc) {
     
    146133            if (!retval->isUndefinedOrNull() && event->storesResultAsString())
    147134                event->storeResult(retval->toString(exec));
    148             if (html) {
     135            if (m_html) {
    149136                bool retvalbool;
    150137                if (retval->getBoolean(retvalbool) && !retvalbool)
     
    160147bool JSAbstractEventListener::isHTMLEventListener() const
    161148{
    162     return html;
     149    return m_html;
    163150}
    164151
    165152// -------------------------------------------------------------------------
    166153
    167 JSUnprotectedEventListener::JSUnprotectedEventListener(JSObject* _listener, Window* _win, bool _html)
    168   : JSAbstractEventListener(_html)
    169   , listener(_listener)
    170   , win(_win)
    171 {
    172     if (_listener) {
    173         Window::UnprotectedListenersMap& listeners = _html
    174             ? _win->jsUnprotectedHTMLEventListeners() : _win->jsUnprotectedEventListeners();
    175         listeners.set(_listener, this);
     154JSUnprotectedEventListener::JSUnprotectedEventListener(JSObject* listener, Window* win, bool html)
     155    : JSAbstractEventListener(html)
     156    , m_listener(listener)
     157    , m_win(win)
     158{
     159    if (m_listener) {
     160        Window::UnprotectedListenersMap& listeners = html
     161            ? m_win->jsUnprotectedHTMLEventListeners() : m_win->jsUnprotectedEventListeners();
     162        listeners.set(m_listener, this);
    176163    }
    177164}
     
    179166JSUnprotectedEventListener::~JSUnprotectedEventListener()
    180167{
    181     if (listener && win) {
     168    if (m_listener && m_win) {
    182169        Window::UnprotectedListenersMap& listeners = isHTMLEventListener()
    183             ? win->jsUnprotectedHTMLEventListeners() : win->jsUnprotectedEventListeners();
    184         listeners.remove(listener);
     170            ? m_win->jsUnprotectedHTMLEventListeners() : m_win->jsUnprotectedEventListeners();
     171        listeners.remove(m_listener);
    185172    }
    186173}
    187174
    188175JSObject* JSUnprotectedEventListener::listenerObj() const
    189 { 
    190     return listener;
     176{
     177    return m_listener;
    191178}
    192179
    193180Window* JSUnprotectedEventListener::windowObj() const
    194181{
    195     return win;
     182    return m_win;
    196183}
    197184
    198185void JSUnprotectedEventListener::clearWindowObj()
    199186{
    200     win = 0;
     187    m_win = 0;
    201188}
    202189
    203190void JSUnprotectedEventListener::mark()
    204191{
    205     if (listener && !listener->marked())
    206         listener->mark();
     192    if (m_listener && !m_listener->marked())
     193        m_listener->mark();
    207194}
    208195
     
    227214// -------------------------------------------------------------------------
    228215
    229 JSEventListener::JSEventListener(JSObject* _listener, Window* _win, bool _html)
    230     : JSAbstractEventListener(_html)
    231     , listener(_listener)
    232     , win(_win)
    233 {
    234     if (_listener) {
    235         Window::ListenersMap& listeners = _html
    236             ? _win->jsHTMLEventListeners() : _win->jsEventListeners();
    237         listeners.set(_listener, this);
     216JSEventListener::JSEventListener(JSObject* listener, Window* win, bool html)
     217    : JSAbstractEventListener(html)
     218    , m_listener(listener)
     219    , m_win(win)
     220{
     221    if (m_listener) {
     222        Window::ListenersMap& listeners = html
     223            ? m_win->jsHTMLEventListeners() : m_win->jsEventListeners();
     224        listeners.set(m_listener, this);
    238225    }
    239226#ifndef NDEBUG
     
    244231JSEventListener::~JSEventListener()
    245232{
    246     if (listener && win) {
     233    if (m_listener && m_win) {
    247234        Window::ListenersMap& listeners = isHTMLEventListener()
    248             ? win->jsHTMLEventListeners() : win->jsEventListeners();
    249         listeners.remove(listener);
     235            ? m_win->jsHTMLEventListeners() : m_win->jsEventListeners();
     236        listeners.remove(m_listener);
    250237    }
    251238#ifndef NDEBUG
     
    255242
    256243JSObject* JSEventListener::listenerObj() const
    257 { 
    258     return listener;
     244{
     245    return m_listener;
    259246}
    260247
    261248Window* JSEventListener::windowObj() const
    262249{
    263     return win;
     250    return m_win;
    264251}
    265252
    266253void JSEventListener::clearWindowObj()
    267254{
    268     win = 0;
     255    m_win = 0;
    269256}
    270257
    271258// -------------------------------------------------------------------------
    272259
    273 JSLazyEventListener::JSLazyEventListener(const String& functionName, const String& code, Window* win, Node* node, int lineno)
    274   : JSEventListener(0, win, true)
    275   , m_functionName(functionName)
    276   , code(code)
    277   , parsed(false)
    278   , lineNumber(lineno)
    279   , originalNode(node)
     260JSLazyEventListener::JSLazyEventListener(const String& functionName, const String& code, Window* win, Node* node, int lineNumber)
     261    : JSEventListener(0, win, true)
     262    , m_functionName(functionName)
     263    , m_code(code)
     264    , m_parsed(false)
     265    , m_lineNumber(lineNumber)
     266    , m_originalNode(node)
    280267{
    281268    // We don't retain the original node because we assume it
     
    289276{
    290277    parseCode();
    291     return listener;
     278    return m_listener;
    292279}
    293280
     
    300287void JSLazyEventListener::parseCode() const
    301288{
    302     if (parsed)
     289    if (m_parsed)
    303290        return;
    304     parsed = true;
    305 
    306     Frame *frame = windowObj()->frame();
    307     KJSProxy *proxy = 0;
     291    m_parsed = true;
     292
     293    Frame* frame = windowObj()->frame();
     294    KJSProxy* proxy = 0;
    308295    if (frame)
    309296        proxy = frame->scriptProxy();
     
    319306        UString sourceURL(frame->loader()->url().url());
    320307        args.append(eventParameterName());
    321         args.append(jsString(code));
    322         listener = constr->construct(exec, args, m_functionName, sourceURL, lineNumber); // ### is globalExec ok ?
    323 
    324         FunctionImp* listenerAsFunction = static_cast<FunctionImp*>(listener.get());
     308        args.append(jsString(m_code));
     309        m_listener = constr->construct(exec, args, m_functionName, sourceURL, m_lineNumber); // FIXME: is globalExec ok ?
     310
     311        FunctionImp* listenerAsFunction = static_cast<FunctionImp*>(m_listener.get());
    325312
    326313        if (exec->hadException()) {
     
    328315
    329316            // failed to parse, so let's just make this listener a no-op
    330             listener = 0;
    331         } else if (originalNode) {
     317            m_listener = 0;
     318        } else if (m_originalNode) {
    332319            // Add the event's home element to the scope
    333320            // (and the document, and the form - see JSHTMLElement::eventHandlerScope)
    334321            ScopeChain scope = listenerAsFunction->scope();
    335322
    336             JSValue* thisObj = toJS(exec, originalNode);
     323            JSValue* thisObj = toJS(exec, m_originalNode);
    337324            if (thisObj->isObject()) {
    338325                static_cast<JSEventTargetNode*>(thisObj)->pushEventHandlerScope(exec, scope);
     
    344331    // no more need to keep the unparsed code around
    345332    m_functionName = String();
    346     code = String();
    347 
    348     if (listener) {
     333    m_code = String();
     334
     335    if (m_listener) {
    349336        Window::ListenersMap& listeners = isHTMLEventListener()
    350337            ? windowObj()->jsHTMLEventListeners() : windowObj()->jsEventListeners();
    351         listeners.set(listener, const_cast<JSLazyEventListener*>(this));
     338        listeners.set(m_listener, const_cast<JSLazyEventListener*>(this));
    352339    }
    353340}
     
    355342JSValue* getNodeEventListener(EventTargetNode* n, const AtomicString& eventType)
    356343{
    357     if (JSAbstractEventListener* listener = static_cast<JSAbstractEventListener*>(n->getHTMLEventListener(eventType)))
     344    if (JSAbstractEventListener* listener = static_cast<JSAbstractEventListener*>(n->getHTMLEventListener(eventType))) {
    358345        if (JSValue* obj = listener->listenerObj())
    359346            return obj;
     347    }
    360348    return jsNull();
    361349}
     
    367355/* Source for JSClipboardTable. Use "make hashtables" to regenerate.
    368356@begin JSClipboardTable 3
    369   dropEffect    JSClipboard::DropEffect   DontDelete
    370   effectAllowed JSClipboard::EffectAllowed        DontDelete
    371   types         JSClipboard::Types        DontDelete|ReadOnly
     357  dropEffect    WebCore::JSClipboard::DropEffect   DontDelete
     358  effectAllowed WebCore::JSClipboard::EffectAllowed        DontDelete
     359  types         WebCore::JSClipboard::Types        DontDelete|ReadOnly
    372360@end
    373361@begin JSClipboardPrototypeTable 4
    374   clearData     JSClipboard::ClearData    DontDelete|Function 0
    375   getData       JSClipboard::GetData      DontDelete|Function 1
    376   setData       JSClipboard::SetData      DontDelete|Function 2
    377   setDragImage  JSClipboard::SetDragImage DontDelete|Function 3
     362  clearData     WebCore::JSClipboard::ClearData    DontDelete|Function 0
     363  getData       WebCore::JSClipboard::GetData      DontDelete|Function 1
     364  setData       WebCore::JSClipboard::SetData      DontDelete|Function 2
     365  setDragImage  WebCore::JSClipboard::SetDragImage DontDelete|Function 3
    378366@end
    379367*/
     
    383371KJS_IMPLEMENT_PROTOTYPE("Clipboard", JSClipboardPrototype, JSClipboardPrototypeFunction)
    384372
    385 JSClipboard::JSClipboard(ExecState* exec, WebCore::Clipboard* cb)
    386     : m_impl(cb)
     373JSClipboard::JSClipboard(ExecState* exec, Clipboard* clipboard)
     374    : m_impl(clipboard)
    387375{
    388376    setPrototype(JSClipboardPrototype::self(exec));
     
    401389JSValue* JSClipboard::getValueProperty(ExecState* exec, int token) const
    402390{
    403     WebCore::Clipboard* clipboard = impl();
     391    Clipboard* clipboard = impl();
    404392    switch (token) {
    405393        case DropEffect:
     
    434422void JSClipboard::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/)
    435423{
    436     WebCore::Clipboard* clipboard = impl();
     424    Clipboard* clipboard = impl();
    437425    switch (token) {
    438426        case DropEffect:
     
    454442        return throwError(exec, TypeError);
    455443
    456     WebCore::Clipboard* clipboard = static_cast<JSClipboard*>(thisObj)->impl();
     444    Clipboard* clipboard = static_cast<JSClipboard*>(thisObj)->impl();
    457445    switch (id) {
    458446        case JSClipboard::ClearData:
     
    495483            if (!node)
    496484                return throwError(exec, TypeError);
    497            
     485
    498486            if (!node->isElementNode())
    499487                return throwError(exec, SyntaxError, "setDragImageFromElement: Invalid first argument");
    500488
    501             if (static_cast<Element*>(node)->hasLocalName(imgTag) && 
     489            if (static_cast<Element*>(node)->hasLocalName(imgTag) &&
    502490                !node->inDocument())
    503491                clipboard->setDragImage(static_cast<HTMLImageElement*>(node)->cachedImage(), IntPoint(x, y));
    504492            else
    505                 clipboard->setDragImageElement(node, IntPoint(x, y));                   
    506                
     493                clipboard->setDragImageElement(node, IntPoint(x, y));
     494
    507495            return jsUndefined();
    508496        }
     
    511499}
    512500
    513 JSValue* toJS(ExecState* exec, WebCore::Clipboard* obj)
    514 {
    515     return cacheDOMObject<WebCore::Clipboard, JSClipboard>(exec, obj);
    516 }
    517 
    518 WebCore::Clipboard* toClipboard(JSValue* val)
     501JSValue* toJS(ExecState* exec, Clipboard* obj)
     502{
     503    return cacheDOMObject<Clipboard, JSClipboard>(exec, obj);
     504}
     505
     506Clipboard* toClipboard(JSValue* val)
    519507{
    520508    return val->isObject(&JSClipboard::info) ? static_cast<JSClipboard*>(val)->impl() : 0;
    521509}
    522510
    523 }
     511} // namespace WebCore
  • trunk/WebCore/bindings/js/kjs_events.h

    r23795 r23841  
    2727#include "kjs_html.h"
    2828
     29
     30namespace KJS {
     31    class Window;
     32}
     33
    2934namespace WebCore {
     35
    3036    class Clipboard;
    3137    class Event;
    32     class KeyboardEvent;
    33     class MouseEvent;
    34     class MutationEvent;
    35     class UIEvent;
    36 }
    3738
    38 namespace KJS {
     39    class JSAbstractEventListener : public EventListener {
     40    public:
     41        JSAbstractEventListener(bool html = false);
    3942
    40     class Window;
    41     class JSClipboard;
    42    
    43     class JSAbstractEventListener : public WebCore::EventListener {
    44     public:
    45         JSAbstractEventListener(bool HTML = false);
    46         virtual void handleEvent(WebCore::Event*, bool isWindowEvent);
     43        virtual void handleEvent(Event*, bool isWindowEvent);
    4744        virtual bool isHTMLEventListener() const;
    48         virtual JSObject* listenerObj() const = 0;
    49         virtual Window* windowObj() const = 0;
     45        virtual KJS::JSObject* listenerObj() const = 0;
     46        virtual KJS::Window* windowObj() const = 0;
     47
    5048    private:
    51         bool html;
     49        bool m_html;
    5250    };
    5351
    5452    class JSUnprotectedEventListener : public JSAbstractEventListener {
    5553    public:
    56         JSUnprotectedEventListener(JSObject* listener, Window*, bool HTML = false);
     54        JSUnprotectedEventListener(KJS::JSObject* listener, KJS::Window*, bool html = false);
    5755        virtual ~JSUnprotectedEventListener();
    58         virtual JSObject* listenerObj() const;
    59         virtual Window* windowObj() const;
     56
     57        virtual KJS::JSObject* listenerObj() const;
     58        virtual KJS::Window* windowObj() const;
    6059        void clearWindowObj();
    6160        virtual void mark();
    6261    private:
    63         JSObject* listener;
    64         Window* win;
     62        KJS::JSObject* m_listener;
     63        KJS::Window* m_win;
    6564    };
    6665
    6766    class JSEventListener : public JSAbstractEventListener {
    6867    public:
    69         JSEventListener(JSObject* listener, Window*, bool HTML = false);
     68        JSEventListener(KJS::JSObject* listener, KJS::Window*, bool html = false);
    7069        virtual ~JSEventListener();
    71         virtual JSObject* listenerObj() const;
    72         virtual Window* windowObj() const;
     70
     71        virtual KJS::JSObject* listenerObj() const;
     72        virtual KJS::Window* windowObj() const;
    7373        void clearWindowObj();
     74
    7475    protected:
    75         mutable ProtectedPtr<JSObject> listener;
     76        mutable KJS::ProtectedPtr<KJS::JSObject> m_listener;
     77
    7678    private:
    77         ProtectedPtr<Window> win;
     79        KJS::ProtectedPtr<KJS::Window> m_win;
    7880    };
    7981
    8082    class JSLazyEventListener : public JSEventListener {
    8183    public:
    82         JSLazyEventListener(const WebCore::String& functionName, const WebCore::String& code, Window*, WebCore::Node*, int lineno = 0);
    83         virtual JSObject* listenerObj() const;
     84        JSLazyEventListener(const String& functionName, const String& code, KJS::Window*, Node*, int lineNumber = 0);
     85        virtual KJS::JSObject* listenerObj() const;
     86
    8487    private:
    85         virtual JSValue* eventParameterName() const;
     88        virtual KJS::JSValue* eventParameterName() const;
    8689        void parseCode() const;
    8790
    88         mutable WebCore::String m_functionName;
    89         mutable WebCore::String code;
    90         mutable bool parsed;
    91         int lineNumber;
    92         WebCore::Node* originalNode;
     91        mutable String m_functionName;
     92        mutable String m_code;
     93        mutable bool m_parsed;
     94        int m_lineNumber;
     95        Node* m_originalNode;
    9396    };
    9497
    95     JSValue* getNodeEventListener(WebCore::Node* n, const WebCore::AtomicString& eventType);
     98    KJS::JSValue* getNodeEventListener(Node*, const AtomicString& eventType);
    9699
    97     class JSClipboard : public DOMObject {
    98         friend class JSClipboardPrototypeFunction;
     100    class JSClipboard : public KJS::DOMObject {
    99101    public:
    100         JSClipboard(ExecState*, WebCore::Clipboard* ds);
     102        JSClipboard(KJS::ExecState*, Clipboard*);
    101103        virtual ~JSClipboard();
    102104
    103         virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    104         JSValue* getValueProperty(ExecState*, int token) const;
    105         virtual void put(ExecState*, const Identifier&, JSValue*, int attr = None);
    106         void putValueProperty(ExecState*, int token, JSValue*, int attr);
     105        virtual bool getOwnPropertySlot(KJS::ExecState*, const KJS::Identifier&, KJS::PropertySlot&);
     106        KJS::JSValue* getValueProperty(KJS::ExecState*, int token) const;
     107        virtual void put(KJS::ExecState*, const KJS::Identifier&, KJS::JSValue*, int attr = KJS::None);
     108        void putValueProperty(KJS::ExecState*, int token, KJS::JSValue*, int attr);
    107109
    108         virtual const ClassInfo* classInfo() const { return &info; }
    109         static const ClassInfo info;
     110        virtual const KJS::ClassInfo* classInfo() const { return &info; }
     111        static const KJS::ClassInfo info;
    110112
    111113        enum { ClearData, GetData, SetData, Types, SetDragImage, DropEffect, EffectAllowed };
    112114
    113         WebCore::Clipboard* impl() const { return m_impl.get(); }
     115        Clipboard* impl() const { return m_impl.get(); }
    114116
    115117    private:
    116         RefPtr<WebCore::Clipboard> m_impl;
     118        RefPtr<Clipboard> m_impl;
    117119    };
    118120
    119     JSValue* toJS(ExecState*, WebCore::Clipboard*);
    120     WebCore::Clipboard* toClipboard(JSValue*);
     121    KJS::JSValue* toJS(KJS::ExecState*, Clipboard*);
     122    Clipboard* toClipboard(KJS::JSValue*);
    121123
    122 } // namespace
     124} // namespace WebCore
    123125
    124 #endif
     126#endif // kjs_events_h
  • trunk/WebCore/bindings/js/kjs_window.h

    r23584 r23841  
    3232    class FrameView;
    3333    class JSDOMWindow;
     34    class JSEventListener;
     35    class JSUnprotectedEventListener;
    3436    class Node;
    3537}
     
    3739namespace KJS {
    3840
    39     class JSEventListener;
    40     class JSLazyEventListener;
    41     class JSUnprotectedEventListener;
    4241    class Location;
    4342    class PausedTimeout;
     
    120119
    121120    // Finds a wrapper of a JS EventListener, returns 0 if no existing one.
    122     JSEventListener* findJSEventListener(JSValue*, bool html = false);
     121    WebCore::JSEventListener* findJSEventListener(JSValue*, bool html = false);
    123122
    124123    // Finds or creates a wrapper of a JS EventListener. JS EventListener object is GC-protected.
    125     JSEventListener *findOrCreateJSEventListener(JSValue*, bool html = false);
     124    WebCore::JSEventListener *findOrCreateJSEventListener(JSValue*, bool html = false);
    126125
    127126    // Finds a wrapper of a GC-unprotected JS EventListener, returns 0 if no existing one.
    128     JSUnprotectedEventListener* findJSUnprotectedEventListener(JSValue*, bool html = false);
     127    WebCore::JSUnprotectedEventListener* findJSUnprotectedEventListener(JSValue*, bool html = false);
    129128
    130129    // Finds or creates a wrapper of a JS EventListener. JS EventListener object is *NOT* GC-protected.
    131     JSUnprotectedEventListener *findOrCreateJSUnprotectedEventListener(JSValue*, bool html = false);
     130    WebCore::JSUnprotectedEventListener *findOrCreateJSUnprotectedEventListener(JSValue*, bool html = false);
    132131
    133132    void clear();
     
    139138    void setReturnValueSlot(JSValue **slot);
    140139
    141     typedef HashMap<JSObject*, JSEventListener*> ListenersMap;
    142     typedef HashMap<JSObject*, JSUnprotectedEventListener*> UnprotectedListenersMap;
     140    typedef HashMap<JSObject*, WebCore::JSEventListener*> ListenersMap;
     141    typedef HashMap<JSObject*, WebCore::JSUnprotectedEventListener*> UnprotectedListenersMap;
    143142   
    144143    ListenersMap& jsEventListeners();
  • trunk/WebCore/ksvg2/events/JSSVGLazyEventListener.h

    r19855 r23841  
    2828namespace WebCore {
    2929
    30     class JSSVGLazyEventListener : public KJS::JSLazyEventListener {
     30    class JSSVGLazyEventListener : public JSLazyEventListener {
    3131    public:
    3232        JSSVGLazyEventListener(const String& functionName, const String& code, KJS::Window*, Node*, int lineno = 0);
Note: See TracChangeset for help on using the changeset viewer.