FROM : Ali Ozer
DATE : Fri Nov 30 17:11:34 2007
All int-sized types in Cocoa moved to NSInteger or NSUInteger under 64-
bit, so what happened to NSEventType is consistent with everything
else. This is true even if the type in question isn't likely to hold
a value greater than 2 or 4 billion in the foreseeable future.
As far as masks, the 32-bit mask has been getting close to full, so we
even considered moving to a 64-bit mask under 32-bit. However, since
this would be a binary incompatible change for NSEvent and likely
require new APIs to do right, we instead allow for a 64-bit mask under
64-bit only. Clearly the top 32-bits can't be except in 64-bit
scenarios, and we're not making any use of it at this point.
Ali
On Nov 30, 2007, at 04:29 , Bill Cheeseman wrote:
> In Leopard, the -[NSEvent type] method returns a value of type
> NSEventType.
> In the NSEvent.h header, this is declared as NSUInteger, meaning
> that it
> will occupy 32 bits in a 32-bit app or 64 bits in a 64-bit app.
>
> Why is this?
>
> I was under the impression that an event type is always 32 bits.
> Consistently with my understanding, the Core Graphics API, in
> CGEventTypes.h, defines CGEventType as uint32-t.
>
> I get even more confused when I look at the declarations of event
> masks. In
> NSEvent.h, the event masks aren't assigned a type, but
> NSAnyEventMask is
> declared to be NSUIntegerMax. In Core Graphics, CGEventMask is
> declared as
> uint64_t.
>
> What am I misunderstanding?
>
> --
>
> Bill Cheeseman - <email_removed>
> Quechee Software, Quechee, Vermont, USA
> www.quecheesoftware.com
>
> PreFab Software - www.prefabsoftware.com
>
>
DATE : Fri Nov 30 17:11:34 2007
All int-sized types in Cocoa moved to NSInteger or NSUInteger under 64-
bit, so what happened to NSEventType is consistent with everything
else. This is true even if the type in question isn't likely to hold
a value greater than 2 or 4 billion in the foreseeable future.
As far as masks, the 32-bit mask has been getting close to full, so we
even considered moving to a 64-bit mask under 32-bit. However, since
this would be a binary incompatible change for NSEvent and likely
require new APIs to do right, we instead allow for a 64-bit mask under
64-bit only. Clearly the top 32-bits can't be except in 64-bit
scenarios, and we're not making any use of it at this point.
Ali
On Nov 30, 2007, at 04:29 , Bill Cheeseman wrote:
> In Leopard, the -[NSEvent type] method returns a value of type
> NSEventType.
> In the NSEvent.h header, this is declared as NSUInteger, meaning
> that it
> will occupy 32 bits in a 32-bit app or 64 bits in a 64-bit app.
>
> Why is this?
>
> I was under the impression that an event type is always 32 bits.
> Consistently with my understanding, the Core Graphics API, in
> CGEventTypes.h, defines CGEventType as uint32-t.
>
> I get even more confused when I look at the declarations of event
> masks. In
> NSEvent.h, the event masks aren't assigned a type, but
> NSAnyEventMask is
> declared to be NSUIntegerMax. In Core Graphics, CGEventMask is
> declared as
> uint64_t.
>
> What am I misunderstanding?
>
> --
>
> Bill Cheeseman - <email_removed>
> Quechee Software, Quechee, Vermont, USA
> www.quecheesoftware.com
>
> PreFab Software - www.prefabsoftware.com
>
>
| Related mails | Author | Date |
|---|---|---|
| Bill Cheeseman | Nov 30, 13:29 | |
| Ali Ozer | Nov 30, 17:11 | |
| Bill Cheeseman | Nov 30, 18:36 | |
| Ali Ozer | Nov 30, 19:28 |






Cocoa mail archive

