comparison dwt/internal/cocoa/NSScreen.d @ 0:380af2bdd8e5

Upload of whole dwt tree
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sat, 09 Aug 2008 17:00:02 +0200
parents
children 8b48be5454ce
comparison
equal deleted inserted replaced
-1:000000000000 0:380af2bdd8e5
1 /*******************************************************************************
2 * Copyright (c) 2007 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *
11 * Port to the D Programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com>
13 *******************************************************************************/
14 module dwt.internal.cocoa.NSScreen;
15
16 import dwt.internal.cocoa.CGFloat;
17 import dwt.internal.cocoa.NSArray;
18 import dwt.internal.cocoa.NSDictionary;
19 import dwt.internal.cocoa.NSObject;
20 import dwt.internal.cocoa.NSRect;
21 import dwt.internal.cocoa.NSWindow : NSWindowDepth;
22 import dwt.internal.cocoa.OS;
23 import objc = dwt.internal.objc.runtime;
24
25 public class NSScreen : NSObject
26 {
27
28 public this ()
29 {
30 super();
31 }
32
33 public this (objc.id id)
34 {
35 super(id);
36 }
37
38 public static NSScreen deepestScreen ()
39 {
40 objc.id result = OS.objc_msgSend(OS.class_NSScreen, OS.sel_deepestScreen);
41 return result !is null ? new NSScreen(result) : null;
42 }
43
44 public NSWindowDepth depth ()
45 {
46 return OS.objc_msgSend(this.id, OS.sel_depth);
47 }
48
49 public NSDictionary deviceDescription ()
50 {
51 objc.id result = OS.objc_msgSend(this.id, OS.sel_deviceDescription);
52 return result !is null ? new NSDictionary(result) : null;
53 }
54
55 public NSRect frame ()
56 {
57 NSRect result;
58 OS.objc_msgSend_stret(result, this.id, OS.sel_frame);
59 return result;
60 }
61
62 public static NSScreen mainScreen ()
63 {
64 objc.id result = OS.objc_msgSend(OS.class_NSScreen, OS.sel_mainScreen);
65 return result !is null ? new NSScreen(result) : null;
66 }
67
68 public static NSArray screens ()
69 {
70 objc.id result = OS.objc_msgSend(OS.class_NSScreen, OS.sel_screens);
71 return result !is null ? new NSArray(result) : null;
72 }
73
74 public /*const*/NSWindowDepth* supportedWindowDepths ()
75 {
76 return cast(/*const*/NSWindowDepth*)OS.objc_msgSend(this.id, OS.sel_supportedWindowDepths);
77 }
78
79 public CGFloat userSpaceScaleFactor ()
80 {
81 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_userSpaceScaleFactor);
82 }
83
84 public NSRect visibleFrame ()
85 {
86 NSRect result;
87 OS.objc_msgSend_stret(result, this.id, OS.sel_visibleFrame);
88 return result;
89 }
90
91 }