formatting cleanup for X11Application.m (no code changes)

This commit is contained in:
Ben Byer 2008-03-31 23:31:25 -07:00
parent bee2b377ef
commit eb083d3f68

View File

@ -220,7 +220,6 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
if ([self isActive]) {
[self deactivate];
if (!_x_active && quartzProcs->IsX11Window([e window],
[e windowNumber]))
[self activateX:YES];
@ -859,19 +858,13 @@ convert_flags (unsigned int nsflags) {
return xflags;
}
// This code should probably be merged with that in XDarwin's XServer.m - BB
static void send_nsevent (NSEventType type, NSEvent *e) {
// static unsigned int button_state = 0;
NSRect screen;
NSPoint location;
NSWindow *window;
int pointer_x, pointer_y, ev_button, ev_type;
float pressure, tilt_x, tilt_y;
// int num_events=0, i=0, state;
// xEvent xe;
/* convert location to global top-left coordinates */
location = [e locationInWindow];
window = [e window];
@ -888,7 +881,6 @@ static void send_nsevent (NSEventType type, NSEvent *e) {
}
pointer_y -= aquaMenuBarHeight;
// state = convert_flags ([e modifierFlags]);
pressure = 0; // for tablets
tilt_x = 0;
@ -911,28 +903,17 @@ static void send_nsevent (NSEventType type, NSEvent *e) {
case NSMouseMoved: ev_button=0; ev_type=MotionNotify; goto handle_mouse;
handle_mouse:
/* I'm not sure the below code is necessary or useful (-bb)
if(ev_type==ButtonPress) {
if (!quartzProcs->IsX11Window([e window], [e windowNumber])) {
fprintf(stderr, "Dropping event because it's not a window\n");
break;
}
button_state |= (1 << ev_button);
DarwinSendPointerEvents(ev_type, ev_button, pointer_x, pointer_y);
} else if (ev_type==ButtonRelease && (button_state & (1 << ev_button)) == 0) break;
*/
// if ([e subtype] == NSTabletPointEventSubtype) pressure = [e pressure];
DarwinSendPointerEvents(ev_type, ev_button, pointer_x, pointer_y,
pressure, tilt_x, tilt_y);
break;
case NSScrollWheel:
DarwinSendScrollEvents([e deltaY], pointer_x, pointer_y,
pressure, tilt_x, tilt_y);
break;
case NSKeyDown: // do we need to translate these keyCodes?
case NSKeyUp:
case NSKeyDown: case NSKeyUp:
DarwinSendKeyboardEvents((type == NSKeyDown)?KeyPress:KeyRelease, [e keyCode]);
break;