@@ -71,6 +71,42 @@ pub const ApplicationActivationPolicyRegular: ApplicationActivationPolicy = 0;
71
71
pub const ApplicationActivationPolicyAccessory : ApplicationActivationPolicy = 0 ;
72
72
pub const ApplicationActivationPolicyProhibited : ApplicationActivationPolicy = 0 ;
73
73
74
+ pub const EventMask = c_ulonglong ;
75
+ pub const EventMaskLeftMouseDown : EventMask = 2 ;
76
+ pub const EventMaskLeftMouseUp : EventMask = 4 ;
77
+ pub const EventMaskRightMouseDown : EventMask = 8 ;
78
+ pub const EventMaskRightMouseUp : EventMask = 16 ;
79
+ pub const EventMaskMouseMoved : EventMask = 32 ;
80
+ pub const EventMaskLeftMouseDragged : EventMask = 64 ;
81
+ pub const EventMaskRightMouseDragged : EventMask = 128 ;
82
+ pub const EventMaskMouseEntered : EventMask = 256 ;
83
+ pub const EventMaskMouseExited : EventMask = 512 ;
84
+ pub const EventMaskKeyDown : EventMask = 1024 ;
85
+ pub const EventMaskKeyUp : EventMask = 2048 ;
86
+ pub const EventMaskFlagsChanged : EventMask = 4096 ;
87
+ pub const EventMaskAppKitDefined : EventMask = 8192 ;
88
+ pub const EventMaskSystemDefined : EventMask = 16384 ;
89
+ pub const EventMaskApplicationDefined : EventMask = 32768 ;
90
+ pub const EventMaskPeriodic : EventMask = 65536 ;
91
+ pub const EventMaskCursorUpdate : EventMask = 131072 ;
92
+ pub const EventMaskScrollWheel : EventMask = 4194304 ;
93
+ pub const EventMaskTabletPoint : EventMask = 8388608 ;
94
+ pub const EventMaskTabletProximity : EventMask = 16777216 ;
95
+ pub const EventMaskOtherMouseDown : EventMask = 33554432 ;
96
+ pub const EventMaskOtherMouseUp : EventMask = 67108864 ;
97
+ pub const EventMaskOtherMouseDragged : EventMask = 134217728 ;
98
+ pub const EventMaskGesture : EventMask = 536870912 ;
99
+ pub const EventMaskMagnify : EventMask = 1073741824 ;
100
+ pub const EventMaskSwipe : EventMask = 2147483648 ;
101
+ pub const EventMaskRotate : EventMask = 262144 ;
102
+ pub const EventMaskBeginGesture : EventMask = 524288 ;
103
+ pub const EventMaskEndGesture : EventMask = 1048576 ;
104
+ pub const EventMaskSmartMagnify : EventMask = 4294967296 ;
105
+ pub const EventMaskPressure : EventMask = 17179869184 ;
106
+ pub const EventMaskDirectTouch : EventMask = 137438953472 ;
107
+ pub const EventMaskChangeMode : EventMask = 274877906944 ;
108
+ pub const EventMaskAny : EventMask = 0 ;
109
+
74
110
pub const BackingStoreType = UInteger ;
75
111
pub const BackingStoreRetained : BackingStoreType = 0 ;
76
112
pub const BackingStoreNonretained : BackingStoreType = 1 ;
@@ -87,6 +123,15 @@ pub const EventModifierFlagHelp: EventModifierFlags = 4194304;
87
123
pub const EventModifierFlagFunction : EventModifierFlags = 8388608 ;
88
124
pub const EventModifierFlagDeviceIndependentFlagsMask : EventModifierFlags = 4294901760 ;
89
125
126
+ pub const EventPhase = UInteger ;
127
+ pub const EventPhaseNone : EventPhase = 0 ;
128
+ pub const EventPhaseBegan : EventPhase = 1 ;
129
+ pub const EventPhaseStationary : EventPhase = 2 ;
130
+ pub const EventPhaseChanged : EventPhase = 4 ;
131
+ pub const EventPhaseEnded : EventPhase = 8 ;
132
+ pub const EventPhaseCancelled : EventPhase = 16 ;
133
+ pub const EventPhaseMayBegin : EventPhase = 32 ;
134
+
90
135
pub const WindowStyleMask = UInteger ;
91
136
pub const WindowStyleMaskBorderless : WindowStyleMask = 0 ;
92
137
pub const WindowStyleMaskTitled : WindowStyleMask = 1 ;
@@ -216,6 +261,9 @@ pub const Window = opaque {
216
261
pub fn setMinSize (self_ : * @This (), minSize_ : Size ) void {
217
262
return objc .msgSend (self_ , "setMinSize:" , void , .{minSize_ });
218
263
}
264
+ pub fn sendEvent (self_ : * @This (), event_ : * Event ) void {
265
+ return objc .msgSend (self_ , "sendEvent:" , void , .{event_ });
266
+ }
219
267
pub fn setIsVisible (self_ : * @This (), flag_ : bool ) void {
220
268
return objc .msgSend (self_ , "setIsVisible:" , void , .{flag_ });
221
269
}
@@ -265,6 +313,21 @@ pub const ObjectInterface = opaque {
265
313
}
266
314
};
267
315
316
+ pub const Appearance = opaque {
317
+ pub const InternalInfo = objc .ExternClass ("NSAppearance" , @This (), ObjectInterface , &.{});
318
+ pub const as = InternalInfo .as ;
319
+ pub const retain = InternalInfo .retain ;
320
+ pub const release = InternalInfo .release ;
321
+ pub const autorelease = InternalInfo .autorelease ;
322
+ pub const new = InternalInfo .new ;
323
+ pub const alloc = InternalInfo .alloc ;
324
+ pub const allocInit = InternalInfo .allocInit ;
325
+
326
+ pub fn appearanceNamed (name_ : * String ) ? * Appearance {
327
+ return objc .msgSend (@This ().InternalInfo .class (), "appearanceNamed:" , ? * Appearance , .{name_ });
328
+ }
329
+ };
330
+
268
331
pub const Event = opaque {
269
332
pub const InternalInfo = objc .ExternClass ("NSEvent" , @This (), ObjectInterface , &.{});
270
333
pub const as = InternalInfo .as ;
@@ -275,6 +338,9 @@ pub const Event = opaque {
275
338
pub const alloc = InternalInfo .alloc ;
276
339
pub const allocInit = InternalInfo .allocInit ;
277
340
341
+ pub fn addLocalMonitorForEventsMatchingMask_handler (mask_ : EventMask , block_ : * ns .Block (fn (* Event ) ? * Event )) ? * objc.Id {
342
+ return objc .msgSend (@This ().InternalInfo .class (), "addLocalMonitorForEventsMatchingMask:handler:" , ? * objc .Id , .{ mask_ , block_ });
343
+ }
278
344
pub fn modifierFlags (self_ : * @This ()) EventModifierFlags {
279
345
return objc .msgSend (self_ , "modifierFlags" , EventModifierFlags , .{});
280
346
}
@@ -302,6 +368,9 @@ pub const Event = opaque {
302
368
pub fn magnification (self_ : * @This ()) cg.Float {
303
369
return objc .msgSend (self_ , "magnification" , cg .Float , .{});
304
370
}
371
+ pub fn phase (self_ : * @This ()) EventPhase {
372
+ return objc .msgSend (self_ , "phase" , EventPhase , .{});
373
+ }
305
374
// pub fn modifierFlags() EventModifierFlags {
306
375
// return objc.msgSend(@This().InternalInfo.class(), "modifierFlags", EventModifierFlags, .{});
307
376
// }
@@ -356,21 +425,12 @@ pub const Cursor = opaque {
356
425
pub const alloc = InternalInfo .alloc ;
357
426
pub const allocInit = InternalInfo .allocInit ;
358
427
359
- // pub fn initWithImage_hotSpot(self_: *@This(), newImage_: *Image, point_: Point) *@This() {
360
- // return objc.msgSend(self_, "initWithImage:hotSpot:", *@This(), .{ newImage_, point_ });
361
- // }
362
- // pub fn initWithCoder(self_: *@This(), coder_: *Coder) *@This() {
363
- // return objc.msgSend(self_, "initWithCoder:", *@This(), .{coder_});
364
- // }
365
428
pub fn hide () void {
366
429
return objc .msgSend (@This ().InternalInfo .class (), "hide" , void , .{});
367
430
}
368
431
pub fn unhide () void {
369
432
return objc .msgSend (@This ().InternalInfo .class (), "unhide" , void , .{});
370
433
}
371
- pub fn setHiddenUntilMouseMoves (flag_ : bool ) void {
372
- return objc .msgSend (@This ().InternalInfo .class (), "setHiddenUntilMouseMoves:" , void , .{flag_ });
373
- }
374
434
pub fn pop () void {
375
435
return objc .msgSend (@This ().InternalInfo .class (), "pop" , void , .{});
376
436
}
@@ -380,15 +440,6 @@ pub const Cursor = opaque {
380
440
// pub fn pop(self_: *@This()) void {
381
441
// return objc.msgSend(self_, "pop", void, .{});
382
442
// }
383
- pub fn set (self_ : * @This ()) void {
384
- return objc .msgSend (self_ , "set" , void , .{});
385
- }
386
- pub fn currentCursor () * Cursor {
387
- return objc .msgSend (@This ().InternalInfo .class (), "currentCursor" , * Cursor , .{});
388
- }
389
- pub fn currentSystemCursor () * Cursor {
390
- return objc .msgSend (@This ().InternalInfo .class (), "currentSystemCursor" , * Cursor , .{});
391
- }
392
443
pub fn arrowCursor () * Cursor {
393
444
return objc .msgSend (@This ().InternalInfo .class (), "arrowCursor" , * Cursor , .{});
394
445
}
@@ -425,51 +476,9 @@ pub const Cursor = opaque {
425
476
pub fn crosshairCursor () * Cursor {
426
477
return objc .msgSend (@This ().InternalInfo .class (), "crosshairCursor" , * Cursor , .{});
427
478
}
428
- pub fn disappearingItemCursor () * Cursor {
429
- return objc .msgSend (@This ().InternalInfo .class (), "disappearingItemCursor" , * Cursor , .{});
430
- }
431
479
pub fn operationNotAllowedCursor () * Cursor {
432
480
return objc .msgSend (@This ().InternalInfo .class (), "operationNotAllowedCursor" , * Cursor , .{});
433
481
}
434
- pub fn dragLinkCursor () * Cursor {
435
- return objc .msgSend (@This ().InternalInfo .class (), "dragLinkCursor" , * Cursor , .{});
436
- }
437
- pub fn dragCopyCursor () * Cursor {
438
- return objc .msgSend (@This ().InternalInfo .class (), "dragCopyCursor" , * Cursor , .{});
439
- }
440
- pub fn contextualMenuCursor () * Cursor {
441
- return objc .msgSend (@This ().InternalInfo .class (), "contextualMenuCursor" , * Cursor , .{});
442
- }
443
- pub fn IBeamCursorForVerticalLayout () * Cursor {
444
- return objc .msgSend (@This ().InternalInfo .class (), "IBeamCursorForVerticalLayout" , * Cursor , .{});
445
- }
446
- // pub fn image(self_: *@This()) *Image {
447
- // return objc.msgSend(self_, "image", *Image, .{});
448
- // }
449
- pub fn hotSpot (self_ : * @This ()) Point {
450
- return objc .msgSend (self_ , "hotSpot" , Point , .{});
451
- }
452
- // pub fn initWithImage_foregroundColorHint_backgroundColorHint_hotSpot(self_: *@This(), newImage_: *Image, fg_: ?*Color, bg_: ?*Color, hotSpot_: Point) *@This() {
453
- // return objc.msgSend(self_, "initWithImage:foregroundColorHint:backgroundColorHint:hotSpot:", *@This(), .{ newImage_, fg_, bg_, hotSpot_ });
454
- // }
455
- pub fn setOnMouseExited (self_ : * @This (), flag_ : bool ) void {
456
- return objc .msgSend (self_ , "setOnMouseExited:" , void , .{flag_ });
457
- }
458
- pub fn setOnMouseEntered (self_ : * @This (), flag_ : bool ) void {
459
- return objc .msgSend (self_ , "setOnMouseEntered:" , void , .{flag_ });
460
- }
461
- pub fn mouseEntered (self_ : * @This (), event_ : * Event ) void {
462
- return objc .msgSend (self_ , "mouseEntered:" , void , .{event_ });
463
- }
464
- pub fn mouseExited (self_ : * @This (), event_ : * Event ) void {
465
- return objc .msgSend (self_ , "mouseExited:" , void , .{event_ });
466
- }
467
- pub fn isSetOnMouseExited (self_ : * @This ()) bool {
468
- return objc .msgSend (self_ , "isSetOnMouseExited" , bool , .{});
469
- }
470
- pub fn isSetOnMouseEntered (self_ : * @This ()) bool {
471
- return objc .msgSend (self_ , "isSetOnMouseEntered" , bool , .{});
472
- }
473
482
};
474
483
475
484
pub const Screen = opaque {
0 commit comments