mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2024-11-27 14:00:22 +00:00
- 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:
parent
1cf32bebaa
commit
dca3526cf5
@ -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 {
|
||||
|
@ -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++) {
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user