Events tidyup.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4520 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-07-06 11:01:46 +00:00
parent a79eeb8a2d
commit 6de1f395d4
3 changed files with 63 additions and 52 deletions

View file

@ -1,3 +1,18 @@
Tue Jul 6 12:06:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Headers/AppKit/NSEvent.h: Added event subtypes for appkit events
* Source/Functions.m: Rewrite for new event types.
Tue Jul 6 6:45:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Headers/AppKit/NSGraphicsContext.h: New method for window control -
([_setFrame:forWindow:])
* Headers/AppKit/NSWindow.m: New ivar 'autosave_name' and new method
([_setFrame:]) for backend to call when window frame has changed.
* Source/NSGraphicsContext.m: Dummy implementation of new method.
* Source/NSWindow.m: Rewrite all moving/sizing methods and methods
for storing/retrieving window frame info in defaults database.
1999-07-05 Adam Fedor <fedor@gnu.org> 1999-07-05 Adam Fedor <fedor@gnu.org>
* Source/GNUmakefile: Install NSPopUpButtonCell.h * Source/GNUmakefile: Install NSPopUpButtonCell.h

View file

@ -310,5 +310,11 @@ enum {
*/ */
unsigned int NSEventMaskFromType(NSEventType type); unsigned int NSEventMaskFromType(NSEventType type);
#ifndef NO_GNUSTEP
typedef enum {
GSAppKitWindowMoved = 1,
GSAppKitWindowResized
} GSAppKitSubtype;
#endif
#endif /* _GNUstep_H_NSEvent */ #endif /* _GNUstep_H_NSEvent */

View file

@ -3,12 +3,10 @@
Generic Functions for the GNUstep GUI Library. Generic Functions for the GNUstep GUI Library.
Copyright (C) 1996 Free Software Foundation, Inc. Copyright (C) 1996,1999 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com> Author: Scott Christley <scottc@net-community.com>
Date: 1996 Date: 1996
Author: Felipe A. Rodriguez <far@ix.netcom.com>
Date: December 1998
This file is part of the GNUstep GUI Library. This file is part of the GNUstep GUI Library.
@ -36,20 +34,23 @@
char **NSArgv = NULL; char **NSArgv = NULL;
// /*
// Main initialization routine for the GNUstep GUI Library Apps * Main initialization routine for the GNUstep GUI Library Apps
// */
int NSApplicationMain(int argc, const char **argv) int
NSApplicationMain(int argc, const char **argv)
{ {
extern char** environ; NSAutoreleasePool *pool;
#if LIB_FOUNDATION_LIBRARY #if LIB_FOUNDATION_LIBRARY
[NSProcessInfo initializeWithArguments:(char**)argv extern char **environ;
count:argc
environment:environ]; [NSProcessInfo initializeWithArguments: (char**)argv
count: argc
environment: environ];
#endif #endif
[NSAutoreleasePool new]; pool = [NSAutoreleasePool new];
#ifndef NX_CURRENT_COMPILER_RELEASE #ifndef NX_CURRENT_COMPILER_RELEASE
initialize_gnustep_backend(); initialize_gnustep_backend();
@ -57,47 +58,36 @@ extern char** environ;
[[NSApplication sharedApplication] run]; [[NSApplication sharedApplication] run];
[pool release];
return 0; return 0;
} }
// /*
// Convert an NSEvent Type to it's respective Event Mask * Convert an NSEvent Type to it's respective Event Mask
// */
unsigned int NSEventMaskFromType(NSEventType type) unsigned
{ NSEventMaskFromType(NSEventType type)
switch(type) {
{ switch(type)
case NSLeftMouseDown: {
return NSLeftMouseDownMask; case NSLeftMouseDown: return NSLeftMouseDownMask;
case NSLeftMouseUp: case NSLeftMouseUp: return NSLeftMouseUpMask;
return NSLeftMouseUpMask; case NSRightMouseDown: return NSRightMouseDownMask;
case NSRightMouseDown: case NSRightMouseUp: return NSRightMouseUpMask;
return NSRightMouseDownMask; case NSMouseMoved: return NSMouseMovedMask;
case NSRightMouseUp: case NSMouseEntered: return NSMouseEnteredMask;
return NSRightMouseUpMask; case NSMouseExited: return NSMouseExitedMask;
case NSMouseMoved: case NSLeftMouseDragged: return NSLeftMouseDraggedMask;
return NSMouseMovedMask; case NSRightMouseDragged: return NSRightMouseDraggedMask;
case NSMouseEntered: case NSKeyDown: return NSKeyDownMask;
return NSMouseEnteredMask; case NSKeyUp: return NSKeyUpMask;
case NSMouseExited: case NSFlagsChanged: return NSFlagsChangedMask;
return NSMouseExitedMask; case NSPeriodic: return NSPeriodicMask;
case NSLeftMouseDragged: case NSCursorUpdate: return NSCursorUpdateMask;
return NSLeftMouseDraggedMask; case NSAppKitDefined: return NSAppKitDefinedMask;
case NSRightMouseDragged: case NSSystemDefined: return NSSystemDefinedMask;
return NSRightMouseDraggedMask; case NSApplicationDefined: return NSApplicationDefinedMask;
case NSKeyDown: }
return NSKeyDownMask; return 0;
case NSKeyUp:
return NSKeyUpMask;
case NSFlagsChanged:
return NSFlagsChangedMask;
case NSPeriodic:
return NSPeriodicMask;
case NSCursorUpdate:
return NSCursorUpdateMask;
default:
break;
}
return 0;
} }