Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/DOMWheelEvent.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 |
comparison
equal
deleted
inserted
replaced
44:ca5e494f2bbf | 45:d8635bb48c7c |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2008 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * | |
2 * Port to the D programming language: | 11 * Port to the D programming language: |
3 * Jacob Carlborg <jacob.carlborg@gmail.com> | 12 * Jacob Carlborg <doob@me.com> |
4 *******************************************************************************/ | 13 *******************************************************************************/ |
5 module dwt.internal.cocoa.DOMWheelEvent; | 14 module dwt.internal.cocoa.DOMWheelEvent; |
6 | 15 |
7 import dwt.dwthelper.utils; | 16 import dwt.dwthelper.utils; |
17 import cocoa = dwt.internal.cocoa.id; | |
8 import dwt.internal.cocoa.NSObject; | 18 import dwt.internal.cocoa.NSObject; |
19 import dwt.internal.cocoa.OS; | |
20 import objc = dwt.internal.objc.runtime; | |
9 | 21 |
10 public class DOMWheelEvent : NSObject { | 22 public class DOMWheelEvent : NSObject { |
11 | 23 |
12 public this () { | 24 public this() { |
13 super(); | 25 super(); |
14 } | 26 } |
15 | 27 |
16 public this (int id) { | 28 public this(objc.id id) { |
17 super(id); | 29 super(id); |
18 } | 30 } |
19 | 31 |
20 public bool altKey () { | 32 public this(cocoa.id id) { |
21 return OS.objc_msgSend(this.id, OS.sel_altKey) !is 0; | 33 super(id); |
22 } | 34 } |
23 | 35 |
24 public int clientX () { | 36 public bool altKey() { |
25 return OS.objc_msgSend(this.id, OS.sel_clientX); | 37 return OS.objc_msgSend_bool(this.id, OS.sel_altKey); |
26 } | 38 } |
27 | 39 |
28 public int clientY () { | 40 public int clientX() { |
29 return OS.objc_msgSend(this.id, OS.sel_clientY); | 41 return cast(int)/*64*/OS.objc_msgSend(this.id, OS.sel_clientX); |
30 } | 42 } |
31 | 43 |
32 public bool ctrlKey () { | 44 public int clientY() { |
33 return OS.objc_msgSend(this.id, OS.sel_ctrlKey) !is 0; | 45 return cast(int)/*64*/OS.objc_msgSend(this.id, OS.sel_clientY); |
34 } | 46 } |
35 | 47 |
36 public bool isHorizontal () { | 48 public bool ctrlKey() { |
37 return OS.objc_msgSend(this.id, OS.sel_isHorizontal) !is 0; | 49 return OS.objc_msgSend_bool(this.id, OS.sel_ctrlKey); |
38 } | 50 } |
39 | 51 |
40 public bool metaKey () { | 52 public bool metaKey() { |
41 return OS.objc_msgSend(this.id, OS.sel_metaKey) !is 0; | 53 return OS.objc_msgSend_bool(this.id, OS.sel_metaKey); |
42 } | 54 } |
43 | 55 |
44 public int screenX () { | 56 public bool shiftKey() { |
45 return OS.objc_msgSend(this.id, OS.sel_screenX); | 57 return OS.objc_msgSend_bool(this.id, OS.sel_shiftKey); |
46 } | 58 } |
47 | 59 |
48 public int screenY () { | 60 public int wheelDelta() { |
49 return OS.objc_msgSend(this.id, OS.sel_screenY); | 61 return cast(int)/*64*/OS.objc_msgSend(this.id, OS.sel_wheelDelta); |
50 } | 62 } |
51 | |
52 public bool shiftKey () { | |
53 return OS.objc_msgSend(this.id, OS.sel_shiftKey) !is 0; | |
54 } | |
55 | |
56 public int wheelDelta () { | |
57 return OS.objc_msgSend(this.id, OS.sel_wheelDelta); | |
58 } | |
59 | 63 |
60 } | 64 } |