Mercurial > emacs
comparison src/frame.c @ 9268:cb55d0155265
(make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Fframe_root_window, Fframe_selected_window, Fset_frame_selected_window,
Fnext_frame, Fprevious_frame, Fdelete_frame, Fmouse_position,
Fmouse_pixel_position, Fmake_frame_visible, Fmake_frame_invisible,
Ficonify_frame): Use new accessor macros instead of calling XSET directly.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Tue, 04 Oct 1994 12:07:50 +0000 |
parents | a31be7afcc83 |
children | 27370f65dfa1 |
comparison
equal
deleted
inserted
replaced
9267:1b685d477c10 | 9268:cb55d0155265 |
---|---|
283 | 283 |
284 register struct frame *f = make_frame (0); | 284 register struct frame *f = make_frame (0); |
285 register Lisp_Object mini_window; | 285 register Lisp_Object mini_window; |
286 register Lisp_Object frame; | 286 register Lisp_Object frame; |
287 | 287 |
288 XSET (frame, Lisp_Frame, f); | 288 XSETFRAME (frame, f); |
289 | 289 |
290 f->auto_raise = 0; | 290 f->auto_raise = 0; |
291 f->auto_lower = 0; | 291 f->auto_lower = 0; |
292 f->no_split = 1; | 292 f->no_split = 1; |
293 f->wants_modeline = 0; | 293 f->wants_modeline = 0; |
321 Lisp_Object frame; | 321 Lisp_Object frame; |
322 | 322 |
323 Vframe_list = Qnil; | 323 Vframe_list = Qnil; |
324 f = make_frame (1); | 324 f = make_frame (1); |
325 | 325 |
326 XSET (frame, Lisp_Frame, f); | 326 XSETFRAME (frame, f); |
327 Vframe_list = Fcons (frame, Vframe_list); | 327 Vframe_list = Fcons (frame, Vframe_list); |
328 | 328 |
329 f->name = build_string ("terminal"); | 329 f->name = build_string ("terminal"); |
330 FRAME_SET_VISIBLE (f, 1); | 330 FRAME_SET_VISIBLE (f, 1); |
331 f->display.nothing = 1; /* Nonzero means frame isn't deleted. */ | 331 f->display.nothing = 1; /* Nonzero means frame isn't deleted. */ |
332 XSET (Vterminal_frame, Lisp_Frame, f); | 332 XSETFRAME (Vterminal_frame, f); |
333 return f; | 333 return f; |
334 } | 334 } |
335 | 335 |
336 static Lisp_Object | 336 static Lisp_Object |
337 do_switch_frame (frame, no_enter, track) | 337 do_switch_frame (frame, no_enter, track) |
450 DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0, | 450 DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0, |
451 "Return the frame that is now selected.") | 451 "Return the frame that is now selected.") |
452 () | 452 () |
453 { | 453 { |
454 Lisp_Object tem; | 454 Lisp_Object tem; |
455 XSET (tem, Lisp_Frame, selected_frame); | 455 XSETFRAME (tem, selected_frame); |
456 return tem; | 456 return tem; |
457 } | 457 } |
458 | 458 |
459 DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0, | 459 DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0, |
460 "Return the frame object that window WINDOW is on.") | 460 "Return the frame object that window WINDOW is on.") |
497 If omitted, FRAME defaults to the currently selected frame.") | 497 If omitted, FRAME defaults to the currently selected frame.") |
498 (frame) | 498 (frame) |
499 Lisp_Object frame; | 499 Lisp_Object frame; |
500 { | 500 { |
501 if (NILP (frame)) | 501 if (NILP (frame)) |
502 XSET (frame, Lisp_Frame, selected_frame); | 502 XSETFRAME (frame, selected_frame); |
503 else | 503 else |
504 CHECK_LIVE_FRAME (frame, 0); | 504 CHECK_LIVE_FRAME (frame, 0); |
505 | 505 |
506 return XFRAME (frame)->root_window; | 506 return XFRAME (frame)->root_window; |
507 } | 507 } |
512 If omitted, FRAME defaults to the currently selected frame.") | 512 If omitted, FRAME defaults to the currently selected frame.") |
513 (frame) | 513 (frame) |
514 Lisp_Object frame; | 514 Lisp_Object frame; |
515 { | 515 { |
516 if (NILP (frame)) | 516 if (NILP (frame)) |
517 XSET (frame, Lisp_Frame, selected_frame); | 517 XSETFRAME (frame, selected_frame); |
518 else | 518 else |
519 CHECK_LIVE_FRAME (frame, 0); | 519 CHECK_LIVE_FRAME (frame, 0); |
520 | 520 |
521 return XFRAME (frame)->selected_window; | 521 return XFRAME (frame)->selected_window; |
522 } | 522 } |
528 If FRAME is the selected frame, this makes WINDOW the selected window.") | 528 If FRAME is the selected frame, this makes WINDOW the selected window.") |
529 (frame, window) | 529 (frame, window) |
530 Lisp_Object frame, window; | 530 Lisp_Object frame, window; |
531 { | 531 { |
532 if (NILP (frame)) | 532 if (NILP (frame)) |
533 XSET (frame, Lisp_Frame, selected_frame); | 533 XSETFRAME (frame, selected_frame); |
534 else | 534 else |
535 CHECK_LIVE_FRAME (frame, 0); | 535 CHECK_LIVE_FRAME (frame, 0); |
536 | 536 |
537 CHECK_LIVE_WINDOW (window, 1); | 537 CHECK_LIVE_WINDOW (window, 1); |
538 | 538 |
723 Lisp_Object frame, miniframe; | 723 Lisp_Object frame, miniframe; |
724 { | 724 { |
725 Lisp_Object tail; | 725 Lisp_Object tail; |
726 | 726 |
727 if (NILP (frame)) | 727 if (NILP (frame)) |
728 XSET (frame, Lisp_Frame, selected_frame); | 728 XSETFRAME (frame, selected_frame); |
729 else | 729 else |
730 CHECK_LIVE_FRAME (frame, 0); | 730 CHECK_LIVE_FRAME (frame, 0); |
731 | 731 |
732 return next_frame (frame, miniframe); | 732 return next_frame (frame, miniframe); |
733 } | 733 } |
746 Lisp_Object frame, miniframe; | 746 Lisp_Object frame, miniframe; |
747 { | 747 { |
748 Lisp_Object tail; | 748 Lisp_Object tail; |
749 | 749 |
750 if (NILP (frame)) | 750 if (NILP (frame)) |
751 XSET (frame, Lisp_Frame, selected_frame); | 751 XSETFRAME (frame, selected_frame); |
752 else | 752 else |
753 CHECK_LIVE_FRAME (frame, 0); | 753 CHECK_LIVE_FRAME (frame, 0); |
754 | 754 |
755 return prev_frame (frame, miniframe); | 755 return prev_frame (frame, miniframe); |
756 } | 756 } |
812 struct frame *f; | 812 struct frame *f; |
813 | 813 |
814 if (EQ (frame, Qnil)) | 814 if (EQ (frame, Qnil)) |
815 { | 815 { |
816 f = selected_frame; | 816 f = selected_frame; |
817 XSET (frame, Lisp_Frame, f); | 817 XSETFRAME (frame, f); |
818 } | 818 } |
819 else | 819 else |
820 { | 820 { |
821 CHECK_FRAME (frame, 0); | 821 CHECK_FRAME (frame, 0); |
822 f = XFRAME (frame); | 822 f = XFRAME (frame); |
1003 row = XINT (y); | 1003 row = XINT (y); |
1004 pixel_to_glyph_coords (f, col, row, &col, &row, 0, 1); | 1004 pixel_to_glyph_coords (f, col, row, &col, &row, 0, 1); |
1005 XSETINT (x, col); | 1005 XSETINT (x, col); |
1006 XSETINT (y, row); | 1006 XSETINT (y, row); |
1007 } | 1007 } |
1008 XSET (lispy_dummy, Lisp_Frame, f); | 1008 XSETFRAME (lispy_dummy, f); |
1009 return Fcons (lispy_dummy, Fcons (x, y)); | 1009 return Fcons (lispy_dummy, Fcons (x, y)); |
1010 } | 1010 } |
1011 | 1011 |
1012 DEFUN ("mouse-pixel-position", Fmouse_pixel_position, | 1012 DEFUN ("mouse-pixel-position", Fmouse_pixel_position, |
1013 Smouse_pixel_position, 0, 0, 0, | 1013 Smouse_pixel_position, 0, 0, 0, |
1033 if (mouse_position_hook) | 1033 if (mouse_position_hook) |
1034 (*mouse_position_hook) (&f, | 1034 (*mouse_position_hook) (&f, |
1035 &lispy_dummy, &party_dummy, | 1035 &lispy_dummy, &party_dummy, |
1036 &x, &y, | 1036 &x, &y, |
1037 &long_dummy); | 1037 &long_dummy); |
1038 XSET (lispy_dummy, Lisp_Frame, f); | 1038 XSETFRAME (lispy_dummy, f); |
1039 return Fcons (lispy_dummy, Fcons (x, y)); | 1039 return Fcons (lispy_dummy, Fcons (x, y)); |
1040 } | 1040 } |
1041 | 1041 |
1042 DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0, | 1042 DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0, |
1043 "Move the mouse pointer to the center of character cell (X,Y) in FRAME.\n\ | 1043 "Move the mouse pointer to the center of character cell (X,Y) in FRAME.\n\ |
1088 If omitted, FRAME defaults to the currently selected frame.") | 1088 If omitted, FRAME defaults to the currently selected frame.") |
1089 (frame) | 1089 (frame) |
1090 Lisp_Object frame; | 1090 Lisp_Object frame; |
1091 { | 1091 { |
1092 if (NILP (frame)) | 1092 if (NILP (frame)) |
1093 XSET (frame, Lisp_Frame, selected_frame); | 1093 XSETFRAME (frame, selected_frame); |
1094 | 1094 |
1095 CHECK_LIVE_FRAME (frame, 0); | 1095 CHECK_LIVE_FRAME (frame, 0); |
1096 | 1096 |
1097 /* I think this should be done with a hook. */ | 1097 /* I think this should be done with a hook. */ |
1098 #ifdef HAVE_X_WINDOWS | 1098 #ifdef HAVE_X_WINDOWS |
1117 but if the second optional argument FORCE is non-nil, you may do so.") | 1117 but if the second optional argument FORCE is non-nil, you may do so.") |
1118 (frame, force) | 1118 (frame, force) |
1119 Lisp_Object frame, force; | 1119 Lisp_Object frame, force; |
1120 { | 1120 { |
1121 if (NILP (frame)) | 1121 if (NILP (frame)) |
1122 XSET (frame, Lisp_Frame, selected_frame); | 1122 XSETFRAME (frame, selected_frame); |
1123 | 1123 |
1124 CHECK_LIVE_FRAME (frame, 0); | 1124 CHECK_LIVE_FRAME (frame, 0); |
1125 | 1125 |
1126 if (NILP (force) && !other_visible_frames (XFRAME (frame))) | 1126 if (NILP (force) && !other_visible_frames (XFRAME (frame))) |
1127 error ("Attempt to make invisible the sole visible or iconified frame"); | 1127 error ("Attempt to make invisible the sole visible or iconified frame"); |
1158 If omitted, FRAME defaults to the currently selected frame.") | 1158 If omitted, FRAME defaults to the currently selected frame.") |
1159 (frame) | 1159 (frame) |
1160 Lisp_Object frame; | 1160 Lisp_Object frame; |
1161 { | 1161 { |
1162 if (NILP (frame)) | 1162 if (NILP (frame)) |
1163 XSET (frame, Lisp_Frame, selected_frame); | 1163 XSETFRAME (frame, selected_frame); |
1164 | 1164 |
1165 CHECK_LIVE_FRAME (frame, 0); | 1165 CHECK_LIVE_FRAME (frame, 0); |
1166 | 1166 |
1167 #if 0 /* This isn't logically necessary, and it can do GC. */ | 1167 #if 0 /* This isn't logically necessary, and it can do GC. */ |
1168 /* Don't let the frame remain selected. */ | 1168 /* Don't let the frame remain selected. */ |