home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / AP / JED / JED097-1.TAR / jed / src / screen.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-12  |  3.7 KB  |  117 lines

  1. #ifndef _JED_SCREEN_H_
  2. #define _JED_SCREEN_H_
  3. /*
  4.  *  Copyright (c) 1992, 1994 John E. Davis  (davis@amy.tch.harvard.edu)
  5.  *  All Rights Reserved.
  6.  */
  7. #include "window.h"
  8.  
  9. /* JED screen management routines */
  10.  
  11. /* Description: JED maintains a list of Lines which contain a pointer
  12.    to the line in the buffer as well as a flag which describes the line
  13.    as being changed, etc.. since the last update.
  14.  
  15.    The buffer is changed only through the insertion or deletion of a
  16.    character.  This can have two effects:  1) It changes a single line leaving
  17.    other lines on the display untouched, or 2) It deletes/adds a newline
  18.    character which changes the current line and acuses the other lines to
  19.    scroll.  Hence, the insert/delete routines will have to inform the display
  20.    code of these changes.
  21.  
  22.    Finally there are situations when the buffer has not changed but the screen
  23.    has.  This occurs when the cursor is in motion such as page up and down. For
  24.    this situation, the screen routines will check to see if it can scroll one
  25.    or two lines to bring the line back into view and if not it will scroll
  26.    enough to recenter.
  27.  
  28.    Once the display code takes over it does the following:
  29.  
  30.    1)  Scrolls to try to bring the point into view.
  31.    2)  Then it does a final touch up of the screen.
  32.  
  33.    Note that if one fails, we just simply redraw the window.  This is more
  34.    efficient then looking at the lines and doing a true screen update like
  35.    emacs does.  Hopefully this will not be a complete loss.  I suspect it
  36.    will win most of the time.
  37.  
  38. */
  39.  
  40. typedef struct Screen_Type
  41.   {
  42.       Line *line;               /* buffer line structure */
  43.       int n;                    /* number of chars written last time */
  44.       int flags;                /* line untouched, etc... */
  45.      unsigned short *old, *neew;
  46.      unsigned char *hi0, *hi1;           /* beg end of hilights */
  47.   }
  48. Screen_Type;
  49.  
  50. #define JNORMAL_COLOR 0
  51. #define JCURSOR_COLOR 1
  52. #define JSTATUS_COLOR 2
  53. #define JREGION_COLOR 3
  54. #define JMENU_COLOR 4
  55. #define JOP_COLOR 5
  56. #define JNUM_COLOR 6
  57. #define JSTR_COLOR 7
  58. #define JCOM_COLOR 8
  59. #define JKEY_COLOR 9
  60. #define JDELIM_COLOR 10
  61. #define JPREPROC_COLOR 11
  62. #define JMAX_COLORS 12
  63.  
  64.  
  65. #ifndef pc_system
  66. #define MAX_SCREEN_SIZE 120
  67. #else
  68. #define MAX_SCREEN_SIZE 75
  69. #endif
  70.  
  71. extern Screen_Type JScreen[MAX_SCREEN_SIZE];
  72.  
  73. extern int Screen_Row;               /* cursor row */
  74. extern int Screen_Col;               /* cursor col */
  75. extern int Cursor_Motion;           /* cursor movement only */
  76. extern int Display_Eight_Bit;           /* if non zero, pass to terminal as is */
  77.  
  78. extern int redraw(void);
  79. extern void recenter(int *);
  80. extern int window_line(void);
  81. extern void scroll_down(int, int, int);
  82. extern int scroll_up(int, int, int);
  83.  
  84. extern void update(Line *, int, int);
  85. extern void init_display(int);
  86. extern void point_cursor(int);
  87. extern void point_column(int);
  88. extern int calculate_column(void);
  89.  
  90. extern void register_change(int);
  91. extern void touch_window(void);
  92. extern void blank_line(int);
  93. extern void reset_display(void);
  94. extern int cursor_visible(void);
  95. extern Line *find_top(void);
  96. extern void do_dialog(char *);
  97. extern void jed_fillmem(char *, char, int);
  98. extern int Goal_Column;
  99. extern int User_Prefers_Line_Numbers;
  100. extern int Wants_Attributes;
  101. extern int Term_Supports_Color;
  102. extern int Wants_Syntax_Highlight;
  103. extern int Display_Time;
  104. extern int Want_Eob;
  105. extern void set_status_format(char *, int *);
  106.  
  107. extern void init_syntax_highlight (void);
  108. extern void syntax_highlight(unsigned short *, unsigned short *);
  109. extern int Mode_Has_Syntax_Highlight;
  110. extern int JED_CSI;
  111. extern int Wants_HScroll;
  112. extern int Mini_Ghost;
  113. extern void redraw_screen(int);
  114. extern void define_top_screen_line(char *);
  115. #endif
  116. /* #ifdef _JED_SCREEN_H_ */
  117.