comparison dwt/printing/Printer.d @ 46:cfa563df4fdd

Updated Widget and Display to 3.514
author Jacob Carlborg <doob@me.com>
date Fri, 05 Dec 2008 16:00:41 +0100
parents d8635bb48c7c
children d9893755f670
comparison
equal deleted inserted replaced
45:d8635bb48c7c 46:cfa563df4fdd
215 */ 215 */
216 NSString job = printInfo.jobDisposition(); 216 NSString job = printInfo.jobDisposition();
217 if (job.isEqual(new NSString(OS.NSPrintPreviewJob()))) { 217 if (job.isEqual(new NSString(OS.NSPrintPreviewJob()))) {
218 printInfo.setJobDisposition(job); 218 printInfo.setJobDisposition(job);
219 } 219 }
220 NSRect rect = new NSRect(); 220 NSRect rect = NSRect();
221 window = (NSWindow)new NSWindow().alloc(); 221 window = (NSWindow)new NSWindow().alloc();
222 window.initWithContentRect(rect, OS.NSBorderlessWindowMask, OS.NSBackingStoreBuffered, false); 222 window.initWithContentRect(rect, OS.NSBorderlessWindowMask, OS.NSBackingStoreBuffered, false);
223 view = (NSView)new NSView().alloc(); 223 view = (NSView)new NSView().alloc();
224 view.initWithFrame(rect); 224 view.initWithFrame(rect);
225 window.setContentView(view); 225 window.setContentView(view);
401 * @see #endJob 401 * @see #endJob
402 */ 402 */
403 public bool startPage() { 403 public bool startPage() {
404 checkDevice(); 404 checkDevice();
405 NSSize paperSize = printInfo.paperSize(); 405 NSSize paperSize = printInfo.paperSize();
406 NSRect rect = new NSRect(); 406 NSRect rect = NSRect();
407 rect.width = paperSize.width; 407 rect.width = paperSize.width;
408 rect.height = paperSize.height; 408 rect.height = paperSize.height;
409 view.beginPageInRect(rect, new NSPoint()); 409 view.beginPageInRect(rect, NSPoint());
410 NSRect imageBounds = printInfo.imageablePageBounds(); 410 NSRect imageBounds = printInfo.imageablePageBounds();
411 NSBezierPath.bezierPathWithRect(imageBounds).setClip(); 411 NSBezierPath.bezierPathWithRect(imageBounds).setClip();
412 NSAffineTransform transform = NSAffineTransform.transform(); 412 NSAffineTransform transform = NSAffineTransform.transform();
413 transform.translateXBy(imageBounds.x, rect.height - imageBounds.y); 413 transform.translateXBy(imageBounds.x, rect.height - imageBounds.y);
414 transform.scaleXBy(1, -1); 414 transform.scaleXBy(1, -1);