mirror of
https://github.com/gnustep/libs-back.git
synced 2025-05-13 08:41:04 +00:00
Break off -processEvent: from -receivedEvent:type:extra:forMode:
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@18056 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
186159864d
commit
0ec00d1093
2 changed files with 35 additions and 14 deletions
|
@ -1,3 +1,8 @@
|
|||
2003-11-05 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* Source/x11/XGServerEvent.m ([XGServer -processEvent:]): New
|
||||
method broken off from -receivedEvent:type:extra:forMode:.
|
||||
|
||||
2003-11-05 03:29 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
* Source/x11/XGServerEvent.m (-receivedEvent:type:extra:forMode:):
|
||||
|
|
|
@ -83,6 +83,8 @@ void __objc_xgcontextevent_linking (void)
|
|||
{
|
||||
}
|
||||
|
||||
static SEL procSel = 0;
|
||||
static void (*procEvent)(id, SEL, XEvent*) = 0;
|
||||
|
||||
@interface XGServer (Private)
|
||||
- (void) receivedEvent: (void*)data
|
||||
|
@ -94,6 +96,7 @@ void __objc_xgcontextevent_linking (void)
|
|||
type: (RunLoopEventType)type
|
||||
forMode: (NSString*)mode;
|
||||
- (int) XGErrorHandler: (Display*)display : (XErrorEvent*)err;
|
||||
- (void) processEvent: (XEvent *) event;
|
||||
@end
|
||||
|
||||
|
||||
|
@ -209,6 +212,12 @@ static inline int check_modifier (XEvent *xEvent, KeyCode key_code)
|
|||
watcher: (id<RunLoopEvents>)self
|
||||
forMode: mode];
|
||||
#endif
|
||||
if (procSel == 0)
|
||||
{
|
||||
procSel = @selector(processEvent:);
|
||||
procEvent = (void (*)(id, SEL, XEvent*))
|
||||
[self methodForSelector: procSel];
|
||||
}
|
||||
}
|
||||
|
||||
#if LIB_FOUNDATION_LIBRARY
|
||||
|
@ -234,20 +243,7 @@ static inline int check_modifier (XEvent *xEvent, KeyCode key_code)
|
|||
extra: (void*)extra
|
||||
forMode: (NSString*)mode
|
||||
{
|
||||
static int clickCount = 1;
|
||||
static unsigned int eventFlags;
|
||||
NSEvent *e = nil;
|
||||
XEvent xEvent;
|
||||
static NSPoint eventLocation;
|
||||
NSWindow *nswin;
|
||||
Window xWin;
|
||||
NSEventType eventType;
|
||||
NSGraphicsContext *gcontext;
|
||||
float deltaX;
|
||||
float deltaY;
|
||||
|
||||
/* FIXME: How do you guarentee a context is associated with an event? */
|
||||
gcontext = GSCurrentContext();
|
||||
|
||||
// loop and grab all of the events from the X queue
|
||||
while (XPending(dpy) > 0)
|
||||
|
@ -262,6 +258,27 @@ static inline int check_modifier (XEvent *xEvent, KeyCode key_code)
|
|||
}
|
||||
#endif
|
||||
|
||||
(*procEvent)(self, procSel, &xEvent);
|
||||
}
|
||||
}
|
||||
|
||||
- (void) processEvent: (XEvent *) event
|
||||
{
|
||||
static int clickCount = 1;
|
||||
static unsigned int eventFlags;
|
||||
NSEvent *e = nil;
|
||||
XEvent xEvent;
|
||||
static NSPoint eventLocation;
|
||||
NSWindow *nswin;
|
||||
Window xWin;
|
||||
NSEventType eventType;
|
||||
NSGraphicsContext *gcontext;
|
||||
float deltaX;
|
||||
float deltaY;
|
||||
|
||||
gcontext = GSCurrentContext();
|
||||
xEvent = *event;
|
||||
|
||||
switch (xEvent.type)
|
||||
{
|
||||
// mouse button events
|
||||
|
@ -1273,7 +1290,6 @@ static inline int check_modifier (XEvent *xEvent, KeyCode key_code)
|
|||
[event_queue addObject: e];
|
||||
e = nil;
|
||||
}
|
||||
}
|
||||
|
||||
// Return the key_code corresponding to the user defaults string
|
||||
// Return 1 (which is an invalid keycode) if the user default
|
||||
|
|
Loading…
Reference in a new issue