comparison src/device-x.c @ 253:157b30c96d03 r20-5b25

Import from CVS: tag r20-5b25
author cvs
date Mon, 13 Aug 2007 10:20:27 +0200
parents 0e522484dd2a
children 11cf20601dec
comparison
equal deleted inserted replaced
252:afb15df44434 253:157b30c96d03
105 /************************************************************************/ 105 /************************************************************************/
106 /* helper functions */ 106 /* helper functions */
107 /************************************************************************/ 107 /************************************************************************/
108 108
109 /* JH 97/11/25 removed the static declaration because I need it during setup in event-Xt... */ 109 /* JH 97/11/25 removed the static declaration because I need it during setup in event-Xt... */
110 struct device * get_device_from_display_1 (Display *dpy);
110 struct device * 111 struct device *
111 get_device_from_display_1 (Display *dpy) 112 get_device_from_display_1 (Display *dpy)
112 { 113 {
113 Lisp_Object devcons, concons; 114 Lisp_Object devcons, concons;
114 115
591 592
592 CONST char * 593 CONST char *
593 x_event_name (int event_type) 594 x_event_name (int event_type)
594 { 595 {
595 if (event_type < 0) return 0; 596 if (event_type < 0) return 0;
596 if (event_type >= (sizeof (events) / sizeof (char *))) return 0; 597 if (event_type >= countof (events)) return 0;
597 return events [event_type]; 598 return events [event_type];
598 } 599 }
599 600
600 /* Handling errors. 601 /* Handling errors.
601 602
1385 Return true if KEYSYM names a key on the keyboard of DEVICE. 1386 Return true if KEYSYM names a key on the keyboard of DEVICE.
1386 More precisely, return true if pressing a physical key 1387 More precisely, return true if pressing a physical key
1387 on the keyboard of DEVICE without any modifier keys generates KEYSYM. 1388 on the keyboard of DEVICE without any modifier keys generates KEYSYM.
1388 Valid keysyms are listed in the files /usr/include/X11/keysymdef.h and in 1389 Valid keysyms are listed in the files /usr/include/X11/keysymdef.h and in
1389 /usr/lib/X11/XKeysymDB, or whatever the equivalents are on your system. 1390 /usr/lib/X11/XKeysymDB, or whatever the equivalents are on your system.
1391 The keysym name can be provided in two forms:
1392 - if keysym is a string, it must be the name as known to X windows.
1393 - if keysym is a symbol, it must be the name as known to XEmacs.
1394 The two names differ in capitalization and underscoring.
1390 */ 1395 */
1391 (keysym, device)) 1396 (keysym, device))
1392 { 1397 {
1393 struct device *d = decode_device (device); 1398 struct device *d = decode_device (device);
1394 if (!DEVICE_X_P (d)) 1399 if (!DEVICE_X_P (d))
1395 signal_simple_error ("Not an X device", device); 1400 signal_simple_error ("Not an X device", device);
1396 CHECK_STRING (keysym);
1397 1401
1398 return (EQ (Qsans_modifiers, 1402 return (EQ (Qsans_modifiers,
1399 Fgethash (keysym, DEVICE_X_KEYSYM_MAP_HASHTABLE (d), Qnil)) ? 1403 Fgethash (keysym, DEVICE_X_KEYSYM_MAP_HASHTABLE (d), Qnil)) ?
1400 Qt : Qnil); 1404 Qt : Qnil);
1401 } 1405 }
1405 Return true if KEYSYM names a key on the keyboard of DEVICE. 1409 Return true if KEYSYM names a key on the keyboard of DEVICE.
1406 More precisely, return true if some keystroke (possibly including modifiers) 1410 More precisely, return true if some keystroke (possibly including modifiers)
1407 on the keyboard of DEVICE keys generates KEYSYM. 1411 on the keyboard of DEVICE keys generates KEYSYM.
1408 Valid keysyms are listed in the files /usr/include/X11/keysymdef.h and in 1412 Valid keysyms are listed in the files /usr/include/X11/keysymdef.h and in
1409 /usr/lib/X11/XKeysymDB, or whatever the equivalents are on your system. 1413 /usr/lib/X11/XKeysymDB, or whatever the equivalents are on your system.
1414 The keysym name can be provided in two forms:
1415 - if keysym is a string, it must be the name as known to X windows.
1416 - if keysym is a symbol, it must be the name as known to XEmacs.
1417 The two names differ in capitalization and underscoring.
1410 */ 1418 */
1411 (keysym, device)) 1419 (keysym, device))
1412 { 1420 {
1413 struct device *d = decode_device (device); 1421 struct device *d = decode_device (device);
1414
1415 if (!DEVICE_X_P (d)) 1422 if (!DEVICE_X_P (d))
1416 signal_simple_error ("Not an X device", device); 1423 signal_simple_error ("Not an X device", device);
1417 CHECK_STRING (keysym);
1418 1424
1419 return (NILP (Fgethash (keysym, DEVICE_X_KEYSYM_MAP_HASHTABLE (d), Qnil)) ? 1425 return (NILP (Fgethash (keysym, DEVICE_X_KEYSYM_MAP_HASHTABLE (d), Qnil)) ?
1420 Qnil : Qt); 1426 Qnil : Qt);
1421 } 1427 }
1422 1428