Haha awesome! Good news :) - Tom
kakar...@users.sourceforge.net wrote: > Revision: 11451 > http://amsn.svn.sourceforge.net/amsn/?rev=11451&view=rev > Author: kakaroto > Date: 2009-08-09 08:14:56 +0000 (Sun, 09 Aug 2009) > > Log Message: > ----------- > HAHA, thanks to Kevin Walzer for showing me the CarbonCocoaDoc from apple > that tells us how to integrate Cocoa windows in Carbon applications :D This > makes our webcam windows appear correctly, no more need for cocoa event loop > integration or anything like that.. events are passed to Cocoa from Carbon > directly > > Modified Paths: > -------------- > trunk/amsn/utils/farsight/src/tcl_farsight.c > trunk/amsn/utils/farsight/tcl_farsight.dylib > > Modified: trunk/amsn/utils/farsight/src/tcl_farsight.c > =================================================================== > --- trunk/amsn/utils/farsight/src/tcl_farsight.c 2009-08-09 08:12:14 UTC > (rev 11450) > +++ trunk/amsn/utils/farsight/src/tcl_farsight.c 2009-08-09 08:14:56 UTC > (rev 11451) > @@ -101,51 +101,8 @@ > > #ifdef __APPLE__ > > -static Tcl_TimerToken cocoa_event_timer = NULL; > static NSAutoreleasePool *cocoa_pool = NULL; > > -...@implementation FarsightAppDelegate : NSObject > -- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication > *)sender > -{ > - // destroy stuff here! > - return NSTerminateNow; > -} > -...@end > - > - > - > -/* cocoa event loop - needed to handle the window */ > -/* FIXME : This is crap because Tk uses Carbon which eats our events > - so it's either Carbon or Cocoa who gets the event, and it's all screwed > up */ > -static void > -cocoa_event_loop (ClientData dummy) > -{ > - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; > - > - while (TRUE) { > - unsigned int masks = NSLeftMouseDownMask | > - NSLeftMouseUpMask | > - NSLeftMouseDraggedMask | > - NSMouseEnteredMask | > - NSMouseExitedMask | > - NSAppKitDefinedMask | /* To handle move window */ > - NSSystemDefinedMask /* To handle resize window */; > - NSEvent *event = [NSApp nextEventMatchingMask:masks > - untilDate:[NSDate > dateWithTimeIntervalSinceNow:0.1] > - inMode:NSDefaultRunLoopMode dequeue:YES]; > - if ( event == nil ) { > - break; > - } else { > - [NSApp sendEvent:event]; > - // loop > - } > - } > - [pool release]; > - > - cocoa_event_timer = Tcl_CreateTimerHandler(100, cocoa_event_loop, NULL); > - > -} > - > #endif > > > @@ -286,9 +243,6 @@ > fsnotifier = NULL; > > #ifdef __APPLE__ > - if (cocoa_event_timer != NULL) { > - Tcl_DeleteTimerHandler(cocoa_event_timer); > - } > if (cocoa_pool != NULL) { > [cocoa_pool release]; > cocoa_pool = NULL; > @@ -1784,7 +1738,7 @@ > rect.size.width = 352.0 ; > rect.size.height = 288.0; > > - [NSApplication sharedApplication]; > + NSApplicationLoad(); > > win =[[NSWindow alloc] > initWithContentRect: rect > @@ -1795,15 +1749,9 @@ > > [win setContentView:nsview]; > > - [win makeKeyAndOrderFront:NSApp]; > + [win makeKeyAndOrderFront:nil]; > [win autorelease]; > > - [NSApp finishLaunching]; > - [NSApp setDelegate:[[FarsightAppDelegate alloc] init]]; > - > - if (cocoa_event_timer == NULL) { > - cocoa_event_timer = Tcl_CreateTimerHandler(100, > cocoa_event_loop, NULL); > - } > } > } > #endif > > Modified: trunk/amsn/utils/farsight/tcl_farsight.dylib > =================================================================== > (Binary files differ) > > > This was sent by the SourceForge.net collaborative development platform, the > world's largest Open Source development site. > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Amsn-commits mailing list > amsn-comm...@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/amsn-commits ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Amsn-devel mailing list Amsn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amsn-devel