limited drag file feature only for mac 10.7 or above

This commit is contained in:
jerry 2013-08-30 20:18:13 +00:00
parent 9d62232a72
commit 6e57005b4a
1 changed files with 4 additions and 0 deletions

View File

@ -24,6 +24,7 @@ COSXDragView* g_dragView = NULL;
void
runCocoaApp()
{
#ifdef MAC_OS_X_VERSION_10_7
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSApplication* app = [[NSApplication alloc] init];
@ -43,11 +44,13 @@ runCocoaApp()
[app run];
[pool release];
#endif
}
void
fakeDragging(const char* str, int length, int cursorX, int cursorY)
{
#ifdef MAC_OS_X_VERSION_10_7
dispatch_async(dispatch_get_main_queue(), ^{
NSRect screen = [[NSScreen mainScreen] frame];
NSLog ( @"mouseLocation: %d %d", cursorX, cursorY);
@ -55,6 +58,7 @@ fakeDragging(const char* str, int length, int cursorX, int cursorY)
[g_dragWindow setFrame:rect display:YES];
[g_dragWindow makeKeyWindow];
});
#endif
}
CFStringRef