Mercurial > hg > xemacs-beta
comparison src/device.c @ 20:859a2309aef8 r19-15b93
Import from CVS: tag r19-15b93
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:50:05 +0200 |
parents | 9ee227acff29 |
children | 131b0175ea99 |
comparison
equal
deleted
inserted
replaced
19:ac1f612d5250 | 20:859a2309aef8 |
---|---|
130 valid_device_class_p (Lisp_Object class) | 130 valid_device_class_p (Lisp_Object class) |
131 { | 131 { |
132 return !NILP (memq_no_quit (class, Vdevice_class_list)); | 132 return !NILP (memq_no_quit (class, Vdevice_class_list)); |
133 } | 133 } |
134 | 134 |
135 DEFUN ("valid-device-class-p", Fvalid_device_class_p, Svalid_device_class_p, | 135 DEFUN ("valid-device-class-p", Fvalid_device_class_p, 1, 1, 0, /* |
136 1, 1, 0 /* | |
137 Given a DEVICE-CLASS, return t if it is valid. | 136 Given a DEVICE-CLASS, return t if it is valid. |
138 Valid classes are 'color, 'grayscale, and 'mono. | 137 Valid classes are 'color, 'grayscale, and 'mono. |
139 */ ) | 138 */ |
140 (device_class) | 139 (device_class)) |
141 Lisp_Object device_class; | |
142 { | 140 { |
143 if (valid_device_class_p (device_class)) | 141 if (valid_device_class_p (device_class)) |
144 return Qt; | 142 return Qt; |
145 else | 143 else |
146 return Qnil; | 144 return Qnil; |
147 } | 145 } |
148 | 146 |
149 DEFUN ("device-class-list", Fdevice_class_list, Sdevice_class_list, | 147 DEFUN ("device-class-list", Fdevice_class_list, 0, 0, 0, /* |
150 0, 0, 0 /* | |
151 Return a list of valid device classes. | 148 Return a list of valid device classes. |
152 */ ) | 149 */ |
153 () | 150 ()) |
154 { | 151 { |
155 return Fcopy_sequence (Vdevice_class_list); | 152 return Fcopy_sequence (Vdevice_class_list); |
156 } | 153 } |
157 | 154 |
158 static struct device * | 155 static struct device * |
218 Lisp_Object device = Qnil; | 215 Lisp_Object device = Qnil; |
219 XSETDEVICE (device, d); | 216 XSETDEVICE (device, d); |
220 return device; | 217 return device; |
221 } | 218 } |
222 | 219 |
223 DEFUN ("dfw-device", Fdfw_device, Sdfw_device, 1, 1, 0 /* | 220 DEFUN ("dfw-device", Fdfw_device, 1, 1, 0, /* |
224 Given a device, frame, or window, return the associated device. | 221 Given a device, frame, or window, return the associated device. |
225 Return nil otherwise. | 222 Return nil otherwise. |
226 */ ) | 223 */ |
227 (obj) | 224 (obj)) |
228 Lisp_Object obj; | |
229 { | 225 { |
230 return DFW_DEVICE (obj); | 226 return DFW_DEVICE (obj); |
231 } | 227 } |
232 | 228 |
233 | 229 |
234 DEFUN ("selected-device", Fselected_device, Sselected_device, 0, 1, 0 /* | 230 DEFUN ("selected-device", Fselected_device, 0, 1, 0, /* |
235 Return the device which is currently active. | 231 Return the device which is currently active. |
236 If optional CONSOLE is non-nil, return the device that would be currently | 232 If optional CONSOLE is non-nil, return the device that would be currently |
237 active if CONSOLE were the selected console. | 233 active if CONSOLE were the selected console. |
238 */ ) | 234 */ |
239 (console) | 235 (console)) |
240 Lisp_Object console; | |
241 { | 236 { |
242 if (NILP (console) && NILP (Vselected_console)) | 237 if (NILP (console) && NILP (Vselected_console)) |
243 return Qnil; /* happens early in temacs */ | 238 return Qnil; /* happens early in temacs */ |
244 return CONSOLE_SELECTED_DEVICE (decode_console (console)); | 239 return CONSOLE_SELECTED_DEVICE (decode_console (console)); |
245 } | 240 } |
257 /* now select the device's console */ | 252 /* now select the device's console */ |
258 CONSOLE_SELECTED_DEVICE (XCONSOLE (DEVICE_CONSOLE (dev))) = device; | 253 CONSOLE_SELECTED_DEVICE (XCONSOLE (DEVICE_CONSOLE (dev))) = device; |
259 select_console_1 (DEVICE_CONSOLE (dev)); | 254 select_console_1 (DEVICE_CONSOLE (dev)); |
260 } | 255 } |
261 | 256 |
262 DEFUN ("select-device", Fselect_device, Sselect_device, 1, 1, 0 /* | 257 DEFUN ("select-device", Fselect_device, 1, 1, 0, /* |
263 Select the device DEVICE. | 258 Select the device DEVICE. |
264 Subsequent editing commands apply to its console, selected frame, | 259 Subsequent editing commands apply to its console, selected frame, |
265 and selected window. | 260 and selected window. |
266 The selection of DEVICE lasts until the next time the user does | 261 The selection of DEVICE lasts until the next time the user does |
267 something to select a different device, or until the next time this | 262 something to select a different device, or until the next time this |
268 function is called. | 263 function is called. |
269 */ ) | 264 */ |
270 (device) | 265 (device)) |
271 Lisp_Object device; | |
272 { | 266 { |
273 CHECK_LIVE_DEVICE (device); | 267 CHECK_LIVE_DEVICE (device); |
274 | 268 |
275 /* select the device's selected frame's selected window. This will call | 269 /* select the device's selected frame's selected window. This will call |
276 selected_frame_1()->selected_device_1()->selected_console_1(). */ | 270 selected_frame_1()->selected_device_1()->selected_console_1(). */ |
288 if (!NILP (frame) && !FRAME_MINIBUF_ONLY_P (XFRAME (frame))) | 282 if (!NILP (frame) && !FRAME_MINIBUF_ONLY_P (XFRAME (frame))) |
289 set_console_last_nonminibuf_frame (XCONSOLE (DEVICE_CONSOLE (d)), frame); | 283 set_console_last_nonminibuf_frame (XCONSOLE (DEVICE_CONSOLE (d)), frame); |
290 d->_selected_frame = frame; | 284 d->_selected_frame = frame; |
291 } | 285 } |
292 | 286 |
293 DEFUN ("set-device-selected-frame", Fset_device_selected_frame, | 287 DEFUN ("set-device-selected-frame", Fset_device_selected_frame, 2, 2, 0, /* |
294 Sset_device_selected_frame, 2, 2, 0 /* | |
295 Set the selected frame of device object DEVICE to FRAME. | 288 Set the selected frame of device object DEVICE to FRAME. |
296 If DEVICE is nil, the selected device is used. | 289 If DEVICE is nil, the selected device is used. |
297 If DEVICE is the selected device, this makes FRAME the selected frame. | 290 If DEVICE is the selected device, this makes FRAME the selected frame. |
298 */ ) | 291 */ |
299 (device, frame) | 292 (device, frame)) |
300 Lisp_Object device, frame; | |
301 { | 293 { |
302 XSETDEVICE (device, decode_device (device)); | 294 XSETDEVICE (device, decode_device (device)); |
303 CHECK_LIVE_FRAME (frame); | 295 CHECK_LIVE_FRAME (frame); |
304 | 296 |
305 if (! EQ (device, FRAME_DEVICE (XFRAME (frame)))) | 297 if (! EQ (device, FRAME_DEVICE (XFRAME (frame)))) |
310 | 302 |
311 set_device_selected_frame (XDEVICE (device), frame); | 303 set_device_selected_frame (XDEVICE (device), frame); |
312 return frame; | 304 return frame; |
313 } | 305 } |
314 | 306 |
315 DEFUN ("devicep", Fdevicep, Sdevicep, 1, 1, 0 /* | 307 DEFUN ("devicep", Fdevicep, 1, 1, 0, /* |
316 Return non-nil if OBJECT is a device. | 308 Return non-nil if OBJECT is a device. |
317 */ ) | 309 */ |
318 (object) | 310 (object)) |
319 Lisp_Object object; | |
320 { | 311 { |
321 if (!DEVICEP (object)) | 312 if (!DEVICEP (object)) |
322 return Qnil; | 313 return Qnil; |
323 return Qt; | 314 return Qt; |
324 } | 315 } |
325 | 316 |
326 DEFUN ("device-live-p", Fdevice_live_p, Sdevice_live_p, 1, 1, 0 /* | 317 DEFUN ("device-live-p", Fdevice_live_p, 1, 1, 0, /* |
327 Return non-nil if OBJECT is a device that has not been deleted. | 318 Return non-nil if OBJECT is a device that has not been deleted. |
328 */ ) | 319 */ |
329 (object) | 320 (object)) |
330 Lisp_Object object; | |
331 { | 321 { |
332 if (!DEVICEP (object) || !DEVICE_LIVE_P (XDEVICE (object))) | 322 if (!DEVICEP (object) || !DEVICE_LIVE_P (XDEVICE (object))) |
333 return Qnil; | 323 return Qnil; |
334 return Qt; | 324 return Qt; |
335 } | 325 } |
336 | 326 |
337 DEFUN ("device-name", Fdevice_name, Sdevice_name, 0, 1, 0 /* | 327 DEFUN ("device-name", Fdevice_name, 0, 1, 0, /* |
338 Return the name of the specified device. | 328 Return the name of the specified device. |
339 DEVICE defaults to the selected device if omitted. | 329 DEVICE defaults to the selected device if omitted. |
340 */ ) | 330 */ |
341 (device) | 331 (device)) |
342 Lisp_Object device; | |
343 { | 332 { |
344 return DEVICE_NAME (decode_device (device)); | 333 return DEVICE_NAME (decode_device (device)); |
345 } | 334 } |
346 | 335 |
347 DEFUN ("device-connection", Fdevice_connection, Sdevice_connection, 0, 1, 0 /* | 336 DEFUN ("device-connection", Fdevice_connection, 0, 1, 0, /* |
348 Return the connection of the specified device. | 337 Return the connection of the specified device. |
349 DEVICE defaults to the selected device if omitted. | 338 DEVICE defaults to the selected device if omitted. |
350 */ ) | 339 */ |
351 (device) | 340 (device)) |
352 Lisp_Object device; | |
353 { | 341 { |
354 return DEVICE_CONNECTION (decode_device (device)); | 342 return DEVICE_CONNECTION (decode_device (device)); |
355 } | 343 } |
356 | 344 |
357 DEFUN ("device-console", Fdevice_console, Sdevice_console, 0, 1, 0 /* | 345 DEFUN ("device-console", Fdevice_console, 0, 1, 0, /* |
358 Return the console of the specified device. | 346 Return the console of the specified device. |
359 DEVICE defaults to the selected device if omitted. | 347 DEVICE defaults to the selected device if omitted. |
360 */ ) | 348 */ |
361 (device) | 349 (device)) |
362 Lisp_Object device; | |
363 { | 350 { |
364 return DEVICE_CONSOLE (decode_device (device)); | 351 return DEVICE_CONSOLE (decode_device (device)); |
365 } | 352 } |
366 | 353 |
367 #ifdef HAVE_X_WINDOWS | 354 #ifdef HAVE_X_WINDOWS |
431 } | 418 } |
432 | 419 |
433 return Qnil; | 420 return Qnil; |
434 } | 421 } |
435 | 422 |
436 DEFUN ("find-device", Ffind_device, Sfind_device, 1, 2, 0 /* | 423 DEFUN ("find-device", Ffind_device, 1, 2, 0, /* |
437 Look for an existing device attached to connection CONNECTION. | 424 Look for an existing device attached to connection CONNECTION. |
438 Return the device if found; otherwise, return nil. | 425 Return the device if found; otherwise, return nil. |
439 | 426 |
440 If TYPE is specified, only return devices of that type; otherwise, | 427 If TYPE is specified, only return devices of that type; otherwise, |
441 return devices of any type. (It is possible, although unlikely, | 428 return devices of any type. (It is possible, although unlikely, |
442 that two devices of different types could have the same connection | 429 that two devices of different types could have the same connection |
443 name; in such a case, the first device found is returned.) | 430 name; in such a case, the first device found is returned.) |
444 */ ) | 431 */ |
445 (connection, type) | 432 (connection, type)) |
446 Lisp_Object connection, type; | |
447 { | 433 { |
448 Lisp_Object canon = Qnil; | 434 Lisp_Object canon = Qnil; |
449 struct gcpro gcpro1; | 435 struct gcpro gcpro1; |
450 | 436 |
451 GCPRO1 (canon); | 437 GCPRO1 (canon); |
480 | 466 |
481 RETURN_UNGCPRO (Qnil); | 467 RETURN_UNGCPRO (Qnil); |
482 } | 468 } |
483 } | 469 } |
484 | 470 |
485 DEFUN ("get-device", Fget_device, Sget_device, 1, 2, 0 /* | 471 DEFUN ("get-device", Fget_device, 1, 2, 0, /* |
486 Look for an existing device attached to connection CONNECTION. | 472 Look for an existing device attached to connection CONNECTION. |
487 Return the device if found; otherwise, signal an error. | 473 Return the device if found; otherwise, signal an error. |
488 | 474 |
489 If TYPE is specified, only return devices of that type; otherwise, | 475 If TYPE is specified, only return devices of that type; otherwise, |
490 return devices of any type. (It is possible, although unlikely, | 476 return devices of any type. (It is possible, although unlikely, |
491 that two devices of different types could have the same connection | 477 that two devices of different types could have the same connection |
492 name; in such a case, the first device found is returned.) | 478 name; in such a case, the first device found is returned.) |
493 */ ) | 479 */ |
494 (connection, type) | 480 (connection, type)) |
495 Lisp_Object connection, type; | |
496 { | 481 { |
497 Lisp_Object device = Ffind_device (connection, type); | 482 Lisp_Object device = Ffind_device (connection, type); |
498 if (NILP (device)) | 483 if (NILP (device)) |
499 { | 484 { |
500 if (NILP (type)) | 485 if (NILP (type)) |
503 signal_simple_error_2 ("No such device", type, connection); | 488 signal_simple_error_2 ("No such device", type, connection); |
504 } | 489 } |
505 return device; | 490 return device; |
506 } | 491 } |
507 | 492 |
508 DEFUN ("make-device", Fmake_device, Smake_device, 2, 3, 0 /* | 493 DEFUN ("make-device", Fmake_device, 2, 3, 0, /* |
509 Create a new device of type TYPE, attached to connection CONNECTION. | 494 Create a new device of type TYPE, attached to connection CONNECTION. |
510 | 495 |
511 The valid values for CONNECTION are device-specific; however, | 496 The valid values for CONNECTION are device-specific; however, |
512 CONNECTION is generally a string. (Specifically, for X devices, | 497 CONNECTION is generally a string. (Specifically, for X devices, |
513 CONNECTION should be a display specification such as "foo:0", and | 498 CONNECTION should be a display specification such as "foo:0", and |
519 device creation. | 504 device creation. |
520 | 505 |
521 If CONNECTION specifies an already-existing device connection, that | 506 If CONNECTION specifies an already-existing device connection, that |
522 device is simply returned; no new device is created, and PROPS | 507 device is simply returned; no new device is created, and PROPS |
523 have no effect. | 508 have no effect. |
524 */ ) | 509 */ |
525 (type, connection, props) | 510 (type, connection, props)) |
526 Lisp_Object type, connection, props; | |
527 { | 511 { |
528 /* This function can GC */ | 512 /* This function can GC */ |
529 struct device *d; | 513 struct device *d; |
530 struct console *con; | 514 struct console *con; |
531 Lisp_Object device = Qnil; | 515 Lisp_Object device = Qnil; |
829 io_error_delete_device (Lisp_Object device) | 813 io_error_delete_device (Lisp_Object device) |
830 { | 814 { |
831 delete_device_internal (XDEVICE (device), 1, 0, 1); | 815 delete_device_internal (XDEVICE (device), 1, 0, 1); |
832 } | 816 } |
833 | 817 |
834 DEFUN ("delete-device", Fdelete_device, Sdelete_device, 1, 2, 0 /* | 818 DEFUN ("delete-device", Fdelete_device, 1, 2, 0, /* |
835 Delete DEVICE, permanently eliminating it from use. | 819 Delete DEVICE, permanently eliminating it from use. |
836 Normally, you cannot delete the last non-minibuffer-only frame (you must | 820 Normally, you cannot delete the last non-minibuffer-only frame (you must |
837 use `save-buffers-kill-emacs' or `kill-emacs'). However, if optional | 821 use `save-buffers-kill-emacs' or `kill-emacs'). However, if optional |
838 second argument FORCE is non-nil, you can delete the last frame. (This | 822 second argument FORCE is non-nil, you can delete the last frame. (This |
839 will automatically call `save-buffers-kill-emacs'.) | 823 will automatically call `save-buffers-kill-emacs'.) |
840 */ ) | 824 */ |
841 (device, force) | 825 (device, force)) |
842 Lisp_Object device, force; | |
843 { | 826 { |
844 CHECK_DEVICE (device); | 827 CHECK_DEVICE (device); |
845 delete_device_internal (XDEVICE (device), !NILP (force), 0, 0); | 828 delete_device_internal (XDEVICE (device), !NILP (force), 0, 0); |
846 return Qnil; | 829 return Qnil; |
847 } | 830 } |
848 | 831 |
849 DEFUN ("device-frame-list", Fdevice_frame_list, Sdevice_frame_list, | 832 DEFUN ("device-frame-list", Fdevice_frame_list, 0, 1, 0, /* |
850 0, 1, 0 /* | |
851 Return a list of all frames on DEVICE. | 833 Return a list of all frames on DEVICE. |
852 If DEVICE is nil, the selected device will be used. | 834 If DEVICE is nil, the selected device will be used. |
853 */ ) | 835 */ |
854 (device) | 836 (device)) |
855 Lisp_Object device; | |
856 { | 837 { |
857 return Fcopy_sequence (DEVICE_FRAME_LIST (decode_device (device))); | 838 return Fcopy_sequence (DEVICE_FRAME_LIST (decode_device (device))); |
858 } | 839 } |
859 | 840 |
860 DEFUN ("device-class", Fdevice_class, Sdevice_class, | 841 DEFUN ("device-class", Fdevice_class, 0, 1, 0, /* |
861 0, 1, 0 /* | |
862 Return the class (color behavior) of DEVICE. | 842 Return the class (color behavior) of DEVICE. |
863 This will be one of 'color, 'grayscale, or 'mono. | 843 This will be one of 'color, 'grayscale, or 'mono. |
864 */ ) | 844 */ |
865 (device) | 845 (device)) |
866 Lisp_Object device; | |
867 { | 846 { |
868 return DEVICE_CLASS (decode_device (device)); | 847 return DEVICE_CLASS (decode_device (device)); |
869 } | 848 } |
870 | 849 |
871 DEFUN ("set-device-class", Fset_device_class, Sset_device_class, | 850 DEFUN ("set-device-class", Fset_device_class, 2, 2, 0, /* |
872 2, 2, 0 /* | |
873 Set the class (color behavior) of DEVICE. | 851 Set the class (color behavior) of DEVICE. |
874 CLASS should be one of 'color, 'grayscale, or 'mono. | 852 CLASS should be one of 'color, 'grayscale, or 'mono. |
875 This is only allowed on device such as TTY devices, where the color | 853 This is only allowed on device such as TTY devices, where the color |
876 behavior cannot necessarily be determined automatically. | 854 behavior cannot necessarily be determined automatically. |
877 */ ) | 855 */ |
878 (device, class) | 856 (device, class)) |
879 Lisp_Object device, class; | |
880 { | 857 { |
881 struct device *d = decode_device (device); | 858 struct device *d = decode_device (device); |
882 XSETDEVICE (device, d); | 859 XSETDEVICE (device, d); |
883 if (!DEVICE_TTY_P (d)) | 860 if (!DEVICE_TTY_P (d)) |
884 signal_simple_error ("Cannot change the class of this device", device); | 861 signal_simple_error ("Cannot change the class of this device", device); |
886 signal_simple_error ("Must be color, mono, or grayscale", class); | 863 signal_simple_error ("Must be color, mono, or grayscale", class); |
887 DEVICE_CLASS (d) = class; | 864 DEVICE_CLASS (d) = class; |
888 return Qnil; | 865 return Qnil; |
889 } | 866 } |
890 | 867 |
891 DEFUN ("device-pixel-width", Fdevice_pixel_width, Sdevice_pixel_width, | 868 DEFUN ("device-pixel-width", Fdevice_pixel_width, 0, 1, 0, /* |
892 0, 1, 0 /* | |
893 Return the width in pixels of DEVICE, or nil if unknown. | 869 Return the width in pixels of DEVICE, or nil if unknown. |
894 */ ) | 870 */ |
895 (device) | 871 (device)) |
896 Lisp_Object device; | |
897 { | 872 { |
898 struct device *d = decode_device (device); | 873 struct device *d = decode_device (device); |
899 int retval; | 874 int retval; |
900 | 875 |
901 retval = DEVMETH_OR_GIVEN (d, device_pixel_width, (d), 0); | 876 retval = DEVMETH_OR_GIVEN (d, device_pixel_width, (d), 0); |
903 return Qnil; | 878 return Qnil; |
904 | 879 |
905 return make_int (retval); | 880 return make_int (retval); |
906 } | 881 } |
907 | 882 |
908 DEFUN ("device-pixel-height", Fdevice_pixel_height, Sdevice_pixel_height, | 883 DEFUN ("device-pixel-height", Fdevice_pixel_height, 0, 1, 0, /* |
909 0, 1, 0 /* | |
910 Return the height in pixels of DEVICE, or nil if unknown. | 884 Return the height in pixels of DEVICE, or nil if unknown. |
911 */ ) | 885 */ |
912 (device) | 886 (device)) |
913 Lisp_Object device; | |
914 { | 887 { |
915 struct device *d = decode_device (device); | 888 struct device *d = decode_device (device); |
916 int retval; | 889 int retval; |
917 | 890 |
918 retval = DEVMETH_OR_GIVEN (d, device_pixel_height, (d), 0); | 891 retval = DEVMETH_OR_GIVEN (d, device_pixel_height, (d), 0); |
920 return Qnil; | 893 return Qnil; |
921 | 894 |
922 return make_int (retval); | 895 return make_int (retval); |
923 } | 896 } |
924 | 897 |
925 DEFUN ("device-mm-width", Fdevice_mm_width, Sdevice_mm_width, | 898 DEFUN ("device-mm-width", Fdevice_mm_width, 0, 1, 0, /* |
926 0, 1, 0 /* | |
927 Return the width in millimeters of DEVICE, or nil if unknown. | 899 Return the width in millimeters of DEVICE, or nil if unknown. |
928 */ ) | 900 */ |
929 (device) | 901 (device)) |
930 Lisp_Object device; | |
931 { | 902 { |
932 struct device *d = decode_device (device); | 903 struct device *d = decode_device (device); |
933 int retval; | 904 int retval; |
934 | 905 |
935 retval = DEVMETH_OR_GIVEN (d, device_mm_width, (d), 0); | 906 retval = DEVMETH_OR_GIVEN (d, device_mm_width, (d), 0); |
937 return Qnil; | 908 return Qnil; |
938 | 909 |
939 return make_int (retval); | 910 return make_int (retval); |
940 } | 911 } |
941 | 912 |
942 DEFUN ("device-mm-height", Fdevice_mm_height, Sdevice_mm_height, | 913 DEFUN ("device-mm-height", Fdevice_mm_height, 0, 1, 0, /* |
943 0, 1, 0 /* | |
944 Return the height in millimeters of DEVICE, or nil if unknown. | 914 Return the height in millimeters of DEVICE, or nil if unknown. |
945 */ ) | 915 */ |
946 (device) | 916 (device)) |
947 Lisp_Object device; | |
948 { | 917 { |
949 struct device *d = decode_device (device); | 918 struct device *d = decode_device (device); |
950 int retval; | 919 int retval; |
951 | 920 |
952 retval = DEVMETH_OR_GIVEN (d, device_mm_height, (d), 0); | 921 retval = DEVMETH_OR_GIVEN (d, device_mm_height, (d), 0); |
954 return Qnil; | 923 return Qnil; |
955 | 924 |
956 return make_int (retval); | 925 return make_int (retval); |
957 } | 926 } |
958 | 927 |
959 DEFUN ("device-bitplanes", Fdevice_bitplanes, Sdevice_bitplanes, | 928 DEFUN ("device-bitplanes", Fdevice_bitplanes, 0, 1, 0, /* |
960 0, 1, 0 /* | |
961 Return the number of bitplanes of DEVICE, or nil if unknown. | 929 Return the number of bitplanes of DEVICE, or nil if unknown. |
962 */ ) | 930 */ |
963 (device) | 931 (device)) |
964 Lisp_Object device; | |
965 { | 932 { |
966 struct device *d = decode_device (device); | 933 struct device *d = decode_device (device); |
967 int retval; | 934 int retval; |
968 | 935 |
969 retval = DEVMETH_OR_GIVEN (d, device_bitplanes, (d), 0); | 936 retval = DEVMETH_OR_GIVEN (d, device_bitplanes, (d), 0); |
971 return Qnil; | 938 return Qnil; |
972 | 939 |
973 return make_int (retval); | 940 return make_int (retval); |
974 } | 941 } |
975 | 942 |
976 DEFUN ("device-color-cells", Fdevice_color_cells, Sdevice_color_cells, | 943 DEFUN ("device-color-cells", Fdevice_color_cells, 0, 1, 0, /* |
977 0, 1, 0 /* | |
978 Return the number of color cells of DEVICE, or nil if unknown. | 944 Return the number of color cells of DEVICE, or nil if unknown. |
979 */ ) | 945 */ |
980 (device) | 946 (device)) |
981 Lisp_Object device; | |
982 { | 947 { |
983 struct device *d = decode_device (device); | 948 struct device *d = decode_device (device); |
984 int retval; | 949 int retval; |
985 | 950 |
986 retval = DEVMETH_OR_GIVEN (d, device_color_cells, (d), 0); | 951 retval = DEVMETH_OR_GIVEN (d, device_color_cells, (d), 0); |
988 return Qnil; | 953 return Qnil; |
989 | 954 |
990 return make_int (retval); | 955 return make_int (retval); |
991 } | 956 } |
992 | 957 |
993 DEFUN ("set-device-baud-rate", Fset_device_baud_rate, Sset_device_baud_rate, | 958 DEFUN ("set-device-baud-rate", Fset_device_baud_rate, 2, 2, 0, /* |
994 2, 2, 0 /* | |
995 Set the output baud rate of DEVICE to RATE. | 959 Set the output baud rate of DEVICE to RATE. |
996 On most systems, changing this value will affect the amount of padding | 960 On most systems, changing this value will affect the amount of padding |
997 and other strategic decisions made during redisplay. | 961 and other strategic decisions made during redisplay. |
998 */ ) | 962 */ |
999 (device, rate) | 963 (device, rate)) |
1000 Lisp_Object device, rate; | |
1001 { | 964 { |
1002 CHECK_INT (rate); | 965 CHECK_INT (rate); |
1003 | 966 |
1004 DEVICE_BAUD_RATE (decode_device (device)) = XINT (rate); | 967 DEVICE_BAUD_RATE (decode_device (device)) = XINT (rate); |
1005 | 968 |
1006 return rate; | 969 return rate; |
1007 } | 970 } |
1008 | 971 |
1009 DEFUN ("device-baud-rate", Fdevice_baud_rate, Sdevice_baud_rate, | 972 DEFUN ("device-baud-rate", Fdevice_baud_rate, 0, 1, 0, /* |
1010 0, 1, 0 /* | |
1011 Return the output baud rate of DEVICE. | 973 Return the output baud rate of DEVICE. |
1012 */ ) | 974 */ |
1013 (device) | 975 (device)) |
1014 Lisp_Object device; | |
1015 { | 976 { |
1016 return make_int (DEVICE_BAUD_RATE (decode_device (device))); | 977 return make_int (DEVICE_BAUD_RATE (decode_device (device))); |
1017 } | 978 } |
1018 | 979 |
1019 void | 980 void |
1070 /************************************************************************/ | 1031 /************************************************************************/ |
1071 | 1032 |
1072 void | 1033 void |
1073 syms_of_device (void) | 1034 syms_of_device (void) |
1074 { | 1035 { |
1075 defsubr (&Svalid_device_class_p); | 1036 DEFSUBR (Fvalid_device_class_p); |
1076 defsubr (&Sdevice_class_list); | 1037 DEFSUBR (Fdevice_class_list); |
1077 | 1038 |
1078 defsubr (&Sdfw_device); | 1039 DEFSUBR (Fdfw_device); |
1079 defsubr (&Sselected_device); | 1040 DEFSUBR (Fselected_device); |
1080 defsubr (&Sselect_device); | 1041 DEFSUBR (Fselect_device); |
1081 defsubr (&Sset_device_selected_frame); | 1042 DEFSUBR (Fset_device_selected_frame); |
1082 defsubr (&Sdevicep); | 1043 DEFSUBR (Fdevicep); |
1083 defsubr (&Sdevice_live_p); | 1044 DEFSUBR (Fdevice_live_p); |
1084 defsubr (&Sdevice_name); | 1045 DEFSUBR (Fdevice_name); |
1085 defsubr (&Sdevice_connection); | 1046 DEFSUBR (Fdevice_connection); |
1086 defsubr (&Sdevice_console); | 1047 DEFSUBR (Fdevice_console); |
1087 defsubr (&Sfind_device); | 1048 DEFSUBR (Ffind_device); |
1088 defsubr (&Sget_device); | 1049 DEFSUBR (Fget_device); |
1089 defsubr (&Smake_device); | 1050 DEFSUBR (Fmake_device); |
1090 defsubr (&Sdelete_device); | 1051 DEFSUBR (Fdelete_device); |
1091 defsubr (&Sdevice_frame_list); | 1052 DEFSUBR (Fdevice_frame_list); |
1092 defsubr (&Sdevice_class); | 1053 DEFSUBR (Fdevice_class); |
1093 defsubr (&Sset_device_class); | 1054 DEFSUBR (Fset_device_class); |
1094 defsubr (&Sdevice_pixel_width); | 1055 DEFSUBR (Fdevice_pixel_width); |
1095 defsubr (&Sdevice_pixel_height); | 1056 DEFSUBR (Fdevice_pixel_height); |
1096 defsubr (&Sdevice_mm_width); | 1057 DEFSUBR (Fdevice_mm_width); |
1097 defsubr (&Sdevice_mm_height); | 1058 DEFSUBR (Fdevice_mm_height); |
1098 defsubr (&Sdevice_bitplanes); | 1059 DEFSUBR (Fdevice_bitplanes); |
1099 defsubr (&Sdevice_color_cells); | 1060 DEFSUBR (Fdevice_color_cells); |
1100 defsubr (&Sset_device_baud_rate); | 1061 DEFSUBR (Fset_device_baud_rate); |
1101 defsubr (&Sdevice_baud_rate); | 1062 DEFSUBR (Fdevice_baud_rate); |
1102 | 1063 |
1103 defsymbol (&Qdevicep, "devicep"); | 1064 defsymbol (&Qdevicep, "devicep"); |
1104 defsymbol (&Qdevice_live_p, "device-live-p"); | 1065 defsymbol (&Qdevice_live_p, "device-live-p"); |
1105 defsymbol (&Qdelete_device, "delete-device"); | 1066 defsymbol (&Qdelete_device, "delete-device"); |
1106 | 1067 |