| OLD | NEW |
| 1 // IconFamily.h | 1 // IconFamily.h |
| 2 // IconFamily class interface | 2 // IconFamily class interface |
| 3 // by Troy Stephens, Thomas Schnitzer, David Remahl, Nathan Day, Ben Haller, Sve
n Janssen, Peter Hosey, Conor Dearden, Elliot Glaysher, and Dave MacLachlan | 3 // by Troy Stephens, Thomas Schnitzer, David Remahl, Nathan Day, Ben Haller, Sve
n Janssen, Peter Hosey, Conor Dearden, Elliot Glaysher, and Dave MacLachlan |
| 4 // version 0.9.4 | 4 // version 0.9.4 |
| 5 // | 5 // |
| 6 // Project Home Page: | 6 // Project Home Page: |
| 7 // http://iconfamily.sourceforge.net/ | 7 // http://iconfamily.sourceforge.net/ |
| 8 // | 8 // |
| 9 // Problems, shortcomings, and uncertainties that I'm aware of are flagged with
"NOTE:". Please address bug reports, bug fixes, suggestions, etc. to the projec
t Forums and bug tracker at https://sourceforge.net/projects/iconfamily/ | 9 // Problems, shortcomings, and uncertainties that I'm aware of are flagged with
"NOTE:". Please address bug reports, bug fixes, suggestions, etc. to the projec
t Forums and bug tracker at https://sourceforge.net/projects/iconfamily/ |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 + (IconFamily*) iconFamilyWithContentsOfFile:(NSString*)path; | 50 + (IconFamily*) iconFamilyWithContentsOfFile:(NSString*)path; |
| 51 + (IconFamily*) iconFamilyWithIconOfFile:(NSString*)path; | 51 + (IconFamily*) iconFamilyWithIconOfFile:(NSString*)path; |
| 52 + (IconFamily*) iconFamilyWithIconFamilyHandle:(IconFamilyHandle)hNewIconFamily; | 52 + (IconFamily*) iconFamilyWithIconFamilyHandle:(IconFamilyHandle)hNewIconFamily; |
| 53 + (IconFamily*) iconFamilyWithSystemIcon:(int)fourByteCode; | 53 + (IconFamily*) iconFamilyWithSystemIcon:(int)fourByteCode; |
| 54 + (IconFamily*) iconFamilyWithThumbnailsOfImage:(NSImage*)image; | 54 + (IconFamily*) iconFamilyWithThumbnailsOfImage:(NSImage*)image; |
| 55 + (IconFamily*) iconFamilyWithThumbnailsOfImage:(NSImage*)image usingImageInterp
olation:(NSImageInterpolation)imageInterpolation; | 55 + (IconFamily*) iconFamilyWithThumbnailsOfImage:(NSImage*)image usingImageInterp
olation:(NSImageInterpolation)imageInterpolation; |
| 56 | 56 |
| 57 // Initializes as a new, empty IconFamily. This is IconFamily's designated | 57 // Initializes as a new, empty IconFamily. This is IconFamily's designated |
| 58 // initializer method. | 58 // initializer method. |
| 59 | 59 |
| 60 - init; | 60 - (id) init; |
| 61 | 61 |
| 62 // Initializes an IconFamily by loading the contents of an .icns file. | 62 // Initializes an IconFamily by loading the contents of an .icns file. |
| 63 | 63 |
| 64 - initWithContentsOfFile:(NSString*)path; | 64 - (id) initWithContentsOfFile:(NSString*)path; |
| 65 | 65 |
| 66 // Initializes an IconFamily from an existing Carbon IconFamilyHandle. | 66 // Initializes an IconFamily from an existing Carbon IconFamilyHandle. |
| 67 | 67 |
| 68 - initWithIconFamilyHandle:(IconFamilyHandle)hNewIconFamily; | 68 - (id) initWithIconFamilyHandle:(IconFamilyHandle)hNewIconFamily; |
| 69 | 69 |
| 70 // Initializes an IconFamily by loading the Finder icon that's assigned to a | 70 // Initializes an IconFamily by loading the Finder icon that's assigned to a |
| 71 // file. | 71 // file. |
| 72 | 72 |
| 73 - initWithIconOfFile:(NSString*)path; | 73 - (id) initWithIconOfFile:(NSString*)path; |
| 74 | 74 |
| 75 // Initializes an IconFamily by referencing a standard system icon. | 75 // Initializes an IconFamily by referencing a standard system icon. |
| 76 | 76 |
| 77 - initWithSystemIcon:(int)fourByteCode; | 77 - (id) initWithSystemIcon:(int)fourByteCode; |
| 78 | 78 |
| 79 // Initializes an IconFamily by creating its elements from a resampled | 79 // Initializes an IconFamily by creating its elements from a resampled |
| 80 // NSImage. The second form of this method allows you to specify the degree | 80 // NSImage. The second form of this method allows you to specify the degree |
| 81 // of antialiasing to be used in resampling the image, by passing in one of | 81 // of antialiasing to be used in resampling the image, by passing in one of |
| 82 // the NSImageInterpolation... constants that are defined in | 82 // the NSImageInterpolation... constants that are defined in |
| 83 // NSGraphicsContext.h. The first form of this initializer simply calls the | 83 // NSGraphicsContext.h. The first form of this initializer simply calls the |
| 84 // second form with imageInterpolation set to NSImageInterpolationHigh, which | 84 // second form with imageInterpolation set to NSImageInterpolationHigh, which |
| 85 // produces highly smoothed thumbnails. | 85 // produces highly smoothed thumbnails. |
| 86 | 86 |
| 87 - initWithThumbnailsOfImage:(NSImage*)image; | 87 - (id) initWithThumbnailsOfImage:(NSImage*)image; |
| 88 - initWithThumbnailsOfImage:(NSImage*)image usingImageInterpolation:(NSImageInte
rpolation)imageInterpolation; | 88 - (id) initWithThumbnailsOfImage:(NSImage*)image usingImageInterpolation:(NSImag
eInterpolation)imageInterpolation; |
| 89 | 89 |
| 90 // Writes the icon family to an .icns file. | 90 // Writes the icon family to an .icns file. |
| 91 | 91 |
| 92 - (BOOL) writeToFile:(NSString*)path; | 92 - (BOOL) writeToFile:(NSString*)path; |
| 93 | 93 |
| 94 // Sets the image data for one of the icon family's elements from an | 94 // Sets the image data for one of the icon family's elements from an |
| 95 // NSBitmapImageRep. The "elementType" parameter must be one of the icon | 95 // NSBitmapImageRep. The "elementType" parameter must be one of the icon |
| 96 // family element types listed below, and the format of the "bitmapImageRep" | 96 // family element types listed below, and the format of the "bitmapImageRep" |
| 97 // must match the corresponding requirements specified below. Regardless of | 97 // must match the corresponding requirements specified below. Regardless of |
| 98 // the elementType, the bitmapImageRep must also be non-planar and have 8 bits | 98 // the elementType, the bitmapImageRep must also be non-planar and have 8 bits |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // Returns nil if the requested element cannot be retrieved (e.g. if the | 140 // Returns nil if the requested element cannot be retrieved (e.g. if the |
| 141 // icon family has no such 32BitData element). | 141 // icon family has no such 32BitData element). |
| 142 | 142 |
| 143 - (NSBitmapImageRep*) bitmapImageRepWithAlphaForIconFamilyElement:(OSType)elemen
tType; | 143 - (NSBitmapImageRep*) bitmapImageRepWithAlphaForIconFamilyElement:(OSType)elemen
tType; |
| 144 | 144 |
| 145 // Creates and returns an NSImage that contains the icon family's various | 145 // Creates and returns an NSImage that contains the icon family's various |
| 146 // elements as its NSImageReps. | 146 // elements as its NSImageReps. |
| 147 | 147 |
| 148 - (NSImage*) imageWithAllReps; | 148 - (NSImage*) imageWithAllReps; |
| 149 | 149 |
| 150 #if !defined(DISABLE_CUSTOM_ICON) |
| 151 |
| 150 // NOTE: Planned method -- not yet implemented. | 152 // NOTE: Planned method -- not yet implemented. |
| 151 // | 153 // |
| 152 // Gets the image data for one of the icon family's elements as a new | 154 // Gets the image data for one of the icon family's elements as a new |
| 153 // NSBitmapImageRep. The specified elementType should be one of | 155 // NSBitmapImageRep. The specified elementType should be one of |
| 154 // kThumbnail32BitData, kThumbnail32BitMask, kLarge32BitData, kLarge8BitMask, | 156 // kThumbnail32BitData, kThumbnail32BitMask, kLarge32BitData, kLarge8BitMask, |
| 155 // kLarge1BitMask, kSmall32BitData, kSmall8BitMask, or kSmall1BitMask. | 157 // kLarge1BitMask, kSmall32BitData, kSmall8BitMask, or kSmall1BitMask. |
| 156 | 158 |
| 157 // - (NSBitmapImageRep*) bitmapImageRepForIconFamilyElement:(OSType)elementType; | 159 // - (NSBitmapImageRep*) bitmapImageRepForIconFamilyElement:(OSType)elementType; |
| 158 | 160 |
| 159 // Writes the icon family to the resource fork of the specified file as its | 161 // Writes the icon family to the resource fork of the specified file as its |
| (...skipping 11 matching lines...) Expand all Loading... |
| 171 // Removes the custom icon (if any) from the specified file's resource fork, | 173 // Removes the custom icon (if any) from the specified file's resource fork, |
| 172 // and clears the necessary Finder bits for the file. (Note that this is a | 174 // and clears the necessary Finder bits for the file. (Note that this is a |
| 173 // class method, so you don't need an instance of IconFamily to invoke it.) | 175 // class method, so you don't need an instance of IconFamily to invoke it.) |
| 174 | 176 |
| 175 + (BOOL) removeCustomIconFromFile:(NSString*)path; | 177 + (BOOL) removeCustomIconFromFile:(NSString*)path; |
| 176 | 178 |
| 177 //Same as the -removeCustomIconFromFile: method, but for folders (directories). | 179 //Same as the -removeCustomIconFromFile: method, but for folders (directories). |
| 178 | 180 |
| 179 + (BOOL) removeCustomIconFromDirectory:(NSString*)path; | 181 + (BOOL) removeCustomIconFromDirectory:(NSString*)path; |
| 180 | 182 |
| 183 #endif // !defined(DISABLE_CUSTOM_ICON) |
| 184 |
| 181 @end | 185 @end |
| 182 | 186 |
| 183 // Methods for interfacing with the Carbon Scrap Manager (analogous to and | 187 // Methods for interfacing with the Carbon Scrap Manager (analogous to and |
| 184 // interoperable with the Cocoa Pasteboard). | 188 // interoperable with the Cocoa Pasteboard). |
| 185 @interface IconFamily (ScrapAdditions) | 189 @interface IconFamily (ScrapAdditions) |
| 186 + (BOOL) canInitWithScrap; | 190 + (BOOL) canInitWithScrap; |
| 187 + (IconFamily*) iconFamilyWithScrap; | 191 + (IconFamily*) iconFamilyWithScrap; |
| 188 - initWithScrap; | 192 - (id) initWithScrap; |
| 189 - (BOOL) putOnScrap; | 193 - (BOOL) putOnScrap; |
| 190 @end | 194 @end |
| OLD | NEW |