diff options
author | Paul Gardiner <paul.gardiner@artifex.com> | 2013-11-22 13:12:14 +0000 |
---|---|---|
committer | Paul Gardiner <paul.gardiner@artifex.com> | 2013-11-22 13:12:14 +0000 |
commit | 6fc675335c3403887d641cc2e7ecb35a8464dd65 (patch) | |
tree | dccb684820e210d5a11b7d3803431b62839ca6b2 /platform/ios/Classes/MuAnnotation.m | |
parent | 26a6b6464c868552487acd91b3738fdee78757d3 (diff) | |
download | mupdf-6fc675335c3403887d641cc2e7ecb35a8464dd65.tar.xz |
iOS: support annotation deletion
Diffstat (limited to 'platform/ios/Classes/MuAnnotation.m')
-rw-r--r-- | platform/ios/Classes/MuAnnotation.m | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/platform/ios/Classes/MuAnnotation.m b/platform/ios/Classes/MuAnnotation.m new file mode 100644 index 00000000..92f7bb45 --- /dev/null +++ b/platform/ios/Classes/MuAnnotation.m @@ -0,0 +1,35 @@ +// +// MuAnnotation.m +// MuPDF +// +// Created by Paul Gardiner on 20/11/2013. +// Copyright (c) 2013 Artifex Software, Inc. All rights reserved. +// + +#import "MuAnnotation.h" + +@implementation MuAnnotation + +@synthesize type, rect; + +-(id) initFromAnnot:(fz_annot *)annot forDoc:(fz_document *)doc +{ + self = [super init]; + if (self) + { + fz_rect frect; + type = pdf_annot_type((pdf_annot *)annot); + fz_bound_annot(doc, annot, &frect); + rect.origin.x = frect.x0; + rect.origin.y = frect.y0; + rect.size.width = frect.x1 - frect.x0; + rect.size.height = frect.y1 - frect.y0; + } + return self; +} + ++(MuAnnotation *) annotFromAnnot:(fz_annot *)annot forDoc:(fz_document *)doc +{ + return [[[MuAnnotation alloc] initFromAnnot:annot forDoc:doc] autorelease]; +} +@end |