Remove the win_type parameter from tui_gen_win_info::reset
[deliverable/binutils-gdb.git] / gdb / tui / tui-layout.c
1 /* TUI layout window management.
2
3 Copyright (C) 1998-2019 Free Software Foundation, Inc.
4
5 Contributed by Hewlett-Packard Company.
6
7 This file is part of GDB.
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21
22 #include "defs.h"
23 #include "arch-utils.h"
24 #include "command.h"
25 #include "symtab.h"
26 #include "frame.h"
27 #include "source.h"
28 #include <ctype.h>
29
30 #include "tui/tui.h"
31 #include "tui/tui-data.h"
32 #include "tui/tui-windata.h"
33 #include "tui/tui-wingeneral.h"
34 #include "tui/tui-stack.h"
35 #include "tui/tui-regs.h"
36 #include "tui/tui-win.h"
37 #include "tui/tui-winsource.h"
38 #include "tui/tui-disasm.h"
39 #include "tui/tui-layout.h"
40 #include "gdb_curses.h"
41
42 /*******************************
43 ** Static Local Decls
44 ********************************/
45 static void show_layout (enum tui_layout_type);
46 static void reset_locator (tui_gen_win_info *,
47 int, int, int, int);
48 static void show_source_or_disasm_and_command (enum tui_layout_type);
49 static struct tui_win_info *make_command_window (int, int);
50 static struct tui_win_info *make_source_window (int, int);
51 static struct tui_win_info *make_disasm_window (int, int);
52 static void show_source_command (void);
53 static void show_disasm_command (void);
54 static void show_source_disasm_command (void);
55 static void show_data (enum tui_layout_type);
56 static enum tui_layout_type next_layout (void);
57 static enum tui_layout_type prev_layout (void);
58 static void tui_layout_command (const char *, int);
59 static void extract_display_start_addr (struct gdbarch **, CORE_ADDR *);
60
61
62 /***************************************
63 ** DEFINITIONS
64 ***************************************/
65
66 #define LAYOUT_USAGE "Usage: layout prev | next | <layout_name> \n"
67
68 /* Show the screen layout defined. */
69 static void
70 show_layout (enum tui_layout_type layout)
71 {
72 enum tui_layout_type cur_layout = tui_current_layout ();
73
74 if (layout != cur_layout)
75 {
76 /* Since the new layout may cause changes in window size, we
77 should free the content and reallocate on next display of
78 source/asm. */
79 tui_clear_source_windows ();
80 if (layout == SRC_DATA_COMMAND
81 || layout == DISASSEM_DATA_COMMAND)
82 {
83 show_data (layout);
84 tui_refresh_all ();
85 }
86 else
87 {
88 /* First make the current layout be invisible. */
89 tui_make_all_invisible ();
90 tui_make_invisible (tui_locator_win_info_ptr ());
91
92 switch (layout)
93 {
94 /* Now show the new layout. */
95 case SRC_COMMAND:
96 show_source_command ();
97 tui_add_to_source_windows (TUI_SRC_WIN);
98 break;
99 case DISASSEM_COMMAND:
100 show_disasm_command ();
101 tui_add_to_source_windows (TUI_DISASM_WIN);
102 break;
103 case SRC_DISASSEM_COMMAND:
104 show_source_disasm_command ();
105 tui_add_to_source_windows (TUI_SRC_WIN);
106 tui_add_to_source_windows (TUI_DISASM_WIN);
107 break;
108 default:
109 break;
110 }
111 }
112 }
113 }
114
115
116 /* Function to set the layout to SRC_COMMAND, DISASSEM_COMMAND,
117 SRC_DISASSEM_COMMAND, SRC_DATA_COMMAND, or DISASSEM_DATA_COMMAND. */
118 enum tui_status
119 tui_set_layout (enum tui_layout_type layout_type)
120 {
121 enum tui_status status = TUI_SUCCESS;
122
123 if (layout_type != UNDEFINED_LAYOUT)
124 {
125 enum tui_layout_type cur_layout = tui_current_layout ();
126 struct gdbarch *gdbarch;
127 CORE_ADDR addr;
128 struct tui_win_info *win_with_focus = tui_win_with_focus ();
129 struct tui_layout_def *layout_def = tui_layout_def ();
130
131 extract_display_start_addr (&gdbarch, &addr);
132
133 enum tui_layout_type new_layout = layout_type;
134
135 if (new_layout != cur_layout)
136 {
137 show_layout (new_layout);
138
139 /* Now determine where focus should be. */
140 if (win_with_focus != TUI_CMD_WIN)
141 {
142 switch (new_layout)
143 {
144 case SRC_COMMAND:
145 tui_set_win_focus_to (TUI_SRC_WIN);
146 layout_def->display_mode = SRC_WIN;
147 break;
148 case DISASSEM_COMMAND:
149 /* The previous layout was not showing code.
150 This can happen if there is no source
151 available:
152
153 1. if the source file is in another dir OR
154 2. if target was compiled without -g
155 We still want to show the assembly though! */
156
157 tui_get_begin_asm_address (&gdbarch, &addr);
158 tui_set_win_focus_to (TUI_DISASM_WIN);
159 layout_def->display_mode = DISASSEM_WIN;
160 break;
161 case SRC_DISASSEM_COMMAND:
162 /* The previous layout was not showing code.
163 This can happen if there is no source
164 available:
165
166 1. if the source file is in another dir OR
167 2. if target was compiled without -g
168 We still want to show the assembly though! */
169
170 tui_get_begin_asm_address (&gdbarch, &addr);
171 if (win_with_focus == TUI_SRC_WIN)
172 tui_set_win_focus_to (TUI_SRC_WIN);
173 else
174 tui_set_win_focus_to (TUI_DISASM_WIN);
175 break;
176 case SRC_DATA_COMMAND:
177 if (win_with_focus != TUI_DATA_WIN)
178 tui_set_win_focus_to (TUI_SRC_WIN);
179 else
180 tui_set_win_focus_to (TUI_DATA_WIN);
181 layout_def->display_mode = SRC_WIN;
182 break;
183 case DISASSEM_DATA_COMMAND:
184 /* The previous layout was not showing code.
185 This can happen if there is no source
186 available:
187
188 1. if the source file is in another dir OR
189 2. if target was compiled without -g
190 We still want to show the assembly though! */
191
192 tui_get_begin_asm_address (&gdbarch, &addr);
193 if (win_with_focus != TUI_DATA_WIN)
194 tui_set_win_focus_to (TUI_DISASM_WIN);
195 else
196 tui_set_win_focus_to (TUI_DATA_WIN);
197 layout_def->display_mode = DISASSEM_WIN;
198 break;
199 default:
200 break;
201 }
202 }
203 /*
204 * Now update the window content.
205 */
206 tui_update_source_windows_with_addr (gdbarch, addr);
207 if (new_layout == SRC_DATA_COMMAND
208 || new_layout == DISASSEM_DATA_COMMAND)
209 tui_show_registers (TUI_DATA_WIN->current_group);
210 }
211 }
212 else
213 status = TUI_FAILURE;
214
215 return status;
216 }
217
218 /* Add the specified window to the layout in a logical way. This
219 means setting up the most logical layout given the window to be
220 added. */
221 void
222 tui_add_win_to_layout (enum tui_win_type type)
223 {
224 enum tui_layout_type cur_layout = tui_current_layout ();
225
226 switch (type)
227 {
228 case SRC_WIN:
229 if (cur_layout != SRC_COMMAND
230 && cur_layout != SRC_DISASSEM_COMMAND
231 && cur_layout != SRC_DATA_COMMAND)
232 {
233 tui_clear_source_windows_detail ();
234 if (cur_layout == DISASSEM_DATA_COMMAND)
235 show_layout (SRC_DATA_COMMAND);
236 else
237 show_layout (SRC_COMMAND);
238 }
239 break;
240 case DISASSEM_WIN:
241 if (cur_layout != DISASSEM_COMMAND
242 && cur_layout != SRC_DISASSEM_COMMAND
243 && cur_layout != DISASSEM_DATA_COMMAND)
244 {
245 tui_clear_source_windows_detail ();
246 if (cur_layout == SRC_DATA_COMMAND)
247 show_layout (DISASSEM_DATA_COMMAND);
248 else
249 show_layout (DISASSEM_COMMAND);
250 }
251 break;
252 case DATA_WIN:
253 if (cur_layout != SRC_DATA_COMMAND
254 && cur_layout != DISASSEM_DATA_COMMAND)
255 {
256 if (cur_layout == DISASSEM_COMMAND)
257 show_layout (DISASSEM_DATA_COMMAND);
258 else
259 show_layout (SRC_DATA_COMMAND);
260 }
261 break;
262 default:
263 break;
264 }
265 }
266
267
268 /* Answer the height of a window. If it hasn't been created yet,
269 answer what the height of a window would be based upon its type and
270 the layout. */
271 int
272 tui_default_win_height (enum tui_win_type type,
273 enum tui_layout_type layout)
274 {
275 int h;
276
277 if (tui_win_list[type] != NULL)
278 h = tui_win_list[type]->height;
279 else
280 {
281 switch (layout)
282 {
283 case SRC_COMMAND:
284 case DISASSEM_COMMAND:
285 if (TUI_CMD_WIN == NULL)
286 h = tui_term_height () / 2;
287 else
288 h = tui_term_height () - TUI_CMD_WIN->height;
289 break;
290 case SRC_DISASSEM_COMMAND:
291 case SRC_DATA_COMMAND:
292 case DISASSEM_DATA_COMMAND:
293 if (TUI_CMD_WIN == NULL)
294 h = tui_term_height () / 3;
295 else
296 h = (tui_term_height () - TUI_CMD_WIN->height) / 2;
297 break;
298 default:
299 h = 0;
300 break;
301 }
302 }
303
304 return h;
305 }
306
307
308 /* Answer the height of a window. If it hasn't been created yet,
309 answer what the height of a window would be based upon its type and
310 the layout. */
311 int
312 tui_default_win_viewport_height (enum tui_win_type type,
313 enum tui_layout_type layout)
314 {
315 int h;
316
317 h = tui_default_win_height (type, layout);
318
319 if (tui_win_list[type] == TUI_CMD_WIN)
320 h -= 1;
321 else
322 h -= 2;
323
324 return h;
325 }
326
327 /* Complete possible layout names. TEXT is the complete text entered so
328 far, WORD is the word currently being completed. */
329
330 static void
331 layout_completer (struct cmd_list_element *ignore,
332 completion_tracker &tracker,
333 const char *text, const char *word)
334 {
335 static const char *layout_names [] =
336 { "src", "asm", "split", "regs", "next", "prev", NULL };
337
338 complete_on_enum (tracker, layout_names, text, word);
339 }
340
341 /* Function to initialize gdb commands, for tui window layout
342 manipulation. */
343
344 void
345 _initialize_tui_layout (void)
346 {
347 struct cmd_list_element *cmd;
348
349 cmd = add_com ("layout", class_tui, tui_layout_command, _("\
350 Change the layout of windows.\n\
351 Usage: layout prev | next | LAYOUT-NAME\n\
352 Layout names are:\n\
353 src : Displays source and command windows.\n\
354 asm : Displays disassembly and command windows.\n\
355 split : Displays source, disassembly and command windows.\n\
356 regs : Displays register window. If existing layout\n\
357 is source/command or assembly/command, the \n\
358 register window is displayed. If the\n\
359 source/assembly/command (split) is displayed, \n\
360 the register window is displayed with \n\
361 the window that has current logical focus."));
362 set_cmd_completer (cmd, layout_completer);
363 }
364
365
366 /*************************
367 ** STATIC LOCAL FUNCTIONS
368 **************************/
369
370
371 /* Function to set the layout to SRC, ASM, SPLIT, NEXT, PREV, DATA, or
372 REGS. */
373 enum tui_status
374 tui_set_layout_by_name (const char *layout_name)
375 {
376 enum tui_status status = TUI_SUCCESS;
377
378 if (layout_name != NULL)
379 {
380 int i;
381 enum tui_layout_type new_layout = UNDEFINED_LAYOUT;
382 enum tui_layout_type cur_layout = tui_current_layout ();
383
384 std::string copy = layout_name;
385 for (i = 0; i < copy.size (); i++)
386 copy[i] = toupper (copy[i]);
387 const char *buf_ptr = copy.c_str ();
388
389 /* First check for ambiguous input. */
390 if (strlen (buf_ptr) <= 1 && *buf_ptr == 'S')
391 {
392 warning (_("Ambiguous command input."));
393 status = TUI_FAILURE;
394 }
395 else
396 {
397 if (subset_compare (buf_ptr, "SRC"))
398 new_layout = SRC_COMMAND;
399 else if (subset_compare (buf_ptr, "ASM"))
400 new_layout = DISASSEM_COMMAND;
401 else if (subset_compare (buf_ptr, "SPLIT"))
402 new_layout = SRC_DISASSEM_COMMAND;
403 else if (subset_compare (buf_ptr, "REGS"))
404 {
405 if (cur_layout == SRC_COMMAND
406 || cur_layout == SRC_DATA_COMMAND)
407 new_layout = SRC_DATA_COMMAND;
408 else
409 new_layout = DISASSEM_DATA_COMMAND;
410 }
411 else if (subset_compare (buf_ptr, "NEXT"))
412 new_layout = next_layout ();
413 else if (subset_compare (buf_ptr, "PREV"))
414 new_layout = prev_layout ();
415 else
416 status = TUI_FAILURE;
417
418 if (status == TUI_SUCCESS)
419 {
420 /* Make sure the curses mode is enabled. */
421 tui_enable ();
422 tui_set_layout (new_layout);
423 }
424 }
425 }
426 else
427 status = TUI_FAILURE;
428
429 return status;
430 }
431
432
433 static void
434 extract_display_start_addr (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p)
435 {
436 enum tui_layout_type cur_layout = tui_current_layout ();
437 struct gdbarch *gdbarch = get_current_arch ();
438 CORE_ADDR addr;
439 CORE_ADDR pc;
440 struct symtab_and_line cursal = get_current_source_symtab_and_line ();
441
442 switch (cur_layout)
443 {
444 case SRC_COMMAND:
445 case SRC_DATA_COMMAND:
446 gdbarch = TUI_SRC_WIN->gdbarch;
447 find_line_pc (cursal.symtab,
448 TUI_SRC_WIN->start_line_or_addr.u.line_no,
449 &pc);
450 addr = pc;
451 break;
452 case DISASSEM_COMMAND:
453 case SRC_DISASSEM_COMMAND:
454 case DISASSEM_DATA_COMMAND:
455 gdbarch = TUI_DISASM_WIN->gdbarch;
456 addr = TUI_DISASM_WIN->start_line_or_addr.u.addr;
457 break;
458 default:
459 addr = 0;
460 break;
461 }
462
463 *gdbarch_p = gdbarch;
464 *addr_p = addr;
465 }
466
467
468 static void
469 tui_layout_command (const char *arg, int from_tty)
470 {
471 /* Switch to the selected layout. */
472 if (tui_set_layout_by_name (arg) != TUI_SUCCESS)
473 warning (_("Invalid layout specified.\n%s"), LAYOUT_USAGE);
474 }
475
476 /* Answer the previous layout to cycle to. */
477 static enum tui_layout_type
478 next_layout (void)
479 {
480 int new_layout;
481
482 new_layout = tui_current_layout ();
483 if (new_layout == UNDEFINED_LAYOUT)
484 new_layout = SRC_COMMAND;
485 else
486 {
487 new_layout++;
488 if (new_layout == UNDEFINED_LAYOUT)
489 new_layout = SRC_COMMAND;
490 }
491
492 return (enum tui_layout_type) new_layout;
493 }
494
495
496 /* Answer the next layout to cycle to. */
497 static enum tui_layout_type
498 prev_layout (void)
499 {
500 int new_layout;
501
502 new_layout = tui_current_layout ();
503 if (new_layout == SRC_COMMAND)
504 new_layout = DISASSEM_DATA_COMMAND;
505 else
506 {
507 new_layout--;
508 if (new_layout == UNDEFINED_LAYOUT)
509 new_layout = DISASSEM_DATA_COMMAND;
510 }
511
512 return (enum tui_layout_type) new_layout;
513 }
514
515
516
517 static struct tui_win_info *
518 make_command_window (int height, int origin_y)
519 {
520 struct tui_win_info *result = new tui_cmd_window ();
521 result->reset (height, tui_term_width (), 0, origin_y);
522 tui_make_window (result, DONT_BOX_WINDOW);
523 return result;
524 }
525
526
527 /* make_source_window().
528 */
529 static struct tui_win_info *
530 make_source_window (int height, int origin_y)
531 {
532 tui_win_info *result = new tui_source_window ();
533 result->reset (height, tui_term_width (), 0, origin_y);
534 result->make_visible (true);
535 return result;
536 }
537
538
539 /* make_disasm_window().
540 */
541 static struct tui_win_info *
542 make_disasm_window (int height, int origin_y)
543 {
544 tui_win_info *result = new tui_disasm_window ();
545 result->reset (height, tui_term_width (), 0, origin_y);
546 result->make_visible (true);
547 return result;
548 }
549
550
551 static tui_win_info *
552 make_data_window (int height, int origin_y)
553 {
554 tui_win_info *result = new tui_data_window ();
555 result->reset (height, tui_term_width (), 0, origin_y);
556 result->make_visible (true);
557 return result;
558 }
559
560
561
562 /* Show the Source/Command layout. */
563 static void
564 show_source_command (void)
565 {
566 show_source_or_disasm_and_command (SRC_COMMAND);
567 }
568
569
570 /* Show the Dissassem/Command layout. */
571 static void
572 show_disasm_command (void)
573 {
574 show_source_or_disasm_and_command (DISASSEM_COMMAND);
575 }
576
577
578 /* Show the Source/Disassem/Command layout. */
579 static void
580 show_source_disasm_command (void)
581 {
582 if (tui_current_layout () != SRC_DISASSEM_COMMAND)
583 {
584 int cmd_height, src_height, asm_height;
585
586 if (TUI_CMD_WIN != NULL)
587 cmd_height = TUI_CMD_WIN->height;
588 else
589 cmd_height = tui_term_height () / 3;
590
591 src_height = (tui_term_height () - cmd_height) / 2;
592 asm_height = tui_term_height () - (src_height + cmd_height);
593
594 if (TUI_SRC_WIN == NULL)
595 tui_win_list[SRC_WIN] = make_source_window (src_height, 0);
596 else
597 {
598 TUI_SRC_WIN->reset (src_height,
599 tui_term_width (),
600 0,
601 0);
602 tui_make_visible (TUI_SRC_WIN);
603 TUI_SRC_WIN->m_has_locator = false;
604 }
605
606 struct tui_locator_window *locator = tui_locator_win_info_ptr ();
607 gdb_assert (locator != nullptr);
608
609 tui_show_source_content (TUI_SRC_WIN);
610 if (TUI_DISASM_WIN == NULL)
611 {
612 tui_win_list[DISASSEM_WIN]
613 = make_disasm_window (asm_height, src_height - 1);
614 reset_locator (locator,
615 2 /* 1 */ ,
616 tui_term_width (),
617 0,
618 (src_height + asm_height) - 1);
619 }
620 else
621 {
622 locator->reset (2 /* 1 */ ,
623 tui_term_width (),
624 0,
625 (src_height + asm_height) - 1);
626 TUI_DISASM_WIN->m_has_locator = true;
627 TUI_DISASM_WIN->reset (asm_height,
628 tui_term_width (),
629 0,
630 src_height - 1);
631 tui_make_visible (TUI_DISASM_WIN);
632 }
633 TUI_SRC_WIN->m_has_locator = false;
634 TUI_DISASM_WIN->m_has_locator = true;
635 tui_make_visible (locator);
636 tui_show_locator_content ();
637 tui_show_source_content (TUI_DISASM_WIN);
638
639 if (TUI_CMD_WIN == NULL)
640 tui_win_list[CMD_WIN]
641 = make_command_window (cmd_height, tui_term_height () - cmd_height);
642 else
643 {
644 TUI_CMD_WIN->reset (TUI_CMD_WIN->height,
645 TUI_CMD_WIN->width,
646 0,
647 TUI_CMD_WIN->origin.y);
648 tui_make_visible (TUI_CMD_WIN);
649 }
650 tui_set_current_layout_to (SRC_DISASSEM_COMMAND);
651 }
652 }
653
654
655 /* Show the Source/Data/Command or the Dissassembly/Data/Command
656 layout. */
657 static void
658 show_data (enum tui_layout_type new_layout)
659 {
660 int total_height = (tui_term_height () - TUI_CMD_WIN->height);
661 int src_height, data_height;
662 enum tui_win_type win_type;
663
664 struct tui_locator_window *locator = tui_locator_win_info_ptr ();
665 gdb_assert (locator != nullptr);
666
667 data_height = total_height / 2;
668 src_height = total_height - data_height;
669 tui_make_all_invisible ();
670 tui_make_invisible (locator);
671 if (tui_win_list[DATA_WIN] == nullptr)
672 tui_win_list[DATA_WIN] = make_data_window (data_height, 0);
673 else
674 tui_win_list[DATA_WIN]->reset (data_height, tui_term_width (), 0, 0);
675 tui_win_list[DATA_WIN]->make_visible (true);
676
677 if (new_layout == SRC_DATA_COMMAND)
678 win_type = SRC_WIN;
679 else
680 win_type = DISASSEM_WIN;
681
682 tui_source_window_base *base;
683 if (tui_win_list[win_type] == NULL)
684 {
685 if (win_type == SRC_WIN)
686 tui_win_list[win_type]
687 = make_source_window (src_height, data_height - 1);
688 else
689 tui_win_list[win_type]
690 = make_disasm_window (src_height, data_height - 1);
691 reset_locator (locator,
692 2 /* 1 */ ,
693 tui_term_width (),
694 0,
695 total_height - 1);
696 base = (tui_source_window_base *) tui_win_list[win_type];
697 }
698 else
699 {
700 base = (tui_source_window_base *) tui_win_list[win_type];
701 tui_win_list[win_type]->reset (src_height,
702 tui_term_width (),
703 0,
704 data_height - 1);
705 tui_make_visible (tui_win_list[win_type]);
706 locator->reset (2 /* 1 */ ,
707 tui_term_width (),
708 0,
709 total_height - 1);
710 }
711 base->m_has_locator = true;
712 tui_make_visible (locator);
713 tui_show_locator_content ();
714 tui_add_to_source_windows
715 ((tui_source_window_base *) tui_win_list[win_type]);
716 tui_set_current_layout_to (new_layout);
717 }
718
719 void
720 tui_gen_win_info::reset (int height_, int width_,
721 int origin_x_, int origin_y_)
722 {
723 int h = height_;
724
725 width = width_;
726 height = h;
727 if (h > 1)
728 {
729 viewport_height = h - 1;
730 if (type != CMD_WIN)
731 viewport_height--;
732 }
733 else
734 viewport_height = 1;
735 origin.x = origin_x_;
736 origin.y = origin_y_;
737 }
738
739 static void
740 reset_locator (tui_gen_win_info *win_info,
741 int height, int width,
742 int origin_x, int origin_y)
743 {
744 win_info->reset (height, width, origin_x, origin_y);
745 tui_make_window (win_info, DONT_BOX_WINDOW);
746 }
747
748
749 /* Show the Source/Command or the Disassem layout. */
750 static void
751 show_source_or_disasm_and_command (enum tui_layout_type layout_type)
752 {
753 if (tui_current_layout () != layout_type)
754 {
755 struct tui_win_info **win_info_ptr;
756 int src_height, cmd_height;
757 struct tui_locator_window *locator = tui_locator_win_info_ptr ();
758 gdb_assert (locator != nullptr);
759
760 if (TUI_CMD_WIN != NULL)
761 cmd_height = TUI_CMD_WIN->height;
762 else
763 cmd_height = tui_term_height () / 3;
764 src_height = tui_term_height () - cmd_height;
765
766 if (layout_type == SRC_COMMAND)
767 win_info_ptr = &tui_win_list[SRC_WIN];
768 else
769 win_info_ptr = &tui_win_list[DISASSEM_WIN];
770
771 tui_source_window_base *base;
772 if ((*win_info_ptr) == NULL)
773 {
774 if (layout_type == SRC_COMMAND)
775 *win_info_ptr = make_source_window (src_height - 1, 0);
776 else
777 *win_info_ptr = make_disasm_window (src_height - 1, 0);
778 reset_locator (locator,
779 2 /* 1 */ ,
780 tui_term_width (),
781 0,
782 src_height - 1);
783 base = (tui_source_window_base *) *win_info_ptr;
784 }
785 else
786 {
787 base = (tui_source_window_base *) *win_info_ptr;
788 locator->reset (2 /* 1 */ ,
789 tui_term_width (),
790 0,
791 src_height - 1);
792 base->m_has_locator = true;
793 (*win_info_ptr)->reset (src_height - 1,
794 tui_term_width (),
795 0,
796 0);
797 tui_make_visible (*win_info_ptr);
798 }
799
800 base->m_has_locator = true;
801 tui_make_visible (locator);
802 tui_show_locator_content ();
803 tui_show_source_content (base);
804
805 if (TUI_CMD_WIN == NULL)
806 {
807 tui_win_list[CMD_WIN] = make_command_window (cmd_height,
808 src_height);
809 }
810 else
811 {
812 TUI_CMD_WIN->reset (TUI_CMD_WIN->height,
813 TUI_CMD_WIN->width,
814 TUI_CMD_WIN->origin.x,
815 TUI_CMD_WIN->origin.y);
816 tui_make_visible (TUI_CMD_WIN);
817 }
818 tui_set_current_layout_to (layout_type);
819 }
820 }
This page took 0.154336 seconds and 5 git commands to generate.