annotate dwt/widgets/Monitor.d @ 259:c0d810de7093

Update SWT 3.4M7 to 3.4
author Frank Benoit <benoit@tionex.de>
date Sun, 29 Jun 2008 14:33:38 +0200
parents ce446666f5a2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
72
5899e0b43e5d porting notice
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
1 /*******************************************************************************
259
c0d810de7093 Update SWT 3.4M7 to 3.4
Frank Benoit <benoit@tionex.de>
parents: 240
diff changeset
2 * Copyright (c) 2000, 2008 IBM Corporation and others.
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3 * All rights reserved. This program and the accompanying materials
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4 * are made available under the terms of the Eclipse Public License v1.0
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
5 * which accompanies this distribution, and is available at
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
6 * http://www.eclipse.org/legal/epl-v10.html
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
7 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
8 * Contributors:
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
9 * IBM Corporation - initial API and implementation
72
5899e0b43e5d porting notice
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
10 * Port to the D programming language:
5899e0b43e5d porting notice
Frank Benoit <benoit@tionex.de>
parents: 59
diff changeset
11 * Frank Benoit <benoit@tionex.de>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
12 *******************************************************************************/
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
13 module dwt.widgets.Monitor;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
14
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
15 import dwt.graphics.Rectangle;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
16
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
17 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
18 * Instances of this class are descriptions of monitors.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
19 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
20 * @see Display
259
c0d810de7093 Update SWT 3.4M7 to 3.4
Frank Benoit <benoit@tionex.de>
parents: 240
diff changeset
21 * @see <a href="http://www.eclipse.org/swt/snippets/#monitor">Monitor snippets</a>
c0d810de7093 Update SWT 3.4M7 to 3.4
Frank Benoit <benoit@tionex.de>
parents: 240
diff changeset
22 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
23 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
24 * @since 3.0
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
25 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
26 public final class Monitor {
240
ce446666f5a2 Update to SWT 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 72
diff changeset
27 int /*long*/ handle;
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 25
diff changeset
28 int x, y, width, height;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 25
diff changeset
29 int clientX, clientY, clientWidth, clientHeight;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
30
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
31 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
32 * Prevents uninitialized instances from being created outside the package.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
33 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
34 this () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
35 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
36
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
37 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
38 * Compares the argument to the receiver, and returns true
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
39 * if they represent the <em>same</em> object using a class
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
40 * specific comparison.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
41 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
42 * @param object the object to compare with this object
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
43 * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
44 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
45 * @see #hashCode()
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
46 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
47 public override int opEquals (Object object) {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 25
diff changeset
48 if (object is this) return true;
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 25
diff changeset
49 if ( auto mon = cast(dwt.widgets.Monitor.Monitor)object ){
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 25
diff changeset
50 return handle is mon.handle;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
51 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
52 return false;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
53 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
54
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
55 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
56 * Returns a rectangle describing the receiver's size and location
240
ce446666f5a2 Update to SWT 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 72
diff changeset
57 * relative to its device. Note that on multi-monitor systems the
ce446666f5a2 Update to SWT 3.4M7
Frank Benoit <benoit@tionex.de>
parents: 72
diff changeset
58 * origin can be negative.
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
59 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
60 * @return the receiver's bounding rectangle
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
61 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
62 public Rectangle getBounds () {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 25
diff changeset
63 return new Rectangle (x, y, width, height);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
64 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
65
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
66 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
67 * Returns a rectangle which describes the area of the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
68 * receiver which is capable of displaying data.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
69 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
70 * @return the client area
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
71 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
72 public Rectangle getClientArea () {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 25
diff changeset
73 return new Rectangle (clientX, clientY, clientWidth, clientHeight);
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
74 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
75
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
76 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
77 * Returns an integer hash code for the receiver. Any two
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
78 * objects that return <code>true</code> when passed to
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
79 * <code>equals</code> must return the same value for this
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
80 * method.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
81 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
82 * @return the receiver's hash
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
83 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
84 * @see #equals(Object)
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
85 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
86 public override hash_t toHash() {
59
8cec8f536af3 All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents: 25
diff changeset
87 return cast(hash_t)handle;
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
88 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
89
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
90 }