Mercurial > projects > dwt-mac
view dwt/internal/cocoa/NSClipView.d @ 13:f565d3a95c0a
Ported dwt.internal
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Fri, 22 Aug 2008 16:46:34 +0200 |
parents | 8b48be5454ce |
children | d8635bb48c7c |
line wrap: on
line source
/******************************************************************************* * Copyright (c) 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation * * Port to the D programming language: * Jacob Carlborg <jacob.carlborg@gmail.com> *******************************************************************************/ module dwt.internal.cocoa.NSClipView; import dwt.internal.cocoa.id; import dwt.internal.cocoa.NSColor; import dwt.internal.cocoa.NSCursor; import dwt.internal.cocoa.NSEvent; import dwt.internal.cocoa.NSNotification; import dwt.internal.cocoa.NSPoint; import dwt.internal.cocoa.NSRect; import dwt.internal.cocoa.NSView; import dwt.internal.cocoa.OS; import objc = dwt.internal.objc.runtime; public class NSClipView : NSView { public this () { super(); } public this (objc.id id) { super(id); } public bool autoscroll (NSEvent theEvent) { return OS.objc_msgSend(this.id_, OS.sel_autoscroll_1, theEvent !is null ? theEvent.id_ : null) !is null; } public NSColor backgroundColor () { objc.id result = OS.objc_msgSend(this.id_, OS.sel_backgroundColor); return result !is null ? new NSColor(result) : null; } public NSPoint constrainScrollPoint (NSPoint newOrigin) { NSPoint result; OS.objc_msgSend_stret(&result, this.id_, OS.sel_constrainScrollPoint_1, newOrigin); return result; } public bool copiesOnScroll () { return OS.objc_msgSend(this.id_, OS.sel_copiesOnScroll) !is null; } public NSCursor documentCursor () { objc.id result = OS.objc_msgSend(this.id_, OS.sel_documentCursor); return result !is null ? new NSCursor(result) : null; } public NSRect documentRect () { NSRect result; OS.objc_msgSend_stret(&result, this.id_, OS.sel_documentRect); return result; } public id documentView () { objc.id result = OS.objc_msgSend(this.id_, OS.sel_documentView); return result !is null ? new id(result) : null; } public NSRect documentVisibleRect () { NSRect result; OS.objc_msgSend_stret(&result, this.id_, OS.sel_documentVisibleRect); return result; } public bool drawsBackground () { return OS.objc_msgSend(this.id_, OS.sel_drawsBackground) !is null; } public void scrollToPoint (NSPoint newOrigin) { OS.objc_msgSend(this.id_, OS.sel_scrollToPoint_1, newOrigin); } public void setBackgroundColor (NSColor color) { OS.objc_msgSend(this.id_, OS.sel_setBackgroundColor_1, color !is null ? color.id_ : null); } public void setCopiesOnScroll (bool flag) { OS.objc_msgSend(this.id_, OS.sel_setCopiesOnScroll_1, flag); } public void setDocumentCursor (NSCursor anObj) { OS.objc_msgSend(this.id_, OS.sel_setDocumentCursor_1, anObj !is null ? anObj.id_ : null); } public void setDocumentView (NSView aView) { OS.objc_msgSend(this.id_, OS.sel_setDocumentView_1, aView !is null ? aView.id_ : null); } public void setDrawsBackground (bool flag) { OS.objc_msgSend(this.id_, OS.sel_setDrawsBackground_1, flag); } public void viewBoundsChanged (NSNotification notification) { OS.objc_msgSend(this.id_, OS.sel_viewBoundsChanged_1, notification !is null ? notification.id_ : null); } public void viewFrameChanged (NSNotification notification) { OS.objc_msgSend(this.id_, OS.sel_viewFrameChanged_1, notification !is null ? notification.id_ : null); } }