comparison src/frame.c @ 27795:83292274bbd4

(Vmouse_position_function): New variable. (Fmouse_position): Use it. (syms_of_frame): Install it.
author Dave Love <fx@gnu.org>
date Mon, 21 Feb 2000 13:49:00 +0000
parents fb13a4706619
children da774b48eb7f
comparison
equal deleted inserted replaced
27794:94d0bfb9a844 27795:83292274bbd4
1 /* Generic frame functions. 1 /* Generic frame functions.
2 Copyright (C) 1993, 1994, 1995, 1997, 1999 Free Software Foundation. 2 Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000 Free Software Foundation.
3 3
4 This file is part of GNU Emacs. 4 This file is part of GNU Emacs.
5 5
6 GNU Emacs is free software; you can redistribute it and/or modify 6 GNU Emacs is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
101 Lisp_Object Qbuffer_list; 101 Lisp_Object Qbuffer_list;
102 Lisp_Object Qtitle; 102 Lisp_Object Qtitle;
103 103
104 Lisp_Object Vterminal_frame; 104 Lisp_Object Vterminal_frame;
105 Lisp_Object Vdefault_frame_alist; 105 Lisp_Object Vdefault_frame_alist;
106 Lisp_Object Vmouse_position_function;
106 107
107 static void 108 static void
108 syms_of_frame_1 () 109 syms_of_frame_1 ()
109 { 110 {
110 /*&&& init symbols here &&&*/ 111 /*&&& init symbols here &&&*/
1373 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\ 1374 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\
1374 The position is given in character cells, where (0, 0) is the\n\ 1375 The position is given in character cells, where (0, 0) is the\n\
1375 upper-left corner.\n\ 1376 upper-left corner.\n\
1376 If Emacs is running on a mouseless terminal or hasn't been programmed\n\ 1377 If Emacs is running on a mouseless terminal or hasn't been programmed\n\
1377 to read the mouse position, it returns the selected frame for FRAME\n\ 1378 to read the mouse position, it returns the selected frame for FRAME\n\
1378 and nil for X and Y.") 1379 and nil for X and Y.\n\
1380 Runs the abnormal hook `mouse-position-function' with the normal return\n\
1381 value as argument.")
1379 () 1382 ()
1380 { 1383 {
1381 FRAME_PTR f; 1384 FRAME_PTR f;
1382 Lisp_Object lispy_dummy; 1385 Lisp_Object lispy_dummy;
1383 enum scroll_bar_part party_dummy; 1386 enum scroll_bar_part party_dummy;
1384 Lisp_Object x, y; 1387 Lisp_Object x, y, retval;
1385 int col, row; 1388 int col, row;
1386 unsigned long long_dummy; 1389 unsigned long long_dummy;
1387 1390
1388 f = SELECTED_FRAME (); 1391 f = SELECTED_FRAME ();
1389 x = y = Qnil; 1392 x = y = Qnil;
1403 XSETINT (x, col); 1406 XSETINT (x, col);
1404 XSETINT (y, row); 1407 XSETINT (y, row);
1405 } 1408 }
1406 #endif 1409 #endif
1407 XSETFRAME (lispy_dummy, f); 1410 XSETFRAME (lispy_dummy, f);
1408 return Fcons (lispy_dummy, Fcons (x, y)); 1411 retval = Fcons (lispy_dummy, Fcons (x, y));
1412 if (!NILP (Vmouse_position_function))
1413 {
1414 struct gcpro gcpro1, gcpro2;
1415 GCPRO2 (x, y);
1416 RETURN_UNGCPRO (call1 (Vmouse_position_function, retval));
1417 }
1418 return retval;
1409 } 1419 }
1410 1420
1411 DEFUN ("mouse-pixel-position", Fmouse_pixel_position, 1421 DEFUN ("mouse-pixel-position", Fmouse_pixel_position,
1412 Smouse_pixel_position, 0, 0, 0, 1422 Smouse_pixel_position, 0, 0, 0,
1413 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\ 1423 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\
2342 2352
2343 DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified, 2353 DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified,
2344 "Non-nil if all of emacs is iconified and frame updates are not needed."); 2354 "Non-nil if all of emacs is iconified and frame updates are not needed.");
2345 Vemacs_iconified = Qnil; 2355 Vemacs_iconified = Qnil;
2346 2356
2357 DEFVAR_LISP ("mouse-position-function", &Vmouse_position_function,
2358 "If non-nil, function applied to the normal result of `mouse-position'.\n\
2359 This abnormal hook exists for the benefit of packages like XTerm-mouse\n\
2360 which need to do mouse handling at the Lisp level.");
2361 Vmouse_position_function = Qnil;
2362
2347 DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame, 2363 DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
2348 "Minibufferless frames use this frame's minibuffer.\n\ 2364 "Minibufferless frames use this frame's minibuffer.\n\
2349 \n\ 2365 \n\
2350 Emacs cannot create minibufferless frames unless this is set to an\n\ 2366 Emacs cannot create minibufferless frames unless this is set to an\n\
2351 appropriate surrogate.\n\ 2367 appropriate surrogate.\n\