diff dwt/widgets/Monitor.d @ 15:2952d5604c0a

Ported some widgets, added some stuff to the runtime bindings
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Fri, 29 Aug 2008 21:46:05 +0200
parents 380af2bdd8e5
children 5b53d338c709
line wrap: on
line diff
--- a/dwt/widgets/Monitor.d	Sat Aug 23 13:49:00 2008 +0200
+++ b/dwt/widgets/Monitor.d	Fri Aug 29 21:46:05 2008 +0200
@@ -7,6 +7,9 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ *     
+ * Port to the D programming language:
+ *     Jacob Carlborg <jacob.carlborg@gmail.com>
  *******************************************************************************/
 module dwt.widgets.Monitor;
 
@@ -29,7 +32,7 @@
 /**
  * Prevents uninitialized instances from being created outside the package.
  */
-Monitor () {    
+this () {    
 }
     
 /**
@@ -42,10 +45,10 @@
  *
  * @see #hashCode()
  */
-public bool equals (Object object) {
+public bool opEquals (Object object) {
     if (object is this) return true;
-    if (!(object instanceof Monitor)) return false;
-    Monitor monitor = (Monitor) object;
+    if (!(cast(dwt.widgets.Monitor.Monitor) object)) return false;
+    dwt.widgets.Monitor.Monitor monitor = cast(dwt.widgets.Monitor.Monitor) object;
     return handle is monitor.handle;
 }
 
@@ -80,8 +83,8 @@
  *
  * @see #equals(Object)
  */
-public int hashCode () {
-    return (int)/*64*/handle;
+public hash_t toHash () {
+    return cast(hash_t)/*64*/handle;
 }
 
 }