Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Side by Side Diff: third_party/icon_family/chromium_icon_family.patch

Issue 15650005: Create app shims with 32-bit icons only, as per OSX 10.5 spec. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove template Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 diff --git a/third_party/icon_family/IconFamily.h b/third_party/icon_family/Icon Family.h
2 index 6a6049f..63f6bb7 100644
3 --- a/third_party/icon_family/IconFamily.h
4 +++ b/third_party/icon_family/IconFamily.h
5 @@ -57,24 +57,24 @@
6 // Initializes as a new, empty IconFamily. This is IconFamily's designated
7 // initializer method.
8
9 -- init;
10 +- (id) init;
11
12 // Initializes an IconFamily by loading the contents of an .icns file.
13
14 -- initWithContentsOfFile:(NSString*)path;
15 +- (id) initWithContentsOfFile:(NSString*)path;
16
17 // Initializes an IconFamily from an existing Carbon IconFamilyHandle.
18
19 -- initWithIconFamilyHandle:(IconFamilyHandle)hNewIconFamily;
20 +- (id) initWithIconFamilyHandle:(IconFamilyHandle)hNewIconFamily;
21
22 // Initializes an IconFamily by loading the Finder icon that's assigned to a
23 // file.
24
25 -- initWithIconOfFile:(NSString*)path;
26 +- (id) initWithIconOfFile:(NSString*)path;
27
28 // Initializes an IconFamily by referencing a standard system icon.
29
30 -- initWithSystemIcon:(int)fourByteCode;
31 +- (id) initWithSystemIcon:(int)fourByteCode;
32
33 // Initializes an IconFamily by creating its elements from a resampled
34 // NSImage. The second form of this method allows you to specify the degree
35 @@ -84,8 +84,8 @@
36 // second form with imageInterpolation set to NSImageInterpolationHigh, which
37 // produces highly smoothed thumbnails.
38
39 -- initWithThumbnailsOfImage:(NSImage*)image;
40 -- initWithThumbnailsOfImage:(NSImage*)image usingImageInterpolation:(NSImageInt erpolation)imageInterpolation;
41 +- (id) initWithThumbnailsOfImage:(NSImage*)image;
42 +- (id) initWithThumbnailsOfImage:(NSImage*)image usingImageInterpolation:(NSIma geInterpolation)imageInterpolation;
43
44 // Writes the icon family to an .icns file.
45
46 @@ -147,6 +147,8 @@
47
48 - (NSImage*) imageWithAllReps;
49
50 +#if !defined(DISABLE_CUSTOM_ICON)
51 +
52 // NOTE: Planned method -- not yet implemented.
53 //
54 // Gets the image data for one of the icon family's elements as a new
55 @@ -178,6 +180,8 @@
56
57 + (BOOL) removeCustomIconFromDirectory:(NSString*)path;
58
59 +#endif // !defined(DISABLE_CUSTOM_ICON)
60 +
61 @end
62
63 // Methods for interfacing with the Carbon Scrap Manager (analogous to and
64 @@ -185,6 +189,6 @@
65 @interface IconFamily (ScrapAdditions)
66 + (BOOL) canInitWithScrap;
67 + (IconFamily*) iconFamilyWithScrap;
68 -- initWithScrap;
69 +- (id) initWithScrap;
70 - (BOOL) putOnScrap;
71 @end
72 diff --git a/third_party/icon_family/IconFamily.m b/third_party/icon_family/Icon Family.m
73 index b9571d0..439c2de 100644
74 --- a/third_party/icon_family/IconFamily.m
75 +++ b/third_party/icon_family/IconFamily.m
76 @@ -91,7 +91,9 @@ enum {
77
78 + (Handle) get1BitMaskFromBitmapImageRep:(NSBitmapImageRep*)bitmapImageRep requ iredPixelSize:(int)requiredPixelSize;
79
80 +#if !defined(DISABLE_CUSTOM_ICON)
81 - (BOOL) addResourceType:(OSType)type asResID:(int)resID;
82 +#endif
83
84 @end
85
86 @@ -135,7 +137,7 @@ enum {
87 // This is IconFamily's designated initializer. It creates a new IconFamily th at initially has no elements.
88 //
89 // The proper way to do this is to simply allocate a zero-sized handle (not to be confused with an empty handle) and assign it to hIconFamily. This technique works on Mac OS X 10.2 as well as on 10.0.x and 10.1.x. Our previous technique of allocating an IconFamily struct with a resourceSize of 0 no longer works as o f Mac OS X 10.2.
90 -- init
91 +- (id) init
92 {
93 self = [super init];
94 if (self) {
95 @@ -148,7 +150,7 @@ enum {
96 return self;
97 }
98
99 -- initWithData:(NSData *)data
100 +- (id) initWithData:(NSData *)data
101 {
102 self = [self init];
103 if (self) {
104 @@ -166,7 +168,7 @@ enum {
105 return self;
106 }
107
108 -- initWithContentsOfFile:(NSString*)path
109 +- (id) initWithContentsOfFile:(NSString*)path
110 {
111 FSRef ref;
112 OSStatus result;
113 @@ -190,7 +192,7 @@ enum {
114 return self;
115 }
116
117 -- initWithIconFamilyHandle:(IconFamilyHandle)hNewIconFamily
118 +- (id) initWithIconFamilyHandle:(IconFamilyHandle)hNewIconFamily
119 {
120 self = [self init];
121 if (self) {
122 @@ -203,7 +205,7 @@ enum {
123 return self;
124 }
125
126 -- initWithIconOfFile:(NSString*)path
127 +- (id) initWithIconOfFile:(NSString*)path
128 {
129 IconRef iconRef;
130 OSStatus result;
131 @@ -257,7 +259,7 @@ enum {
132 return self;
133 }
134
135 -- initWithSystemIcon:(int)fourByteCode
136 +- (id) initWithSystemIcon:(int)fourByteCode
137 {
138 IconRef iconRef;
139 OSErr result;
140 @@ -295,13 +297,13 @@ enum {
141 return self;
142 }
143
144 -- initWithThumbnailsOfImage:(NSImage*)image
145 +- (id) initWithThumbnailsOfImage:(NSImage*)image
146 {
147 // The default is to use a high degree of antialiasing, producing a smooth image.
148 return [self initWithThumbnailsOfImage:image usingImageInterpolation:NSImag eInterpolationHigh];
149 }
150
151 -- initWithThumbnailsOfImage:(NSImage*)image usingImageInterpolation:(NSImageInt erpolation)imageInterpolation
152 +- (id) initWithThumbnailsOfImage:(NSImage*)image usingImageInterpolation:(NSIma geInterpolation)imageInterpolation
153 {
154 NSImage* iconImage512x512;
155 NSImage* iconImage256x256;
156 @@ -724,6 +726,8 @@ enum {
157 return YES;
158 }
159
160 +#if !defined(DISABLE_CUSTOM_ICON)
161 +
162 - (BOOL) setAsCustomIconForFile:(NSString*)path
163 {
164 return( [self setAsCustomIconForFile:path withCompatibility:NO] );
165 @@ -1139,6 +1143,8 @@ enum {
166 return YES;
167 }
168
169 +#endif // !defined(DISABLE_CUSTOM_ICON)
170 +
171 - (NSData *) data
172 {
173 return [NSData dataWithBytes:*hIconFamily length:GetHandleSize((Handle)hIco nFamily)];
174 @@ -1589,6 +1595,8 @@ enum {
175 return hRawData;
176 }
177
178 +#if !defined(DISABLE_CUSTOM_ICON)
179 +
180 - (BOOL) addResourceType:(OSType)type asResID:(int)resID
181 {
182 Handle hIconRes = NewHandle(0);
183 @@ -1604,6 +1612,8 @@ enum {
184 return YES;
185 }
186
187 +#endif // !defined(DISABLE_CUSTOM_ICON)
188 +
189 @end
190
191 // Methods for interfacing with the Cocoa Pasteboard.
192 @@ -1621,7 +1631,7 @@ enum {
193 return [[[IconFamily alloc] initWithScrap] autorelease];
194 }
195
196 -- initWithScrap
197 +- (id) initWithScrap
198 {
199 NSPasteboard *pboard = [NSPasteboard generalPasteboard];
200
201 @@ -1702,7 +1712,7 @@ enum {
202 - (NSImageRep *) iconfamily_bestRepresentation
203 {
204 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
205 - if ([!self respondsToSelector:@selector(bestRepresentationForRect:contex t:hints:)])
206 + if (![self respondsToSelector:@selector(bestRepresentationForRect:contex t:hints:)])
207 {
208 return [self bestRepresentationForDevice:nil];
209 }
210 diff --git a/third_party/icon_family/NSString+CarbonFSRefCreation.m b/third_part y/icon_family/NSString+CarbonFSRefCreation.m
211 index 723de8b..fb86c52 100644
212 --- a/third_party/icon_family/NSString+CarbonFSRefCreation.m
213 +++ b/third_party/icon_family/NSString+CarbonFSRefCreation.m
214 @@ -23,7 +23,7 @@
215 // Check whether the file exists already. If not, create an empty file if requested.
216 if (![fileManager fileExistsAtPath:self]) {
217 if (createFile) {
218 - if (![[NSData data] writeToFile:self atomically:YES]) {
219 + if (![(NSData*)[NSData data] writeToFile:self atomically:YES]) {
220 return NO;
221 }
222 } else {
OLDNEW
« no previous file with comments | « third_party/icon_family/README.chromium ('k') | third_party/icon_family/chromium_icon_family_2.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698