discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ScrollWheel, Xdps and NSEvent modification


From: Richard Frith-Macdonald
Subject: Re: ScrollWheel, Xdps and NSEvent modification
Date: Sat, 2 Mar 2002 06:48:45 +0000

On Friday, March 1, 2002, at 10:56 AM, Pierre-Yves Rivaille wrote:


Well, if it's MacOS-X bloat, I guess we need to add it :-)

MacOS-X bloat is holy bloat ...

But we should not break the old code in order to add the new stuff - that's
my
main concern.
Basically, to implement the MacOS-X documentaed API we need to have these
deltas AND eventNumber,
clickCount, pressure. We can't remove some values to make way for the new,
we
have to increase
the size of the NSEvent object.

I did it that way because that's the way it's done in MOSX, delta* ivars do replace
eventNumber, clickCount and pressure ivars.
I will check if calling eventNumber, clickCount or pressure methods on a scrollwheel event leads to an exception on MOSX (it's an exception or a default value, as there is no more ivars storing the values).


As I see it, we have two options ...

1. We can assume that the MacOS-X documentation is just wrong ... and the delta information *only*
applies to scrollWheel events.
In this case, the ivar layout you did is fine, though I'd suggest changing your new method new to
scrollWheelEventWithType... rather than mouseEventWithType...
But the backend code in XGContextEvent is partially wrong, since it is setting incorrect information
in mouse drag/move events.

2. We can assume that the MacOS-X documentation reflects their intent rather than the state of their code, and that the delta information should be provided for mouse events too (perhaps for 3d input
devices in the future).
In this case, the three delta fields must be added to the existing mouse fields, and we need an NSEvent constructor to handle all the existing fields plus the three new ones.
The backend code in XGContextEvent is again in need of fixing.

Either way, the current backend code is broken for mouse events, and we should either fix it or revert it.

Actually there is a third option - assume that their documentation and code are both wrong ... and they are intending to remove the eventNumber, clickCount, and pressure information from mouse events (which is what the current broken code in the backend effectively does). If this is the case, I *don't* think we should be copying them. Generally our policy is to adopt new MacOS-X APIs while maintaining the old ones - unless the old ones were clearly bad - which is not the case here as all that mouse info is useful.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]