@@ -184,6 +184,7 @@ pub enum NSApplicationTerminateReply {
184184}
185185
186186bitflags ! {
187+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
187188 pub struct NSApplicationPresentationOptions : NSUInteger {
188189 const NSApplicationPresentationDefault = 0 ;
189190 const NSApplicationPresentationAutoHideDock = 1 << 0 ;
@@ -202,6 +203,7 @@ bitflags! {
202203}
203204
204205bitflags ! {
206+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
205207 pub struct NSWindowStyleMask : NSUInteger {
206208 const NSBorderlessWindowMask = 0 ;
207209 const NSTitledWindowMask = 1 << 0 ;
@@ -251,6 +253,7 @@ pub enum NSWindowToolbarStyle {
251253}
252254
253255bitflags ! {
256+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
254257 pub struct NSWindowOrderingMode : NSInteger {
255258 const NSWindowAbove = 1 ;
256259 const NSWindowBelow = -1 ;
@@ -259,6 +262,7 @@ bitflags! {
259262}
260263
261264bitflags ! {
265+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
262266 pub struct NSAlignmentOptions : libc:: c_ulonglong {
263267 const NSAlignMinXInward = 1 << 0 ;
264268 const NSAlignMinYInward = 1 << 1 ;
@@ -279,18 +283,18 @@ bitflags! {
279283 const NSAlignWidthNearest = 1 << 20 ;
280284 const NSAlignHeightNearest = 1 << 21 ;
281285 const NSAlignRectFlipped = 1 << 63 ;
282- const NSAlignAllEdgesInward = NSAlignmentOptions :: NSAlignMinXInward . bits
283- | NSAlignmentOptions :: NSAlignMaxXInward . bits
284- | NSAlignmentOptions :: NSAlignMinYInward . bits
285- | NSAlignmentOptions :: NSAlignMaxYInward . bits;
286- const NSAlignAllEdgesOutward = NSAlignmentOptions :: NSAlignMinXOutward . bits
287- | NSAlignmentOptions :: NSAlignMaxXOutward . bits
288- | NSAlignmentOptions :: NSAlignMinYOutward . bits
289- | NSAlignmentOptions :: NSAlignMaxYOutward . bits;
290- const NSAlignAllEdgesNearest = NSAlignmentOptions :: NSAlignMinXNearest . bits
291- | NSAlignmentOptions :: NSAlignMaxXNearest . bits
292- | NSAlignmentOptions :: NSAlignMinYNearest . bits
293- | NSAlignmentOptions :: NSAlignMaxYNearest . bits;
286+ const NSAlignAllEdgesInward = NSAlignmentOptions :: NSAlignMinXInward . bits( )
287+ | NSAlignmentOptions :: NSAlignMaxXInward . bits( )
288+ | NSAlignmentOptions :: NSAlignMinYInward . bits( )
289+ | NSAlignmentOptions :: NSAlignMaxYInward . bits( ) ;
290+ const NSAlignAllEdgesOutward = NSAlignmentOptions :: NSAlignMinXOutward . bits( )
291+ | NSAlignmentOptions :: NSAlignMaxXOutward . bits( )
292+ | NSAlignmentOptions :: NSAlignMinYOutward . bits( )
293+ | NSAlignmentOptions :: NSAlignMaxYOutward . bits( ) ;
294+ const NSAlignAllEdgesNearest = NSAlignmentOptions :: NSAlignMinXNearest . bits( )
295+ | NSAlignmentOptions :: NSAlignMaxXNearest . bits( )
296+ | NSAlignmentOptions :: NSAlignMinYNearest . bits( )
297+ | NSAlignmentOptions :: NSAlignMaxYNearest . bits( ) ;
294298 }
295299}
296300
@@ -578,7 +582,7 @@ impl NSApplication for id {
578582 }
579583
580584 unsafe fn setPresentationOptions_ ( self , options : NSApplicationPresentationOptions ) -> BOOL {
581- msg_send ! [ self , setPresentationOptions: options. bits]
585+ msg_send ! [ self , setPresentationOptions: options. bits( ) ]
582586 }
583587
584588 unsafe fn presentationOptions_ ( self ) -> NSApplicationPresentationOptions {
@@ -1041,6 +1045,7 @@ impl NSMenuItem for id {
10411045pub type NSWindowDepth = libc:: c_int ;
10421046
10431047bitflags ! {
1048+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
10441049 pub struct NSWindowCollectionBehavior : NSUInteger {
10451050 const NSWindowCollectionBehaviorDefault = 0 ;
10461051 const NSWindowCollectionBehaviorCanJoinAllSpaces = 1 << 0 ;
@@ -1059,6 +1064,7 @@ bitflags! {
10591064}
10601065
10611066bitflags ! {
1067+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
10621068 pub struct NSWindowOcclusionState : NSUInteger {
10631069 const NSWindowOcclusionStateVisible = 1 << 1 ;
10641070 }
@@ -1351,7 +1357,7 @@ impl NSWindow for id {
13511357 defer : BOOL ,
13521358 ) -> id {
13531359 msg_send ! [ self , initWithContentRect: rect
1354- styleMask: style. bits
1360+ styleMask: style. bits( )
13551361 backing: backing as NSUInteger
13561362 defer: defer]
13571363 }
@@ -1365,7 +1371,7 @@ impl NSWindow for id {
13651371 screen : id ,
13661372 ) -> id {
13671373 msg_send ! [ self , initWithContentRect: rect
1368- styleMask: style. bits
1374+ styleMask: style. bits( )
13691375 backing: backing as NSUInteger
13701376 defer: defer
13711377 screen: screen]
@@ -1378,7 +1384,7 @@ impl NSWindow for id {
13781384 }
13791385
13801386 unsafe fn setStyleMask_ ( self , styleMask : NSWindowStyleMask ) {
1381- msg_send ! [ self , setStyleMask: styleMask. bits]
1387+ msg_send ! [ self , setStyleMask: styleMask. bits( ) ]
13821388 }
13831389
13841390 unsafe fn toggleFullScreen_ ( self , sender : id ) {
@@ -1507,23 +1513,23 @@ impl NSWindow for id {
15071513 windowFrame : NSRect ,
15081514 windowStyle : NSWindowStyleMask ,
15091515 ) -> NSRect {
1510- msg_send ! [ self , contentRectForFrameRect: windowFrame styleMask: windowStyle. bits]
1516+ msg_send ! [ self , contentRectForFrameRect: windowFrame styleMask: windowStyle. bits( ) ]
15111517 }
15121518
15131519 unsafe fn frameRectForContentRect_styleMask_ (
15141520 self ,
15151521 windowContentRect : NSRect ,
15161522 windowStyle : NSWindowStyleMask ,
15171523 ) -> NSRect {
1518- msg_send ! [ self , frameRectForContentRect: windowContentRect styleMask: windowStyle. bits]
1524+ msg_send ! [ self , frameRectForContentRect: windowContentRect styleMask: windowStyle. bits( ) ]
15191525 }
15201526
15211527 unsafe fn minFrameWidthWithTitle_styleMask_ (
15221528 self ,
15231529 windowTitle : id ,
15241530 windowStyle : NSWindowStyleMask ,
15251531 ) -> CGFloat {
1526- msg_send ! [ self , minFrameWidthWithTitle: windowTitle styleMask: windowStyle. bits]
1532+ msg_send ! [ self , minFrameWidthWithTitle: windowTitle styleMask: windowStyle. bits( ) ]
15271533 }
15281534
15291535 unsafe fn contentRectForFrameRect_ ( self , windowFrame : NSRect ) -> NSRect {
@@ -2517,6 +2523,7 @@ impl NSOpenGLContext for id {
25172523}
25182524
25192525bitflags ! {
2526+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
25202527 pub struct NSEventSwipeTrackingOptions : NSUInteger {
25212528 const NSEventSwipeTrackingLockDirection = 0x1 << 0 ;
25222529 const NSEventSwipeTrackingClampGestureAmount = 0x1 << 1 ;
@@ -2531,6 +2538,7 @@ pub enum NSEventGestureAxis {
25312538}
25322539
25332540bitflags ! {
2541+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
25342542 pub struct NSEventPhase : NSUInteger {
25352543 const NSEventPhaseNone = 0 ;
25362544 const NSEventPhaseBegan = 0x1 << 0 ;
@@ -2543,15 +2551,16 @@ bitflags! {
25432551}
25442552
25452553bitflags ! {
2554+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
25462555 pub struct NSTouchPhase : NSUInteger {
25472556 const NSTouchPhaseBegan = 1 << 0 ;
25482557 const NSTouchPhaseMoved = 1 << 1 ;
25492558 const NSTouchPhaseStationary = 1 << 2 ;
25502559 const NSTouchPhaseEnded = 1 << 3 ;
25512560 const NSTouchPhaseCancelled = 1 << 4 ;
2552- const NSTouchPhaseTouching = NSTouchPhase :: NSTouchPhaseBegan . bits
2553- | NSTouchPhase :: NSTouchPhaseMoved . bits
2554- | NSTouchPhase :: NSTouchPhaseStationary . bits;
2561+ const NSTouchPhaseTouching = NSTouchPhase :: NSTouchPhaseBegan . bits( )
2562+ | NSTouchPhase :: NSTouchPhaseMoved . bits( )
2563+ | NSTouchPhase :: NSTouchPhaseStationary . bits( ) ;
25552564 const NSTouchPhaseAny = !0 ; // NSUIntegerMax
25562565 }
25572566}
@@ -2592,6 +2601,7 @@ pub enum NSEventType {
25922601}
25932602
25942603bitflags ! {
2604+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
25952605 pub struct NSEventMask : libc:: c_ulonglong {
25962606 const NSLeftMouseDownMask = 1 << NSLeftMouseDown as libc:: c_ulonglong;
25972607 const NSLeftMouseUpMask = 1 << NSLeftMouseUp as libc:: c_ulonglong;
@@ -2628,13 +2638,12 @@ bitflags! {
26282638
26292639impl NSEventMask {
26302640 pub fn from_type ( ty : NSEventType ) -> NSEventMask {
2631- NSEventMask {
2632- bits : 1 << ty as libc:: c_ulonglong ,
2633- }
2641+ NSEventMask :: from_bits_truncate ( 1 << ty as libc:: c_ulonglong )
26342642 }
26352643}
26362644
26372645bitflags ! {
2646+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
26382647 pub struct NSEventModifierFlags : NSUInteger {
26392648 const NSAlphaShiftKeyMask = 1 << 16 ;
26402649 const NSShiftKeyMask = 1 << 17 ;
0 commit comments