diff options
author | Ben Byer <bbyer@bbyer.(none)> | 2007-03-05 02:30:56 -0800 |
---|---|---|
committer | Ben Byer <bbyer@bbyer.(none)> | 2007-03-05 02:30:56 -0800 |
commit | 537dc5ecde46d0525c503d1d2b39b6eb89a1298e (patch) | |
tree | cce12c49044ac01d14803f387714613f271971d9 | |
parent | 8ba5e8d82014b774a52f3e050ddbbb8bde4e0933 (diff) |
started moving new input code into darwinEvents.c so that it may be shared by the three servers
-rw-r--r-- | hw/darwin/apple/X11Application.m | 19 | ||||
-rw-r--r-- | hw/darwin/darwinEvents.c | 2 |
2 files changed, 11 insertions, 10 deletions
diff --git a/hw/darwin/apple/X11Application.m b/hw/darwin/apple/X11Application.m index 0be1e40b5..c50f70482 100644 --- a/hw/darwin/apple/X11Application.m +++ b/hw/darwin/apple/X11Application.m @@ -56,7 +56,7 @@ extern int darwinFakeButtons, input_check_flag; // extern Bool enable_stereo; Bool enable_stereo; //<-- this needs to go back to being an extern once glxCGL is fixed -static xEvent *quartzEvents; +extern xEvent *darwinEvents; X11Application *X11App; @@ -805,7 +805,6 @@ void X11ApplicationMain (int argc, const char *argv[], pool = [[NSAutoreleasePool alloc] init]; X11App = (X11Application *) [X11Application sharedApplication]; - quartzEvents = (xEvent *)malloc(sizeof(xEvent) * GetMaximumEventsNum()); init_ports (); @@ -914,33 +913,33 @@ static void send_nsevent (NSEventType type, NSEvent *e) { button_state |= (1 << ev_button); } else if (ev_type==ButtonRelease && (button_state & (1 << ev_button)) == 0) break; - num_events = GetPointerEvents(quartzEvents, darwinPointer, ev_type, ev_button, + num_events = GetPointerEvents(darwinEvents, darwinPointer, ev_type, ev_button, POINTER_ABSOLUTE, 0, 2, valuators); for(i=0; i<num_events; i++) - mieqEnqueue (darwinPointer,&quartzEvents[i]); + mieqEnqueue (darwinPointer,&darwinEvents[i]); break; case NSScrollWheel: count = [e deltaY]; ev_button = count > 0.0f ? 4 : 5; for (count = fabs(count); count > 0.0; count = count - 1.0f) { - num_events = GetPointerEvents(quartzEvents, darwinPointer, ButtonPress, ev_button, + num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonPress, ev_button, POINTER_ABSOLUTE, 0, 2, valuators); for(i=0; i<num_events; i++) - mieqEnqueue(darwinPointer,&quartzEvents[i]); - num_events = GetPointerEvents(quartzEvents, darwinPointer, ButtonRelease, ev_button, + mieqEnqueue(darwinPointer,&darwinEvents[i]); + num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonRelease, ev_button, POINTER_ABSOLUTE, 0, 2, valuators); for(i=0; i<num_events; i++) - mieqEnqueue(darwinPointer,&quartzEvents[i]); + mieqEnqueue(darwinPointer,&darwinEvents[i]); } break; case NSKeyDown: // do we need to translate these keyCodes? case NSKeyUp: - num_events = GetKeyboardEvents(quartzEvents, darwinKeyboard, + num_events = GetKeyboardEvents(darwinEvents, darwinKeyboard, (type == NSKeyDown)?KeyPress:KeyRelease, [e keyCode]); for(i=0; i<num_events; i++) - mieqEnqueue(darwinKeyboard,&quartzEvents[i]); + mieqEnqueue(darwinKeyboard,&darwinEvents[i]); break; case NSFlagsChanged: diff --git a/hw/darwin/darwinEvents.c b/hw/darwin/darwinEvents.c index 2a27ac465..1eb2336fd 100644 --- a/hw/darwin/darwinEvents.c +++ b/hw/darwin/darwinEvents.c @@ -74,6 +74,7 @@ typedef struct _EventQueue { } EventQueueRec, *EventQueuePtr; static EventQueueRec darwinEventQueue; +xEvent *darwinEvents; /* * DarwinPressModifierMask @@ -179,6 +180,7 @@ static void DarwinSimulateMouseClick( Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr) { + darwinEvents = (xEvent *)malloc(sizeof(xEvent) * GetMaximumEventsNum()); mieqInit(); darwinEventQueue.head = darwinEventQueue.tail = 0; darwinEventQueue.lastEventTime = GetTimeInMillis (); |