Changeset 1707

Show
Ignore:
Timestamp:
02/17/98 01:45:19 (11 years ago)
Author:
himi
Message:

Emacs20.5 import

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/GNU/src/window.h

    r1693 r1707  
    11/* Window definitions for GNU Emacs. 
    2    Copyright (C) 1985, 1986, 1993, 1995, 1997, 1998, 1999, 2000, 2001 
    3    Free Software Foundation, Inc. 
     2   Copyright (C) 1985, 1986, 1993, 1995 Free Software Foundation, Inc. 
    43 
    54This file is part of GNU Emacs. 
     
    2019Boston, MA 02111-1307, USA.  */ 
    2120 
    22 #ifndef WINDOW_H_INCLUDED 
    23 #define WINDOW_H_INCLUDED 
    24  
    25 #include "dispextern.h" 
    2621 
    2722/* Windows are allocated as if they were vectors, but then the 
     
    7772 
    7873A dead window has its buffer, hchild, and vchild windows all nil.  */ 
    79  
    80 struct cursor_pos 
    81 { 
    82   /* Pixel position.  These are always window relative.  */ 
    83   int x, y; 
    84  
    85   /* Glyph matrix position.  */ 
    86   int hpos, vpos; 
    87 }; 
    8874 
    8975struct window 
     
    128114    Lisp_Object force_start; 
    129115    /* Non-nil means we have explicitly changed the value of start, 
    130        but that the next redisplay is not obliged to use the new value. 
    131        This is used in Fdelete_other_windows to force a call to 
    132        Vwindow_scroll_functions.  */ 
     116       but that the next redisplay is not obliged to use the new value.  */ 
    133117    Lisp_Object optional_new_start; 
    134118    /* Number of columns display within the window is scrolled to the left.  */ 
    135119    Lisp_Object hscroll; 
    136     /* Minimum hscroll for automatic hscrolling.  This is the value 
    137        the user has set, by set-window-hscroll for example.  */ 
    138     Lisp_Object min_hscroll; 
    139120    /* Number saying how recently window was selected */ 
    140121    Lisp_Object use_time; 
     
    159140    Lisp_Object vertical_scroll_bar; 
    160141 
    161     /* Width of left and right marginal areas.  A value of nil means 
    162        no margin.  */ 
    163     Lisp_Object left_margin_width; 
    164     Lisp_Object right_margin_width; 
    165  
    166 /* The rest are currently not used or only half used */ 
     142    /* Some of these are currently not used or only half used */ 
     143    /* Frame coords of point at that time */ 
     144    Lisp_Object last_point_x; 
     145    Lisp_Object last_point_y; 
    167146    /* Frame coords of mark as of last time display completed */ 
    168147    /* May be nil if mark does not exist or was not on frame */ 
    169148    Lisp_Object last_mark_x; 
    170149    Lisp_Object last_mark_y; 
    171     /* Z - the buffer position of the last glyph in the current matrix 
    172        of W.  Only valid if WINDOW_END_VALID is not nil.  */ 
     150 
     151    /* Number of characters in buffer past bottom of window, 
     152       as of last redisplay that finished. */ 
    173153    Lisp_Object window_end_pos; 
    174     /* Glyph matrix row of the last glyph in the current matrix 
    175        of W.  Only valid if WINDOW_END_VALID is not nil.  */ 
    176     Lisp_Object window_end_vpos; 
    177154    /* t if window_end_pos is truly valid. 
    178155       This is nil if nontrivial redisplay is preempted 
     
    180157       did not get onto the frame.  */ 
    181158    Lisp_Object window_end_valid; 
     159    /* Vertical position (relative to window top) of that buffer position 
     160       of the first of those characters */ 
     161    Lisp_Object window_end_vpos; 
    182162    /* Non-nil means must regenerate mode line of this window */ 
    183163    Lisp_Object update_mode_line; 
     
    209189    /* Non-nil means don't delete this window for becoming "too small".  */ 
    210190    Lisp_Object too_small_ok; 
    211  
    212     /* Original window height and top before mini-window was 
    213        enlarged. */ 
    214     Lisp_Object orig_height, orig_top; 
    215      
    216     /* No Lisp data may follow below this point without changing 
    217        mark_object in alloc.c.  The member current_matrix must be the 
    218        first non-Lisp member.  */ 
    219  
    220     /* Glyph matrices.  */ 
    221     struct glyph_matrix *current_matrix; 
    222     struct glyph_matrix *desired_matrix; 
    223  
    224     /* Cursor position as of last update that completed without 
    225        pause.  This is the position of last_point.  */ 
    226     struct cursor_pos last_cursor; 
    227  
    228     /* Intended cursor position.   This is a position within the 
    229        glyph matrix.  */ 
    230     struct cursor_pos cursor; 
    231      
    232     /* Where the cursor actually is.  */ 
    233     struct cursor_pos phys_cursor; 
    234      
    235     /* Cursor type last drawn on the window.  Used for X frames; -1 
    236        initially.  */ 
    237     int phys_cursor_type; 
    238  
    239     /* This is handy for undrawing the cursor.  */ 
    240     int phys_cursor_ascent, phys_cursor_height; 
    241      
    242     /* Non-zero means the cursor is currently displayed.  This can be 
    243        set to zero by functions overpainting the cursor image.  */ 
    244     unsigned phys_cursor_on_p : 1; 
    245  
    246     /* 0 means cursor is logically on, 1 means it's off.  Used for 
    247        blinking cursor.  */ 
    248     unsigned cursor_off_p : 1; 
    249  
    250     /* Value of cursor_off_p as of the last redisplay.  */ 
    251     unsigned last_cursor_off_p : 1; 
    252  
    253     /* 1 means desired matrix has been build and window must be 
    254        updated in update_frame.  */ 
    255     unsigned must_be_updated_p : 1; 
    256  
    257     /* Flag indicating that this window is not a real one. 
    258        Currently only used for menu bar windows of frames.  */ 
    259     unsigned pseudo_window_p : 1; 
    260  
    261     /* Amount by which lines of this window are scrolled in 
    262        y-direction (smooth scrolling).  */ 
    263     int vscroll; 
    264      
    265     /* Z_BYTE - the buffer position of the last glyph in the current matrix 
    266        of W.  Only valid if WINDOW_END_VALID is not nil.  */ 
    267     int window_end_bytepos; 
    268  
    269     /* 1 means the window start of this window is frozen and may not 
    270        be changed during redisplay.  If point is not in the window, 
    271        accept that.  */ 
    272     unsigned frozen_window_start_p : 1; 
    273  
    274     /* 1 means that this window's height is temporarily fixed.  Used 
    275        in resize_mini_window to precent resizing selected_window, if 
    276        possible.  */ 
    277     unsigned height_fixed_p : 1; 
    278 }; 
     191  }; 
    279192 
    280193/* 1 if W is a minibuffer window.  */ 
    281194 
    282 #define MINI_WINDOW_P(W)       (!EQ ((W)->mini_p, Qnil)) 
    283  
    284 /* Return the window column at which the text in window W starts. 
     195#define MINI_WINDOW_P(W)  (!EQ ((W)->mini_p, Qnil)) 
     196 
     197/* Return the frame column at which the text in window W starts. 
    285198   This is different from the `left' field because it does not include 
    286199   a left-hand scroll bar if any.  */ 
     
    290203      + FRAME_LEFT_SCROLL_BAR_WIDTH (XFRAME (WINDOW_FRAME (W)))) 
    291204 
    292 /* Return the window column before which window W ends. 
     205/* Return the frame column before window W ends. 
    293206   This includes a right-hand scroll bar, if any.  */ 
    294207 
     
    296209     (XFASTINT ((W)->left) + XFASTINT ((W)->width)) 
    297210 
    298 /* Return the window column before which the text in window W ends. 
     211/* Return the frame column before which the text in window W ends. 
    299212   This is different from WINDOW_RIGHT_EDGE because it does not include 
    300213   a scroll bar or window-separating line on the right edge.  */ 
    301214 
    302 #define WINDOW_RIGHT_MARGIN(W) \ 
    303      (WINDOW_RIGHT_EDGE (W) \ 
    304       - (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (XFRAME (WINDOW_FRAME (W))) \ 
    305          ? FRAME_SCROLL_BAR_COLS (XFRAME (WINDOW_FRAME (W))) \ 
    306          : 0)) 
     215#define WINDOW_RIGHT_MARGIN(W)                                              \ 
     216  (WINDOW_RIGHT_EDGE (W)                                                    \ 
     217   - (! FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (WINDOW_FRAME (W)))          \ 
     218      ? ((WINDOW_RIGHTMOST_P (W)) ? 0 : 1)                                  \ 
     219      : FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (XFRAME (WINDOW_FRAME (W))) \ 
     220      ? FRAME_SCROLL_BAR_COLS (XFRAME (WINDOW_FRAME (W)))                   \ 
     221      : 0)) 
    307222 
    308223/* 1 if window W takes up the full width of its frame.  */  
     
    316231     (WINDOW_RIGHT_EDGE (W) == FRAME_WINDOW_WIDTH (XFRAME (WINDOW_FRAME (W)))) 
    317232      
    318  
    319233/* This is the window in which the terminal's cursor should 
    320234   be left when nothing is being done with it.  This must 
     
    339253extern Lisp_Object minibuf_window; 
    340254 
    341 /* Non-nil => window to for C-M-v to scroll when the minibuffer is 
    342    selected.  */ 
    343  
     255/* Non-nil => window to for C-M-v to scroll 
     256   when the minibuffer is selected.  */ 
    344257extern Lisp_Object Vminibuf_scroll_window; 
    345258 
    346 /* Nil or a symbol naming the window system under which emacs is 
    347    running ('x is the only current possibility) */ 
    348  
     259/* nil or a symbol naming the window system 
     260   under which emacs is running 
     261   ('x is the only current possibility) */ 
    349262extern Lisp_Object Vwindow_system; 
    350263 
    351264/* Version number of X windows: 10, 11 or nil.  */ 
    352  
    353265extern Lisp_Object Vwindow_system_version; 
    354266 
    355267/* Window that the mouse is over (nil if no mouse support).  */ 
    356  
    357268extern Lisp_Object Vmouse_window; 
    358269 
    359270/* Last mouse-click event (nil if no mouse support).  */ 
    360  
    361271extern Lisp_Object Vmouse_event; 
    362272 
     
    365275EXFUN (Fdisplay_buffer, 3); 
    366276EXFUN (Fset_window_buffer, 2); 
    367 EXFUN (Fset_window_hscroll, 2); 
    368 EXFUN (Fwindow_hscroll, 1); 
    369 EXFUN (Fset_window_vscroll, 2); 
    370 EXFUN (Fwindow_vscroll, 1); 
    371 EXFUN (Fset_window_margins, 3); 
    372 EXFUN (Fwindow_live_p, 1); 
    373 EXFUN (Fset_window_point, 2); 
    374277extern Lisp_Object make_window P_ ((void)); 
    375278extern void delete_window P_ ((Lisp_Object)); 
    376 extern Lisp_Object window_from_coordinates P_ ((struct frame *, int, int, int *, int)); 
     279extern Lisp_Object window_from_coordinates P_ ((struct frame *, int, int, int *)); 
    377280EXFUN (Fwindow_dedicated_p, 1); 
    378281extern int window_height P_ ((Lisp_Object)); 
     
    380283extern void set_window_height P_ ((Lisp_Object, int, int)); 
    381284extern void set_window_width P_ ((Lisp_Object, int, int)); 
     285extern void change_window_height P_ ((int, int)); 
    382286extern void delete_all_subwindows P_ ((struct window *)); 
    383 extern void freeze_window_starts P_ ((struct frame *, int)); 
    384 extern void foreach_window P_ ((struct frame *, 
    385                                 int (* fn) (struct window *, void *), 
    386                                 void *)); 
    387 extern void grow_mini_window P_ ((struct window *, int)); 
    388 extern void shrink_mini_window P_ ((struct window *)); 
    389  
    390  
    391 /* Make WINDOW display BUFFER as its contents.  RUN_HOOKS_P non-zero 
    392    means it's allowed to run hooks.  See make_frame for a case where 
    393    it's not allowed.  */ 
    394  
    395 void set_window_buffer P_ ((Lisp_Object window, Lisp_Object buffer, 
    396                             int run_hooks_p)); 
    397287 
    398288/* Prompt to display in front of the minibuffer contents.  */ 
    399  
    400289extern Lisp_Object minibuf_prompt; 
    401290 
    402291/* The visual width of the above.  */ 
    403  
    404292extern int minibuf_prompt_width; 
    405293 
    406 /* This is the window where the echo area message was displayed.  It 
    407    is always a minibuffer window, but it may not be the same window 
    408    currently active as a minibuffer.  */ 
    409  
     294/* Message to display instead of minibuffer contents.  
     295   This is what the functions error and message make, 
     296   and command echoing uses it as well. It overrides the 
     297   minibuf_prompt as well as the buffer.  */ 
     298extern char *echo_area_glyphs; 
     299 
     300/* This is the length of the message in echo_area_glyphs.  */ 
     301extern int echo_area_glyphs_length; 
     302 
     303/* Value of echo_area_glyphs when it was last acted on. 
     304  If this is nonzero, there is a message on the frame 
     305  in the minibuffer and it should be erased as soon 
     306  as it is no longer requested to appear. */ 
     307extern char *previous_echo_glyphs; 
     308 
     309/* This is the window where the echo area message was displayed. 
     310   It is always a minibuffer window, but it may not be the 
     311   same window currently active as a minibuffer.  */ 
    410312extern Lisp_Object echo_area_window; 
    411313 
    412314/* Depth in recursive edits.  */ 
    413  
    414315extern int command_loop_level; 
    415316 
    416317/* Depth in minibuffer invocations.  */ 
    417  
    418318extern int minibuf_level; 
    419319 
    420320/* true iff we should redraw the mode lines on the next redisplay.  */ 
    421  
    422321extern int update_mode_lines; 
    423322 
    424 /* Nonzero if BEGV - BEG or Z - ZV of current buffer has changed since 
    425    last redisplay that finished.  */ 
    426  
     323/* Minimum value of GPT - BEG since last redisplay that finished.  */ 
     324 
     325extern int beg_unchanged; 
     326 
     327/* Minimum value of Z - GPT since last redisplay that finished.  */ 
     328 
     329extern int end_unchanged; 
     330 
     331/* MODIFF as of last redisplay that finished; 
     332   if it matches MODIFF, beg_unchanged and end_unchanged 
     333   contain no useful information.  */ 
     334extern int unchanged_modified; 
     335 
     336/* BUF_OVERLAY_MODIFF of current buffer, as of last redisplay that finished; 
     337   if it matches BUF_OVERLAY_MODIFF, beg_unchanged and end_unchanged 
     338   contain no useful information.  */ 
     339extern int overlay_unchanged_modified; 
     340 
     341/* Nonzero if BEGV - BEG or Z - ZV of current buffer has changed 
     342   since last redisplay that finished.  */ 
    427343extern int clip_changed; 
    428344 
    429 /* Nonzero if window sizes or contents have changed since last 
    430    redisplay that finished */ 
    431  
     345/* Nonzero if window sizes or contents have changed 
     346 since last redisplay that finished */ 
    432347extern int windows_or_buffers_changed; 
    433348 
    434 /* Number of windows displaying the selected buffer.  Normally this is 
    435    1, but it can be more.  */ 
    436  
     349/* Number of windows displaying the selected buffer. 
     350   Normally this is 1, but it can be more.  */ 
    437351extern int buffer_shared; 
    438352 
    439353/* If *ROWS or *COLS are too small a size for FRAME, set them to the 
    440354   minimum allowable size.  */ 
    441  
    442355extern void check_frame_size P_ ((struct frame *frame, int *rows, int *cols)); 
    443  
    444 /* Return a pointer to the glyph W's physical cursor is on.  Value is 
    445    null if W's current matrix is invalid, so that no meaningfull glyph 
    446    can be returned.  */ 
    447  
    448 struct glyph *get_phys_cursor_glyph P_ ((struct window *w)); 
    449  
    450 /* Value is non-zero if WINDOW is a live window.  */ 
    451  
    452 #define WINDOW_LIVE_P(WINDOW) \ 
    453      (WINDOWP ((WINDOW)) && !NILP (XWINDOW ((WINDOW))->buffer)) 
    454  
    455 #endif /* not WINDOW_H_INCLUDED */