Mercurial > projects > dwt-mac
comparison 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 |
comparison
equal
deleted
inserted
replaced
14:762fbe6f17d3 | 15:2952d5604c0a |
---|---|
5 * which accompanies this distribution, and is available at | 5 * which accompanies this distribution, and is available at |
6 * http://www.eclipse.org/legal/epl-v10.html | 6 * http://www.eclipse.org/legal/epl-v10.html |
7 * | 7 * |
8 * Contributors: | 8 * Contributors: |
9 * IBM Corporation - initial API and implementation | 9 * IBM Corporation - initial API and implementation |
10 * | |
11 * Port to the D programming language: | |
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | |
10 *******************************************************************************/ | 13 *******************************************************************************/ |
11 module dwt.widgets.Monitor; | 14 module dwt.widgets.Monitor; |
12 | 15 |
13 import dwt.dwthelper.utils; | 16 import dwt.dwthelper.utils; |
14 | 17 |
27 int clientX, clientY, clientWidth, clientHeight; | 30 int clientX, clientY, clientWidth, clientHeight; |
28 | 31 |
29 /** | 32 /** |
30 * Prevents uninitialized instances from being created outside the package. | 33 * Prevents uninitialized instances from being created outside the package. |
31 */ | 34 */ |
32 Monitor () { | 35 this () { |
33 } | 36 } |
34 | 37 |
35 /** | 38 /** |
36 * Compares the argument to the receiver, and returns true | 39 * Compares the argument to the receiver, and returns true |
37 * if they represent the <em>same</em> object using a class | 40 * if they represent the <em>same</em> object using a class |
40 * @param object the object to compare with this object | 43 * @param object the object to compare with this object |
41 * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise | 44 * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise |
42 * | 45 * |
43 * @see #hashCode() | 46 * @see #hashCode() |
44 */ | 47 */ |
45 public bool equals (Object object) { | 48 public bool opEquals (Object object) { |
46 if (object is this) return true; | 49 if (object is this) return true; |
47 if (!(object instanceof Monitor)) return false; | 50 if (!(cast(dwt.widgets.Monitor.Monitor) object)) return false; |
48 Monitor monitor = (Monitor) object; | 51 dwt.widgets.Monitor.Monitor monitor = cast(dwt.widgets.Monitor.Monitor) object; |
49 return handle is monitor.handle; | 52 return handle is monitor.handle; |
50 } | 53 } |
51 | 54 |
52 /** | 55 /** |
53 * Returns a rectangle describing the receiver's size and location | 56 * Returns a rectangle describing the receiver's size and location |
78 * | 81 * |
79 * @return the receiver's hash | 82 * @return the receiver's hash |
80 * | 83 * |
81 * @see #equals(Object) | 84 * @see #equals(Object) |
82 */ | 85 */ |
83 public int hashCode () { | 86 public hash_t toHash () { |
84 return (int)/*64*/handle; | 87 return cast(hash_t)/*64*/handle; |
85 } | 88 } |
86 | 89 |
87 } | 90 } |