Home | History | Annotate | Download | only in tui

Lines Matching refs:layout

1 /* TUI layout window management.
37 #include "tui/tui-layout.h"
45 /* The layout that is currently applied. */
48 /* The "skeleton" version of the layout that is currently applied. */
59 /* See tui-layout.h. */
78 /* This should always be made visible by a layout. */
102 /* See tui-layout. */
110 /* See tui-layout. */
118 /* Set the current layout to LAYOUT. */
121 tui_set_layout (tui_layout_split *layout)
127 applied_skeleton = layout;
128 applied_layout = layout->clone ();
137 /* See tui-layout.h. */
159 /* Find LAYOUT in the "layouts" global and return its index. */
162 find_layout (tui_layout_split *layout)
166 if (layout == layouts[i].get ())
169 gdb_assert_not_reached ("layout not found!?");
172 /* Function to set the layout. */
177 tui_layout_split *layout = (tui_layout_split *) command->context ();
181 tui_set_layout (layout);
184 /* See tui-layout.h. */
196 /* Implement the "layout next" command. */
205 /* See tui-layout.h. */
213 /* Implement the "layout prev" command. */
227 /* See tui-layout.h. */
241 /* Implement the "layout regs" command. */
250 /* See tui-layout.h. */
322 /* See tui-layout.h. */
372 /* See tui-layout.h. */
407 /* See tui-layout.h. */
416 /* See tui-layout.h. */
437 /* See tui-layout.h. */
464 /* See tui-layout.h. */
473 /* See tui-layout.h. */
482 /* See tui-layout.h. */
498 /* See tui-layout.h. */
506 /* See tui-layout.h. */
517 /* See tui-layout.h. */
520 tui_layout_split::add_split (std::unique_ptr<tui_layout_split> &&layout,
523 split s = {weight, std::move (layout)};
527 /* See tui-layout.h. */
537 /* See tui-layout.h. */
545 std::unique_ptr<tui_layout_base> next = item.layout->clone ();
552 /* See tui-layout.h. */
565 item.layout->get_sizes (height, &new_min, &new_max);
585 /* See tui-layout.h. */
592 return m_splits[0].layout->first_edge_has_border_p ();
595 /* See tui-layout.h. */
602 return m_splits.back ().layout->last_edge_has_border_p ();
605 /* See tui-layout.h. */
612 = m_vertical ? m_splits[i].layout->height : m_splits[i].layout->width;
615 /* See tui-layout.h. */
632 /* See tui-layout.h. */
647 /* See tui-layout.h. */
657 /* Look through the children. If one is a layout holding the named
665 adjusted = m_splits[i].layout->set_width (name, new_size);
667 adjusted = m_splits[i].layout->set_height (name, new_size);
682 ? m_splits[found_index].layout->width
683 : m_splits[found_index].layout->height);
713 m_splits[index].layout->get_sizes (m_vertical, &new_min, &new_max);
756 /* Simply re-apply the updated layout. We pass false here so that
766 /* See tui-layout.h. */
808 /* Step 1: Find the min and max size of each sub-layout.
823 m_splits[i].layout->get_sizes (m_vertical, &info[i].min_size,
828 && m_splits[i].layout->get_name () != nullptr
829 && strcmp (m_splits[i].layout->get_name (), "cmd") == 0)
835 /* If this layout has never been applied, then it means the
836 user just changed the layout. In this situation, it's
857 && m_splits[prev].layout->last_edge_has_border_p ()
858 && m_splits[i].layout->first_edge_has_border_p ())
885 /* Step 2: Compute the size of each sub-layout. Fixed-sized items
927 non-fixed size sub-layout.
931 this layout (see below). */
952 around the loop, hopefully, this will allow the layout to be
962 more space than is available. This layout is not going to
1028 m_splits[i].layout->apply (x, y + size_accum, width, info[i].size,
1031 m_splits[i].layout->apply (x + size_accum, y, info[i].size, height,
1037 /* See tui-layout.h. */
1044 const char *this_name = m_splits[i].layout->get_name ();
1046 m_splits[i].layout->remove_windows (name);
1061 /* See tui-layout.h. */
1067 item.layout->replace_window (name, new_window);
1070 /* See tui-layout.h. */
1087 item.layout->specification (output, depth + 1);
1095 /* See tui-layout.h. */
1102 std::string fp = item.layout->layout_fingerprint ();
1110 /* Destroy the layout associated with SELF. */
1115 tui_layout_split *layout = (tui_layout_split *) context;
1116 size_t index = find_layout (layout);
1120 /* List holding the sub-commands of "layout". */
1124 /* Called to implement 'tui layout'. */
1129 help_list (layout_list, "tui layout ", all_commands, gdb_stdout);
1132 /* Add a "layout" command with name NAME that switches to LAYOUT. */
1135 add_layout_command (const char *name, tui_layout_split *layout)
1140 layout->specification (&spec, 0);
1143 = xstrprintf (_("Apply the \"%s\" layout.\n\
1144 This layout was created using:\n\
1145 tui new-layout %s %s"),
1149 cmd->set_context (layout);
1155 layouts.emplace_back (layout);
1165 tui_layout_split *layout;
1167 layout = new tui_layout_split ();
1168 layout->add_window (SRC_NAME, 2);
1169 layout->add_window (STATUS_NAME, 0);
1170 layout->add_window (CMD_NAME, 1);
1171 add_layout_command (SRC_NAME, layout);
1173 layout = new tui_layout_split ();
1174 layout->add_window (DISASSEM_NAME, 2);
1175 layout->add_window (STATUS_NAME, 0);
1176 layout->add_window (CMD_NAME, 1);
1177 add_layout_command (DISASSEM_NAME, layout);
1179 layout = new tui_layout_split ();
1180 layout->add_window (SRC_NAME, 1);
1181 layout->add_window (DISASSEM_NAME, 1);
1182 layout->add_window (STATUS_NAME, 0);
1183 layout->add_window (CMD_NAME, 1);
1184 add_layout_command ("split", layout);
1186 layout = new tui_layout_split ();
1187 layout->add_window (DATA_NAME, 1);
1188 layout->add_window (SRC_NAME, 1);
1189 layout->add_window (STATUS_NAME, 0);
1190 layout->add_window (CMD_NAME, 1);
1191 layouts.emplace_back (layout);
1192 src_regs_layout = layout;
1194 layout = new tui_layout_split ();
1195 layout->add_window (DATA_NAME, 1);
1196 layout->add_window (DISASSEM_NAME, 1);
1197 layout->add_window (STATUS_NAME, 0);
1198 layout->add_window (CMD_NAME, 1);
1199 layouts.emplace_back (layout);
1200 asm_regs_layout = layout;
1216 /* Implementation of the "tui new-layout" command. */
1223 error (_("No layout name specified"));
1225 error (_("Layout name cannot start with '-'"));
1258 error (_("Extra '}' in layout specification"));
1268 error (_("Window \"%s\" seen twice in layout"), name.c_str ());
1288 error (_("Missing '}' in layout specification"));
1290 error (_("New layout does not contain any windows"));
1292 error (_("New layout does not contain the \"" CMD_NAME "\" window"));
1304 /* Function to initialize gdb commands, for tui window layout
1312 = add_prefix_cmd ("layout", class_tui, tui_layout_command, _("\
1313 Change the layout of windows.\n\
1314 Usage: tui layout prev | next | LAYOUT-NAME"),
1316 add_com_alias ("layout", layout_cmd, class_tui, 0);
1319 _("Apply the next TUI layout."),
1322 _("Apply the previous TUI layout."),
1325 _("Apply the TUI register layout."),
1328 add_cmd ("new-layout", class_tui, tui_new_layout_command,
1329 _("Create a new TUI layout.\n\
1330 Usage: tui new-layout [-horizontal] NAME WINDOW WEIGHT [WINDOW WEIGHT]...\n\
1331 Create a new TUI layout. The new layout will be named NAME,\n\
1332 and can be accessed using \"layout NAME\".\n\