home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / e20313sr.zip / emacs / 20.3.1 / src / dispextern.h < prev    next >
C/C++ Source or Header  |  1999-07-31  |  9KB  |  256 lines

  1. /* Interface definitions for display code.
  2.    Copyright (C) 1985, 1993, 1994 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, Inc., 59 Temple Place - Suite 330,
  19. Boston, MA 02111-1307, USA.  */
  20.  
  21. /* Modified for emx by Jeremy Bowen, May 1999 based on patches
  22.    to v19.33 by Eberhard Mattes */
  23.  
  24. #ifndef _DISPEXTERN_H_
  25. #define _DISPEXTERN_H_
  26.  
  27. /* Nonzero means last display completed and cursor is really at
  28.    cursX, cursY.  Zero means it was preempted. */
  29. extern int display_completed;
  30.  
  31. #ifdef HAVE_X_WINDOWS
  32. #ifndef HAVE_PM
  33. #include <X11/Xlib.h>
  34. #else /* HAVE_PM */
  35. #include "pmlib.h"
  36. #endif /* HAVE_PM */
  37.  
  38. #endif
  39.  
  40. #ifdef MSDOS
  41. #include "msdos.h"
  42. #endif
  43.  
  44. #ifdef HAVE_NTGUI
  45. #include "w32gui.h"
  46. #endif
  47.  
  48. #ifdef HAVE_FACES
  49. struct face
  50.   {
  51.     /* If this is non-zero, it is a GC we can use without modification
  52.        to represent this face.  Used only for ASCII characters.  */
  53.     GC gc;
  54.  
  55.     /* GC used for non-ASCII characters.  */
  56.     GC non_ascii_gc;
  57.  
  58.     /* Pixel value for foreground color.  */
  59.     EMACS_UINT foreground;
  60.   
  61.     /* Pixel value for background color.  */
  62.     EMACS_UINT background;
  63.   
  64.     /* Font used for this face.  If any fontset is set for this face,
  65.        this points to a `font' slot of the struct `font_info' for an
  66.        ASCII font of the fontset.  In that case, we should not call
  67.        XFreeFont on it because the font may still be used somewhere
  68.        else.  */
  69.     XFontStruct *font;
  70.  
  71.     /* Fontset ID if any fontset is set for this face, else -1.  */
  72.     int fontset;
  73.   
  74.     /* Background stipple or bitmap used for this face.  */
  75.     Pixmap stipple;
  76.  
  77.     /* Pixmap_depth.  */
  78.     unsigned int pixmap_w, pixmap_h;
  79.   
  80.     /* Whether or not to underline text in this face.  */
  81.     char underline;
  82.   };
  83.  
  84. /* Let's stop using this and get rid of it.  */
  85. typedef struct face *FACE;
  86.  
  87. #define NORMAL_FACE ((struct face *) 0)
  88.  
  89. #define FACE_HAS_GC(f) ((f)->gc)
  90. #define FACE_GC(f) ((f)->gc)
  91. #define FACE_NON_ASCII_GC(f) ((f)->non_ascii_gc)
  92. #define FACE_FOREGROUND(f) ((f)->foreground)
  93. #define FACE_BACKGROUND(f) ((f)->background)
  94. #define FACE_FONT(f) ((f)->font)
  95. #define FACE_FONTSET(f) ((f)->fontset)
  96. #define FACE_STIPPLE(f) ((f)->stipple)
  97. #define FACE_UNDERLINE_P(f) ((f)->underline)
  98.  
  99. #else /* not HAVE_FACES */
  100.  
  101. typedef int FACE;
  102.  
  103. #define NORMAL_FACE 0x0
  104. #define HIGHLIGHT_FACE 0x1
  105. #define UNDERLINE_FACE 0x2
  106. #define HIGHLIGHT_UNDERLINE_FACE 0x3
  107.  
  108. #define FACE_HIGHLIGHT(f) ((f) & 0x1)
  109. #define FACE_UNDERLINE(f) ((f) & 0x2)
  110.  
  111. #endif /* not HAVE_FACES */
  112.  
  113.  
  114. /* This structure is used for the actual display of text on a frame.
  115.  
  116.    There are two instantiations of it:  the glyphs currently displayed,
  117.    and the glyphs we desire to display.  The latter object is generated
  118.    from buffers being displayed.  */
  119.  
  120. struct frame_glyphs
  121.   {
  122.     struct  frame *frame;    /* Frame these glyphs belong to.  */
  123.     int height;
  124.     int width;
  125.  
  126.     /* Contents of the frame.
  127.        glyphs[V][H] is the glyph at position V, H.
  128.        Note that glyphs[V][-1],
  129.                  glyphs[V][used[V]],
  130.          and glyphs[V][frame_width] are always '\0'.  */
  131.     GLYPH **glyphs;
  132.     /* long vector from which the strings in `glyphs' are taken.  */
  133.     GLYPH *total_contents;
  134.  
  135.     /* When representing a desired frame,
  136.          enable[n] == 0 means that line n is same as current frame.
  137.      Between updates, all lines should be disabled.
  138.        When representing current frame contents,
  139.          enable[n] == 0 means that line n is blank.  */
  140.     char *enable;
  141.  
  142.     /* Everything on line n after column used[n] is considered blank.  */
  143.     int *used;
  144.  
  145.     /* highlight[n] != 0 iff line n is highlighted.  */
  146.     char *highlight;
  147.  
  148.     /* Buffer offset of this line's first char.
  149.        This is not really implemented, and cannot be,
  150.        and should be deleted.  */
  151.     int   *bufp;
  152.  
  153. #ifdef HAVE_WINDOW_SYSTEM
  154.     /* Pixel position of top left corner of line.  */
  155.     short *top_left_x;
  156.     short *top_left_y;
  157.  
  158.     /* Pixel width of line.  */
  159.     short *pix_width;
  160.  
  161.     /* Pixel height of line.  */
  162.     short *pix_height;
  163.  
  164.     /* Largest font ascent on this line.  */
  165.     short *max_ascent;
  166. #endif    /* HAVE_WINDOW_SYSTEM */
  167.  
  168.     /* Mapping of coordinate pairs to buffer positions.
  169.        This field holds a vector indexed by row number.
  170.        Its elements are vectors indexed by column number.
  171.        Each element of these vectors is a buffer position, 0, or -1.
  172.  
  173.        For a column where the image of a text character starts,
  174.        the element value is the buffer position of that character.
  175.        When a window's screen line starts in mid character,
  176.        the element for the line's first column (at the window's left margin)
  177.        is that character's position.
  178.        For successive columns within a multicolumn character,
  179.        the element is -1.
  180.        For the column just beyond the last glyph on a line,
  181.        the element is the buffer position of the end of the line.
  182.        For following columns within the same window, the element is 0.
  183.        For rows past the end of the accessible buffer text,
  184.        the window's first column has ZV and other columns have 0.
  185.  
  186.        Mode lines and vertical separator lines have 0.
  187.  
  188.        The column of a window's left margin
  189.        always has a positive value (a buffer position), not 0 or -1,
  190.        for each line in that window's interior.  */
  191.  
  192.     int **charstarts;
  193.  
  194.     /* This holds all the space in the subvectors of the charstarts field.  */
  195.     int *total_charstarts;
  196.   };
  197.  
  198. extern void redraw_frame P_ ((struct frame *));
  199. extern void redraw_garbaged_frames P_ ((void));
  200. extern void free_frame_glyphs P_ ((struct frame *, struct frame_glyphs *));
  201. extern void remake_frame_glyphs P_ ((struct frame *));
  202. extern void cancel_line P_ ((int, struct frame *));
  203. extern void clear_frame_records P_ ((struct frame *));
  204. extern void init_desired_glyphs P_ ((struct frame *));
  205. extern void get_display_line P_ ((struct frame *, int, int));
  206. extern int scroll_frame_lines P_ ((struct frame *, int, int, int, int));
  207. extern void preserve_other_columns P_ ((struct window *));
  208. extern void adjust_window_charstarts P_ ((struct window *, int, int));
  209. extern void verify_charstarts P_ ((struct window *));
  210. extern void cancel_my_columns P_ ((struct window *));
  211. extern int direct_output_for_insert P_ ((int));
  212. extern int direct_output_forward_char P_ ((int));
  213. extern int update_frame P_ ((struct frame *, int, int));
  214. extern void quit_error_check P_ ((void));
  215. extern int scrolling P_ ((struct frame *));
  216. extern int buffer_posn_from_coords P_ ((struct window *, int, int));
  217. extern void do_pending_window_change P_ ((void));
  218. extern void change_frame_size P_ ((struct frame *, int, int, int, int));
  219. extern void bitch_at_user P_ ((void));
  220.  
  221. /* Defined in term.c */
  222. extern void ring_bell P_ ((void));
  223. extern void set_terminal_modes P_ ((void));
  224. extern void reset_terminal_modes P_ ((void));
  225. extern void update_begin P_ ((struct frame *));
  226. extern void update_end P_ ((struct frame *));
  227. extern void set_terminal_window P_ ((int));
  228. extern void set_scroll_region P_ ((int, int));
  229. extern void turn_off_insert P_ ((void));
  230. extern void turn_off_highlight P_ ((void));
  231. extern void background_highlight P_ ((void));
  232. extern void reassert_line_highlight P_ ((int, int));
  233. extern void change_line_highlight P_ ((int, int, int));
  234. extern void cursor_to P_ ((int, int));
  235. extern void clear_frame P_ ((void));
  236. extern void clear_end_of_line P_ ((int));
  237. extern void clear_end_of_line_raw P_ ((int));
  238. extern void write_glyphs P_ ((GLYPH *, int));
  239. extern void insert_glyphs P_ ((GLYPH *, int));
  240. extern void delete_glyphs P_ ((int));
  241. extern void ins_del_lines P_ ((int, int));
  242. extern int string_cost P_ ((char *));
  243. extern int per_line_cost P_ ((char *));
  244. extern void calculate_costs P_ ((struct frame *));
  245. extern void term_init P_ ((char *));
  246. extern void fatal P_ ((/* char *, ... */));
  247.  
  248. /* Defined in scroll.c */
  249. extern int scrolling_max_lines_saved P_ ((int, int, int *, int *, int *));
  250. extern int scroll_cost P_ ((struct frame *, int, int, int));
  251. extern void do_line_insertion_deletion_costs P_ ((struct frame *, char *,
  252.                           char *, char *, char *,
  253.                           char *, char *, int));
  254.  
  255. #endif /* not _DISPEXTERN_H_ */
  256.