Mercurial > projects > dwt-mac
diff dwt/internal/cocoa/NSScrollView.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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwt/internal/cocoa/NSScrollView.d Sat Aug 09 17:00:02 2008 +0200 @@ -0,0 +1,336 @@ +/******************************************************************************* + * 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.NSScrollView; + +import dwt.internal.cocoa.id; +import dwt.internal.cocoa.CGFloat; +import dwt.internal.cocoa.NSClipView; +import dwt.internal.cocoa.NSColor; +import dwt.internal.cocoa.NSCursor; +import dwt.internal.cocoa.NSEvent; +import dwt.internal.cocoa.NSRect; +import dwt.internal.cocoa.NSRulerView; +import dwt.internal.cocoa.NSScroller; +import dwt.internal.cocoa.NSSize; +import dwt.internal.cocoa.NSView; +import dwt.internal.cocoa.OS; +import objc = dwt.internal.objc.runtime; + +public class NSScrollView : NSView +{ + + public this () + { + super(); + } + + public this (objc.id id) + { + super(id); + } + + public bool autohidesScrollers () + { + return OS.objc_msgSend(this.id, OS.sel_autohidesScrollers) !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 NSBorderType borderType () + { + return cast(NSBorderType) OS.objc_msgSend(this.id, OS.sel_borderType); + } + + public NSSize contentSize () + { + NSSize result; + OS.objc_msgSend_struct(result, this.id, OS.sel_contentSize); + return result; + } + + public static NSSize contentSizeForFrameSize (NSSize fSize, bool hFlag, bool vFlag, NSBorderType aType) + { + NSSize result; + OS.objc_msgSend_stret(result, OS.class_NSScrollView, + OS.sel_contentSizeForFrameSize_1hasHorizontalScroller_1hasVerticalScroller_1borderType_1, fSize, hFlag, vFlag, aType); + return result; + } + + public NSClipView contentView () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_contentView); + return result !is null ? new NSClipView(result) : null; + } + + public NSCursor documentCursor () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_documentCursor); + return result !is null ? new NSCursor(result) : null; + } + + 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 static NSSize frameSizeForContentSize (NSSize cSize, bool hFlag, bool vFlag, NSBorderType aType) + { + NSSize result; + OS.objc_msgSend_struct(result, OS.class_NSScrollView, + OS.sel_frameSizeForContentSize_1hasHorizontalScroller_1hasVerticalScroller_1borderType_1, cSize, hFlag, vFlag, aType); + return result; + } + + public bool hasHorizontalRuler () + { + return OS.objc_msgSend(this.id, OS.sel_hasHorizontalRuler) !is null; + } + + public bool hasHorizontalScroller () + { + return OS.objc_msgSend(this.id, OS.sel_hasHorizontalScroller) !is null; + } + + public bool hasVerticalRuler () + { + return OS.objc_msgSend(this.id, OS.sel_hasVerticalRuler) !is null; + } + + public bool hasVerticalScroller () + { + return OS.objc_msgSend(this.id, OS.sel_hasVerticalScroller) !is null; + } + + public CGFloat horizontalLineScroll () + { + return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_horizontalLineScroll); + } + + public CGFloat horizontalPageScroll () + { + return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_horizontalPageScroll); + } + + public NSRulerView horizontalRulerView () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_horizontalRulerView); + return result !is null ? new NSRulerView(result) : null; + } + + public NSScroller horizontalScroller () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_horizontalScroller); + return result !is null ? new NSScroller(result) : null; + } + + public CGFloat lineScroll () + { + return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_lineScroll); + } + + public CGFloat pageScroll () + { + return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_pageScroll); + } + + public void reflectScrolledClipView (NSClipView cView) + { + OS.objc_msgSend(this.id, OS.sel_reflectScrolledClipView_1, cView !is null ? cView.id : null); + } + + public static objc.Class rulerViewClass () + { + return OS.objc_msgSend(OS.class_NSScrollView, OS.sel_rulerViewClass); + } + + public bool rulersVisible () + { + return OS.objc_msgSend(this.id, OS.sel_rulersVisible) !is null; + } + + public void scrollWheel (NSEvent theEvent) + { + OS.objc_msgSend(this.id, OS.sel_scrollWheel_1, theEvent !is null ? theEvent.id : null); + } + + public bool scrollsDynamically () + { + return OS.objc_msgSend(this.id, OS.sel_scrollsDynamically) !is null; + } + + public void setAutohidesScrollers (bool flag) + { + OS.objc_msgSend(this.id, OS.sel_setAutohidesScrollers_1, flag); + } + + public void setBackgroundColor (NSColor color) + { + OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color !is null ? color.id : null); + } + + public void setBorderType (NSBorderType aType) + { + OS.objc_msgSend(this.id, OS.sel_setBorderType_1, aType); + } + + public void setContentView (NSClipView contentView) + { + OS.objc_msgSend(this.id, OS.sel_setContentView_1, contentView !is null ? contentView.id : null); + } + + 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 setHasHorizontalRuler (bool flag) + { + OS.objc_msgSend(this.id, OS.sel_setHasHorizontalRuler_1, flag); + } + + public void setHasHorizontalScroller (bool flag) + { + OS.objc_msgSend(this.id, OS.sel_setHasHorizontalScroller_1, flag); + } + + public void setHasVerticalRuler (bool flag) + { + OS.objc_msgSend(this.id, OS.sel_setHasVerticalRuler_1, flag); + } + + public void setHasVerticalScroller (bool flag) + { + OS.objc_msgSend(this.id, OS.sel_setHasVerticalScroller_1, flag); + } + + public void setHorizontalLineScroll (CGFloat value) + { + OS.objc_msgSend(this.id, OS.sel_setHorizontalLineScroll_1, value); + } + + public void setHorizontalPageScroll (CGFloat value) + { + OS.objc_msgSend(this.id, OS.sel_setHorizontalPageScroll_1, value); + } + + public void setHorizontalRulerView (NSRulerView ruler) + { + OS.objc_msgSend(this.id, OS.sel_setHorizontalRulerView_1, ruler !is null ? ruler.id : null); + } + + public void setHorizontalScroller (NSScroller anObject) + { + OS.objc_msgSend(this.id, OS.sel_setHorizontalScroller_1, anObject !is null ? anObject.id : null); + } + + public void setLineScroll (CGFloat value) + { + OS.objc_msgSend(this.id, OS.sel_setLineScroll_1, value); + } + + public void setPageScroll (CGFloat value) + { + OS.objc_msgSend(this.id, OS.sel_setPageScroll_1, value); + } + + public static void setRulerViewClass (objc.Class rulerViewClass) + { + OS.objc_msgSend(OS.class_NSScrollView, OS.sel_setRulerViewClass_1, rulerViewClass); + } + + public void setRulersVisible (bool flag) + { + OS.objc_msgSend(this.id, OS.sel_setRulersVisible_1, flag); + } + + public void setScrollsDynamically (bool flag) + { + OS.objc_msgSend(this.id, OS.sel_setScrollsDynamically_1, flag); + } + + public void setVerticalLineScroll (CGFloat value) + { + OS.objc_msgSend(this.id, OS.sel_setVerticalLineScroll_1, value); + } + + public void setVerticalPageScroll (CGFloat value) + { + OS.objc_msgSend(this.id, OS.sel_setVerticalPageScroll_1, value); + } + + public void setVerticalRulerView (NSRulerView ruler) + { + OS.objc_msgSend(this.id, OS.sel_setVerticalRulerView_1, ruler !is null ? ruler.id : null); + } + + public void setVerticalScroller (NSScroller anObject) + { + OS.objc_msgSend(this.id, OS.sel_setVerticalScroller_1, anObject !is null ? anObject.id : null); + } + + public void tile () + { + OS.objc_msgSend(this.id, OS.sel_tile); + } + + public CGFloat verticalLineScroll () + { + return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_verticalLineScroll); + } + + public CGFloat verticalPageScroll () + { + return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_verticalPageScroll); + } + + public NSRulerView verticalRulerView () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_verticalRulerView); + return result !is null ? new NSRulerView(result) : null; + } + + public NSScroller verticalScroller () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_verticalScroller); + return result !is null ? new NSScroller(result) : null; + } + +}