home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / lucid / lemacs-19.6 / src / window.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-13  |  9.3 KB  |  240 lines

  1. /* Window definitions for GNU Emacs.
  2.    Copyright (C) 1985-1993 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU Emacs.
  5.  
  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
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. GNU Emacs is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU Emacs; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. #ifndef _EMACS_WINDOW_H_
  21. #define _EMACS_WINDOW_H_
  22.  
  23. /* Windows are allocated as if they were vectors, but then the
  24. Lisp data type is changed to Lisp_Window.  They are garbage
  25. collected along with the vectors.
  26.  
  27. All windows in use are arranged into a tree, with pointers up and down.
  28.  
  29. Windows that are leaves of the tree are actually displayed
  30. and show the contents of buffers.  Windows that are not leaves
  31. are used for representing the way groups of leaf windows are
  32. arranged on the screen.  Leaf windows never become non-leaves.
  33. They are deleted only by calling delete-window on them (but
  34. this can be done implicitly).  Combination windows can be created
  35. and deleted at any time.
  36.  
  37. A leaf window has a non-nil buffer field, and also
  38.  has markers in its start and pointm fields.  Non-leaf windows
  39.  have nil in these fields.
  40.  
  41. Non-leaf windows are either vertical or horizontal combinations.
  42.  
  43. A vertical combination window has children that are arranged on the screen
  44. one above the next.  Its vchild field points to the uppermost child.
  45. The parent field of each of the children points to the vertical
  46. combination window.  The next field of each child points to the
  47. child below it, or is nil for the lowest child.  The prev field
  48. of each child points to the child above it, or is nil for the
  49. highest child.
  50.  
  51. A horizontal combination window has children that are side by side.
  52. Its hchild field points to the leftmost child.  In each child
  53. the next field points to the child to the right and the prev field
  54. points to the child to the left.
  55.  
  56. The children of a vertical combination window may be leaf windows
  57. or horizontal combination windows.  The children of a horizontal
  58. combination window may be leaf windows or vertical combination windows.
  59.  
  60. At the top of the tree are two windows which have nil as parent.
  61. The second of these is minibuf_window.  The first one manages all
  62. the screen area that is not minibuffer, and is called the root window.
  63. Different windows can be the root at different times;
  64. initially the root window is a leaf window, but if more windows
  65. are created then that leaf window ceases to be root and a newly
  66. made combination window becomes root instead.
  67.  
  68. In any case, prev of the minibuf window is the root window and
  69. next of the root window is the minibuf window.  To find the
  70. root window at any time, do XWINDOW (minibuf_window)->prev.
  71.  
  72. */
  73.  
  74. struct window
  75.   {
  76.     /* The first two fields are really the header of a vector */
  77.     /* The window code does not refer to them.  */
  78.     int size;
  79.     struct Lisp_Vector *vec_next;
  80.     /* The screen this window is on.  */
  81.     Lisp_Object screen;
  82.     /* t if this window is a minibuffer window.  */
  83.     Lisp_Object mini_p;
  84.     /* Following child (to right or down) at same level of tree */
  85.     Lisp_Object next;
  86.     /* Preceding child (to left or up) at same level of tree */
  87.     Lisp_Object prev;
  88.     /* First child of this window. */
  89.     /* vchild is used if this is a vertical combination,
  90.        hchild if this is a horizontal combination. */
  91.     Lisp_Object hchild, vchild;
  92.     /* The window this one is a child of. */
  93.     Lisp_Object parent;
  94.     /* The upper left corner coordinates of this window,
  95.        as integers relative to upper left corner of screen = 0, 0 */
  96.     Lisp_Object left;
  97.     Lisp_Object top;
  98.     /* The size of the window */
  99.     Lisp_Object height;
  100.     Lisp_Object width;
  101.     /* The buffer displayed in this window */
  102.     /* Of the fields vchild, hchild and buffer, only one is non-nil.  */
  103.     Lisp_Object buffer;
  104.     /* A marker pointing to where in the text to start displaying */
  105.     Lisp_Object start;
  106.     /* A marker pointing to where in the text point is in this window,
  107.        used only when the window is not selected.
  108.        This exists so that when multiple windows show one buffer
  109.        each one can have its own value of point.  */
  110.     Lisp_Object pointm;
  111.     /* Non-nil means next redisplay must use the value of start
  112.        set up for it in advance.  Set by scrolling commands.  */
  113.     Lisp_Object force_start;
  114.     /* Number of columns display within the window is scrolled to the left.  */
  115.     Lisp_Object hscroll;
  116.     /* Number saying how recently window was selected */
  117.     Lisp_Object use_time;
  118.     /* Unique number of window assigned when it was created */
  119.     Lisp_Object sequence_number;
  120.     /* No permanent meaning; used by save-window-excursion's bookkeeping */
  121.     Lisp_Object temslot;
  122.     /* text.modified of displayed buffer as of last time display completed */
  123.     Lisp_Object last_modified;
  124.     /* Value of point at that time */
  125.     Lisp_Object last_point;
  126.     /* buf.face_change as of last time display completed */
  127.     Lisp_Object last_facechange;
  128. /* The rest are currently not used or only half used */
  129.     /* Screen coords of point at that time */
  130.     Lisp_Object last_point_x;
  131.     Lisp_Object last_point_y;
  132.     /* Screen coords of mark as of last time display completed */
  133.     /* May be nil if mark does not exist or was not on screen */
  134.     Lisp_Object last_mark_x;
  135.     Lisp_Object last_mark_y;
  136.     /* Number of characters in buffer past bottom of window,
  137.        as of last redisplay that finished. */
  138.     Lisp_Object window_end_pos;
  139.     /* t if window_end_pos is truly valid.
  140.        This is nil if nontrivial redisplay is preempted
  141.        since in that case the screen image that window_end_pos
  142.        did not get onto the screen.  */
  143.     Lisp_Object window_end_valid;
  144.     /* Vertical position (relative to window top) of that buffer position
  145.        of the first of those characters */
  146.     Lisp_Object window_end_vpos;
  147.     /* Non-nil means must regenerate mode line of this window */
  148.     Lisp_Object redo_mode_line;
  149.     /* Non-nil means current value of `start'
  150.        was the beginning of a line when it was chosen.  */
  151.     Lisp_Object start_at_line_beg;
  152.     /* Display-table to use for displaying chars in this window.
  153.        Nil means use the buffer's own display-table.  */
  154.     Lisp_Object display_table;
  155.     /* Non-nil means window is marked as dedicated.  */
  156.     Lisp_Object dedicated;
  157.   };
  158.  
  159. #ifdef emacs  /* some things other than emacs want the structs */
  160.  
  161. /* 1 if W is a minibuffer window.  */
  162. #define MINI_WINDOW_P(W)  (!EQ ((W)->mini_p, Qnil))
  163.  
  164. /* Check only window on this screen. */
  165. #define ONLY_WINDOW_P(w) (NILP (w->parent))
  166.  
  167. /* This is the window in which the terminal's cursor should
  168.    be left when nothing is being done with it.  This must
  169.    always be a leaf window, and its buffer is selected by
  170.    the top level editing loop at the end of each command.
  171.  
  172.    This value is always the same as
  173.     SCREEN_SELECTED_WINDOW (selected_screen).  */
  174. extern Lisp_Object selected_window;
  175.  
  176. /* The minibuffer window of the selected screen.
  177.    Note that you cannot test for minibufferness of an arbitrary window
  178.    by comparing against this; but you can test for minibufferness of
  179.    the selected window or of any window that is displayed.  */
  180. extern Lisp_Object minibuf_window;
  181.  
  182. /* Non-nil => window to for C-M-v to scroll
  183.    when the minibuffer is selected.  */
  184. extern Lisp_Object Vminibuf_scroll_window;
  185.  
  186. /* nil or a symbol naming the window system
  187.    under which emacs is running
  188.    ('x is the only current possibility) */
  189. extern Lisp_Object Vwindow_system;
  190.  
  191. /* Version number of X windows: 10, 11 or nil.  */
  192. extern Lisp_Object Vwindow_system_version;
  193.  
  194. /* Prompt to display in front of the minibuffer contents or nil */
  195. extern Lisp_Object Vminibuf_prompt;
  196.  
  197. /* Message to display instead of minibuffer contents 
  198.    This is what the functions error and message make,
  199.    and command echoing uses it as well. It overrides the
  200.    Vminibuf_prompt as well as the buffer */
  201. extern char *echo_area_glyphs;
  202.  
  203. /* Depth in recursive edits */
  204. extern int command_loop_level;
  205.  
  206. /* Depth in minibuffer invocations */
  207. extern int minibuf_level;
  208.  
  209. /* true iff we should redraw the mode lines on the next redisplay */
  210. extern int redraw_mode_line;
  211.  
  212. /* Minimum value of bf_s1 since last redisplay that finished.
  213.  Valid for current buffer unless Cant1WinOpt is nonzero. */
  214. extern int beg_unchanged;
  215.  
  216. /* Minimum value of bf_s2 since last redisplay that finished.
  217.  Valid for current buffer unless Cant1WinOpt is nonzero. */
  218. extern int end_unchanged;
  219.  
  220. /* MODIFF as of last redisplay that finished;
  221.  if it matches MODIFF, beg_unchanged and end_unchanged
  222.  contain no useful information */
  223. extern int unchanged_modified;
  224.  
  225. /* Nonzero if head_clip or tail_clip of current buffer has changed
  226.  since last redisplay that finished */
  227. extern int clip_changed;
  228.  
  229. /* Nonzero if window sizes or contents have changed
  230.  since last redisplay that finished */
  231. extern int windows_or_buffers_changed;
  232.  
  233. /* Number of windows displaying the selected buffer.
  234.    Normally this is 1, but it can be more.  */
  235. extern int buffer_shared;
  236.  
  237. #endif /* emacs */
  238.  
  239. #endif /* _EMACS_WINDOW_H_ */
  240.