1/* 2 Project: LaternaMagica 3 4 Copyright (C) 2013 Free Software Foundation 5 6 Author: multix 7 8 Created: 2013-01-07 23:53:49 +0100 by multix 9 10 This application is free software; you can redistribute it and/or 11 modify it under the terms of the GNU General Public 12 License as published by the Free Software Foundation; either 13 version 2 of the License, or (at your option) any later version. 14 15 This application is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 Library General Public License for more details. 19 20 You should have received a copy of the GNU General Public 21 License along with this library; if not, write to the Free 22 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. 23*/ 24 25#import "LMImage.h" 26 27@implementation LMImage 28 29- (id)init 30{ 31 self = [super init]; 32 if (self) 33 { 34 path = nil; 35 name = nil; 36 rotation = 0; 37 } 38 return self; 39} 40 41- (void) dealloc 42{ 43 [path release]; 44 [name release]; 45 [super dealloc]; 46} 47 48- (void) setPath:(NSString *)aPath 49{ 50 [path release]; 51 path = [aPath retain]; 52 [name release]; 53 name = [[path lastPathComponent] retain]; 54} 55 56- (NSString *)path 57{ 58 return path; 59} 60 61- (NSString *)name 62{ 63 return name; 64} 65 66- (void) setRotation: (unsigned)r 67{ 68 rotation += r; 69 rotation = rotation % 360; 70} 71- (unsigned) rotation 72{ 73 return rotation; 74} 75 76@end 77