@@ -184,6 +184,7 @@ pub enum NSApplicationTerminateReply {
184
184
}
185
185
186
186
bitflags ! {
187
+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
187
188
pub struct NSApplicationPresentationOptions : NSUInteger {
188
189
const NSApplicationPresentationDefault = 0 ;
189
190
const NSApplicationPresentationAutoHideDock = 1 << 0 ;
@@ -202,6 +203,7 @@ bitflags! {
202
203
}
203
204
204
205
bitflags ! {
206
+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
205
207
pub struct NSWindowStyleMask : NSUInteger {
206
208
const NSBorderlessWindowMask = 0 ;
207
209
const NSTitledWindowMask = 1 << 0 ;
@@ -251,6 +253,7 @@ pub enum NSWindowToolbarStyle {
251
253
}
252
254
253
255
bitflags ! {
256
+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
254
257
pub struct NSWindowOrderingMode : NSInteger {
255
258
const NSWindowAbove = 1 ;
256
259
const NSWindowBelow = -1 ;
@@ -259,6 +262,7 @@ bitflags! {
259
262
}
260
263
261
264
bitflags ! {
265
+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
262
266
pub struct NSAlignmentOptions : libc:: c_ulonglong {
263
267
const NSAlignMinXInward = 1 << 0 ;
264
268
const NSAlignMinYInward = 1 << 1 ;
@@ -279,18 +283,18 @@ bitflags! {
279
283
const NSAlignWidthNearest = 1 << 20 ;
280
284
const NSAlignHeightNearest = 1 << 21 ;
281
285
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( ) ;
294
298
}
295
299
}
296
300
@@ -578,7 +582,7 @@ impl NSApplication for id {
578
582
}
579
583
580
584
unsafe fn setPresentationOptions_ ( self , options : NSApplicationPresentationOptions ) -> BOOL {
581
- msg_send ! [ self , setPresentationOptions: options. bits]
585
+ msg_send ! [ self , setPresentationOptions: options. bits( ) ]
582
586
}
583
587
584
588
unsafe fn presentationOptions_ ( self ) -> NSApplicationPresentationOptions {
@@ -1041,6 +1045,7 @@ impl NSMenuItem for id {
1041
1045
pub type NSWindowDepth = libc:: c_int ;
1042
1046
1043
1047
bitflags ! {
1048
+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
1044
1049
pub struct NSWindowCollectionBehavior : NSUInteger {
1045
1050
const NSWindowCollectionBehaviorDefault = 0 ;
1046
1051
const NSWindowCollectionBehaviorCanJoinAllSpaces = 1 << 0 ;
@@ -1059,6 +1064,7 @@ bitflags! {
1059
1064
}
1060
1065
1061
1066
bitflags ! {
1067
+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
1062
1068
pub struct NSWindowOcclusionState : NSUInteger {
1063
1069
const NSWindowOcclusionStateVisible = 1 << 1 ;
1064
1070
}
@@ -1351,7 +1357,7 @@ impl NSWindow for id {
1351
1357
defer : BOOL ,
1352
1358
) -> id {
1353
1359
msg_send ! [ self , initWithContentRect: rect
1354
- styleMask: style. bits
1360
+ styleMask: style. bits( )
1355
1361
backing: backing as NSUInteger
1356
1362
defer: defer]
1357
1363
}
@@ -1365,7 +1371,7 @@ impl NSWindow for id {
1365
1371
screen : id ,
1366
1372
) -> id {
1367
1373
msg_send ! [ self , initWithContentRect: rect
1368
- styleMask: style. bits
1374
+ styleMask: style. bits( )
1369
1375
backing: backing as NSUInteger
1370
1376
defer: defer
1371
1377
screen: screen]
@@ -1378,7 +1384,7 @@ impl NSWindow for id {
1378
1384
}
1379
1385
1380
1386
unsafe fn setStyleMask_ ( self , styleMask : NSWindowStyleMask ) {
1381
- msg_send ! [ self , setStyleMask: styleMask. bits]
1387
+ msg_send ! [ self , setStyleMask: styleMask. bits( ) ]
1382
1388
}
1383
1389
1384
1390
unsafe fn toggleFullScreen_ ( self , sender : id ) {
@@ -1507,23 +1513,23 @@ impl NSWindow for id {
1507
1513
windowFrame : NSRect ,
1508
1514
windowStyle : NSWindowStyleMask ,
1509
1515
) -> NSRect {
1510
- msg_send ! [ self , contentRectForFrameRect: windowFrame styleMask: windowStyle. bits]
1516
+ msg_send ! [ self , contentRectForFrameRect: windowFrame styleMask: windowStyle. bits( ) ]
1511
1517
}
1512
1518
1513
1519
unsafe fn frameRectForContentRect_styleMask_ (
1514
1520
self ,
1515
1521
windowContentRect : NSRect ,
1516
1522
windowStyle : NSWindowStyleMask ,
1517
1523
) -> NSRect {
1518
- msg_send ! [ self , frameRectForContentRect: windowContentRect styleMask: windowStyle. bits]
1524
+ msg_send ! [ self , frameRectForContentRect: windowContentRect styleMask: windowStyle. bits( ) ]
1519
1525
}
1520
1526
1521
1527
unsafe fn minFrameWidthWithTitle_styleMask_ (
1522
1528
self ,
1523
1529
windowTitle : id ,
1524
1530
windowStyle : NSWindowStyleMask ,
1525
1531
) -> CGFloat {
1526
- msg_send ! [ self , minFrameWidthWithTitle: windowTitle styleMask: windowStyle. bits]
1532
+ msg_send ! [ self , minFrameWidthWithTitle: windowTitle styleMask: windowStyle. bits( ) ]
1527
1533
}
1528
1534
1529
1535
unsafe fn contentRectForFrameRect_ ( self , windowFrame : NSRect ) -> NSRect {
@@ -2517,6 +2523,7 @@ impl NSOpenGLContext for id {
2517
2523
}
2518
2524
2519
2525
bitflags ! {
2526
+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
2520
2527
pub struct NSEventSwipeTrackingOptions : NSUInteger {
2521
2528
const NSEventSwipeTrackingLockDirection = 0x1 << 0 ;
2522
2529
const NSEventSwipeTrackingClampGestureAmount = 0x1 << 1 ;
@@ -2531,6 +2538,7 @@ pub enum NSEventGestureAxis {
2531
2538
}
2532
2539
2533
2540
bitflags ! {
2541
+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
2534
2542
pub struct NSEventPhase : NSUInteger {
2535
2543
const NSEventPhaseNone = 0 ;
2536
2544
const NSEventPhaseBegan = 0x1 << 0 ;
@@ -2543,15 +2551,16 @@ bitflags! {
2543
2551
}
2544
2552
2545
2553
bitflags ! {
2554
+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
2546
2555
pub struct NSTouchPhase : NSUInteger {
2547
2556
const NSTouchPhaseBegan = 1 << 0 ;
2548
2557
const NSTouchPhaseMoved = 1 << 1 ;
2549
2558
const NSTouchPhaseStationary = 1 << 2 ;
2550
2559
const NSTouchPhaseEnded = 1 << 3 ;
2551
2560
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( ) ;
2555
2564
const NSTouchPhaseAny = !0 ; // NSUIntegerMax
2556
2565
}
2557
2566
}
@@ -2592,6 +2601,7 @@ pub enum NSEventType {
2592
2601
}
2593
2602
2594
2603
bitflags ! {
2604
+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
2595
2605
pub struct NSEventMask : libc:: c_ulonglong {
2596
2606
const NSLeftMouseDownMask = 1 << NSLeftMouseDown as libc:: c_ulonglong;
2597
2607
const NSLeftMouseUpMask = 1 << NSLeftMouseUp as libc:: c_ulonglong;
@@ -2628,13 +2638,12 @@ bitflags! {
2628
2638
2629
2639
impl NSEventMask {
2630
2640
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 )
2634
2642
}
2635
2643
}
2636
2644
2637
2645
bitflags ! {
2646
+ #[ derive( Clone , Copy , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
2638
2647
pub struct NSEventModifierFlags : NSUInteger {
2639
2648
const NSAlphaShiftKeyMask = 1 << 16 ;
2640
2649
const NSShiftKeyMask = 1 << 17 ;
0 commit comments