comparison src/w32console.c @ 51206:22a5614b558f

Make (few) trivial substitutions for renamed and new macros in dispextern.h, frame.h and window.h.
author Kim F. Storm <storm@cua.dk>
date Sat, 24 May 2003 22:07:03 +0000
parents f9447a2e045c
children 695cf19ef79e
comparison
equal deleted inserted replaced
51205:e53316f7017e 51206:22a5614b558f
119 void 119 void
120 clear_to_end (void) 120 clear_to_end (void)
121 { 121 {
122 struct frame * f = PICK_FRAME (); 122 struct frame * f = PICK_FRAME ();
123 123
124 clear_end_of_line (FRAME_WIDTH (f) - 1); 124 clear_end_of_line (FRAME_COLS (f) - 1);
125 ins_del_lines (cursor_coords.Y, FRAME_HEIGHT (f) - cursor_coords.Y - 1); 125 ins_del_lines (cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1);
126 } 126 }
127 127
128 /* Clear the frame. */ 128 /* Clear the frame. */
129 void 129 void
130 clear_frame (void) 130 clear_frame (void)
136 CONSOLE_SCREEN_BUFFER_INFO info; 136 CONSOLE_SCREEN_BUFFER_INFO info;
137 137
138 GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &info); 138 GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &info);
139 139
140 /* Remember that the screen buffer might be wider than the window. */ 140 /* Remember that the screen buffer might be wider than the window. */
141 n = FRAME_HEIGHT (f) * info.dwSize.X; 141 n = FRAME_LINES (f) * info.dwSize.X;
142 dest.X = dest.Y = 0; 142 dest.X = dest.Y = 0;
143 143
144 FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r); 144 FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r);
145 FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r); 145 FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r);
146 146
178 struct frame * f = PICK_FRAME (); 178 struct frame * f = PICK_FRAME ();
179 179
180 if (n < 0) 180 if (n < 0)
181 { 181 {
182 scroll.Top = vpos - n; 182 scroll.Top = vpos - n;
183 scroll.Bottom = FRAME_HEIGHT (f); 183 scroll.Bottom = FRAME_LINES (f);
184 dest.Y = vpos; 184 dest.Y = vpos;
185 } 185 }
186 else 186 else
187 { 187 {
188 scroll.Top = vpos; 188 scroll.Top = vpos;
189 scroll.Bottom = FRAME_HEIGHT (f) - n; 189 scroll.Bottom = FRAME_LINES (f) - n;
190 dest.Y = vpos + n; 190 dest.Y = vpos + n;
191 } 191 }
192 scroll.Left = 0; 192 scroll.Left = 0;
193 scroll.Right = FRAME_WIDTH (f); 193 scroll.Right = FRAME_COLS (f);
194 194
195 dest.X = 0; 195 dest.X = 0;
196 196
197 fill.Char.AsciiChar = 0x20; 197 fill.Char.AsciiChar = 0x20;
198 fill.Attributes = char_attr_normal; 198 fill.Attributes = char_attr_normal;
211 if (scroll.Bottom < dest.Y) 211 if (scroll.Bottom < dest.Y)
212 { 212 {
213 for (i = scroll.Bottom; i < dest.Y; i++) 213 for (i = scroll.Bottom; i < dest.Y; i++)
214 { 214 {
215 move_cursor (i, 0); 215 move_cursor (i, 0);
216 clear_end_of_line (FRAME_WIDTH (f)); 216 clear_end_of_line (FRAME_COLS (f));
217 } 217 }
218 } 218 }
219 } 219 }
220 else 220 else
221 { 221 {
224 if (nb < scroll.Top) 224 if (nb < scroll.Top)
225 { 225 {
226 for (i = nb; i < scroll.Top; i++) 226 for (i = nb; i < scroll.Top; i++)
227 { 227 {
228 move_cursor (i, 0); 228 move_cursor (i, 0);
229 clear_end_of_line (FRAME_WIDTH (f)); 229 clear_end_of_line (FRAME_COLS (f));
230 } 230 }
231 } 231 }
232 } 232 }
233 233
234 cursor_coords.X = 0; 234 cursor_coords.X = 0;
254 scroll.Bottom = cursor_coords.Y; 254 scroll.Bottom = cursor_coords.Y;
255 255
256 if (direction == LEFT) 256 if (direction == LEFT)
257 { 257 {
258 scroll.Left = cursor_coords.X + dist; 258 scroll.Left = cursor_coords.X + dist;
259 scroll.Right = FRAME_WIDTH (f) - 1; 259 scroll.Right = FRAME_COLS (f) - 1;
260 } 260 }
261 else 261 else
262 { 262 {
263 scroll.Left = cursor_coords.X; 263 scroll.Left = cursor_coords.X;
264 scroll.Right = FRAME_WIDTH (f) - dist - 1; 264 scroll.Right = FRAME_COLS (f) - dist - 1;
265 } 265 }
266 266
267 dest.X = cursor_coords.X; 267 dest.X = cursor_coords.X;
268 dest.Y = cursor_coords.Y; 268 dest.Y = cursor_coords.Y;
269 269
659 meta_key = 1; 659 meta_key = 1;
660 char_attr_normal = info.wAttributes; 660 char_attr_normal = info.wAttributes;
661 661
662 if (w32_use_full_screen_buffer) 662 if (w32_use_full_screen_buffer)
663 { 663 {
664 FRAME_HEIGHT (SELECTED_FRAME ()) = info.dwSize.Y; /* lines per page */ 664 FRAME_LINES (SELECTED_FRAME ()) = info.dwSize.Y; /* lines per page */
665 SET_FRAME_WIDTH (SELECTED_FRAME (), info.dwSize.X); /* characters per line */ 665 SET_FRAME_COLS (SELECTED_FRAME (), info.dwSize.X); /* characters per line */
666 } 666 }
667 else 667 else
668 { 668 {
669 /* Lines per page. Use buffer coords instead of buffer size. */ 669 /* Lines per page. Use buffer coords instead of buffer size. */
670 FRAME_HEIGHT (SELECTED_FRAME ()) = 1 + info.srWindow.Bottom - 670 FRAME_LINES (SELECTED_FRAME ()) = 1 + info.srWindow.Bottom -
671 info.srWindow.Top; 671 info.srWindow.Top;
672 /* Characters per line. Use buffer coords instead of buffer size. */ 672 /* Characters per line. Use buffer coords instead of buffer size. */
673 SET_FRAME_WIDTH (SELECTED_FRAME (), 1 + info.srWindow.Right - 673 SET_FRAME_COLS (SELECTED_FRAME (), 1 + info.srWindow.Right -
674 info.srWindow.Left); 674 info.srWindow.Left);
675 } 675 }
676 676
677 /* Setup w32_display_info structure for this frame. */ 677 /* Setup w32_display_info structure for this frame. */
678 678