Mercurial > projects > dwt-mac
diff dwt/internal/cocoa/WebFrameView.d @ 45:d8635bb48c7c
Merge with SWT 3.5
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Mon, 01 Dec 2008 17:07:00 +0100 |
parents | 30a762abda2a |
children |
line wrap: on
line diff
--- a/dwt/internal/cocoa/WebFrameView.d Tue Oct 21 15:20:04 2008 +0200 +++ b/dwt/internal/cocoa/WebFrameView.d Mon Dec 01 17:07:00 2008 +0100 @@ -1,30 +1,42 @@ -module dwt.internal.cocoa; +/******************************************************************************* + * Copyright (c) 2000, 2008 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 <doob@me.com> + *******************************************************************************/ +module dwt.internal.cocoa.WebFrameView; + +import dwt.dwthelper.utils; +import cocoa = dwt.internal.cocoa.id; +import dwt.internal.cocoa.NSObject; +import dwt.internal.cocoa.NSPrintInfo; +import dwt.internal.cocoa.NSPrintOperation; +import dwt.internal.cocoa.OS; +import objc = dwt.internal.objc.runtime; public class WebFrameView : NSObject { -public WebFrameView() { +public this() { super(); } -public WebFrameView(int id) { +public this(objc.id id) { super(id); } -public bool allowsScrolling() { - return OS.objc_msgSend(this.id, OS.sel_allowsScrolling) !is 0; -} - -public bool canPrintHeadersAndFooters() { - return OS.objc_msgSend(this.id, OS.sel_canPrintHeadersAndFooters) !is 0; -} - -public NSView documentView() { - int result = OS.objc_msgSend(this.id, OS.sel_documentView); - return result !is 0 ? new NSView (result) : null; +public this(cocoa.id id) { + super(id); } public bool documentViewShouldHandlePrint() { - return OS.objc_msgSend(this.id, OS.sel_documentViewShouldHandlePrint) !is 0; + return OS.objc_msgSend_bool(this.id, OS.sel_documentViewShouldHandlePrint); } public void printDocumentView() { @@ -32,17 +44,8 @@ } public NSPrintOperation printOperationWithPrintInfo(NSPrintInfo printInfo) { - int result = OS.objc_msgSend(this.id, OS.sel_printOperationWithPrintInfo_1, printInfo !is null ? printInfo.id : 0); - return result !is 0 ? new NSPrintOperation(result) : null; -} - -public void setAllowsScrolling(bool flag) { - OS.objc_msgSend(this.id, OS.sel_setAllowsScrolling_1, flag); -} - -public WebFrame webFrame() { - int result = OS.objc_msgSend(this.id, OS.sel_webFrame); - return result !is 0 ? new WebFrame(result) : null; + objc.id result = OS.objc_msgSend(this.id, OS.sel_printOperationWithPrintInfo_, printInfo !is null ? printInfo.id : null); + return result !is null ? new NSPrintOperation(result) : null; } }