1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSResponder;

    unsafe impl ClassType for NSResponder {
        type Super = NSObject;
        type Mutability = MainThreadOnly;
    }
);

unsafe impl NSCoding for NSResponder {}

unsafe impl NSObjectProtocol for NSResponder {}

extern_methods!(
    unsafe impl NSResponder {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Option<Id<Self>>;

        #[method_id(@__retain_semantics Other nextResponder)]
        pub unsafe fn nextResponder(&self) -> Option<Id<NSResponder>>;

        #[method(setNextResponder:)]
        pub unsafe fn setNextResponder(&self, next_responder: Option<&NSResponder>);

        #[method(tryToPerform:with:)]
        pub unsafe fn tryToPerform_with(&self, action: Sel, object: Option<&AnyObject>) -> bool;

        #[cfg(feature = "NSEvent")]
        #[method(performKeyEquivalent:)]
        pub unsafe fn performKeyEquivalent(&self, event: &NSEvent) -> bool;

        #[cfg(feature = "NSPasteboard")]
        #[method_id(@__retain_semantics Other validRequestorForSendType:returnType:)]
        pub unsafe fn validRequestorForSendType_returnType(
            &self,
            send_type: Option<&NSPasteboardType>,
            return_type: Option<&NSPasteboardType>,
        ) -> Option<Id<AnyObject>>;

        #[cfg(feature = "NSEvent")]
        #[method(mouseDown:)]
        pub unsafe fn mouseDown(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(rightMouseDown:)]
        pub unsafe fn rightMouseDown(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(otherMouseDown:)]
        pub unsafe fn otherMouseDown(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(mouseUp:)]
        pub unsafe fn mouseUp(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(rightMouseUp:)]
        pub unsafe fn rightMouseUp(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(otherMouseUp:)]
        pub unsafe fn otherMouseUp(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(mouseMoved:)]
        pub unsafe fn mouseMoved(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(mouseDragged:)]
        pub unsafe fn mouseDragged(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(scrollWheel:)]
        pub unsafe fn scrollWheel(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(rightMouseDragged:)]
        pub unsafe fn rightMouseDragged(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(otherMouseDragged:)]
        pub unsafe fn otherMouseDragged(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(mouseEntered:)]
        pub unsafe fn mouseEntered(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(mouseExited:)]
        pub unsafe fn mouseExited(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(keyDown:)]
        pub unsafe fn keyDown(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(keyUp:)]
        pub unsafe fn keyUp(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(flagsChanged:)]
        pub unsafe fn flagsChanged(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(tabletPoint:)]
        pub unsafe fn tabletPoint(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(tabletProximity:)]
        pub unsafe fn tabletProximity(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(cursorUpdate:)]
        pub unsafe fn cursorUpdate(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(magnifyWithEvent:)]
        pub unsafe fn magnifyWithEvent(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(rotateWithEvent:)]
        pub unsafe fn rotateWithEvent(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(swipeWithEvent:)]
        pub unsafe fn swipeWithEvent(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(beginGestureWithEvent:)]
        pub unsafe fn beginGestureWithEvent(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(endGestureWithEvent:)]
        pub unsafe fn endGestureWithEvent(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(smartMagnifyWithEvent:)]
        pub unsafe fn smartMagnifyWithEvent(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(changeModeWithEvent:)]
        pub unsafe fn changeModeWithEvent(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(touchesBeganWithEvent:)]
        pub unsafe fn touchesBeganWithEvent(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(touchesMovedWithEvent:)]
        pub unsafe fn touchesMovedWithEvent(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(touchesEndedWithEvent:)]
        pub unsafe fn touchesEndedWithEvent(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(touchesCancelledWithEvent:)]
        pub unsafe fn touchesCancelledWithEvent(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(quickLookWithEvent:)]
        pub unsafe fn quickLookWithEvent(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(pressureChangeWithEvent:)]
        pub unsafe fn pressureChangeWithEvent(&self, event: &NSEvent);

        #[method(noResponderFor:)]
        pub unsafe fn noResponderFor(&self, event_selector: Sel);

        #[method(acceptsFirstResponder)]
        pub unsafe fn acceptsFirstResponder(&self) -> bool;

        #[method(becomeFirstResponder)]
        pub unsafe fn becomeFirstResponder(&self) -> bool;

        #[method(resignFirstResponder)]
        pub unsafe fn resignFirstResponder(&self) -> bool;

        #[cfg(feature = "NSEvent")]
        #[method(interpretKeyEvents:)]
        pub unsafe fn interpretKeyEvents(&self, event_array: &NSArray<NSEvent>);

        #[method(flushBufferedKeyEvents)]
        pub unsafe fn flushBufferedKeyEvents(&self);

        #[cfg(feature = "NSMenu")]
        #[method_id(@__retain_semantics Other menu)]
        pub unsafe fn menu(&self) -> Option<Id<NSMenu>>;

        #[cfg(feature = "NSMenu")]
        #[method(setMenu:)]
        pub unsafe fn setMenu(&self, menu: Option<&NSMenu>);

        #[method(showContextHelp:)]
        pub unsafe fn showContextHelp(&self, sender: Option<&AnyObject>);

        #[cfg(feature = "NSEvent")]
        #[method(helpRequested:)]
        pub unsafe fn helpRequested(&self, event_ptr: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[method(shouldBeTreatedAsInkEvent:)]
        pub unsafe fn shouldBeTreatedAsInkEvent(&self, event: &NSEvent) -> bool;

        #[cfg(feature = "NSEvent")]
        #[method(wantsScrollEventsForSwipeTrackingOnAxis:)]
        pub unsafe fn wantsScrollEventsForSwipeTrackingOnAxis(
            &self,
            axis: NSEventGestureAxis,
        ) -> bool;

        #[cfg(feature = "NSEvent")]
        #[method(wantsForwardedScrollEventsForAxis:)]
        pub unsafe fn wantsForwardedScrollEventsForAxis(&self, axis: NSEventGestureAxis) -> bool;

        #[method_id(@__retain_semantics Other supplementalTargetForAction:sender:)]
        pub unsafe fn supplementalTargetForAction_sender(
            &self,
            action: Sel,
            sender: Option<&AnyObject>,
        ) -> Option<Id<AnyObject>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSResponder {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
    }
);

extern_protocol!(
    pub unsafe trait NSStandardKeyBindingResponding:
        NSObjectProtocol + IsMainThreadOnly
    {
        #[optional]
        #[method(insertText:)]
        unsafe fn insertText(&self, insert_string: &AnyObject);

        #[optional]
        #[method(doCommandBySelector:)]
        unsafe fn doCommandBySelector(&self, selector: Sel);

        #[optional]
        #[method(moveForward:)]
        unsafe fn moveForward(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveRight:)]
        unsafe fn moveRight(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveBackward:)]
        unsafe fn moveBackward(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveLeft:)]
        unsafe fn moveLeft(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveUp:)]
        unsafe fn moveUp(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveDown:)]
        unsafe fn moveDown(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveWordForward:)]
        unsafe fn moveWordForward(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveWordBackward:)]
        unsafe fn moveWordBackward(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveToBeginningOfLine:)]
        unsafe fn moveToBeginningOfLine(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveToEndOfLine:)]
        unsafe fn moveToEndOfLine(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveToBeginningOfParagraph:)]
        unsafe fn moveToBeginningOfParagraph(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveToEndOfParagraph:)]
        unsafe fn moveToEndOfParagraph(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveToEndOfDocument:)]
        unsafe fn moveToEndOfDocument(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveToBeginningOfDocument:)]
        unsafe fn moveToBeginningOfDocument(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(pageDown:)]
        unsafe fn pageDown(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(pageUp:)]
        unsafe fn pageUp(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(centerSelectionInVisibleArea:)]
        unsafe fn centerSelectionInVisibleArea(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveBackwardAndModifySelection:)]
        unsafe fn moveBackwardAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveForwardAndModifySelection:)]
        unsafe fn moveForwardAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveWordForwardAndModifySelection:)]
        unsafe fn moveWordForwardAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveWordBackwardAndModifySelection:)]
        unsafe fn moveWordBackwardAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveUpAndModifySelection:)]
        unsafe fn moveUpAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveDownAndModifySelection:)]
        unsafe fn moveDownAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveToBeginningOfLineAndModifySelection:)]
        unsafe fn moveToBeginningOfLineAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveToEndOfLineAndModifySelection:)]
        unsafe fn moveToEndOfLineAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveToBeginningOfParagraphAndModifySelection:)]
        unsafe fn moveToBeginningOfParagraphAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveToEndOfParagraphAndModifySelection:)]
        unsafe fn moveToEndOfParagraphAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveToEndOfDocumentAndModifySelection:)]
        unsafe fn moveToEndOfDocumentAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveToBeginningOfDocumentAndModifySelection:)]
        unsafe fn moveToBeginningOfDocumentAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(pageDownAndModifySelection:)]
        unsafe fn pageDownAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(pageUpAndModifySelection:)]
        unsafe fn pageUpAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveParagraphForwardAndModifySelection:)]
        unsafe fn moveParagraphForwardAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveParagraphBackwardAndModifySelection:)]
        unsafe fn moveParagraphBackwardAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveWordRight:)]
        unsafe fn moveWordRight(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveWordLeft:)]
        unsafe fn moveWordLeft(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveRightAndModifySelection:)]
        unsafe fn moveRightAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveLeftAndModifySelection:)]
        unsafe fn moveLeftAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveWordRightAndModifySelection:)]
        unsafe fn moveWordRightAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveWordLeftAndModifySelection:)]
        unsafe fn moveWordLeftAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveToLeftEndOfLine:)]
        unsafe fn moveToLeftEndOfLine(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveToRightEndOfLine:)]
        unsafe fn moveToRightEndOfLine(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveToLeftEndOfLineAndModifySelection:)]
        unsafe fn moveToLeftEndOfLineAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(moveToRightEndOfLineAndModifySelection:)]
        unsafe fn moveToRightEndOfLineAndModifySelection(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(scrollPageUp:)]
        unsafe fn scrollPageUp(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(scrollPageDown:)]
        unsafe fn scrollPageDown(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(scrollLineUp:)]
        unsafe fn scrollLineUp(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(scrollLineDown:)]
        unsafe fn scrollLineDown(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(scrollToBeginningOfDocument:)]
        unsafe fn scrollToBeginningOfDocument(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(scrollToEndOfDocument:)]
        unsafe fn scrollToEndOfDocument(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(transpose:)]
        unsafe fn transpose(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(transposeWords:)]
        unsafe fn transposeWords(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(selectAll:)]
        unsafe fn selectAll(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(selectParagraph:)]
        unsafe fn selectParagraph(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(selectLine:)]
        unsafe fn selectLine(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(selectWord:)]
        unsafe fn selectWord(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(indent:)]
        unsafe fn indent(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(insertTab:)]
        unsafe fn insertTab(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(insertBacktab:)]
        unsafe fn insertBacktab(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(insertNewline:)]
        unsafe fn insertNewline(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(insertParagraphSeparator:)]
        unsafe fn insertParagraphSeparator(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(insertNewlineIgnoringFieldEditor:)]
        unsafe fn insertNewlineIgnoringFieldEditor(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(insertTabIgnoringFieldEditor:)]
        unsafe fn insertTabIgnoringFieldEditor(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(insertLineBreak:)]
        unsafe fn insertLineBreak(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(insertContainerBreak:)]
        unsafe fn insertContainerBreak(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(insertSingleQuoteIgnoringSubstitution:)]
        unsafe fn insertSingleQuoteIgnoringSubstitution(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(insertDoubleQuoteIgnoringSubstitution:)]
        unsafe fn insertDoubleQuoteIgnoringSubstitution(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(changeCaseOfLetter:)]
        unsafe fn changeCaseOfLetter(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(uppercaseWord:)]
        unsafe fn uppercaseWord(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(lowercaseWord:)]
        unsafe fn lowercaseWord(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(capitalizeWord:)]
        unsafe fn capitalizeWord(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(deleteForward:)]
        unsafe fn deleteForward(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(deleteBackward:)]
        unsafe fn deleteBackward(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(deleteBackwardByDecomposingPreviousCharacter:)]
        unsafe fn deleteBackwardByDecomposingPreviousCharacter(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(deleteWordForward:)]
        unsafe fn deleteWordForward(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(deleteWordBackward:)]
        unsafe fn deleteWordBackward(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(deleteToBeginningOfLine:)]
        unsafe fn deleteToBeginningOfLine(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(deleteToEndOfLine:)]
        unsafe fn deleteToEndOfLine(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(deleteToBeginningOfParagraph:)]
        unsafe fn deleteToBeginningOfParagraph(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(deleteToEndOfParagraph:)]
        unsafe fn deleteToEndOfParagraph(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(yank:)]
        unsafe fn yank(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(complete:)]
        unsafe fn complete(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(setMark:)]
        unsafe fn setMark(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(deleteToMark:)]
        unsafe fn deleteToMark(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(selectToMark:)]
        unsafe fn selectToMark(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(swapWithMark:)]
        unsafe fn swapWithMark(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(cancelOperation:)]
        unsafe fn cancelOperation(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(makeBaseWritingDirectionNatural:)]
        unsafe fn makeBaseWritingDirectionNatural(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(makeBaseWritingDirectionLeftToRight:)]
        unsafe fn makeBaseWritingDirectionLeftToRight(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(makeBaseWritingDirectionRightToLeft:)]
        unsafe fn makeBaseWritingDirectionRightToLeft(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(makeTextWritingDirectionNatural:)]
        unsafe fn makeTextWritingDirectionNatural(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(makeTextWritingDirectionLeftToRight:)]
        unsafe fn makeTextWritingDirectionLeftToRight(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(makeTextWritingDirectionRightToLeft:)]
        unsafe fn makeTextWritingDirectionRightToLeft(&self, sender: Option<&AnyObject>);

        #[optional]
        #[method(quickLookPreviewItems:)]
        unsafe fn quickLookPreviewItems(&self, sender: Option<&AnyObject>);
    }

    unsafe impl ProtocolType for dyn NSStandardKeyBindingResponding {}
);

extern_methods!(
    /// NSStandardKeyBindingMethods
    unsafe impl NSResponder {}
);

unsafe impl NSStandardKeyBindingResponding for NSResponder {}

extern_methods!(
    /// NSUndoSupport
    unsafe impl NSResponder {
        #[method_id(@__retain_semantics Other undoManager)]
        pub unsafe fn undoManager(&self) -> Option<Id<NSUndoManager>>;
    }
);

extern_methods!(
    /// NSControlEditingSupport
    unsafe impl NSResponder {
        #[cfg(feature = "NSEvent")]
        #[method(validateProposedFirstResponder:forEvent:)]
        pub unsafe fn validateProposedFirstResponder_forEvent(
            &self,
            responder: &NSResponder,
            event: Option<&NSEvent>,
        ) -> bool;
    }
);

extern_methods!(
    /// NSErrorPresentation
    unsafe impl NSResponder {
        #[cfg(feature = "NSWindow")]
        #[method(presentError:modalForWindow:delegate:didPresentSelector:contextInfo:)]
        pub unsafe fn presentError_modalForWindow_delegate_didPresentSelector_contextInfo(
            &self,
            error: &NSError,
            window: &NSWindow,
            delegate: Option<&AnyObject>,
            did_present_selector: Option<Sel>,
            context_info: *mut c_void,
        );

        #[method(presentError:)]
        pub unsafe fn presentError(&self, error: &NSError) -> bool;

        #[method_id(@__retain_semantics Other willPresentError:)]
        pub unsafe fn willPresentError(&self, error: &NSError) -> Id<NSError>;
    }
);

extern_methods!(
    /// NSTextFinderSupport
    unsafe impl NSResponder {
        #[method(performTextFinderAction:)]
        pub unsafe fn performTextFinderAction(&self, sender: Option<&AnyObject>);
    }
);

extern_methods!(
    /// NSWindowTabbing
    unsafe impl NSResponder {
        #[method(newWindowForTab:)]
        pub unsafe fn newWindowForTab(&self, sender: Option<&AnyObject>);
    }
);

extern_methods!(
    /// NSDeprecated
    unsafe impl NSResponder {
        #[deprecated = "This has always returned NO and had no effect on macOS"]
        #[method(performMnemonic:)]
        pub unsafe fn performMnemonic(&self, string: &NSString) -> bool;
    }
);