Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
[bpt/emacs.git] / src / window.h
index b2c62fd..e952948 100644 (file)
@@ -1,14 +1,14 @@
 /* Window definitions for GNU Emacs.
    Copyright (C) 1985, 1986, 1993, 1995, 1997, 1998, 1999, 2000, 2001,
-                 2002, 2003, 2004, 2005, 2006, 2007, 2008
+                 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
                  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
-GNU Emacs is free software; you can redistribute it and/or modify
+GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -16,9 +16,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.  */
+along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef WINDOW_H_INCLUDED
 #define WINDOW_H_INCLUDED
@@ -119,7 +117,10 @@ struct window
     /* The buffer displayed in this window */
     /* Of the fields vchild, hchild and buffer, only one is non-nil.  */
     Lisp_Object buffer;
-    /* A marker pointing to where in the text to start displaying */
+    /* A marker pointing to where in the text to start displaying.
+       BIDI Note: This is the _logical-order_ start, i.e. the smallest
+       buffer position visible in the window, not necessarily the
+       character displayed in the top left corner of the window.  */
     Lisp_Object start;
     /* A marker pointing to where in the text point is in this window,
        used only when the window is not selected.
@@ -222,13 +223,16 @@ struct window
     /* If redisplay in this window goes beyond this buffer position,
        must run the redisplay-end-trigger-hook.  */
     Lisp_Object redisplay_end_trigger;
-    /* Non-nil means don't delete this window for becoming "too small".  */
-    Lisp_Object too_small_ok;
+    /* Non-nil means resizing windows will attempt to resize this window
+       proportionally.  */
+    Lisp_Object resize_proportionally;
 
-    /* Original window height and top before mini-window was
-       enlarged. */
+    /* Original window height and top before mini-window was enlarged. */
     Lisp_Object orig_total_lines, orig_top_line;
 
+    /* An alist with parameteres.  */
+    Lisp_Object window_parameters;
+
     /* No Lisp data may follow below this point without changing
        mark_object in alloc.c.  The member current_matrix must be the
        first non-Lisp member.  */
@@ -279,6 +283,11 @@ struct window
        Currently only used for menu bar windows of frames.  */
     unsigned pseudo_window_p : 1;
 
+    /* 1 means the window start of this window is frozen and may not
+       be changed during redisplay.  If point is not in the window,
+       accept that.  */
+    unsigned frozen_window_start_p : 1;
+
     /* Amount by which lines of this window are scrolled in
        y-direction (smooth scrolling).  */
     int vscroll;
@@ -286,11 +295,6 @@ struct window
     /* Z_BYTE - the buffer position of the last glyph in the current matrix
        of W.  Only valid if WINDOW_END_VALID is not nil.  */
     int window_end_bytepos;
-
-    /* 1 means the window start of this window is frozen and may not
-       be changed during redisplay.  If point is not in the window,
-       accept that.  */
-    unsigned frozen_window_start_p : 1;
 };
 
 /* 1 if W is a minibuffer window.  */
@@ -337,20 +341,18 @@ struct window
 #define WINDOW_FRAME_LINE_HEIGHT(W) \
   (FRAME_LINE_HEIGHT (WINDOW_XFRAME ((W))))
 
-
-/* Return the frame width in canonical column units.
+/* Return the width of window W in canonical column units.
    This includes scroll bars and fringes.  */
 
 #define WINDOW_TOTAL_COLS(W) \
   (XFASTINT ((W)->total_cols))
 
-/* Return the frame height in canonical line units.
+/* Return the height of window W in canonical line units.
    This includes header and mode lines, if any.  */
 
 #define WINDOW_TOTAL_LINES(W) \
   (XFASTINT ((W)->total_lines))
 
-
 /* Return the total pixel width of window W.  */
 
 #define WINDOW_TOTAL_WIDTH(W) \
@@ -401,18 +403,32 @@ struct window
   (FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W)) \
    + WINDOW_RIGHT_EDGE_COL (W) * WINDOW_FRAME_COLUMN_WIDTH (W))
 
+/* 1 if W is a menu bar window.  */
+
+#define WINDOW_MENU_BAR_P(W) \
+  (WINDOWP (WINDOW_XFRAME (W)->menu_bar_window) \
+   && (W) == XWINDOW (WINDOW_XFRAME (W)->menu_bar_window))
+
+/* 1 if W is a tool bar window.  */
+
+#define WINDOW_TOOL_BAR_P(W) \
+  (WINDOWP (WINDOW_XFRAME (W)->tool_bar_window) \
+   && (W) == XWINDOW (WINDOW_XFRAME (W)->tool_bar_window))
+
 /* Return the frame y-position at which window W starts.
    This includes a header line, if any.  */
 
 #define WINDOW_TOP_EDGE_Y(W) \
-  (FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W)) \
+  (((WINDOW_MENU_BAR_P (W) || WINDOW_TOOL_BAR_P (W)) \
+    ? 0 : FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W))) \
    + WINDOW_TOP_EDGE_LINE (W) * WINDOW_FRAME_LINE_HEIGHT (W))
 
 /* Return the frame y-position before which window W ends.
    This includes a mode line, if any.  */
 
 #define WINDOW_BOTTOM_EDGE_Y(W) \
-  (FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W)) \
+  (((WINDOW_MENU_BAR_P (W) || WINDOW_TOOL_BAR_P (W)) \
+    ? 0 : FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W))) \
    + WINDOW_BOTTOM_EDGE_LINE (W) * WINDOW_FRAME_LINE_HEIGHT (W))
 
 
@@ -761,7 +777,6 @@ extern Lisp_Object Vmouse_event;
 
 EXFUN (Fnext_window, 3);
 EXFUN (Fselect_window, 2);
-EXFUN (Fdisplay_buffer, 3);
 EXFUN (Fset_window_buffer, 3);
 EXFUN (Fset_window_hscroll, 2);
 EXFUN (Fwindow_hscroll, 1);
@@ -770,25 +785,25 @@ EXFUN (Fwindow_vscroll, 2);
 EXFUN (Fset_window_margins, 3);
 EXFUN (Fwindow_live_p, 1);
 EXFUN (Fset_window_point, 2);
-extern Lisp_Object make_window P_ ((void));
-extern void delete_window P_ ((Lisp_Object));
-extern Lisp_Object window_from_coordinates P_ ((struct frame *, int, int,
-                                               enum window_part *,
-                                               int *, int*, int));
+extern Lisp_Object make_window (void);
+extern void delete_window (Lisp_Object);
+extern Lisp_Object window_from_coordinates (struct frame *, int, int,
+                                            enum window_part *,
+                                            int *, int*, int);
 EXFUN (Fwindow_dedicated_p, 1);
-extern int window_height P_ ((Lisp_Object));
-extern int window_width P_ ((Lisp_Object));
+extern int window_height (Lisp_Object);
+extern int window_width (Lisp_Object);
 EXFUN (Fwindow_full_width_p, 1);
-extern void set_window_height P_ ((Lisp_Object, int, int));
-extern void set_window_width P_ ((Lisp_Object, int, int));
-extern void change_window_heights P_ ((Lisp_Object, int));
-extern void delete_all_subwindows P_ ((struct window *));
-extern void freeze_window_starts P_ ((struct frame *, int));
-extern void foreach_window P_ ((struct frame *,
-                               int (* fn) (struct window *, void *),
-                               void *));
-extern void grow_mini_window P_ ((struct window *, int));
-extern void shrink_mini_window P_ ((struct window *));
+extern void set_window_height (Lisp_Object, int, int);
+extern void set_window_width (Lisp_Object, int, int);
+extern void change_window_heights (Lisp_Object, int);
+extern void delete_all_subwindows (struct window *);
+extern void freeze_window_starts (struct frame *, int);
+extern void foreach_window (struct frame *,
+                            int (* fn) (struct window *, void *),
+                            void *);
+extern void grow_mini_window (struct window *, int);
+extern void shrink_mini_window (struct window *);
 
 void run_window_configuration_change_hook (struct frame *f);
 
@@ -796,8 +811,8 @@ void run_window_configuration_change_hook (struct frame *f);
    means it's allowed to run hooks.  See make_frame for a case where
    it's not allowed.  */
 
-void set_window_buffer P_ ((Lisp_Object window, Lisp_Object buffer,
-                           int run_hooks_p, int keep_margins_p));
+void set_window_buffer (Lisp_Object window, Lisp_Object buffer,
+                        int run_hooks_p, int keep_margins_p);
 
 /* Prompt to display in front of the minibuffer contents.  */
 
@@ -847,13 +862,13 @@ extern int buffer_shared;
 /* If *ROWS or *COLS are too small a size for FRAME, set them to the
    minimum allowable size.  */
 
-extern void check_frame_size P_ ((struct frame *frame, int *rows, int *cols));
+extern void check_frame_size (struct frame *frame, int *rows, int *cols);
 
 /* Return a pointer to the glyph W's physical cursor is on.  Value is
    null if W's current matrix is invalid, so that no meaningfull glyph
    can be returned.  */
 
-struct glyph *get_phys_cursor_glyph P_ ((struct window *w));
+struct glyph *get_phys_cursor_glyph (struct window *w);
 
 /* Value is non-zero if WINDOW is a live window.  */
 
@@ -876,24 +891,24 @@ EXFUN (Fsave_window_excursion, UNEVALLED);
 EXFUN (Fsplit_window, 3);
 EXFUN (Fset_window_configuration, 1);
 EXFUN (Fcurrent_window_configuration, 1);
-extern int compare_window_configurations P_ ((Lisp_Object, Lisp_Object, int));
+extern int compare_window_configurations (Lisp_Object, Lisp_Object, int);
 EXFUN (Fcoordinates_in_window_p, 2);
 EXFUN (Fwindow_at, 3);
 EXFUN (Fpos_visible_in_window_p, 3);
-extern void mark_window_cursors_off P_ ((struct window *));
-extern int window_internal_height P_ ((struct window *));
-extern int window_internal_width P_ ((struct window *));
+extern void mark_window_cursors_off (struct window *);
+extern int window_internal_height (struct window *);
+extern int window_internal_width (struct window *);
 EXFUN (Frecenter, 1);
 EXFUN (Fscroll_other_window, 1);
 EXFUN (Fset_window_start, 3);
-extern void temp_output_buffer_show P_ ((Lisp_Object));
-extern void replace_buffer_in_all_windows P_ ((Lisp_Object));
-extern void init_window_once P_ ((void));
-extern void init_window P_ ((void));
-extern void syms_of_window P_ ((void));
-extern void keys_of_window P_ ((void));
-
-extern int window_box_text_cols P_ ((struct window *w));
+extern void temp_output_buffer_show (Lisp_Object);
+extern void replace_buffer_in_all_windows (Lisp_Object);
+extern void init_window_once (void);
+extern void init_window (void);
+extern void syms_of_window (void);
+extern void keys_of_window (void);
+
+extern int window_box_text_cols (struct window *w);
 
 #endif /* not WINDOW_H_INCLUDED */