- Issue #151, Alexei Svitkine's fix for dropping files from windows explorer

- Issue #180, Alexei Svitkine's fix for generating alpha mask from windows icon
This commit is contained in:
Christopher Lloyd 2008-09-26 13:56:17 +00:00
parent 1cf32bebaa
commit dca3526cf5
3 changed files with 16 additions and 7 deletions

View File

@ -26,7 +26,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
-(NSData *)dataForType:(NSString *)type {
return [_dataClient dataForType:type];
if([type isEqualToString:NSFilenamesPboardType]) {
NSString *error=nil;
NSData *result=[NSPropertyListSerialization dataFromPropertyList:[_dataClient filenames] format:NSPropertyListXMLFormat_v1_0 errorDescription:&error];
if(error) {
NSLog(@"Error: %@", error);
[error release];
}
return result;
} else
return [_dataClient dataForType:type];
}
-(id)propertyListForType:(NSString *)type {

View File

@ -89,7 +89,7 @@ static NSImageRep *imageRepForIcon(SHFILEINFO * fileInfo) {
}
}
#define BIT_SET(x,y) (((x) >> (8-(y))) & 1)
#define BIT_SET(x,y) (((x) >> (7-(y))) & 1)
if (!hasAlpha) {
for (i = 0; i < masklen; i++) {

View File

@ -41,18 +41,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
@try{
if((result=[NSPropertyListReader_xml1 propertyListFromData:data])!=nil){
*format=NSPropertyListXMLFormat_v1_0;
if((result=[NSPropertyListReader_xml1 propertyListFromData:data])!=nil){
if(format)*format=NSPropertyListXMLFormat_v1_0;
return result;
}
if((result=[NSPropertyListReader_binary1 propertyListFromData:data])!=nil){
*format=NSPropertyListBinaryFormat_v1_0;
return result;
if(format)*format=NSPropertyListBinaryFormat_v1_0;
return result;
}
if((result=[NSPropertyListReader_vintage propertyListFromData:data])!=nil){
*format=NSPropertyListOpenStepFormat;
if(format)*format=NSPropertyListOpenStepFormat;
return result;
}
}