Mercurial > projects > dwt-mac
annotate dwt/internal/cocoa/NSResponder.d @ 45:d8635bb48c7c
Merge with SWT 3.5
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Mon, 01 Dec 2008 17:07:00 +0100 |
parents | f565d3a95c0a |
children |
rev | line source |
---|---|
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
1 /******************************************************************************* |
45 | 2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
3 * All rights reserved. This program and the accompanying materials |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
4 * are made available under the terms of the Eclipse Public License v1.0 |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
5 * which accompanies this distribution, and is available at |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
6 * http://www.eclipse.org/legal/epl-v10.html |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
7 * |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
8 * Contributors: |
45 | 9 * IBM Corporation - initial API and implementation |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
10 * |
13
f565d3a95c0a
Ported dwt.internal
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
1
diff
changeset
|
11 * Port to the D programming language: |
45 | 12 * Jacob Carlborg <doob@me.com> |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
13 *******************************************************************************/ |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
14 module dwt.internal.cocoa.NSResponder; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
15 |
45 | 16 import dwt.dwthelper.utils; |
17 import cocoa = dwt.internal.cocoa.id; | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
18 import dwt.internal.cocoa.NSArray; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
19 import dwt.internal.cocoa.NSEvent; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
20 import dwt.internal.cocoa.NSObject; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
21 import dwt.internal.cocoa.OS; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
22 import objc = dwt.internal.objc.runtime; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
23 |
45 | 24 public class NSResponder : NSObject { |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
25 |
45 | 26 public this() { |
27 super(); | |
28 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
29 |
45 | 30 public this(objc.id id) { |
31 super(id); | |
32 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
33 |
45 | 34 public this(cocoa.id id) { |
35 super(id); | |
36 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
37 |
45 | 38 public bool acceptsFirstResponder() { |
39 return OS.objc_msgSend_bool(this.id, OS.sel_acceptsFirstResponder); | |
40 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
41 |
45 | 42 public bool becomeFirstResponder() { |
43 return OS.objc_msgSend_bool(this.id, OS.sel_becomeFirstResponder); | |
44 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
45 |
45 | 46 public void doCommandBySelector(objc.SEL aSelector) { |
47 OS.objc_msgSend(this.id, OS.sel_doCommandBySelector_, aSelector); | |
48 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
49 |
45 | 50 public void flagsChanged(NSEvent theEvent) { |
51 OS.objc_msgSend(this.id, OS.sel_flagsChanged_, theEvent !is null ? theEvent.id : null); | |
52 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
53 |
45 | 54 public void helpRequested(NSEvent eventPtr) { |
55 OS.objc_msgSend(this.id, OS.sel_helpRequested_, eventPtr !is null ? eventPtr.id : null); | |
56 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
57 |
45 | 58 public void insertText(cocoa.id insertString) { |
59 OS.objc_msgSend(this.id, OS.sel_insertText_, insertString !is null ? insertString.id : null); | |
60 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
61 |
45 | 62 public void interpretKeyEvents(NSArray eventArray) { |
63 OS.objc_msgSend(this.id, OS.sel_interpretKeyEvents_, eventArray !is null ? eventArray.id : null); | |
64 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
65 |
45 | 66 public void keyDown(NSEvent theEvent) { |
67 OS.objc_msgSend(this.id, OS.sel_keyDown_, theEvent !is null ? theEvent.id : null); | |
68 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
69 |
45 | 70 public void keyUp(NSEvent theEvent) { |
71 OS.objc_msgSend(this.id, OS.sel_keyUp_, theEvent !is null ? theEvent.id : null); | |
72 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
73 |
45 | 74 public void mouseDown(NSEvent theEvent) { |
75 OS.objc_msgSend(this.id, OS.sel_mouseDown_, theEvent !is null ? theEvent.id : null); | |
76 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
77 |
45 | 78 public void mouseDragged(NSEvent theEvent) { |
79 OS.objc_msgSend(this.id, OS.sel_mouseDragged_, theEvent !is null ? theEvent.id : null); | |
80 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
81 |
45 | 82 public void mouseEntered(NSEvent theEvent) { |
83 OS.objc_msgSend(this.id, OS.sel_mouseEntered_, theEvent !is null ? theEvent.id : null); | |
84 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
85 |
45 | 86 public void mouseExited(NSEvent theEvent) { |
87 OS.objc_msgSend(this.id, OS.sel_mouseExited_, theEvent !is null ? theEvent.id : null); | |
88 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
89 |
45 | 90 public void mouseMoved(NSEvent theEvent) { |
91 OS.objc_msgSend(this.id, OS.sel_mouseMoved_, theEvent !is null ? theEvent.id : null); | |
92 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
93 |
45 | 94 public void mouseUp(NSEvent theEvent) { |
95 OS.objc_msgSend(this.id, OS.sel_mouseUp_, theEvent !is null ? theEvent.id : null); | |
96 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
97 |
45 | 98 public void moveToBeginningOfParagraph(cocoa.id sender) { |
99 OS.objc_msgSend(this.id, OS.sel_moveToBeginningOfParagraph_, sender !is null ? sender.id : null); | |
100 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
101 |
45 | 102 public void moveToEndOfParagraph(cocoa.id sender) { |
103 OS.objc_msgSend(this.id, OS.sel_moveToEndOfParagraph_, sender !is null ? sender.id : null); | |
104 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
105 |
45 | 106 public void moveUp(cocoa.id sender) { |
107 OS.objc_msgSend(this.id, OS.sel_moveUp_, sender !is null ? sender.id : null); | |
108 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
109 |
45 | 110 public void otherMouseDown(NSEvent theEvent) { |
111 OS.objc_msgSend(this.id, OS.sel_otherMouseDown_, theEvent !is null ? theEvent.id : null); | |
112 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
113 |
45 | 114 public void otherMouseDragged(NSEvent theEvent) { |
115 OS.objc_msgSend(this.id, OS.sel_otherMouseDragged_, theEvent !is null ? theEvent.id : null); | |
116 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
117 |
45 | 118 public void otherMouseUp(NSEvent theEvent) { |
119 OS.objc_msgSend(this.id, OS.sel_otherMouseUp_, theEvent !is null ? theEvent.id : null); | |
120 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
121 |
45 | 122 public void pageDown(cocoa.id sender) { |
123 OS.objc_msgSend(this.id, OS.sel_pageDown_, sender !is null ? sender.id : null); | |
124 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
125 |
45 | 126 public void pageUp(cocoa.id sender) { |
127 OS.objc_msgSend(this.id, OS.sel_pageUp_, sender !is null ? sender.id : null); | |
128 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
129 |
45 | 130 public bool resignFirstResponder() { |
131 return OS.objc_msgSend_bool(this.id, OS.sel_resignFirstResponder); | |
132 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
133 |
45 | 134 public void rightMouseDown(NSEvent theEvent) { |
135 OS.objc_msgSend(this.id, OS.sel_rightMouseDown_, theEvent !is null ? theEvent.id : null); | |
136 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
137 |
45 | 138 public void rightMouseDragged(NSEvent theEvent) { |
139 OS.objc_msgSend(this.id, OS.sel_rightMouseDragged_, theEvent !is null ? theEvent.id : null); | |
140 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
141 |
45 | 142 public void rightMouseUp(NSEvent theEvent) { |
143 OS.objc_msgSend(this.id, OS.sel_rightMouseUp_, theEvent !is null ? theEvent.id : null); | |
144 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
145 |
45 | 146 public void scrollWheel(NSEvent theEvent) { |
147 OS.objc_msgSend(this.id, OS.sel_scrollWheel_, theEvent !is null ? theEvent.id : null); | |
148 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
149 |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
150 } |