Mercurial > dwindows
comparison mac/dw.m @ 1861:c836603d3f14
Add dw_shutdown() function which does the same thing as dw_exit() ...
except it doesn't actually end the process. Useful for bindings
that are expecting to do their own cleanup after the script exits.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 01 Mar 2013 16:51:08 +0000 |
parents | 4790589f52a9 |
children | 9c7485b1921c |
comparison
equal
deleted
inserted
replaced
1860:02a23143334c | 1861:c836603d3f14 |
---|---|
3214 } | 3214 } |
3215 } | 3215 } |
3216 | 3216 |
3217 /* | 3217 /* |
3218 * Cleanly terminates a DW session, should be signal handler safe. | 3218 * Cleanly terminates a DW session, should be signal handler safe. |
3219 * Parameters: | 3219 */ |
3220 * exitcode: Exit code reported to the operating system. | 3220 void API dw_shutdown(void) |
3221 */ | |
3222 void API dw_exit(int exitcode) | |
3223 { | 3221 { |
3224 #if !defined(GARBAGE_COLLECT) | 3222 #if !defined(GARBAGE_COLLECT) |
3225 pool = pthread_getspecific(_dw_pool_key); | 3223 pool = pthread_getspecific(_dw_pool_key); |
3226 [pool drain]; | 3224 [pool drain]; |
3227 #endif | 3225 #endif |
3226 } | |
3227 | |
3228 /* | |
3229 * Cleanly terminates a DW session, should be signal handler safe. | |
3230 * Parameters: | |
3231 * exitcode: Exit code reported to the operating system. | |
3232 */ | |
3233 void API dw_exit(int exitcode) | |
3234 { | |
3235 dw_shutdown(); | |
3228 exit(exitcode); | 3236 exit(exitcode); |
3229 } | 3237 } |
3230 | 3238 |
3231 /* | 3239 /* |
3232 * Free's memory allocated by dynamic windows. | 3240 * Free's memory allocated by dynamic windows. |
8297 | 8305 |
8298 [window setContentView:view]; | 8306 [window setContentView:view]; |
8299 [window setDelegate:view]; | 8307 [window setDelegate:view]; |
8300 [window setAutorecalculatesKeyViewLoop:YES]; | 8308 [window setAutorecalculatesKeyViewLoop:YES]; |
8301 [window setAcceptsMouseMovedEvents:YES]; | 8309 [window setAcceptsMouseMovedEvents:YES]; |
8302 [view release]; | 8310 [window setReleasedWhenClosed:YES]; |
8311 [view autorelease]; | |
8303 | 8312 |
8304 /* Enable full screen mode on resizeable windows */ | 8313 /* Enable full screen mode on resizeable windows */ |
8305 if(flStyle & DW_FCF_SIZEBORDER) | 8314 if(flStyle & DW_FCF_SIZEBORDER) |
8306 { | 8315 { |
8307 [window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; | 8316 [window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; |