diff --git a/ChangeLog b/ChangeLog index 774ad23a7..011284cb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Tue May 4 18:00:00 1999 Richard Frith-Macdonald + + * Headers/AppKit/NSGraphicsContext.h: methods for event handling. + * Headers/AppKit/GSMethodTable.h: methods for event handling. + * Headers/AppKit/DPSOperators.h: methods for event handling. + * Headers/AppKit/PSOperators.h: methods for event handling. + * Source/NSGraphicsContext.m: methods for event handling. + Tue May 4 14:40:00 1999 Richard Frith-Macdonald Updates from information supplied by Marc Champesme to make NSWindow diff --git a/Headers/gnustep/gui/DPSOperators.h b/Headers/gnustep/gui/DPSOperators.h index aa18bee42..75664b6cf 100644 --- a/Headers/gnustep/gui/DPSOperators.h +++ b/Headers/gnustep/gui/DPSOperators.h @@ -1812,4 +1812,29 @@ DPScapturegstate(GSCTXT *ctxt, int *gst) (ctxt, @selector(DPScapturegstate:), gst); } +/* ----------------------------------------------------------------------- */ +/* GNUstep Event and other I/O extensions */ +/* ----------------------------------------------------------------------- */ +static inline NSEvent* +DPSGetEventMatchingMaskBeforeDateInModeDequeue(GSCTXT *ctxt, unsigned mask, NSDate* limit, NSString *mode, BOOL dequeue) +{ + return (ctxt->methods->DPSGetEventMatchingMask_beforeDate_inMode_dequeue_) + (ctxt, @selector(DPSGetEventMatchingMask:beforeDate:inMode:dequeue:), + mask, limit, mode, dequeue); +} + +static inline void +DPSDiscardEventsMatchingMaskBeforeEvent(GSCTXT *ctxt, unsigned mask, NSEvent* limit) +{ + (ctxt->methods->DPSDiscardEventsMatchingMask_beforeEvent_) + (ctxt, @selector(DPSDiscardEventsMatchingMask:beforeEvent:), mask, limit); +} + +static inline void +DPSPostEventAtStart(GSCTXT *ctxt, NSEvent* anEvent, BOOL atStart) +{ + (ctxt->methods->DPSPostEvent_atStart_) + (ctxt, @selector(DPSPostEvent:atStart:), anEvent, atStart); +} + #endif diff --git a/Headers/gnustep/gui/GSMethodTable.h b/Headers/gnustep/gui/GSMethodTable.h index 59df167b2..8d5bcfa1a 100644 --- a/Headers/gnustep/gui/GSMethodTable.h +++ b/Headers/gnustep/gui/GSMethodTable.h @@ -26,7 +26,10 @@ #include +@class NSDate; +@class NSEvent; @class NSGraphicsContext; +@class NSString; typedef struct { @@ -371,6 +374,16 @@ typedef struct { (NSGraphicsContext*, SEL, double, double, double, int*); void (*DPScapturegstate_) (NSGraphicsContext*, SEL, int*); +/* ----------------------------------------------------------------------- */ +/* GNUstep Event and other I/O extensions */ +/* ----------------------------------------------------------------------- */ + NSEvent* (*DPSGetEventMatchingMask_beforeDate_inMode_dequeue_) + (NSGraphicsContext*, SEL, unsigned, NSDate*, NSString*, BOOL); + void (*DPSDiscardEventsMatchingMask_beforeEvent_) + (NSGraphicsContext*, SEL, unsigned, NSEvent*); + void (*DPSPostEvent_atStart_) + (NSGraphicsContext*, SEL, NSEvent*, BOOL); + } gsMethodTable; #endif diff --git a/Headers/gnustep/gui/NSGraphicsContext.h b/Headers/gnustep/gui/NSGraphicsContext.h index e6b3f7ed7..bdc18d8e0 100644 --- a/Headers/gnustep/gui/NSGraphicsContext.h +++ b/Headers/gnustep/gui/NSGraphicsContext.h @@ -34,9 +34,12 @@ #include +@class NSDate; +@class NSDictionary; +@class NSEvent; @class NSMutableArray; @class NSMutableData; -@class NSDictionary; +@class NSString; @class NSView; // @@ -324,6 +327,16 @@ typedef enum _NSWindowOrderingMode - (void) DPSsetrgbactual: (double)r : (double)g : (double)b : (int *)success ; - (void) DPScapturegstate: (int *)gst ; +/* ----------------------------------------------------------------------- */ +/* GNUstep Event and other I/O extensions */ +/* ----------------------------------------------------------------------- */ +- (NSEvent*) DPSGetEventMatchingMask: (unsigned)mask + beforeDate: (NSDate*)limit + inMode: (NSString*)mode + dequeue: (BOOL)flag; +- (void) DPSDiscardEventsMatchingMask: (unsigned)mask + beforeEvent: (NSEvent*)limit; +- (void) DPSPostEvent: (NSEvent*)anEvent atStart: (BOOL)flag; @end #endif /* _NSGraphicsContext_h_INCLUDE */ diff --git a/Headers/gnustep/gui/PSOperators.h b/Headers/gnustep/gui/PSOperators.h index 8253bbe5f..92616040f 100644 --- a/Headers/gnustep/gui/PSOperators.h +++ b/Headers/gnustep/gui/PSOperators.h @@ -1654,4 +1654,26 @@ PScapturegstate(int *gst) DPScapturegstate(DEFCTXT, gst); } +/* ----------------------------------------------------------------------- */ +/* GNUstep Event and other I/O extensions */ +/* ----------------------------------------------------------------------- */ +static inline NSEvent* +PSGetEventMatchingMaskBeforeDateInModeDequeue(unsigned mask, NSDate* limit, NSString *mode, BOOL dequeue) +{ + return DPSGetEventMatchingMaskBeforeDateInModeDequeue(DEFCTXT, + mask, limit, mode, dequeue); +} + +static inline void +PSDiscardEventsMatchingMaskBeforeEvent(unsigned mask, NSEvent* limit) +{ + DPSDiscardEventsMatchingMaskBeforeEvent(DEFCTXT, mask, limit); +} + +static inline void +PSPostEventAtStart(NSEvent* anEvent, BOOL atStart) +{ + DPSPostEventAtStart(DEFCTXT, anEvent, atStart); +} + #endif diff --git a/Source/NSGraphicsContext.m b/Source/NSGraphicsContext.m index dec0d11b8..6500b4aeb 100644 --- a/Source/NSGraphicsContext.m +++ b/Source/NSGraphicsContext.m @@ -1434,4 +1434,27 @@ struct NSWindow_struct [self subclassResponsibility: _cmd]; } +/* ----------------------------------------------------------------------- */ +/* GNUstep Event and other I/O extensions */ +/* ----------------------------------------------------------------------- */ +- (NSEvent*) DPSGetEventMatchingMask: (unsigned)mask + beforeDate: (NSDate*)limit + inMode: (NSString*)mode + dequeue: (BOOL)flag +{ + [self subclassResponsibility: _cmd]; + return nil; +} + +- (void) DPSDiscardEventsMatchingMask: (unsigned)mask + beforeEvent: (NSEvent*)limit +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSPostEvent: (NSEvent*)anEvent atStart: (BOOL)flag +{ + [self subclassResponsibility: _cmd]; +} + @end