src/video/x11/SDL_x11events.c
changeset 1575 3ba88cb7eb1b
parent 1402 d910939febfa
child 1657 5b0805ceb50f
     1.1 --- a/src/video/x11/SDL_x11events.c	Wed Mar 22 04:51:44 2006 +0000
     1.2 +++ b/src/video/x11/SDL_x11events.c	Wed Mar 22 05:00:59 2006 +0000
     1.3 @@ -187,13 +187,13 @@
     1.4  	int repeated;
     1.5  
     1.6  	repeated = 0;
     1.7 -	if ( pXPending(display) ) {
     1.8 -		pXPeekEvent(display, &peekevent);
     1.9 +	if ( XPending(display) ) {
    1.10 +		XPeekEvent(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 -			pXNextEvent(display, &peekevent);
    1.16 +			XNextEvent(display, &peekevent);
    1.17  		}
    1.18  	}
    1.19  	return(repeated);
    1.20 @@ -228,7 +228,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 ( pXCheckTypedEvent(SDL_Display, MotionNotify, xevent) ) {
    1.25 +		while ( XCheckTypedEvent(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 @@ -240,10 +240,10 @@
    1.30  		}
    1.31  		mouse_last.x = w/2;
    1.32  		mouse_last.y = h/2;
    1.33 -		pXWarpPointer(SDL_Display, None, SDL_Window, 0, 0, 0, 0,
    1.34 +		XWarpPointer(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 -        		pXMaskEvent(SDL_Display, PointerMotionMask, xevent);
    1.38 +        		XMaskEvent(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 @@ -273,7 +273,7 @@
    1.43  	XEvent xevent;
    1.44  
    1.45  	SDL_memset(&xevent, '\0', sizeof (XEvent));  /* valgrind fix. --ryan. */
    1.46 -	pXNextEvent(SDL_Display, &xevent);
    1.47 +	XNextEvent(SDL_Display, &xevent);
    1.48  
    1.49  	posted = 0;
    1.50  	switch (xevent.type) {
    1.51 @@ -332,7 +332,7 @@
    1.52  
    1.53  #ifdef X_HAVE_UTF8_STRING
    1.54  		if ( SDL_IC != NULL ) {
    1.55 -			pXSetICFocus(SDL_IC);
    1.56 +			XSetICFocus(SDL_IC);
    1.57  		}
    1.58  #endif
    1.59  		/* Queue entry into fullscreen mode */
    1.60 @@ -350,7 +350,7 @@
    1.61  
    1.62  #ifdef X_HAVE_UTF8_STRING
    1.63  		if ( SDL_IC != NULL ) {
    1.64 -			pXUnsetICFocus(SDL_IC);
    1.65 +			XUnsetICFocus(SDL_IC);
    1.66  		}
    1.67  #endif
    1.68  		/* Queue leaving fullscreen mode */
    1.69 @@ -433,7 +433,7 @@
    1.70  			break;
    1.71  		}
    1.72  
    1.73 -		if ( pXFilterEvent(&xevent, None) ) {
    1.74 +		if ( XFilterEvent(&xevent, None) ) {
    1.75  			if ( xevent.xkey.keycode ) {
    1.76  				posted = SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
    1.77  			} else {
    1.78 @@ -450,7 +450,7 @@
    1.79  			static Status state;
    1.80  			/* A UTF-8 character can be at most 6 bytes */
    1.81  			char keybuf[6];
    1.82 -			if ( pXutf8LookupString(SDL_IC, &xevent.xkey,
    1.83 +			if ( Xutf8LookupString(SDL_IC, &xevent.xkey,
    1.84  			                        keybuf, sizeof(keybuf),
    1.85  			                        NULL, &state) ) {
    1.86  				keysym.unicode = Utf8ToUcs4((Uint8*)keybuf);
    1.87 @@ -462,7 +462,7 @@
    1.88  			static XComposeStatus state;
    1.89  			char keybuf[32];
    1.90  
    1.91 -			if ( pXLookupString(&xevent.xkey,
    1.92 +			if ( XLookupString(&xevent.xkey,
    1.93  			                    keybuf, sizeof(keybuf),
    1.94  			                    NULL, &state) ) {
    1.95  				/*
    1.96 @@ -622,8 +622,8 @@
    1.97  int X11_Pending(Display *display)
    1.98  {
    1.99  	/* Flush the display connection and look to see if events are queued */
   1.100 -	pXFlush(display);
   1.101 -	if ( pXEventsQueued(display, QueuedAlready) ) {
   1.102 +	XFlush(display);
   1.103 +	if ( XEventsQueued(display, QueuedAlready) ) {
   1.104  		return(1);
   1.105  	}
   1.106  
   1.107 @@ -637,7 +637,7 @@
   1.108  		FD_ZERO(&fdset);
   1.109  		FD_SET(x11_fd, &fdset);
   1.110  		if ( select(x11_fd+1, &fdset, NULL, NULL, &zero_time) == 1 ) {
   1.111 -			return(pXPending(display));
   1.112 +			return(XPending(display));
   1.113  		}
   1.114  	}
   1.115  
   1.116 @@ -827,7 +827,7 @@
   1.117  	KeySym xsym;
   1.118  	SDLKey key;
   1.119  
   1.120 -	xsym = pXKeycodeToKeysym(display, kc, 0);
   1.121 +	xsym = XKeycodeToKeysym(display, kc, 0);
   1.122  #ifdef DEBUG_KEYS
   1.123  	fprintf(stderr, "Translating key code %d -> 0x%.4x\n", kc, xsym);
   1.124  #endif
   1.125 @@ -914,12 +914,12 @@
   1.126  	if(got_masks)
   1.127  		return;
   1.128  
   1.129 -	xmods = pXGetModifierMapping(display);
   1.130 +	xmods = XGetModifierMapping(display);
   1.131  	n = xmods->max_keypermod;
   1.132  	for(i = 3; i < 8; i++) {
   1.133  		for(j = 0; j < n; j++) {
   1.134  			KeyCode kc = xmods->modifiermap[i * n + j];
   1.135 -			KeySym ks = pXKeycodeToKeysym(display, kc, 0);
   1.136 +			KeySym ks = XKeycodeToKeysym(display, kc, 0);
   1.137  			unsigned mask = 1 << i;
   1.138  			switch(ks) {
   1.139  			case XK_Num_Lock:
   1.140 @@ -937,7 +937,7 @@
   1.141  			}
   1.142  		}
   1.143  	}
   1.144 -	pXFreeModifiermap(xmods);
   1.145 +	XFreeModifiermap(xmods);
   1.146  	got_masks = 1;
   1.147  }
   1.148  
   1.149 @@ -979,7 +979,7 @@
   1.150  		}
   1.151  	}
   1.152  
   1.153 -	xkey.keycode = pXKeysymToKeycode(xkey.display, xsym);
   1.154 +	xkey.keycode = XKeysymToKeycode(xkey.display, xsym);
   1.155  
   1.156  	get_modifier_masks(SDL_Display);
   1.157  	if(modifiers & KMOD_SHIFT)
   1.158 @@ -1002,7 +1002,7 @@
   1.159  		xkey.state |= num_mask;
   1.160  
   1.161  	unicode = 0;
   1.162 -	if ( pXLookupString(&xkey, keybuf, sizeof(keybuf), NULL, NULL) )
   1.163 +	if ( XLookupString(&xkey, keybuf, sizeof(keybuf), NULL, NULL) )
   1.164  		unicode = (unsigned char)keybuf[0];
   1.165  	return(unicode);
   1.166  }
   1.167 @@ -1025,14 +1025,14 @@
   1.168  
   1.169  	/* The first time the window is mapped, we initialize key state */
   1.170  	if ( ! key_vec ) {
   1.171 -		pXQueryKeymap(display, keys_return);
   1.172 +		XQueryKeymap(display, keys_return);
   1.173  		key_vec = keys_return;
   1.174  	}
   1.175  
   1.176  	/* Get the keyboard modifier state */
   1.177  	modstate = 0;
   1.178  	get_modifier_masks(display);
   1.179 -	if ( pXQueryPointer(display, DefaultRootWindow(display),
   1.180 +	if ( XQueryPointer(display, DefaultRootWindow(display),
   1.181  		&junk_window, &junk_window, &x, &y, &x, &y, &mask) ) {
   1.182  		if ( mask & LockMask ) {
   1.183  			modstate |= KMOD_CAPS;