[Webkit-unassigned] [Bug 42232] Make changing Cursors work in WebKit2.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 13 22:41:37 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=42232





--- Comment #8 from Sam Weinig <sam at webkit.org>  2010-07-13 22:41:37 PST ---
(In reply to comment #5)
> (From update of attachment 61468 [details])
> > +        - Rework Windows cursor code to use less global variables.
> 
> fewer?

Will change.

> 
> > Index: WebCore/page/Chrome.h
> > ===================================================================
> > --- WebCore/page/Chrome.h	(revision 63102)
> > +++ WebCore/page/Chrome.h	(working copy)
> > @@ -69,6 +69,7 @@ namespace WebCore {
> >          virtual IntRect windowToScreen(const IntRect&) const;
> >          virtual PlatformPageClient platformPageClient() const;
> >          virtual void scrollbarsModeDidChange() const;
> > +        virtual void setCursor(const Cursor&);
> 
> Does this method need to be virtual?

Yes, since it is from HostWindow.

> 
> > +        PlatformCursor impl() const { return m_platformCursor; }
> 
> I’d rename this method to platformCursor() as well.

I would, but that would require changing a lot of places.  I can do it in a follow up though.

> > +    const char* nameForCursorType(Cursor::Type);
> 
> How is this going to be used? Should it return 0 instead of the constant string "ERROR"?

I used it for debugging.  Perhaps I should remove it.

> > -    return [[NSCursor alloc] initWithImage:img hotSpot:determineHotSpot(image, hotSpot)];
> > +    return [[NSCursor alloc] initWithImage:img hotSpot:hotSpot];
> 
> You should explain in the change log how hotSpot changed from being an out parameter in this function (and its caller) to being an in parameter.

Ok.

> 
> > +Cursor::Cursor(Image* image, const IntPoint& hotSpot)
> 
> > +Cursor::Cursor(Type type)
> 
> > +Cursor::Cursor(const Cursor& other)
> 
> > +Cursor& Cursor::operator=(const Cursor& other)
> 
> > +PlatformCursor Cursor::platformCursor() const
> 
> These methods have identical implementations in CursorMac.mm and CursorWin.cpp. Can they be shared in Cursor.cpp inside #if USE(LAZY_NATIVE_CURSOR)?

Yes!

> 
> >  void Widget::setCursor(const Cursor& cursor)
> 
> I think this method has identical implementations in WidgetMac.mm and WidgetWin.cpp. Can they be shared in Widget.cpp inside #if USE(LAZY_NATIVE_CURSOR)?

They don't unfortunately, the windows one has bit extra.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list