I've implemented NSFilenamesPBoardType instead o NSURLPBoardtype for "text/uri-list" in gtkquartz.c. But iTunes refuses to accept drop anyway(however, iTunes icon become gray while dragging over it) . According to Drop Inspector application data provided by me for NSFilenamesPBoardTypes are identical to data Finder provides. Here is the example: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <string>/Users/aleksej/Music/Top Billboard/Billboard Top 100 - 1969(1969)/78 Flying Machine - Smile a Little Smile for Me.mp3 </string> </array> </plist> Here is NSFilenamesPBoardTypes implementation code(gtkquartz.c): else if ([type isEqualTo:NSFilenamesPboardType]) { gchar **list = NULL; int count; count = gdk_text_property_to_utf8_list_for_display (display, gdk_atom_intern_static_string ("UTF8_STRING"), format, data, length, &list); if (count > 0) { gchar **result; result = g_uri_list_extract_uris (list[0]); NSString* str = [[[NSString stringWithUTF8String:list[0]] substringFromIndex:7] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSArray *fileList = [NSArray arrayWithObject:str]; [pasteboard declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:nil]; [pasteboard setPropertyList:fileList forType:NSFilenamesPboardType]; g_strfreev (result); } g_strfreev (list); } I see what Finder provides many pasteboard types, there is public.file-url among them. I couldn't find any documentation on what iTunes expects as pb type. Maybe you have some suggestions on my problem? Maybe gtkquartz-dnd.c have to be modified too? Any help is appreciated. Thank you. Alexander Ivanenko. 11.05.2010, в 18:32, Tobias Weber написал(а):
|