forked from karelia/iMedia
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trying to start bringing in the links parser from the old iMedia. At …
…least it builds now! Also fixed some NSLocalizedString calls to use instead NSLocalizedStringWithDefaultValue which allows the strings to come from the iMedia bundle.
- Loading branch information
Dan Wood
committed
Sep 18, 2009
1 parent
5a89b01
commit aee959f
Showing
15 changed files
with
1,111 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
/* | ||
* Copyright (C) 2005 Apple Computer, Inc. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of | ||
* its contributors may be used to endorse or promote products derived | ||
* from this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY | ||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY | ||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
// Sent whenever a site icon has changed. The object of the notification is the icon database. | ||
// The userInfo contains the site URL whose icon has changed. | ||
// It can be accessed with the key WebIconNotificationUserInfoURLKey. | ||
extern NSString *WebIconDatabaseDidAddIconNotification; | ||
|
||
extern NSString *WebIconNotificationUserInfoURLKey; | ||
|
||
extern NSString *WebIconDatabaseDirectoryDefaultsKey; | ||
extern NSString *WebIconDatabaseEnabledDefaultsKey; | ||
|
||
extern NSSize WebIconSmallSize; // 16 x 16 | ||
extern NSSize WebIconMediumSize; // 32 x 32 | ||
extern NSSize WebIconLargeSize; // 128 x 128 | ||
|
||
@class WebIconDatabasePrivate; | ||
|
||
/*! | ||
@class WebIconDatabase | ||
@discussion Features: | ||
- memory cache icons at different sizes | ||
- disk storage | ||
- icon update notification | ||
Uses: | ||
- WebIconLoader to cache icon images | ||
- UI elements to retrieve icons that represent site URLs. | ||
- Save icons to disk for later use. | ||
Every icon in the database has a retain count. If an icon has a retain count greater than 0, it will be written to disk for later use. If an icon's retain count equals zero it will be removed from disk. The retain count is not persistent across launches. If the WebKit client wishes to retain an icon it should retain the icon once for every launch. This is best done at initialization time before the database begins removing icons. To make sure that the database does not remove unretained icons prematurely, call delayDatabaseCleanup until all desired icons are retained. Once all are retained, call allowDatabaseCleanup. | ||
Note that an icon can be retained after the database clean-up has begun. This just has to be done before the icon is removed. Icons are removed from the database whenever new icons are added to it. | ||
Retention methods can be called for icons that are not yet in the database. | ||
*/ | ||
@interface WebIconDatabase : NSObject { | ||
|
||
@private | ||
WebIconDatabasePrivate *_private; | ||
} | ||
|
||
|
||
/*! | ||
@method sharedIconDatabase | ||
@abstract Returns a shared instance of the icon database | ||
*/ | ||
+ (WebIconDatabase *)sharedIconDatabase; | ||
|
||
/*! | ||
@method iconForURL:withSize: | ||
@discussion Calls iconForURL:withSize:cache: with YES for cache. | ||
@param URL | ||
@param size | ||
*/ | ||
- (NSImage *)iconForURL:(NSString *)URL withSize:(NSSize)size; | ||
|
||
/*! | ||
@method iconForURL:withSize:cache: | ||
@discussion Returns an icon for a web site URL from memory or disk. nil if none is found. | ||
Usually called by a UI element to determine if a site URL has an associated icon. | ||
Often called by the observer of WebIconChangedNotification after the notification is sent. | ||
@param URL | ||
@param size | ||
@param cache If yes, caches the returned image in memory if not already cached | ||
*/ | ||
- (NSImage *)iconForURL:(NSString *)URL withSize:(NSSize)size cache:(BOOL)cache; | ||
|
||
/*! | ||
@method iconURLForURL:withSize:cache: | ||
@discussion Returns an icon URL for a web site URL from memory or disk. nil if none is found. | ||
@param URL | ||
*/ | ||
- (NSString *)iconURLForURL:(NSString *)URL; | ||
|
||
/*! | ||
@method defaultIconWithSize: | ||
@param size | ||
*/ | ||
- (NSImage *)defaultIconWithSize:(NSSize)size; | ||
|
||
/*! | ||
@method retainIconForURL: | ||
@abstract Increments the retain count of the icon. | ||
@param URL | ||
*/ | ||
- (void)retainIconForURL:(NSString *)URL; | ||
|
||
/*! | ||
@method releaseIconForURL: | ||
@abstract Decrements the retain count of the icon. | ||
@param URL | ||
*/ | ||
- (void)releaseIconForURL:(NSString *)URL; | ||
|
||
/*! | ||
@method delayDatabaseCleanup: | ||
@discussion Only effective if called before the database begins removing icons. | ||
delayDatabaseCleanUp increments an internal counter that when 0 begins the database clean-up. | ||
The counter equals 0 at initialization. | ||
*/ | ||
- (void)delayDatabaseCleanup; | ||
|
||
/*! | ||
@method allowDatabaseCleanup: | ||
@discussion Informs the database that it now can begin removing icons. | ||
allowDatabaseCleanup decrements an internal counter that when 0 begins the database clean-up. | ||
The counter equals 0 at initialization. | ||
*/ | ||
- (void)allowDatabaseCleanup; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
iMedia Browser Framework <http://karelia.com/imedia/> | ||
Copyright (c) 2005-2009 by Karelia Software et al. | ||
iMedia Browser is based on code originally developed by Jason Terhorst, | ||
further developed for Sandvox by Greg Hulands, Dan Wood, and Terrence Talbot. | ||
The new architecture for version 2.0 was developed by Peter Baumgartner. | ||
Contributions have also been made by Matt Gough, Martin Wennerberg and others | ||
as indicated in source files. | ||
The iMedia Browser Framework is licensed under the following terms: | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in all or substantial portions of the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to permit | ||
persons to whom the Software is furnished to do so, subject to the following | ||
conditions: | ||
Redistributions of source code must retain the original terms stated here, | ||
including this list of conditions, the disclaimer noted below, and the | ||
following copyright notice: Copyright (c) 2005-2009 by Karelia Software et al. | ||
Redistributions in binary form must include, in an end-user-visible manner, | ||
e.g., About window, Acknowledgments window, or similar, either a) the original | ||
terms stated here, including this list of conditions, the disclaimer noted | ||
below, and the aforementioned copyright notice, or b) the aforementioned | ||
copyright notice and a link to karelia.com/imedia. | ||
Neither the name of Karelia Software, nor Sandvox, nor the names of | ||
contributors to iMedia Browser may be used to endorse or promote products | ||
derived from the Software without prior and express written permission from | ||
Karelia Software or individual contributors, as appropriate. | ||
Disclaimer: THE SOFTWARE IS PROVIDED BY THE COPYRIGHT OWNER AND CONTRIBUTORS | ||
"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT | ||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, | ||
AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF | ||
CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH, THE | ||
SOFTWARE OR THE USE OF, OR OTHER DEALINGS IN, THE SOFTWARE. | ||
*/ | ||
|
||
|
||
#import <Cocoa/Cocoa.h> | ||
#import "IMBParser.h" | ||
|
||
@class WebView, IMBNode; | ||
|
||
@interface iMBFireFoxParser : IMBParser | ||
{ | ||
|
||
} | ||
|
||
@end |
Oops, something went wrong.