comparison dwt/internal/cocoa/NSClipView.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.NSClipView;
15
16 import dwt.internal.cocoa.NSColor;
17 import dwt.internal.cocoa.NSCursor;
18 import dwt.internal.cocoa.NSEvent;
19 import dwt.internal.cocoa.NSNotification;
20 import dwt.internal.cocoa.NSPoint;
21 import dwt.internal.cocoa.NSRect;
22 import dwt.internal.cocoa.NSView;
23 import dwt.internal.cocoa.OS;
24 import objc = dwt.internal.objc.runtime;
25
26 public class NSClipView : NSView
27 {
28
29 public this ()
30 {
31 super();
32 }
33
34 public this (objc.id id)
35 {
36 super(id);
37 }
38
39 public bool autoscroll (NSEvent theEvent)
40 {
41 return OS.objc_msgSend(this.id, OS.sel_autoscroll_1, theEvent !is null ? theEvent.id : null) !is null;
42 }
43
44 public NSColor backgroundColor ()
45 {
46 objc.id result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
47 return result !is null ? new NSColor(result) : null;
48 }
49
50 public NSPoint constrainScrollPoint (NSPoint newOrigin)
51 {
52 NSPoint result;
53 OS.objc_msgSend_stret(result, this.id, OS.sel_constrainScrollPoint_1, newOrigin);
54 return result;
55 }
56
57 public bool copiesOnScroll ()
58 {
59 return OS.objc_msgSend(this.id, OS.sel_copiesOnScroll) !is null;
60 }
61
62 public NSCursor documentCursor ()
63 {
64 objc.id result = OS.objc_msgSend(this.id, OS.sel_documentCursor);
65 return result !is null ? new NSCursor(result) : null;
66 }
67
68 public NSRect documentRect ()
69 {
70 NSRect result;
71 OS.objc_msgSend_stret(result, this.id, OS.sel_documentRect);
72 return result;
73 }
74
75 public id documentView ()
76 {
77 objc.id result = OS.objc_msgSend(this.id, OS.sel_documentView);
78 return result !is null ? new id(result) : null;
79 }
80
81 public NSRect documentVisibleRect ()
82 {
83 NSRect result;
84 OS.objc_msgSend_stret(result, this.id, OS.sel_documentVisibleRect);
85 return result;
86 }
87
88 public bool drawsBackground ()
89 {
90 return OS.objc_msgSend(this.id, OS.sel_drawsBackground) !is null;
91 }
92
93 public void scrollToPoint (NSPoint newOrigin)
94 {
95 OS.objc_msgSend(this.id, OS.sel_scrollToPoint_1, newOrigin);
96 }
97
98 public void setBackgroundColor (NSColor color)
99 {
100 OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color !is null ? color.id : null);
101 }
102
103 public void setCopiesOnScroll (bool flag)
104 {
105 OS.objc_msgSend(this.id, OS.sel_setCopiesOnScroll_1, flag);
106 }
107
108 public void setDocumentCursor (NSCursor anObj)
109 {
110 OS.objc_msgSend(this.id, OS.sel_setDocumentCursor_1, anObj !is null ? anObj.id : null);
111 }
112
113 public void setDocumentView (NSView aView)
114 {
115 OS.objc_msgSend(this.id, OS.sel_setDocumentView_1, aView !is null ? aView.id : null);
116 }
117
118 public void setDrawsBackground (bool flag)
119 {
120 OS.objc_msgSend(this.id, OS.sel_setDrawsBackground_1, flag);
121 }
122
123 public void viewBoundsChanged (NSNotification notification)
124 {
125 OS.objc_msgSend(this.id, OS.sel_viewBoundsChanged_1, notification !is null ? notification.id : null);
126 }
127
128 public void viewFrameChanged (NSNotification notification)
129 {
130 OS.objc_msgSend(this.id, OS.sel_viewFrameChanged_1, notification !is null ? notification.id : null);
131 }
132
133 }