Mercurial > projects > dwt-mac
annotate dwt/internal/cocoa/NSRect.d @ 46:cfa563df4fdd
Updated Widget and Display to 3.514
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Fri, 05 Dec 2008 16:00:41 +0100 |
parents | d8635bb48c7c |
children | 34237ae5156a |
rev | line source |
---|---|
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
1 /******************************************************************************* |
45 | 2 * Copyright (c) 2008 IBM Corporation and others. |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
3 * All rights reserved. This program and the accompanying materials |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
4 * are made available under the terms of the Eclipse Public License v1.0 |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
5 * which accompanies this distribution, and is available at |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
6 * http://www.eclipse.org/legal/epl-v10.html |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
7 * |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
8 * Contributors: |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
9 * IBM Corporation - initial API and implementation |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
10 * |
13
f565d3a95c0a
Ported dwt.internal
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
0
diff
changeset
|
11 * Port to the D programming language: |
45 | 12 * Jacob Carlborg <doob@me.com> |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
13 *******************************************************************************/ |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
14 module dwt.internal.cocoa.NSRect; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
15 |
45 | 16 import dwt.dwthelper.utils; |
46
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
17 import dwt.internal.c.Carbon; |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
18 import dwt.internal.cocoa.NSPoint; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
19 import dwt.internal.cocoa.NSSize; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
20 |
37
642f460a0908
Fixed a lot of compile errors, a "hello world" app compiles now
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
36
diff
changeset
|
21 |
45 | 22 public struct NSRect { |
23 /** @field accessor=origin.x */ | |
46
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
24 CGFloat x () |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
25 { |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
26 return origin.x; |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
27 } |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
28 |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
29 CGFloat x (CGFloat x) |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
30 { |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
31 return origin.x = x; |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
32 } |
45 | 33 /** @field accessor=origin.y */ |
46
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
34 CGFloat y () |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
35 { |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
36 return origin.y; |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
37 } |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
38 |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
39 CGFloat y (CGFloat y) |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
40 { |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
41 return origin.y = y; |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
42 } |
45 | 43 /** @field accessor=size.width */ |
46
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
44 CGFloat width () |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
45 { |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
46 return size.width; |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
47 } |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
48 |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
49 CGFloat width (CGFloat width) |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
50 { |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
51 return size.width = width; |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
52 } |
45 | 53 /** @field accessor=size.height */ |
46
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
54 CGFloat height () |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
55 { |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
56 return size.height; |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
57 } |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
58 |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
59 CGFloat width (CGFloat height) |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
60 { |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
61 return size.height = height; |
cfa563df4fdd
Updated Widget and Display to 3.514
Jacob Carlborg <doob@me.com>
parents:
45
diff
changeset
|
62 } |
45 | 63 |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
64 NSPoint origin; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
65 NSSize size; |
45 | 66 } |