mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Move defaultExceptionHandler initialisation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28829 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
875614cc47
commit
24a12e840f
3 changed files with 26 additions and 12 deletions
|
@ -1,3 +1,9 @@
|
|||
2009-10-16 Sheldon Gill <sheldon@westnet.net.au>
|
||||
|
||||
* Source/NSEvent.m: add default for unknown events
|
||||
* Source/NSApplication.m: Move saving defaultExceptionHandler to
|
||||
when it is required (in _init) rather than early in +[initialize]
|
||||
|
||||
2009-10-13 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/GSTextStorage.m (-initWithCoder:): Display the warning
|
||||
|
|
|
@ -111,7 +111,7 @@ _NSAppKitUncaughtExceptionHandler (NSException *exception)
|
|||
|
||||
/* Reset the exception handler to the Base library's one, to prevent
|
||||
recursive calls to the gui one. */
|
||||
NSSetUncaughtExceptionHandler (defaultUncaughtExceptionHandler);
|
||||
NSSetUncaughtExceptionHandler(defaultUncaughtExceptionHandler);
|
||||
|
||||
/*
|
||||
* If there is no graphics context to run the alert panel in or
|
||||
|
@ -156,7 +156,8 @@ _NSAppKitUncaughtExceptionHandler (NSException *exception)
|
|||
static NSBundle *guiBundle = nil;
|
||||
|
||||
/* Get the bundle. */
|
||||
NSBundle *GSGuiBundle (void)
|
||||
NSBundle *
|
||||
GSGuiBundle(void)
|
||||
{
|
||||
return guiBundle;
|
||||
}
|
||||
|
@ -167,7 +168,7 @@ NSBundle *GSGuiBundle (void)
|
|||
@end
|
||||
|
||||
static NSString *
|
||||
gnustep_backend_path (NSString *dir, NSString *name)
|
||||
gnustep_backend_path(NSString *dir, NSString *name)
|
||||
{
|
||||
NSString *path;
|
||||
NSEnumerator *benum;
|
||||
|
@ -193,7 +194,7 @@ gnustep_backend_path (NSString *dir, NSString *name)
|
|||
such as 'GNUstep-back', or simply 'back', or for historical reasons,
|
||||
'libgnustep-back'. */
|
||||
static NSString *
|
||||
gnustep_backend_framework (NSString *bundleName)
|
||||
gnustep_backend_framework(NSString *bundleName)
|
||||
{
|
||||
if (bundleName == nil)
|
||||
bundleName = @"GNUstep_back.framework";
|
||||
|
@ -720,9 +721,6 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
|
|||
guiBundle = [NSBundle bundleForLibrary: @"gnustep-gui"
|
||||
version: OBJC_STRINGIFY(GNUSTEP_GUI_MAJOR_VERSION.GNUSTEP_GUI_MINOR_VERSION)];
|
||||
RETAIN(guiBundle);
|
||||
|
||||
/* Save the base library exception handler */
|
||||
defaultUncaughtExceptionHandler = NSGetUncaughtExceptionHandler ();
|
||||
|
||||
/* Cache the NSAutoreleasePool class */
|
||||
arpClass = [NSAutoreleasePool class];
|
||||
|
@ -819,7 +817,7 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
|
|||
GSDisplayServer *srv;
|
||||
NSDictionary *attributes;
|
||||
/* Initialization must be enclosed in an autorelease pool. */
|
||||
CREATE_AUTORELEASE_POOL (_app_init_pool);
|
||||
CREATE_AUTORELEASE_POOL(_app_init_pool);
|
||||
|
||||
/*
|
||||
* Set NSApp as soon as possible, since other gui classes (which
|
||||
|
@ -859,8 +857,10 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
|
|||
//_main_menu = nil;
|
||||
_windows_need_update = YES;
|
||||
|
||||
/* Save the base library exception handler */
|
||||
defaultUncaughtExceptionHandler = NSGetUncaughtExceptionHandler();
|
||||
/* Set a new exception handler for the gui library. */
|
||||
NSSetUncaughtExceptionHandler (_NSAppKitUncaughtExceptionHandler);
|
||||
NSSetUncaughtExceptionHandler(_NSAppKitUncaughtExceptionHandler);
|
||||
|
||||
_listener = [GSServicesManager newWithApplication: self];
|
||||
|
||||
|
@ -871,7 +871,7 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
|
|||
/* We are the end of responder chain. */
|
||||
[self setNextResponder: nil];
|
||||
|
||||
RELEASE (_app_init_pool);
|
||||
RELEASE(_app_init_pool);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -683,9 +683,17 @@ static const char *eventTypes[] = {
|
|||
event_data.mouse.deltaZ];
|
||||
break;
|
||||
|
||||
// FIXME: Tablet events
|
||||
case NSTabletPoint:
|
||||
case NSTabletProximity:
|
||||
// FIXME: Tablet events
|
||||
break;
|
||||
|
||||
default:
|
||||
return [NSString stringWithFormat:
|
||||
@"NSEvent: eventType = UNKNOWN!, point = { %f, %f }, modifiers = %u,"
|
||||
@" time = %f, window = %d"
|
||||
location_point.x, location_point.y,
|
||||
modifier_flags, event_time, window_num];
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -765,7 +773,7 @@ static const char *eventTypes[] = {
|
|||
if (!(NSEventMaskFromType(event_type) & GSMouseEventMask) &&
|
||||
!(NSEventMaskFromType(event_type) & GSEnterExitEventMask))
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"eventNumber requested for non-mouse event"];
|
||||
format: @"eventNumber requested for non-tracking event"];
|
||||
|
||||
if ((event_type == NSMouseEntered) || (event_type == NSMouseExited))
|
||||
return event_data.tracking.event_num;
|
||||
|
|
Loading…
Reference in a new issue