• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Size of -[NSEvent type]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Size of -[NSEvent type]


  • Subject: Re: Size of -[NSEvent type]
  • From: Ali Ozer <email@hidden>
  • Date: Fri, 30 Nov 2007 08:11:34 -0800

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@hidden
Quechee Software, Quechee, Vermont, USA
www.quecheesoftware.com

PreFab Software - www.prefabsoftware.com


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Size of -[NSEvent type]
      • From: Bill Cheeseman <email@hidden>
References: 
 >Size of -[NSEvent type] (From: Bill Cheeseman <email@hidden>)

  • Prev by Date: Re: Is there any compression library for Cocoa?
  • Next by Date: Re: limiting CPU usage
  • Previous by thread: Size of -[NSEvent type]
  • Next by thread: Re: Size of -[NSEvent type]
  • Index(es):
    • Date
    • Thread