diff dwt/internal/cocoa/DOMMouseEvent.d @ 0:380af2bdd8e5

Upload of whole dwt tree
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sat, 09 Aug 2008 17:00:02 +0200
parents
children f565d3a95c0a
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dwt/internal/cocoa/DOMMouseEvent.d	Sat Aug 09 17:00:02 2008 +0200
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Port to the D Programming language:
+ *     Jacob Carlborg <jacob.carlborg@gmail.com>
+ *******************************************************************************/
+module dwt.internal.cocoa.DOMMouseEvent;
+
+import dwt.dwthelper.utils;
+import dwt.internal.cocoa.NSObject;
+
+public class DOMMouseEvent : NSObject {
+
+    public this () {
+        super();
+    }
+
+    public this (int id) {
+        super(id);
+    }
+
+    public bool altKey () {
+        return OS.objc_msgSend(this.id, OS.sel_altKey) !is 0;
+    }
+
+    public short button () {
+        return cast(short) OS.objc_msgSend(this.id, OS.sel_button);
+    }
+
+    public int clientX () {
+        return OS.objc_msgSend(this.id, OS.sel_clientX);
+    }
+
+    public int clientY () {
+        return OS.objc_msgSend(this.id, OS.sel_clientY);
+    }
+
+    public bool ctrlKey () {
+        return OS.objc_msgSend(this.id, OS.sel_ctrlKey) !is 0;
+    }
+
+    public int detail () {
+        return OS.objc_msgSend(this.id, OS.sel_detail);
+    }
+
+    //public void initMouseEvent_______________(NSString initMouseEvent, bool canBubble, bool cancelable, DOMAbstractView view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, short button, id relatedTarget) {
+    //  OS.objc_msgSend(this.id, OS.sel_initMouseEvent_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1, initMouseEvent !is null ? initMouseEvent.id : 0, canBubble, cancelable, view !is null ? view.id : 0, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget !is null ? relatedTarget.id : 0);
+    //}
+
+    //public void initMouseEvent_canBubble_cancelable_view_detail_screenX_screenY_clientX_clientY_ctrlKey_altKey_shiftKey_metaKey_button_relatedTarget_(NSString type, bool canBubble, bool cancelable, DOMAbstractView view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, short button, id  relatedTarget) {
+    //  OS.objc_msgSend(this.id, OS.sel_initMouseEvent_1canBubble_1cancelable_1view_1detail_1screenX_1screenY_1clientX_1clientY_1ctrlKey_1altKey_1shiftKey_1metaKey_1button_1relatedTarget_1, type !is null ? type.id : 0, canBubble, cancelable, view !is null ? view.id : 0, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget !is null ? relatedTarget.id : 0);
+    //}
+
+    public bool metaKey () {
+        return OS.objc_msgSend(this.id, OS.sel_metaKey) !is 0;
+    }
+
+    public id relatedTarget () {
+        int result = OS.objc_msgSend(this.id, OS.sel_relatedTarget);
+        return result !is 0 ? new id(result) : null;
+    }
+
+    public int screenX () {
+        return OS.objc_msgSend(this.id, OS.sel_screenX);
+    }
+
+    public int screenY () {
+        return OS.objc_msgSend(this.id, OS.sel_screenY);
+    }
+
+    public bool shiftKey () {
+        return OS.objc_msgSend(this.id, OS.sel_shiftKey) !is 0;
+    }
+
+}