Multi copy from other applications

master
Allen Webster 2017-11-09 19:47:57 -05:00
parent bcff1f1f9f
commit d04dd8879b
2 changed files with 325 additions and 313 deletions

View File

@ -695,7 +695,7 @@ CUSTOM_COMMAND_SIG(setup_new_project){
if (sh_script != 0){ if (sh_script != 0){
fprintf(sh_script, "#!/bin/bash\n\n"); fprintf(sh_script, "#!/bin/bash\n\n");
fprintf(sh_script, get_code_home); fprintf(sh_script, "%s", get_code_home);
fprintf(sh_script, "OPTS=%.*s\n", fprintf(sh_script, "OPTS=%.*s\n",
default_flags_sh.size, default_flags_sh.str); default_flags_sh.size, default_flags_sh.str);

View File

@ -74,6 +74,7 @@ osx_error_dialogue(char *str){
} }
- (void)requestDisplay; - (void)requestDisplay;
- (void)checkClipboard;
- (CVReturn)getFrame; - (CVReturn)getFrame;
- (void)drawRect:(NSRect)bounds; - (void)drawRect:(NSRect)bounds;
@end @end
@ -141,7 +142,18 @@ static DISPLINK_SIG(osx_display_link);
[self setNeedsDisplayInRect:rect]; [self setNeedsDisplayInRect:rect];
} }
static i32 did_update_for_clipboard = true;
- (void)checkClipboard{
NSPasteboard *board = [NSPasteboard generalPasteboard];
if (board.changeCount != osx_objc.prev_clipboard_change_count && did_update_for_clipboard){
[self requestDisplay];
did_update_for_clipboard = false;
}
}
- (CVReturn)getFrame{ - (CVReturn)getFrame{
did_update_for_clipboard = true;
@autoreleasepool @autoreleasepool
{ {
if (osx_objc.running){ if (osx_objc.running){
@ -637,15 +649,10 @@ NSWindow* window = 0;
void void
osx_schedule_step(void){ osx_schedule_step(void){
//DBG_POINT();
#if 1
[NSTimer scheduledTimerWithTimeInterval: 0.0 [NSTimer scheduledTimerWithTimeInterval: 0.0
target: view target: view
selector: @selector(requestDisplay) selector: @selector(requestDisplay)
userInfo: nil repeats:NO]; userInfo: nil repeats:NO];
#else
[view requestDisplay];
#endif
} }
void void
@ -700,6 +707,11 @@ main(int argc, char **argv){
[window setTitle:@WINDOW_NAME]; [window setTitle:@WINDOW_NAME];
[window makeKeyAndOrderFront:nil]; [window makeKeyAndOrderFront:nil];
[NSTimer scheduledTimerWithTimeInterval: 0.5
target: view
selector: @selector(checkClipboard)
userInfo: nil repeats:YES];
osx_init(); osx_init();
[NSApp run]; [NSApp run];