From 6fc675335c3403887d641cc2e7ecb35a8464dd65 Mon Sep 17 00:00:00 2001 From: Paul Gardiner Date: Fri, 22 Nov 2013 13:12:14 +0000 Subject: iOS: support annotation deletion --- platform/ios/Classes/MuAnnotation.m | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 platform/ios/Classes/MuAnnotation.m (limited to 'platform/ios/Classes/MuAnnotation.m') 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 -- cgit v1.2.3