diff dwt/internal/cocoa/DOMEvent.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
line wrap: on
line diff
--- a/dwt/internal/cocoa/DOMEvent.d	Tue Oct 21 15:20:04 2008 +0200
+++ b/dwt/internal/cocoa/DOMEvent.d	Mon Dec 01 17:07:00 2008 +0100
@@ -1,69 +1,40 @@
 /*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    IBM Corporation - initial API and implementation
+ *     
  * Port to the D programming language:
- *     Jacob Carlborg <jacob.carlborg@gmail.com>
+ *    Jacob Carlborg <doob@me.com>
  *******************************************************************************/
 module dwt.internal.cocoa.DOMEvent;
 
+import dwt.dwthelper.utils;
+import cocoa = dwt.internal.cocoa.id;
 import dwt.internal.cocoa.NSObject;
-import dwt.internal.cocoa.NSString;
 import dwt.internal.cocoa.OS;
-import objc = dwt.internal.objc.objc : id;
+import objc = dwt.internal.objc.runtime;
 
 public class DOMEvent : NSObject {
 
-    public this () {
-        super();
-    }
-
-    public this (objc.id id) {
-        super(id);
-    }
-
-    public bool bubbles () {
-        return OS.objc_msgSend(this.id, OS.sel_bubbles) !is null;
-    }
+public this() {
+    super();
+}
 
-    public bool cancelable () {
-        return OS.objc_msgSend(this.id, OS.sel_cancelable) !is null;
-    }
-
-    public id currentTarget () {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_currentTarget);
-        return result !is null ? new id(result) : null;
-    }
-
-    public short eventPhase () {
-        return cast(short) OS.objc_msgSend(this.id, OS.sel_eventPhase);
-    }
+public this(objc.id id) {
+    super(id);
+}
 
-    public void initEvent___ (NSString initEvent, bool canBubbleArg, bool cancelableArg) {
-        OS.objc_msgSend(this.id, OS.sel_initEvent_1_1_1, initEvent !is null ? initEvent.id : null, canBubbleArg, cancelableArg);
-    }
-
-    public void initEvent_canBubbleArg_cancelableArg_ (NSString eventTypeArg, bool canBubbleArg, bool cancelableArg) {
-        OS.objc_msgSend(this.id, OS.sel_initEvent_1canBubbleArg_1cancelableArg_1, eventTypeArg !is null ? eventTypeArg.id : null, canBubbleArg,
-                cancelableArg);
-    }
-
-    public void preventDefault () {
-        OS.objc_msgSend(this.id, OS.sel_preventDefault);
-    }
+public this(cocoa.id id) {
+    super(id);
+}
 
-    public void stopPropagation () {
-        OS.objc_msgSend(this.id, OS.sel_stopPropagation);
-    }
-
-    public id target () {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_target);
-        return result !is null ? new id(result) : null;
-    }
+public void preventDefault() {
+    OS.objc_msgSend(this.id, OS.sel_preventDefault);
+}
 
-    public long timeStamp () {
-        return cast(long) OS.objc_msgSend(this.id, OS.sel_timeStamp);
-    }
-
-    public NSString type () {
-        objc.id result = OS.objc_msgSend(this.id, OS.sel_type);
-        return result !is null ? new NSString(result) : null;
-    }
 }