comparison dstep/appkit/NSPDFImageRep.d @ 16:19885b43130e

Huge update, the bridge actually works now
author Jacob Carlborg <doob@me.com>
date Sun, 03 Jan 2010 22:06:11 +0100
parents
children b9de51448c6b
comparison
equal deleted inserted replaced
15:7ff919f595d5 16:19885b43130e
1 /**
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
3 * Authors: Jacob Carlborg
4 * Version: Initial created: Sep 24, 2009
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
6 */
7 module dstep.appkit.NSPDFImageRep;
8
9 import dstep.appkit.NSImageRep;
10 import dstep.foundation.NSData;
11 import dstep.foundation.NSGeometry;
12 import dstep.foundation.NSObjCRuntime;
13 import dstep.objc.bridge.Bridge;
14 import dstep.objc.objc;
15
16 class NSPDFImageRep : NSImageRep
17 {
18 mixin (ObjcWrap);
19
20 static Object imageRepWithData (NSData pdfData)
21 {
22 return invokeObjcSelfClass!(Object, "imageRepWithData:", NSData)(pdfData);
23 }
24
25 NSPDFImageRep initWithData (NSData pdfData)
26 {
27 id result = invokeObjcSelf!(id, "initWithData:", NSData)(pdfData);
28 return result is this.objcObject ? this : (result !is null ? new NSPDFImageRep(result) : null);
29 }
30
31 this (NSData pdfData)
32 {
33 super(NSPDFImageRep.alloc.initWithData(pdfData).objcObject);
34 }
35
36 NSData PDFRepresentation ()
37 {
38 return invokeObjcSelf!(NSData, "PDFRepresentation");
39 }
40
41 NSRect bounds ()
42 {
43 return invokeObjcSelf!(NSRect, "bounds");
44 }
45
46 void setCurrentPage (NSInteger page)
47 {
48 return invokeObjcSelf!(void, "setCurrentPage:", NSInteger)(page);
49 }
50
51 NSInteger currentPage ()
52 {
53 return invokeObjcSelf!(NSInteger, "currentPage");
54 }
55
56 NSInteger pageCount ()
57 {
58 return invokeObjcSelf!(NSInteger, "pageCount");
59 }
60 }
61