Revision: 7527 http://skim-app.svn.sourceforge.net/skim-app/?rev=7527&view=rev Author: hofman Date: 2011-10-28 11:15:55 +0000 (Fri, 28 Oct 2011) Log Message: ----------- use properties
Modified Paths: -------------- trunk/SKTemplateTag.h trunk/SKTemplateTag.m Modified: trunk/SKTemplateTag.h =================================================================== --- trunk/SKTemplateTag.h 2011-10-25 17:02:27 UTC (rev 7526) +++ trunk/SKTemplateTag.h 2011-10-28 11:15:55 UTC (rev 7527) @@ -55,9 +55,10 @@ }; typedef NSInteger SKTemplateTagMatchType; -@interface SKTemplateTag : NSObject { -} -- (SKTemplateTagType)type; +@interface SKTemplateTag : NSObject + +@property (nonatomic, readonly) SKTemplateTagType type; + @end #pragma mark - @@ -68,7 +69,7 @@ - (id)initWithKeyPath:(NSString *)aKeyPath; -- (NSString *)keyPath; +@property (nonatomic, readonly) NSString *keyPath; @end @@ -80,7 +81,7 @@ - (id)initWithKeyPath:(NSString *)aKeyPath attributes:(NSDictionary *)anAttributes; -- (NSDictionary *)attributes; +@property (nonatomic, readonly) NSDictionary *attributes; @end @@ -95,8 +96,7 @@ - (id)initWithKeyPath:(NSString *)aKeyPath itemTemplateString:(NSString *)anItemTemplateString separatorTemplateString:(NSString *)aSeparatorTemplateString; -- (NSArray *)itemTemplate; -- (NSArray *)separatorTemplate; +@property (nonatomic, readonly) NSArray *itemTemplate, *separatorTemplate; @end @@ -111,8 +111,7 @@ - (id)initWithKeyPath:(NSString *)aKeyPath itemTemplateAttributedString:(NSAttributedString *)anItemTemplateAttributedString separatorTemplateAttributedString:(NSAttributedString *)aSeparatorTemplateAttributedString; -- (NSArray *)itemTemplate; -- (NSArray *)separatorTemplate; +@property (nonatomic, readonly) NSArray *itemTemplate, *separatorTemplate; @end @@ -126,9 +125,10 @@ - (id)initWithKeyPath:(NSString *)aKeyPath matchType:(SKTemplateTagMatchType)aMatchType matchStrings:(NSArray *)aMatchStrings subtemplates:(NSArray *)aSubtemplates; -- (SKTemplateTagMatchType)matchType; -- (NSArray *)matchStrings; -- (NSArray *)subtemplates; +@property (nonatomic, readonly) SKTemplateTagMatchType matchType; +@property (nonatomic, readonly) NSArray *matchStrings; +@property (nonatomic, readonly) NSArray *subtemplates; + - (NSArray *)subtemplateAtIndex:(NSUInteger)index; @end @@ -146,8 +146,7 @@ - (id)initWithText:(NSString *)aText; -- (NSString *)text; -- (void)setText:(NSString *)newText; +@property (nonatomic, retain) NSString *text; - (void)appendText:(NSString *)newText; @@ -161,8 +160,7 @@ - (id)initWithAttributedText:(NSAttributedString *)anAttributedText; -- (NSAttributedString *)attributedText; -- (void)setAttributedText:(NSAttributedString *)newAttributedText; +@property (nonatomic, retain) NSAttributedString *attributedText; - (void)appendAttributedText:(NSAttributedString *)newAttributedText; Modified: trunk/SKTemplateTag.m =================================================================== --- trunk/SKTemplateTag.m 2011-10-25 17:02:27 UTC (rev 7526) +++ trunk/SKTemplateTag.m 2011-10-28 11:15:55 UTC (rev 7527) @@ -41,13 +41,19 @@ @implementation SKTemplateTag + +@dynamic type; + - (SKTemplateTagType)type { return -1; } + @end #pragma mark - @implementation SKValueTemplateTag +@synthesize keyPath; + - (id)initWithKeyPath:(NSString *)aKeyPath { self = [super init]; if (self) { @@ -63,16 +69,14 @@ - (SKTemplateTagType)type { return SKValueTemplateTagType; } -- (NSString *)keyPath { - return keyPath; -} - @end #pragma mark - @implementation SKRichValueTemplateTag +@synthesize attributes; + - (id)initWithKeyPath:(NSString *)aKeyPath attributes:(NSDictionary *)anAttributes { self = [super initWithKeyPath:aKeyPath]; if (self) { @@ -86,16 +90,14 @@ [super dealloc]; } -- (NSDictionary *)attributes { - return attributes; -} - @end #pragma mark - @implementation SKCollectionTemplateTag +@dynamic itemTemplate, separatorTemplate; + - (id)initWithKeyPath:(NSString *)aKeyPath itemTemplateString:(NSString *)anItemTemplateString separatorTemplateString:(NSString *)aSeparatorTemplateString { self = [super initWithKeyPath:aKeyPath]; if (self) { @@ -135,6 +137,8 @@ @implementation SKRichCollectionTemplateTag +@dynamic itemTemplate, separatorTemplate; + - (id)initWithKeyPath:(NSString *)aKeyPath itemTemplateAttributedString:(NSAttributedString *)anItemTemplateAttributedString separatorTemplateAttributedString:(NSAttributedString *)aSeparatorTemplateAttributedString { self = [super initWithKeyPath:aKeyPath]; if (self) { @@ -174,6 +178,8 @@ @implementation SKConditionTemplateTag +@synthesize matchType, matchStrings, subtemplates; + - (id)initWithKeyPath:(NSString *)aKeyPath matchType:(SKTemplateTagMatchType)aMatchType matchStrings:(NSArray *)aMatchStrings subtemplates:(NSArray *)aSubtemplates { self = [super initWithKeyPath:aKeyPath]; if (self) { @@ -192,18 +198,6 @@ - (SKTemplateTagType)type { return SKConditionTemplateTagType; } -- (SKTemplateTagMatchType)matchType { - return matchType; -} - -- (NSArray *)subtemplates { - return subtemplates; -} - -- (NSArray *)matchStrings { - return matchStrings; -} - - (NSArray *)subtemplateAtIndex:(NSUInteger)anIndex { id subtemplate = [subtemplates objectAtIndex:anIndex]; if ([subtemplate isKindOfClass:[NSArray class]] == NO) { @@ -234,6 +228,8 @@ @implementation SKTextTemplateTag +@synthesize text; + - (id)initWithText:(NSString *)aText { self = [super init]; if (self) { @@ -249,17 +245,6 @@ - (SKTemplateTagType)type { return SKTextTemplateTagType; } -- (NSString *)text { - return text; -} - -- (void)setText:(NSString *)newText { - if (text != newText) { - [text release]; - text = [newText retain]; - } -} - - (void)appendText:(NSString *)newText { [self setText:[text stringByAppendingString:newText]]; } @@ -270,6 +255,8 @@ @implementation SKRichTextTemplateTag +@synthesize attributedText; + - (id)initWithAttributedText:(NSAttributedString *)anAttributedText { self = [super init]; if (self) { @@ -285,17 +272,6 @@ - (SKTemplateTagType)type { return SKTextTemplateTagType; } -- (NSAttributedString *)attributedText { - return attributedText; -} - -- (void)setAttributedText:(NSAttributedString *)newAttributedText { - if (attributedText != newAttributedText) { - [attributedText release]; - attributedText = [newAttributedText retain]; - } -} - - (void)appendAttributedText:(NSAttributedString *)newAttributedText { NSMutableAttributedString *newAttrText = [attributedText mutableCopy]; [newAttrText appendAttributedString:newAttributedText]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit