Changeset 2925
- Timestamp:
- 05/28/05 17:15:14 (4 years ago)
- Files:
-
- Footagehead/trunk/English.lproj/ReleaseNotes.rtf (modified) (2 diffs)
- Footagehead/trunk/FHAtomStreamParser.h (added)
- Footagehead/trunk/FHAtomStreamParser.m (added)
- Footagehead/trunk/FHFlickrHandler.h (modified) (1 diff)
- Footagehead/trunk/FHFlickrHandler.m (modified) (4 diffs)
- Footagehead/trunk/FHHandler.m (modified) (3 diffs)
- Footagehead/trunk/FHRSSStreamParser.h (moved) (moved from Footagehead/trunk/FHRSSParser.h) (1 diff)
- Footagehead/trunk/FHRSSStreamParser.m (moved) (moved from Footagehead/trunk/FHRSSParser.m) (6 diffs)
- Footagehead/trunk/FHStreamParser.h (added)
- Footagehead/trunk/FHStreamParser.m (added)
- Footagehead/trunk/Footagehead.xcode/project.pbxproj (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Footagehead/trunk/English.lproj/ReleaseNotes.rtf
r2919 r2925 19 19 \f1\b0 \cf0 \ 20 20 Footagehead is a fast local and remote image browser. With it, you can quickly navigate your local disks and display pictures in a window, or as a slideshow. Footagehead can also open images remotely from the web.\ 21 \ 22 23 \f0\b \cf2 What formats are supported? 24 \f1\b0 \cf0 \ 25 Footagehead supports all native Mac OS X image formats. That is, anything that Preview can open, Footagehead should also be able to open.\ 26 \ 27 28 \f0\b \cf2 What remote browsing schemes are supported? 29 \f1\b0 \cf0 \ 30 Footagehead can browse the following types of sites remotely:\ 31 \ 32 - Single image ( 33 \f2\i http://www.zankasoftware.com/images/footagehead-screen1.jpg 34 \f1\i0 )\ 35 - HTML page with inline images or links to images ( 36 \f2\i http://www.apple.com/macosx/ 37 \f1\i0 )\ 38 - Range of images ( 39 \f2\i http://images.ucomics.com/comics/ch/1994/ch9405[01-30].gif 40 \f1\i0 )\ 41 - Flickr photo stream ( 42 \f2\i http://www.flickr.com/services/feeds/photos_public.gne?id=81007463@N00&tags=knockoff&format=rss_200 43 \f1\i0 )\ 21 44 \ 22 45 … … 55 78 - Fast thumbnail generation for JPEG files\ 56 79 - Spotlight image search support\ 57 - Flickr RSS stream support\80 - Flickr RSS/Atom stream support\ 58 81 - Zoom command\ 59 82 Footagehead/trunk/FHFlickrHandler.h
r2919 r2925 29 29 #import "FHHandler.h" 30 30 31 @class FH RSSParser;31 @class FHStreamParser; 32 32 33 33 @interface FHFlickrHandler : FHHandler { 34 FH RSSParser *_parser;34 FHStreamParser *_parser; 35 35 } 36 36 Footagehead/trunk/FHFlickrHandler.m
r2920 r2925 34 34 35 35 + (BOOL)handlesURL:(ZAURL *)url isPrimary:(BOOL)primary { 36 return ([[url host] containsSubstring:@"flickr.com"] && [[url path] containsSubstring:@"format=rss_200"]);36 return ([[url host] containsSubstring:@"flickr.com"] && [[url path] hasPrefix:@"/services/feeds/"]); 37 37 } 38 38 … … 50 50 self = [super initWithURL:url hint:hint]; 51 51 52 _parser = [[FH RSSParser alloc] initParserWithURL:[self URL]];52 _parser = [[FHStreamParser alloc] initParserWithURL:[self URL]]; 53 53 54 54 if(!_parser) { … … 77 77 NSDictionary *item; 78 78 NSMutableString *address; 79 NSString *name, * description, *string;79 NSString *name, *content, *string; 80 80 NSScanner *scanner; 81 81 FHFile *file; … … 90 90 item = [items objectAtIndex:i]; 91 91 name = [item objectForKey:@"title"]; 92 description = [item objectForKey:@"description"];92 content = [item objectForKey:[[_parser class] itemContentKey]]; 93 93 94 scanner = [NSScanner scannerWithString: description];94 scanner = [NSScanner scannerWithString:content]; 95 95 96 96 if(![scanner scanUpToString:@"img src=\"" intoString:NULL]) Footagehead/trunk/FHHandler.m
r2919 r2925 346 346 class = [FHHandlerHints objectForKey:[NSNumber numberWithInt:hint]]; 347 347 348 return [[class alloc ] initWithURL:url hint:hint];348 return [[class allocWithZone:zone] initWithURL:url hint:hint]; 349 349 } 350 350 … … 355 355 356 356 if([class handlesURL:url isPrimary:YES]) 357 return [[class alloc ] initWithURL:url hint:hint];357 return [[class allocWithZone:zone] initWithURL:url hint:hint]; 358 358 } 359 359 … … 362 362 363 363 if([class handlesURL:url isPrimary:NO]) 364 return [[class alloc ] initWithURL:url hint:hint];364 return [[class allocWithZone:zone] initWithURL:url hint:hint]; 365 365 } 366 366 Footagehead/trunk/FHRSSStreamParser.h
r2919 r2925 27 27 */ 28 28 29 @interface FHRSSParser : ZAObject { 30 CFXMLTreeRef _tree; 29 #import "FHStreamParser.h" 30 31 @interface FHRSSStreamParser : FHStreamParser { 31 32 CFXMLTreeRef _channelTree; 32 33 NSMutableDictionary *_header;34 NSMutableArray *_items;35 33 } 36 34 37 38 - (id)initParserWithData:(NSData *)data;39 - (id)initParserWithURL:(ZAURL *)url;40 41 - (NSDictionary *)header;42 - (NSArray *)items;43 44 35 @end Footagehead/trunk/FHRSSStreamParser.m
r2919 r2925 27 27 */ 28 28 29 #import "FHRSS Parser.h"29 #import "FHRSSStreamParser.h" 30 30 31 @interface FHRSS Parser(Private)31 @interface FHRSSStreamParser(Private) 32 32 33 33 - (void)parseHeader; … … 35 35 - (void)parseItems; 36 36 37 - (CFXMLTreeRef)treeWithName:(NSString *)name inTree:(CFXMLTreeRef)tree;38 - (NSString *)valueOfTree: (CFXMLTreeRef) tree;39 40 37 @end 41 38 42 39 43 @implementation FHRSS Parser40 @implementation FHRSSStreamParser 44 41 45 - (id)initParserWithData:(NSData *)data { 42 + (NSString *)itemContentKey { 43 return @"description"; 44 } 45 46 47 48 #pragma mark - 49 50 - (id)initParserWithTree:(CFXMLTreeRef)tree { 46 51 CFXMLTreeRef rssTree; 47 52 48 self = [super init]; 49 50 _tree = CFXMLTreeCreateFromData(kCFAllocatorDefault, (CFDataRef) data, 51 NULL, kCFXMLParserSkipWhitespace, 52 kCFXMLNodeCurrentVersion); 53 54 if(!_tree) { 55 [self release]; 56 57 return NULL; 58 } 53 self = [super initParserWithTree:tree]; 59 54 60 55 rssTree = [self treeWithName:@"rss" inTree:_tree]; … … 81 76 82 77 return self; 83 }84 85 86 87 - (id)initParserWithURL:(ZAURL *)url {88 NSData *data;89 90 data = [[NSData alloc] initWithContentsOfURL:[url URL]];91 self = [self initParserWithData:data];92 [data release];93 94 return self;95 }96 97 98 99 - (void) dealloc {100 CFRelease(_tree);101 102 [_header release];103 [_items release];104 105 [super dealloc];106 78 } 107 79 … … 134 106 unsigned int i, count; 135 107 108 _header = [[NSMutableDictionary alloc] initWithCapacity:10]; 136 109 count = CFTreeGetChildCount(_channelTree); 137 _header = [[NSMutableDictionary alloc] initWithCapacity:count];138 110 139 111 for(i = 0; i < count; i++) { … … 191 163 192 164 itemCount = CFTreeGetChildCount(tree); 193 items = [[NSMutableDictionary alloc] initWithCapacity: itemCount];165 items = [[NSMutableDictionary alloc] initWithCapacity:itemCount]; 194 166 195 167 for(j = 0; j < itemCount; j++) { … … 205 177 } 206 178 207 208 209 - (CFXMLTreeRef)treeWithName:(NSString *)name inTree:(CFXMLTreeRef)tree {210 NSString *itemName;211 CFXMLTreeRef child;212 CFXMLNodeRef node;213 unsigned int i, count;214 215 count = CFTreeGetChildCount(tree);216 217 for(i = 0; i < count; i++) {218 child = CFTreeGetChildAtIndex(tree, i);219 node = CFXMLTreeGetNode(child);220 itemName = (NSString *) CFXMLNodeGetString(node);221 222 if([itemName isEqualToString:name])223 return child;224 }225 226 return NULL;227 }228 229 230 231 - (NSString *)valueOfTree:(CFXMLTreeRef)tree {232 NSMutableString *value;233 NSString *itemName;234 CFXMLTreeRef itemTree;235 CFXMLNodeRef itemNode;236 unsigned int i, count;237 238 value = [NSMutableString string];239 count = CFTreeGetChildCount (tree);240 241 for (i = 0; i < count; i++) {242 itemTree = CFTreeGetChildAtIndex (tree, i);243 itemNode = CFXMLTreeGetNode (itemTree);244 itemName = (NSString *) CFXMLNodeGetString (itemNode);245 246 if(itemName) {247 if(CFXMLNodeGetTypeCode(itemNode) == kCFXMLNodeTypeEntityReference) {248 if ([itemName isEqualToString:@"lt"])249 itemName = @"<";250 else if ([itemName isEqualToString:@"gt"])251 itemName = @">";252 else if ([itemName isEqualToString:@"quot"])253 itemName = @"\"";254 else if ([itemName isEqualToString:@"amp"])255 itemName = @"&";256 }257 258 [value appendString:itemName];259 }260 }261 262 return value;263 }264 265 179 @end Footagehead/trunk/Footagehead.xcode/project.pbxproj
r2919 r2925 135 135 A5B1F60D067B3A8000111D0A, 136 136 A5B1F7B9067B43C300111D0A, 137 A5E7CC4B0848B02B00F1E98C, 137 138 A5EE94DA055AA5EE00CC2AD8, 138 139 29B97315FDCFA39411CA2CEA, … … 1537 1538 A5092F57083E7812006646D1, 1538 1539 77BD99520760B7380007D034, 1540 A5E7CC520848B05300F1E98C, 1541 A5E7CC610848B09000F1E98C, 1539 1542 ); 1540 1543 isa = PBXSourcesBuildPhase; … … 1904 1907 files = ( 1905 1908 A54D42DD07663AA300227EBE, 1909 A5E7CC510848B05300F1E98C, 1910 A5E7CC620848B09000F1E98C, 1906 1911 ); 1907 1912 isa = PBXCopyFilesBuildPhase; … … 2002 2007 A5B1F7BA067B440E00111D0A, 2003 2008 A5B1F7BB067B440E00111D0A, 2004 A5E7CA4C0847CBA000F1E98C,2005 A5E7CA4D0847CBA000F1E98C,2006 2009 A587DF7B055AA418005D2097, 2007 2010 A587DF76055AA418005D2097, … … 2237 2240 isa = PBXFileReference; 2238 2241 lastKnownFileType = sourcecode.c.objc; 2239 path = FHRSS Parser.m;2242 path = FHRSSStreamParser.m; 2240 2243 refType = 4; 2241 2244 sourceTree = "<group>"; … … 2245 2248 isa = PBXFileReference; 2246 2249 lastKnownFileType = sourcecode.c.h; 2247 path = FHRSS Parser.h;2250 path = FHRSSStreamParser.h; 2248 2251 refType = 4; 2249 2252 sourceTree = "<group>"; … … 2264 2267 A5E7CC3B0847E7C900F1E98C = { 2265 2268 fileRef = A5E7CC3A0847E7C900F1E98C; 2269 isa = PBXBuildFile; 2270 settings = { 2271 }; 2272 }; 2273 A5E7CC4B0848B02B00F1E98C = { 2274 children = ( 2275 A5E7CC5F0848B09000F1E98C, 2276 A5E7CC600848B09000F1E98C, 2277 A5E7CC500848B05300F1E98C, 2278 A5E7CC4F0848B05300F1E98C, 2279 A5E7CA4C0847CBA000F1E98C, 2280 A5E7CA4D0847CBA000F1E98C, 2281 ); 2282 isa = PBXGroup; 2283 name = Streams; 2284 refType = 4; 2285 sourceTree = "<group>"; 2286 }; 2287 A5E7CC4F0848B05300F1E98C = { 2288 fileEncoding = 5; 2289 isa = PBXFileReference; 2290 lastKnownFileType = sourcecode.c.h; 2291 path = FHAtomStreamParser.h; 2292 refType = 4; 2293 sourceTree = "<group>"; 2294 }; 2295 A5E7CC500848B05300F1E98C = { 2296 fileEncoding = 5; 2297 isa = PBXFileReference; 2298 lastKnownFileType = sourcecode.c.objc; 2299 path = FHAtomStreamParser.m; 2300 refType = 4; 2301 sourceTree = "<group>"; 2302 }; 2303 A5E7CC510848B05300F1E98C = { 2304 fileRef = A5E7CC4F0848B05300F1E98C; 2305 isa = PBXBuildFile; 2306 settings = { 2307 }; 2308 }; 2309 A5E7CC520848B05300F1E98C = { 2310 fileRef = A5E7CC500848B05300F1E98C; 2311 isa = PBXBuildFile; 2312 settings = { 2313 }; 2314 }; 2315 A5E7CC5F0848B09000F1E98C = { 2316 fileEncoding = 5; 2317 isa = PBXFileReference; 2318 lastKnownFileType = sourcecode.c.objc; 2319 path = FHStreamParser.m; 2320 refType = 4; 2321 sourceTree = "<group>"; 2322 }; 2323 A5E7CC600848B09000F1E98C = { 2324 fileEncoding = 5; 2325 isa = PBXFileReference; 2326 lastKnownFileType = sourcecode.c.h; 2327 path = FHStreamParser.h; 2328 refType = 4; 2329 sourceTree = "<group>"; 2330 }; 2331 A5E7CC610848B09000F1E98C = { 2332 fileRef = A5E7CC5F0848B09000F1E98C; 2333 isa = PBXBuildFile; 2334 settings = { 2335 }; 2336 }; 2337 A5E7CC620848B09000F1E98C = { 2338 fileRef = A5E7CC600848B09000F1E98C; 2266 2339 isa = PBXBuildFile; 2267 2340 settings = {
