src/video/x11/SDL_x11events.c
changeset 1168 045f186426e1
parent 1159 787b8d2c23e4
child 1178 9867f3d86e44
     1.1 --- a/src/video/x11/SDL_x11events.c	Sat Nov 05 17:41:11 2005 +0000
     1.2 +++ b/src/video/x11/SDL_x11events.c	Sat Nov 05 19:53:37 2005 +0000
     1.3 @@ -74,13 +74,13 @@
     1.4  	int repeated;
     1.5  
     1.6  	repeated = 0;
     1.7 -	if ( XPending(display) ) {
     1.8 -		XPeekEvent(display, &peekevent);
     1.9 +	if ( pXPending(display) ) {
    1.10 +		pXPeekEvent(display, &peekevent);
    1.11  		if ( (peekevent.type == KeyPress) &&
    1.12  		     (peekevent.xkey.keycode == event->xkey.keycode) &&
    1.13  		     ((peekevent.xkey.time-event->xkey.time) < 2) ) {
    1.14  			repeated = 1;
    1.15 -			XNextEvent(display, &peekevent);
    1.16 +			pXNextEvent(display, &peekevent);
    1.17  		}
    1.18  	}
    1.19  	return(repeated);
    1.20 @@ -115,7 +115,7 @@
    1.21  	     (xevent->xmotion.y < MOUSE_FUDGE_FACTOR) ||
    1.22  	     (xevent->xmotion.y > (h-MOUSE_FUDGE_FACTOR)) ) {
    1.23  		/* Get the events that have accumulated */
    1.24 -		while ( XCheckTypedEvent(SDL_Display, MotionNotify, xevent) ) {
    1.25 +		while ( pXCheckTypedEvent(SDL_Display, MotionNotify, xevent) ) {
    1.26  			deltax = xevent->xmotion.x - mouse_last.x;
    1.27  			deltay = xevent->xmotion.y - mouse_last.y;
    1.28  #ifdef DEBUG_MOTION
    1.29 @@ -127,10 +127,10 @@
    1.30  		}
    1.31  		mouse_last.x = w/2;
    1.32  		mouse_last.y = h/2;
    1.33 -		XWarpPointer(SDL_Display, None, SDL_Window, 0, 0, 0, 0,
    1.34 +		pXWarpPointer(SDL_Display, None, SDL_Window, 0, 0, 0, 0,
    1.35  					mouse_last.x, mouse_last.y);
    1.36  		for ( i=0; i<10; ++i ) {
    1.37 -        		XMaskEvent(SDL_Display, PointerMotionMask, xevent);
    1.38 +        		pXMaskEvent(SDL_Display, PointerMotionMask, xevent);
    1.39  			if ( (xevent->xmotion.x >
    1.40  			          (mouse_last.x-MOUSE_FUDGE_FACTOR)) &&
    1.41  			     (xevent->xmotion.x <
    1.42 @@ -160,7 +160,7 @@
    1.43  	XEvent xevent;
    1.44  
    1.45  	memset(&xevent, '\0', sizeof (XEvent));  /* valgrind fix. --ryan. */
    1.46 -	XNextEvent(SDL_Display, &xevent);
    1.47 +	pXNextEvent(SDL_Display, &xevent);
    1.48  
    1.49  	posted = 0;
    1.50  	switch (xevent.type) {
    1.51 @@ -437,8 +437,8 @@
    1.52  int X11_Pending(Display *display)
    1.53  {
    1.54  	/* Flush the display connection and look to see if events are queued */
    1.55 -	XFlush(display);
    1.56 -	if ( XEventsQueued(display, QueuedAlready) ) {
    1.57 +	pXFlush(display);
    1.58 +	if ( pXEventsQueued(display, QueuedAlready) ) {
    1.59  		return(1);
    1.60  	}
    1.61  
    1.62 @@ -452,7 +452,7 @@
    1.63  		FD_ZERO(&fdset);
    1.64  		FD_SET(x11_fd, &fdset);
    1.65  		if ( select(x11_fd+1, &fdset, NULL, NULL, &zero_time) == 1 ) {
    1.66 -			return(XPending(display));
    1.67 +			return(pXPending(display));
    1.68  		}
    1.69  	}
    1.70  
    1.71 @@ -619,7 +619,7 @@
    1.72  
    1.73  	/* Get the raw keyboard scancode */
    1.74  	keysym->scancode = kc;
    1.75 -	xsym = XKeycodeToKeysym(display, kc, 0);
    1.76 +	xsym = pXKeycodeToKeysym(display, kc, 0);
    1.77  #ifdef DEBUG_KEYS
    1.78  	fprintf(stderr, "Translating key 0x%.4x (%d)\n", xsym, kc);
    1.79  #endif
    1.80 @@ -711,7 +711,7 @@
    1.81  		}
    1.82  #endif
    1.83  		/* Look up the translated value for the key event */
    1.84 -		if ( XLookupString(xkey, (char *)keybuf, sizeof(keybuf),
    1.85 +		if ( pXLookupString(xkey, (char *)keybuf, sizeof(keybuf),
    1.86  							NULL, &state) ) {
    1.87  			/*
    1.88  			 * FIXME,: XLookupString() may yield more than one
    1.89 @@ -739,12 +739,12 @@
    1.90  	if(got_masks)
    1.91  		return;
    1.92  
    1.93 -	xmods = XGetModifierMapping(display);
    1.94 +	xmods = pXGetModifierMapping(display);
    1.95  	n = xmods->max_keypermod;
    1.96  	for(i = 3; i < 8; i++) {
    1.97  		for(j = 0; j < n; j++) {
    1.98  			KeyCode kc = xmods->modifiermap[i * n + j];
    1.99 -			KeySym ks = XKeycodeToKeysym(display, kc, 0);
   1.100 +			KeySym ks = pXKeycodeToKeysym(display, kc, 0);
   1.101  			unsigned mask = 1 << i;
   1.102  			switch(ks) {
   1.103  			case XK_Num_Lock:
   1.104 @@ -762,7 +762,7 @@
   1.105  			}
   1.106  		}
   1.107  	}
   1.108 -	XFreeModifiermap(xmods);
   1.109 +	pXFreeModifiermap(xmods);
   1.110  	got_masks = 1;
   1.111  }
   1.112  
   1.113 @@ -804,7 +804,7 @@
   1.114  		}
   1.115  	}
   1.116  
   1.117 -	xkey.keycode = XKeysymToKeycode(xkey.display, xsym);
   1.118 +	xkey.keycode = pXKeysymToKeycode(xkey.display, xsym);
   1.119  
   1.120  	get_modifier_masks(SDL_Display);
   1.121  	if(modifiers & KMOD_SHIFT)
   1.122 @@ -827,7 +827,7 @@
   1.123  		xkey.state |= num_mask;
   1.124  
   1.125  	unicode = 0;
   1.126 -	if ( XLookupString(&xkey, keybuf, sizeof(keybuf), NULL, NULL) )
   1.127 +	if ( pXLookupString(&xkey, keybuf, sizeof(keybuf), NULL, NULL) )
   1.128  		unicode = (unsigned char)keybuf[0];
   1.129  	return(unicode);
   1.130  }
   1.131 @@ -851,14 +851,14 @@
   1.132  
   1.133  	/* The first time the window is mapped, we initialize key state */
   1.134  	if ( ! key_vec ) {
   1.135 -		XQueryKeymap(display, keys_return);
   1.136 +		pXQueryKeymap(display, keys_return);
   1.137  		key_vec = keys_return;
   1.138  	}
   1.139  
   1.140  	/* Get the keyboard modifier state */
   1.141  	modstate = 0;
   1.142  	get_modifier_masks(display);
   1.143 -	if ( XQueryPointer(display, DefaultRootWindow(display),
   1.144 +	if ( pXQueryPointer(display, DefaultRootWindow(display),
   1.145  		&junk_window, &junk_window, &x, &y, &x, &y, &mask) ) {
   1.146  		if ( mask & LockMask ) {
   1.147  			modstate |= KMOD_CAPS;