… | |
… | |
111 | * width : 1 <= width |
111 | * width : 1 <= width |
112 | * height : 1 <= height |
112 | * height : 1 <= height |
113 | * ncol : 1 <= ncol <= MAX(int16_t) |
113 | * ncol : 1 <= ncol <= MAX(int16_t) |
114 | * nrow : 1 <= nrow <= MAX(int16_t) |
114 | * nrow : 1 <= nrow <= MAX(int16_t) |
115 | * saveLines : 0 <= saveLines <= MAX(int16_t) |
115 | * saveLines : 0 <= saveLines <= MAX(int16_t) |
|
|
116 | * nlines : nrow + saveLines |
116 | * nsaved : 0 <= nscrolled <= saveLines |
117 | * nsaved : 0 <= nsaved <= saveLines |
117 | * term_start: 0 <= term_start < saveLines |
118 | * term_start: 0 <= term_start < saveLines |
118 | * view_start: 0 <= view_start < saveLines |
119 | * view_start: 0 <= view_start < saveLines |
119 | */ |
120 | */ |
120 | |
121 | |
121 | struct TermWin_t { |
122 | struct TermWin_t { |
… | |
… | |
131 | int mapped; /* window state mapped? */ |
132 | int mapped; /* window state mapped? */ |
132 | int int_bwidth; /* internal border width */ |
133 | int int_bwidth; /* internal border width */ |
133 | int ext_bwidth; /* external border width */ |
134 | int ext_bwidth; /* external border width */ |
134 | int lineSpace; /* number of extra pixels between rows */ |
135 | int lineSpace; /* number of extra pixels between rows */ |
135 | int saveLines; /* number of lines that fit in scrollback */ |
136 | int saveLines; /* number of lines that fit in scrollback */ |
|
|
137 | int total_rows; /* total number of rows in this terminal */ |
136 | int nsaved; /* number of line actually scrolled */ |
138 | int nsaved; /* number of rows saved to scrollback */ |
137 | int nscrolled; /*D*///TODO remove |
|
|
138 | int term_start; /* term lines start here */ |
139 | int term_start; /* term lines start here */ |
139 | int view_start; /* scrollback view starts here */ |
140 | int view_start; /* scrollback view starts here */ |
140 | Window parent[6]; /* parent identifiers - we're parent[0] */ |
141 | Window parent[6]; /* parent identifiers - we're parent[0] */ |
141 | Window vt; /* vt100 window */ |
142 | Window vt; /* vt100 window */ |
142 | GC gc; /* GC for drawing */ |
143 | GC gc; /* GC for drawing */ |
… | |
… | |
163 | * clicks: 1, 2 or 3 clicks - 4 indicates a special condition of 1 where |
164 | * clicks: 1, 2 or 3 clicks - 4 indicates a special condition of 1 where |
164 | * nothing is selected |
165 | * nothing is selected |
165 | * beg: row/column of beginning of selection : never past mark |
166 | * beg: row/column of beginning of selection : never past mark |
166 | * mark: row/column of initial click : never past end |
167 | * mark: row/column of initial click : never past end |
167 | * end: row/column of one character past end of selection |
168 | * end: row/column of one character past end of selection |
168 | * * Note: -nscrolled <= beg.row <= mark.row <= end.row < nrow |
169 | * * Note: -nsaved <= beg.row <= mark.row <= end.row < nrow |
169 | * * Note: col == -1 ==> we're left of screen |
170 | * * Note: col == -1 ==> we're left of screen |
170 | * |
171 | * |
171 | * Layout of text/rend information in the screen_t text/rend structures: |
172 | * Layout of text/rend information in the screen_t text/rend structures: |
172 | * Rows [0] ... [saveLines - 1] |
173 | * Rows [0] ... [saveLines - 1] |
173 | * scrollback region : we're only here if view_start != 0 |
174 | * scrollback region : we're only here if view_start != 0 |
174 | * Rows [saveLines] ... [saveLines + nrow - 1] |
175 | * Rows [saveLines] ... [saveLines + nrow - 1] |
175 | * normal `unscrolled' screen region |
176 | * normal `unsaved' screen region |
176 | */ |
177 | */ |
177 | typedef struct { |
178 | typedef struct { |
178 | line_t **line; |
179 | line_t **line; |
179 | |
180 | |
180 | row_col_t cur; /* cursor position on the screen */ |
181 | row_col_t cur; /* cursor position on the screen */ |