Derive tui_win_info from tui_gen_win_info
authorTom Tromey <tom@tromey.com>
Sun, 16 Jun 2019 22:03:54 +0000 (16:03 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 25 Jun 2019 13:48:37 +0000 (07:48 -0600)
This changes tui_win_info to derive from tui_gen_win_info, rather than
having a tui_gen_win_info as a member.  This removes a layer of member
access from the entire TUI, which is why this patch is so large.  This
change will enable further removal of switches based on window type.

gdb/ChangeLog
2019-06-25  Tom Tromey  <tom@tromey.com>

* tui/tui.c (tui_rl_other_window, tui_enable)
(tui_is_window_visible, tui_get_command_dimension): Update.
* tui/tui-winsource.c (tui_update_source_window_as_is)
(tui_clear_source_content, tui_erase_source_content)
(tui_show_source_line, tui_source_window_base::refill)
(tui_source_window_base::do_scroll_horizontal)
(tui_source_window_base::set_is_exec_point_at)
(tui_update_breakpoint_info, tui_set_exec_info_content)
(tui_alloc_source_buffer, tui_line_is_displayed)
(tui_addr_is_displayed): Update.
* tui/tui-wingeneral.c (tui_unhighlight_win, tui_highlight_win)
(tui_check_and_display_highlight_if_needed)
(tui_win_info::make_visible, tui_win_info::refresh)
(tui_refresh_all): Update.
* tui/tui-windata.c (tui_first_data_item_displayed)
(tui_delete_data_content_windows, tui_erase_data_content)
(tui_display_all_data, tui_data_window::refresh_all)
(tui_check_data_values): Update.
* tui/tui-win.c (window_name_completer, tui_update_gdb_sizes)
(tui_set_win_focus_to, tui_win_info::forward_scroll)
(tui_win_info::backward_scroll, tui_refresh_all_win)
(tui_resize_all, tui_set_focus, tui_all_windows_info)
(update_tab_width, tui_set_win_height, tui_adjust_win_heights)
(tui_source_window_base::set_new_height)
(tui_data_window::set_new_height)
(make_invisible_and_set_new_height)
(make_visible_with_new_height, new_height_ok)
(parse_scrolling_args): Update.
* tui/tui-stack.c (tui_show_frame_info): Update.
* tui/tui-source.c (tui_set_source_content)
(tui_set_source_content_nil, tui_source_is_displayed)
(tui_source_window::do_scroll_vertical): Update.
* tui/tui-regs.c (tui_show_registers, tui_show_register_group)
(tui_display_registers_from, tui_display_reg_element_at_line)
(tui_check_register_values, tui_reg_command): Update.
* tui/tui-layout.c (tui_default_win_height)
(show_source_disasm_command, show_data, init_and_make_win)
(show_source_or_disasm_and_command): Update.
* tui/tui-io.c (update_cmdwin_start_line, tui_putc, tui_puts)
(tui_redisplay_readline, tui_mld_flush)
(tui_mld_erase_entire_line, tui_mld_getc, tui_cont_sig)
(tui_getc): Update.
* tui/tui-disasm.c (tui_set_disassem_content)
(tui_disasm_window::do_scroll_vertical): Update.
* tui/tui-data.h (struct tui_gen_win_info) <~tui_gen_win_info>:
Now virtual.
(struct tui_win_info): Derive from tui_gen_win_info.
<~tui_win_info>: Mark as override.
<generic>: Remove member.
* tui/tui-data.c (tui_cmd_window::clear_detail, tui_next_win)
(tui_prev_win, tui_partial_win_by_name, tui_win_info)
(~tui_data_window, ~tui_win_info)
(tui_free_all_source_wins_content): Update.
* tui/tui-command.c (tui_refresh_cmd_win): Update.

15 files changed:
gdb/ChangeLog
gdb/tui/tui-command.c
gdb/tui/tui-data.c
gdb/tui/tui-data.h
gdb/tui/tui-disasm.c
gdb/tui/tui-io.c
gdb/tui/tui-layout.c
gdb/tui/tui-regs.c
gdb/tui/tui-source.c
gdb/tui/tui-stack.c
gdb/tui/tui-win.c
gdb/tui/tui-windata.c
gdb/tui/tui-wingeneral.c
gdb/tui/tui-winsource.c
gdb/tui/tui.c

index 79a018aa7ef11e6f44bad20ba16536a8300e2cc7..41b7de392d5b8da6945d712d59c5088cb263d8ef 100644 (file)
@@ -1,3 +1,60 @@
+2019-06-25  Tom Tromey  <tom@tromey.com>
+
+       * tui/tui.c (tui_rl_other_window, tui_enable)
+       (tui_is_window_visible, tui_get_command_dimension): Update.
+       * tui/tui-winsource.c (tui_update_source_window_as_is)
+       (tui_clear_source_content, tui_erase_source_content)
+       (tui_show_source_line, tui_source_window_base::refill)
+       (tui_source_window_base::do_scroll_horizontal)
+       (tui_source_window_base::set_is_exec_point_at)
+       (tui_update_breakpoint_info, tui_set_exec_info_content)
+       (tui_alloc_source_buffer, tui_line_is_displayed)
+       (tui_addr_is_displayed): Update.
+       * tui/tui-wingeneral.c (tui_unhighlight_win, tui_highlight_win)
+       (tui_check_and_display_highlight_if_needed)
+       (tui_win_info::make_visible, tui_win_info::refresh)
+       (tui_refresh_all): Update.
+       * tui/tui-windata.c (tui_first_data_item_displayed)
+       (tui_delete_data_content_windows, tui_erase_data_content)
+       (tui_display_all_data, tui_data_window::refresh_all)
+       (tui_check_data_values): Update.
+       * tui/tui-win.c (window_name_completer, tui_update_gdb_sizes)
+       (tui_set_win_focus_to, tui_win_info::forward_scroll)
+       (tui_win_info::backward_scroll, tui_refresh_all_win)
+       (tui_resize_all, tui_set_focus, tui_all_windows_info)
+       (update_tab_width, tui_set_win_height, tui_adjust_win_heights)
+       (tui_source_window_base::set_new_height)
+       (tui_data_window::set_new_height)
+       (make_invisible_and_set_new_height)
+       (make_visible_with_new_height, new_height_ok)
+       (parse_scrolling_args): Update.
+       * tui/tui-stack.c (tui_show_frame_info): Update.
+       * tui/tui-source.c (tui_set_source_content)
+       (tui_set_source_content_nil, tui_source_is_displayed)
+       (tui_source_window::do_scroll_vertical): Update.
+       * tui/tui-regs.c (tui_show_registers, tui_show_register_group)
+       (tui_display_registers_from, tui_display_reg_element_at_line)
+       (tui_check_register_values, tui_reg_command): Update.
+       * tui/tui-layout.c (tui_default_win_height)
+       (show_source_disasm_command, show_data, init_and_make_win)
+       (show_source_or_disasm_and_command): Update.
+       * tui/tui-io.c (update_cmdwin_start_line, tui_putc, tui_puts)
+       (tui_redisplay_readline, tui_mld_flush)
+       (tui_mld_erase_entire_line, tui_mld_getc, tui_cont_sig)
+       (tui_getc): Update.
+       * tui/tui-disasm.c (tui_set_disassem_content)
+       (tui_disasm_window::do_scroll_vertical): Update.
+       * tui/tui-data.h (struct tui_gen_win_info) <~tui_gen_win_info>:
+       Now virtual.
+       (struct tui_win_info): Derive from tui_gen_win_info.
+       <~tui_win_info>: Mark as override.
+       <generic>: Remove member.
+       * tui/tui-data.c (tui_cmd_window::clear_detail, tui_next_win)
+       (tui_prev_win, tui_partial_win_by_name, tui_win_info)
+       (~tui_data_window, ~tui_win_info)
+       (tui_free_all_source_wins_content): Update.
+       * tui/tui-command.c (tui_refresh_cmd_win): Update.
+
 2019-06-25  Tom Tromey  <tom@tromey.com>
 
        * tui/tui-layout.c (init_and_make_win): Use new.
index 9603b3cfdcace496a8a1aef4ca4ec61d5c621194..259620f7ce7a1f05f894c88a7453713a0da1a5dd 100644 (file)
@@ -94,7 +94,7 @@ tui_dispatch_ctrl_char (unsigned int ch)
 void
 tui_refresh_cmd_win (void)
 {
-  WINDOW *w = TUI_CMD_WIN->generic.handle;
+  WINDOW *w = TUI_CMD_WIN->handle;
 
   wrefresh (w);
 
index 86e347f6a00018510b438cc35d72d7709e11856a..c9f401f3912060bbb7362b6e24a41664fb93a3b9 100644 (file)
@@ -169,7 +169,7 @@ tui_source_window_base::clear_detail ()
 void
 tui_cmd_window::clear_detail ()
 {
-  wmove (generic.handle, 0, 0);
+  wmove (handle, 0, 0);
 }
 
 /* See tui-data.h.  */
@@ -268,17 +268,17 @@ tui_set_current_layout_to (enum tui_layout_type new_layout)
 struct tui_win_info *
 tui_next_win (struct tui_win_info *cur_win)
 {
-  int type = cur_win->generic.type;
+  int type = cur_win->type;
   struct tui_win_info *next_win = NULL;
 
-  if (cur_win->generic.type == CMD_WIN)
+  if (cur_win->type == CMD_WIN)
     type = SRC_WIN;
   else
-    type = cur_win->generic.type + 1;
-  while (type != cur_win->generic.type && (next_win == NULL))
+    type = cur_win->type + 1;
+  while (type != cur_win->type && (next_win == NULL))
     {
       if (tui_win_list[type]
-         && tui_win_list[type]->generic.is_visible)
+         && tui_win_list[type]->is_visible)
        next_win = tui_win_list[type];
       else
        {
@@ -298,17 +298,17 @@ tui_next_win (struct tui_win_info *cur_win)
 struct tui_win_info *
 tui_prev_win (struct tui_win_info *cur_win)
 {
-  int type = cur_win->generic.type;
+  int type = cur_win->type;
   struct tui_win_info *prev = NULL;
 
-  if (cur_win->generic.type == SRC_WIN)
+  if (cur_win->type == SRC_WIN)
     type = CMD_WIN;
   else
-    type = cur_win->generic.type - 1;
-  while (type != cur_win->generic.type && (prev == NULL))
+    type = cur_win->type - 1;
+  while (type != cur_win->type && (prev == NULL))
     {
       if (tui_win_list[type]
-         && tui_win_list[type]->generic.is_visible)
+         && tui_win_list[type]->is_visible)
        prev = tui_win_list[type];
       else
        {
@@ -337,8 +337,7 @@ tui_partial_win_by_name (const char *name)
        {
           if (tui_win_list[i] != 0)
             {
-              const char *cur_name =
-               tui_win_name (&tui_win_list[i]->generic);
+              const char *cur_name = tui_win_name (tui_win_list[i]);
 
               if (strlen (name) <= strlen (cur_name)
                  && startswith (cur_name, name))
@@ -457,7 +456,7 @@ init_content_element (struct tui_win_element *element,
 }
 
 tui_win_info::tui_win_info (enum tui_win_type type)
-  : generic (type)
+  : tui_gen_win_info (type)
 {
 }
 
@@ -569,7 +568,7 @@ tui_source_window_base::~tui_source_window_base ()
 
 tui_data_window::~tui_data_window ()
 {
-  if (generic.content != NULL)
+  if (content != NULL)
     {
       tui_free_data_content (regs_content, regs_content_count);
       regs_content = NULL;
@@ -579,21 +578,21 @@ tui_data_window::~tui_data_window ()
       data_content_count = 0;
       regs_column_count = 1;
       display_regs = false;
-      generic.content = NULL;
-      generic.content_size = 0;
+      content = NULL;
+      content_size = 0;
     }
 }  
 
 tui_win_info::~tui_win_info ()
 {
-  if (generic.handle != NULL)
+  if (handle != NULL)
     {
-      tui_delete_win (generic.handle);
-      generic.handle = NULL;
-      tui_free_win_content (&generic);
+      tui_delete_win (handle);
+      handle = NULL;
+      tui_free_win_content (this);
     }
-  if (generic.title)
-    xfree (generic.title);
+  if (title)
+    xfree (title);
 }
 
 
@@ -602,7 +601,7 @@ tui_free_all_source_wins_content ()
 {
   for (tui_source_window_base *win_info : tui_source_windows ())
     {
-      tui_free_win_content (&(win_info->generic));
+      tui_free_win_content (win_info);
       tui_free_win_content (win_info->execution_info);
     }
 }
index f6aabaaa90aebd8730698b9706d4ae3b60312833..08d388fb8c1c35fa2c5436771608ed3f0ab00d36 100644 (file)
@@ -44,7 +44,7 @@ struct tui_gen_win_info
   {
   }
 
-  ~tui_gen_win_info ()
+  virtual ~tui_gen_win_info ()
   {
   }
 
@@ -246,7 +246,7 @@ struct tui_win_element
 };
 
 /* This defines information about each logical window.  */
-struct tui_win_info
+struct tui_win_info : public tui_gen_win_info
 {
 protected:
 
@@ -265,7 +265,7 @@ protected:
 
 public:
 
-  virtual ~tui_win_info ();
+  ~tui_win_info () override;
 
   /* Clear the pertinent detail in the window.  */
   virtual void clear_detail () = 0;
@@ -311,8 +311,6 @@ public:
   void left_scroll (int num_to_scroll);
   void right_scroll (int num_to_scroll);
 
-  struct tui_gen_win_info generic;     /* General window information.  */
-
   /* Can this window ever be highlighted?  */
   bool can_highlight = false;
 
index 8dd156d09079094e50b5e9ccf6c579bb8d17a752..a9d827f5b7877b0c0a39b90c626d82e0d103f011 100644 (file)
@@ -191,8 +191,8 @@ tui_set_disassem_content (struct gdbarch *gdbarch, CORE_ADDR pc)
   cur_pc = locator->content[0]->which_element.locator.addr;
 
   /* Window size, excluding highlight box.  */
-  max_lines = TUI_DISASM_WIN->generic.height - 2;
-  line_width = TUI_DISASM_WIN->generic.width - 2;
+  max_lines = TUI_DISASM_WIN->height - 2;
+  line_width = TUI_DISASM_WIN->width - 2;
 
   /* Get temporary table that will hold all strings (addr & insn).  */
   asm_lines = XALLOCAVEC (struct tui_asm_line, max_lines);
@@ -228,7 +228,7 @@ tui_set_disassem_content (struct gdbarch *gdbarch, CORE_ADDR pc)
       struct tui_source_element *src;
       int cur_len;
 
-      element = TUI_DISASM_WIN->generic.content[i];
+      element = TUI_DISASM_WIN->content[i];
       src = &element->which_element.source;
       strcpy (line, asm_lines[i].addr_string);
       cur_len = strlen (line);
@@ -257,7 +257,7 @@ tui_set_disassem_content (struct gdbarch *gdbarch, CORE_ADDR pc)
       xfree (asm_lines[i].addr_string);
       xfree (asm_lines[i].insn);
     }
-  TUI_DISASM_WIN->generic.content_size = i;
+  TUI_DISASM_WIN->content_size = i;
   return TUI_SUCCESS;
 }
 
@@ -377,15 +377,12 @@ void
 tui_disasm_window::do_scroll_vertical
   (enum tui_scroll_direction scroll_direction, int num_to_scroll)
 {
-  if (generic.content != NULL)
+  if (content != NULL)
     {
       CORE_ADDR pc;
-      tui_win_content content;
       struct tui_line_or_address val;
       int dir;
 
-      content = generic.content;
-
       pc = content[0]->which_element.source.line_or_addr.u.addr;
       num_to_scroll++;
       dir = (scroll_direction == FORWARD_SCROLL)
index cdb14bf53146f4d2d4c12656db3f3bf3c5b6fb99..56d5974cb35774e8314ef51abd91ecade28fc12a 100644 (file)
@@ -180,7 +180,7 @@ static void
 update_cmdwin_start_line ()
 {
   TUI_CMD_WIN->start_line
-    = getcury (TUI_CMD_WIN->generic.handle);
+    = getcury (TUI_CMD_WIN->handle);
 }
 
 /* Print a character in the curses command window.  The output is
@@ -190,7 +190,7 @@ update_cmdwin_start_line ()
 static void
 tui_putc (char c)
 {
-  WINDOW *w = TUI_CMD_WIN->generic.handle;
+  WINDOW *w = TUI_CMD_WIN->handle;
 
   do_tui_putc (w, c);
   update_cmdwin_start_line ();
@@ -502,7 +502,7 @@ void
 tui_puts (const char *string, WINDOW *w)
 {
   if (w == nullptr)
-    w = TUI_CMD_WIN->generic.handle;
+    w = TUI_CMD_WIN->handle;
   tui_puts_internal (w, string, nullptr);
 }
 
@@ -538,13 +538,13 @@ tui_redisplay_readline (void)
   
   c_pos = -1;
   c_line = -1;
-  w = TUI_CMD_WIN->generic.handle;
+  w = TUI_CMD_WIN->handle;
   start_line = TUI_CMD_WIN->start_line;
   wmove (w, start_line, 0);
   prev_col = 0;
   height = 1;
   if (prompt != nullptr)
-    tui_puts_internal (TUI_CMD_WIN->generic.handle, prompt, &height);
+    tui_puts_internal (TUI_CMD_WIN->handle, prompt, &height);
 
   prev_col = getcurx (w);
   for (in = 0; in <= rl_end; in++)
@@ -663,7 +663,7 @@ tui_mld_puts (const struct match_list_displayer *displayer, const char *s)
 static void
 tui_mld_flush (const struct match_list_displayer *displayer)
 {
-  wrefresh (TUI_CMD_WIN->generic.handle);
+  wrefresh (TUI_CMD_WIN->handle);
 }
 
 /* TUI version of displayer.erase_entire_line.  */
@@ -671,7 +671,7 @@ tui_mld_flush (const struct match_list_displayer *displayer)
 static void
 tui_mld_erase_entire_line (const struct match_list_displayer *displayer)
 {
-  WINDOW *w = TUI_CMD_WIN->generic.handle;
+  WINDOW *w = TUI_CMD_WIN->handle;
   int cur_y = getcury (w);
 
   wmove (w, cur_y, 0);
@@ -709,7 +709,7 @@ gdb_wgetch (WINDOW *win)
 static int
 tui_mld_getc (FILE *fp)
 {
-  WINDOW *w = TUI_CMD_WIN->generic.handle;
+  WINDOW *w = TUI_CMD_WIN->handle;
   int c = gdb_wgetch (w);
 
   return c;
@@ -845,7 +845,7 @@ tui_cont_sig (int sig)
       /* Force a refresh of the screen.  */
       tui_refresh_all_win ();
 
-      wrefresh (TUI_CMD_WIN->generic.handle);
+      wrefresh (TUI_CMD_WIN->handle);
     }
   signal (sig, tui_cont_sig);
 }
@@ -914,7 +914,7 @@ tui_getc (FILE *fp)
   int ch;
   WINDOW *w;
 
-  w = TUI_CMD_WIN->generic.handle;
+  w = TUI_CMD_WIN->handle;
 
 #ifdef TUI_USE_PIPE_FOR_READLINE
   /* Flush readline output.  */
@@ -950,8 +950,8 @@ tui_getc (FILE *fp)
          int px, py;
          getyx (w, py, px);
          px += rl_end - rl_point;
-         py += px / TUI_CMD_WIN->generic.width;
-         px %= TUI_CMD_WIN->generic.width;
+         py += px / TUI_CMD_WIN->width;
+         px %= TUI_CMD_WIN->width;
          wmove (w, py, px);
          tui_putc ('\n');
         }
index 556bef833a3a71942ac1c3e6cd1b2bad42c20ff1..9685d7fc4e5f824c989857892206cb6248c4140e 100644 (file)
@@ -296,7 +296,7 @@ tui_default_win_height (enum tui_win_type type,
   int h;
 
   if (tui_win_list[type] != NULL)
-    h = tui_win_list[type]->generic.height;
+    h = tui_win_list[type]->height;
   else
     {
       switch (layout)
@@ -306,7 +306,7 @@ tui_default_win_height (enum tui_win_type type,
          if (TUI_CMD_WIN == NULL)
            h = tui_term_height () / 2;
          else
-           h = tui_term_height () - TUI_CMD_WIN->generic.height;
+           h = tui_term_height () - TUI_CMD_WIN->height;
          break;
        case SRC_DISASSEM_COMMAND:
        case SRC_DATA_COMMAND:
@@ -314,7 +314,7 @@ tui_default_win_height (enum tui_win_type type,
          if (TUI_CMD_WIN == NULL)
            h = tui_term_height () / 3;
          else
-           h = (tui_term_height () - TUI_CMD_WIN->generic.height) / 2;
+           h = (tui_term_height () - TUI_CMD_WIN->height) / 2;
          break;
        default:
          h = 0;
@@ -610,7 +610,7 @@ show_source_disasm_command (void)
       int cmd_height, src_height, asm_height;
 
       if (TUI_CMD_WIN != NULL)
-       cmd_height = TUI_CMD_WIN->generic.height;
+       cmd_height = TUI_CMD_WIN->height;
       else
        cmd_height = tui_term_height () / 3;
 
@@ -621,10 +621,10 @@ show_source_disasm_command (void)
        tui_win_list[SRC_WIN] = make_source_window (src_height, 0);
       else
        {
-         init_gen_win_info (&TUI_SRC_WIN->generic,
-                            TUI_SRC_WIN->generic.type,
+         init_gen_win_info (TUI_SRC_WIN,
+                            TUI_SRC_WIN->type,
                             src_height,
-                            TUI_SRC_WIN->generic.width,
+                            TUI_SRC_WIN->width,
                             TUI_SRC_WIN->execution_info->width,
                             0);
          TUI_SRC_WIN->can_highlight = true;
@@ -634,7 +634,7 @@ show_source_disasm_command (void)
                             3,
                             0,
                             0);
-         tui_make_visible (&TUI_SRC_WIN->generic);
+         tui_make_visible (TUI_SRC_WIN);
          tui_make_visible (TUI_SRC_WIN->execution_info);
          TUI_SRC_WIN->m_has_locator = false;
        }
@@ -665,10 +665,10 @@ show_source_disasm_command (void)
                             0,
                             (src_height + asm_height) - 1);
          TUI_DISASM_WIN->m_has_locator = true;
-         init_gen_win_info (&TUI_DISASM_WIN->generic,
-                            TUI_DISASM_WIN->generic.type,
+         init_gen_win_info (TUI_DISASM_WIN,
+                            TUI_DISASM_WIN->type,
                             asm_height,
-                            TUI_DISASM_WIN->generic.width,
+                            TUI_DISASM_WIN->width,
                             TUI_DISASM_WIN->execution_info->width,
                             src_height - 1);
          init_gen_win_info (TUI_DISASM_WIN->execution_info,
@@ -678,7 +678,7 @@ show_source_disasm_command (void)
                             0,
                             src_height - 1);
          TUI_DISASM_WIN->can_highlight = true;
-         tui_make_visible (&TUI_DISASM_WIN->generic);
+         tui_make_visible (TUI_DISASM_WIN);
          tui_make_visible (TUI_DISASM_WIN->execution_info);
        }
       TUI_SRC_WIN->m_has_locator = false;
@@ -692,16 +692,16 @@ show_source_disasm_command (void)
          = make_command_window (cmd_height, tui_term_height () - cmd_height);
       else
        {
-         init_gen_win_info (&TUI_CMD_WIN->generic,
-                            TUI_CMD_WIN->generic.type,
-                            TUI_CMD_WIN->generic.height,
-                            TUI_CMD_WIN->generic.width,
+         init_gen_win_info (TUI_CMD_WIN,
+                            TUI_CMD_WIN->type,
+                            TUI_CMD_WIN->height,
+                            TUI_CMD_WIN->width,
                             0,
-                            TUI_CMD_WIN->generic.origin.y);
+                            TUI_CMD_WIN->origin.y);
          TUI_CMD_WIN->can_highlight = false;
-         tui_make_visible (&TUI_CMD_WIN->generic);
+         tui_make_visible (TUI_CMD_WIN);
        }
-      tui_refresh_win (&TUI_CMD_WIN->generic);
+      tui_refresh_win (TUI_CMD_WIN);
       tui_set_current_layout_to (SRC_DISASSEM_COMMAND);
     }
 }
@@ -712,7 +712,7 @@ show_source_disasm_command (void)
 static void
 show_data (enum tui_layout_type new_layout)
 {
-  int total_height = (tui_term_height () - TUI_CMD_WIN->generic.height);
+  int total_height = (tui_term_height () - TUI_CMD_WIN->height);
   int src_height, data_height;
   enum tui_win_type win_type;
   struct tui_gen_win_info *locator = tui_locator_win_info_ptr ();
@@ -752,10 +752,10 @@ show_data (enum tui_layout_type new_layout)
   else
     {
       base = (tui_source_window_base *) tui_win_list[win_type];
-      init_gen_win_info (&tui_win_list[win_type]->generic,
-                        tui_win_list[win_type]->generic.type,
+      init_gen_win_info (tui_win_list[win_type],
+                        tui_win_list[win_type]->type,
                         src_height,
-                        tui_win_list[win_type]->generic.width,
+                        tui_win_list[win_type]->width,
                         base->execution_info->width,
                         data_height - 1);
       init_gen_win_info (base->execution_info,
@@ -764,7 +764,7 @@ show_data (enum tui_layout_type new_layout)
                         3,
                         0,
                         data_height - 1);
-      tui_make_visible (&tui_win_list[win_type]->generic);
+      tui_make_visible (tui_win_list[win_type]);
       tui_make_visible (base->execution_info);
       init_gen_win_info (locator,
                         LOCATOR_WIN,
@@ -829,7 +829,7 @@ init_and_make_win (void *opaque_win_info,
   if (tui_win_is_auxillary (win_type))
     generic = (struct tui_gen_win_info *) opaque_win_info;
   else
-    generic = &((struct tui_win_info *) opaque_win_info)->generic;
+    generic = (struct tui_win_info *) opaque_win_info;
 
   init_gen_win_info (generic, win_type, height, width, origin_x, origin_y);
   if (!tui_win_is_auxillary (win_type))
@@ -892,7 +892,7 @@ show_source_or_disasm_and_command (enum tui_layout_type layout_type)
       struct tui_gen_win_info *locator = tui_locator_win_info_ptr ();
 
       if (TUI_CMD_WIN != NULL)
-       cmd_height = TUI_CMD_WIN->generic.height;
+       cmd_height = TUI_CMD_WIN->height;
       else
        cmd_height = tui_term_height () / 3;
       src_height = tui_term_height () - cmd_height;
@@ -930,10 +930,10 @@ show_source_or_disasm_and_command (enum tui_layout_type layout_type)
                             0,
                             src_height - 1);
          base->m_has_locator = true;
-         init_gen_win_info (&(*win_info_ptr)->generic,
-                            (*win_info_ptr)->generic.type,
+         init_gen_win_info (*win_info_ptr,
+                            (*win_info_ptr)->type,
                             src_height - 1,
-                            (*win_info_ptr)->generic.width,
+                            (*win_info_ptr)->width,
                             base->execution_info->width,
                             0);
          init_gen_win_info (base->execution_info,
@@ -943,7 +943,7 @@ show_source_or_disasm_and_command (enum tui_layout_type layout_type)
                             0,
                             0);
          base->can_highlight = true;
-         tui_make_visible (&(*win_info_ptr)->generic);
+         tui_make_visible (*win_info_ptr);
          tui_make_visible (base->execution_info);
        }
 
@@ -956,18 +956,18 @@ show_source_or_disasm_and_command (enum tui_layout_type layout_type)
        {
          tui_win_list[CMD_WIN] = make_command_window (cmd_height,
                                                       src_height);
-         tui_refresh_win (&TUI_CMD_WIN->generic);
+         tui_refresh_win (TUI_CMD_WIN);
        }
       else
        {
-         init_gen_win_info (&TUI_CMD_WIN->generic,
-                            TUI_CMD_WIN->generic.type,
-                            TUI_CMD_WIN->generic.height,
-                            TUI_CMD_WIN->generic.width,
-                            TUI_CMD_WIN->generic.origin.x,
-                            TUI_CMD_WIN->generic.origin.y);
+         init_gen_win_info (TUI_CMD_WIN,
+                            TUI_CMD_WIN->type,
+                            TUI_CMD_WIN->height,
+                            TUI_CMD_WIN->width,
+                            TUI_CMD_WIN->origin.x,
+                            TUI_CMD_WIN->origin.y);
          TUI_CMD_WIN->can_highlight = false;
-         tui_make_visible (&TUI_CMD_WIN->generic);
+         tui_make_visible (TUI_CMD_WIN);
        }
       tui_set_current_layout_to (layout_type);
     }
index 7367cf7c0cb3d6f423ad32665e3c44eff2930ac1..cfb735c81d5071ce367c9d45cb6278be655a8b2d 100644 (file)
@@ -135,7 +135,7 @@ tui_show_registers (struct reggroup *group)
 
   /* Make sure the register window is visible.  If not, select an
      appropriate layout.  */
-  if (TUI_DATA_WIN == NULL || !TUI_DATA_WIN->generic.is_visible)
+  if (TUI_DATA_WIN == NULL || !TUI_DATA_WIN->is_visible)
     tui_set_layout_by_name (DATA_NAME);
 
   if (group == 0)
@@ -195,8 +195,8 @@ tui_show_register_group (struct reggroup *group,
   /* Make a new title showing which group we display.  */
   snprintf (title, sizeof (title) - 1, "Register group: %s",
             reggroup_name (group));
-  xfree (TUI_DATA_WIN->generic.title);
-  TUI_DATA_WIN->generic.title = xstrdup (title);
+  xfree (TUI_DATA_WIN->title);
+  TUI_DATA_WIN->title = xstrdup (title);
 
   /* See how many registers must be displayed.  */
   nr_regs = 0;
@@ -235,10 +235,10 @@ tui_show_register_group (struct reggroup *group,
     {
       if (!refresh_values_only || allocated_here)
        {
-         TUI_DATA_WIN->generic.content = NULL;
-         TUI_DATA_WIN->generic.content_size = 0;
-         tui_add_content_elements (&TUI_DATA_WIN->generic, nr_regs);
-         TUI_DATA_WIN->regs_content = TUI_DATA_WIN->generic.content;
+         TUI_DATA_WIN->content = NULL;
+         TUI_DATA_WIN->content_size = 0;
+         tui_add_content_elements (TUI_DATA_WIN, nr_regs);
+         TUI_DATA_WIN->regs_content = TUI_DATA_WIN->content;
          TUI_DATA_WIN->regs_content_count = nr_regs;
        }
 
@@ -276,7 +276,7 @@ tui_show_register_group (struct reggroup *group,
           pos++;
        }
 
-      TUI_DATA_WIN->generic.content_size =
+      TUI_DATA_WIN->content_size =
        TUI_DATA_WIN->regs_content_count + TUI_DATA_WIN->data_content_count;
       ret = TUI_SUCCESS;
     }
@@ -326,17 +326,17 @@ tui_display_registers_from (int start_element_no)
       i = start_element_no;
 
       TUI_DATA_WIN->regs_column_count =
-        (TUI_DATA_WIN->generic.width - 2) / item_win_width;
+        (TUI_DATA_WIN->width - 2) / item_win_width;
       if (TUI_DATA_WIN->regs_column_count == 0)
         TUI_DATA_WIN->regs_column_count = 1;
       item_win_width =
-        (TUI_DATA_WIN->generic.width - 2) / TUI_DATA_WIN->regs_column_count;
+        (TUI_DATA_WIN->width - 2) / TUI_DATA_WIN->regs_column_count;
 
       /* Now create each data "sub" window, and write the display into
         it.  */
       cur_y = 1;
       while (i < TUI_DATA_WIN->regs_content_count 
-            && cur_y <= TUI_DATA_WIN->generic.viewport_height)
+            && cur_y <= TUI_DATA_WIN->viewport_height)
        {
          for (j = 0;
               j < TUI_DATA_WIN->regs_column_count
@@ -401,7 +401,7 @@ tui_display_reg_element_at_line (int start_element_no,
 
          last_line_no = tui_last_regs_line_no ();
          first_line_on_last_page
-           = last_line_no - (TUI_DATA_WIN->generic.height - 2);
+           = last_line_no - (TUI_DATA_WIN->height - 2);
          if (first_line_on_last_page < 0)
            first_line_on_last_page = 0;
 
@@ -470,7 +470,7 @@ void
 tui_check_register_values (struct frame_info *frame)
 {
   if (TUI_DATA_WIN != NULL
-      && TUI_DATA_WIN->generic.is_visible)
+      && TUI_DATA_WIN->is_visible)
     {
       if (TUI_DATA_WIN->regs_content_count <= 0 
          && TUI_DATA_WIN->display_regs)
@@ -596,7 +596,7 @@ tui_reg_command (const char *args, int from_tty)
       /* Make sure the register window is visible.  If not, select an
         appropriate layout.  We need to do this before trying to run the
         'next' or 'prev' commands.  */
-      if (TUI_DATA_WIN == NULL || !TUI_DATA_WIN->generic.is_visible)
+      if (TUI_DATA_WIN == NULL || !TUI_DATA_WIN->is_visible)
        tui_set_layout_by_name (DATA_NAME);
 
       if (strncmp (args, "next", len) == 0)
index ac3f225e1b1e0be6c6e9f7b28afb42ef80ebd821..c6367765d6786b15f75e379fdd656ed7af788349 100644 (file)
@@ -135,10 +135,10 @@ tui_set_source_content (struct symtab *s,
 
       if ((ret = tui_alloc_source_buffer (TUI_SRC_WIN)) == TUI_SUCCESS)
        {
-         line_width = TUI_SRC_WIN->generic.width - 1;
+         line_width = TUI_SRC_WIN->width - 1;
          /* Take hilite (window border) into account, when
             calculating the number of lines.  */
-         nlines = (line_no + (TUI_SRC_WIN->generic.height - 2)) - line_no;
+         nlines = (line_no + (TUI_SRC_WIN->height - 2)) - line_no;
 
          std::string srclines;
          if (!g_source_cache.get_source_lines (s, line_no, line_no + nlines,
@@ -163,9 +163,9 @@ tui_set_source_content (struct symtab *s,
                = (struct tui_source_window_base *) TUI_SRC_WIN;
              const char *s_filename = symtab_to_filename_for_display (s);
 
-             if (TUI_SRC_WIN->generic.title)
-               xfree (TUI_SRC_WIN->generic.title);
-             TUI_SRC_WIN->generic.title = xstrdup (s_filename);
+             if (TUI_SRC_WIN->title)
+               xfree (TUI_SRC_WIN->title);
+             TUI_SRC_WIN->title = xstrdup (s_filename);
 
              xfree (src->fullname);
              src->fullname = xstrdup (symtab_to_fullname (s));
@@ -179,7 +179,7 @@ tui_set_source_content (struct symtab *s,
              while (cur_line < nlines)
                {
                  struct tui_win_element *element
-                   = TUI_SRC_WIN->generic.content[cur_line];
+                   = TUI_SRC_WIN->content[cur_line];
 
                  std::string text;
                  if (*iter != '\0')
@@ -201,16 +201,16 @@ tui_set_source_content (struct symtab *s,
                     == locator->content[0]
                     ->which_element.locator.line_no);
 
-                 xfree (TUI_SRC_WIN->generic.content[cur_line]
+                 xfree (TUI_SRC_WIN->content[cur_line]
                         ->which_element.source.line);
-                 TUI_SRC_WIN->generic.content[cur_line]
+                 TUI_SRC_WIN->content[cur_line]
                    ->which_element.source.line
                    = xstrdup (text.c_str ());
 
                  cur_line++;
                  cur_line_no++;
                }
-             TUI_SRC_WIN->generic.content_size = nlines;
+             TUI_SRC_WIN->content_size = nlines;
              ret = TUI_SUCCESS;
            }
        }
@@ -233,18 +233,18 @@ tui_set_source_content_nil (struct tui_win_info *win_info,
   int n_lines;
   int curr_line = 0;
 
-  line_width = win_info->generic.width - 1;
-  n_lines = win_info->generic.height - 2;
+  line_width = win_info->width - 1;
+  n_lines = win_info->height - 2;
 
   /* Set to empty each line in the window, except for the one which
      contains the message.  */
-  while (curr_line < win_info->generic.content_size)
+  while (curr_line < win_info->content_size)
     {
       /* Set the information related to each displayed line to null:
          i.e. the line number is 0, there is no bp, it is not where
          the program is stopped.  */
 
-      struct tui_win_element *element = win_info->generic.content[curr_line];
+      struct tui_win_element *element = win_info->content[curr_line];
 
       element->which_element.source.line_or_addr.loa = LOA_LINE;
       element->which_element.source.line_or_addr.u.line_no = 0;
@@ -300,7 +300,7 @@ int
 tui_source_is_displayed (const char *fullname)
 {
   return (TUI_SRC_WIN != NULL
-         && TUI_SRC_WIN->generic.content_in_use 
+         && TUI_SRC_WIN->content_in_use 
          && (filename_cmp (tui_locator_win_info_ptr ()->content[0]
                              ->which_element.locator.full_name,
                            fullname) == 0));
@@ -312,11 +312,10 @@ void
 tui_source_window::do_scroll_vertical
   (enum tui_scroll_direction scroll_direction, int num_to_scroll)
 {
-  if (generic.content != NULL)
+  if (content != NULL)
     {
       struct tui_line_or_address l;
       struct symtab *s;
-      tui_win_content content = generic.content;
       struct symtab_and_line cursal = get_current_source_symtab_and_line ();
 
       if (cursal.symtab == NULL)
@@ -330,7 +329,7 @@ tui_source_window::do_scroll_vertical
          l.u.line_no = content[0]->which_element.source.line_or_addr.u.line_no
            + num_to_scroll;
          if (l.u.line_no > s->nlines)
-           /* line = s->nlines - win_info->generic.content_size + 1; */
+           /* line = s->nlines - win_info->content_size + 1; */
            /* elz: fix for dts 23398.  */
            l.u.line_no
              = content[0]->which_element.source.line_or_addr.u.line_no;
index 125a5b7a8e36c3fc63820e14f3a5caf70d28a579..a38971542eb473d2a7a8ccc0cd3750dd970af71a 100644 (file)
@@ -404,7 +404,7 @@ tui_show_frame_info (struct frame_info *fi)
          if (win_info == TUI_SRC_WIN)
            {
              start_line = (item->locator.line_no -
-                          (win_info->generic.viewport_height / 2)) + 1;
+                          (win_info->viewport_height / 2)) + 1;
              if (start_line <= 0)
                start_line = 1;
            }
index e4c1522a62de4401f3360ab1daf4d394c96e9ca2..a40e6c5206b075b9c95dcea21574a556257c3dcf 100644 (file)
@@ -373,10 +373,10 @@ window_name_completer (completion_tracker &tracker,
 
       /* We can't focus on an invisible window.  */
       if (tui_win_list[win_type] == NULL
-         || !tui_win_list[win_type]->generic.is_visible)
+         || !tui_win_list[win_type]->is_visible)
        continue;
 
-      completion_name = tui_win_name (&tui_win_list [win_type]->generic);
+      completion_name = tui_win_name (tui_win_list [win_type]);
       gdb_assert (completion_name != NULL);
       completion_name_vec.push_back (completion_name);
     }
@@ -438,8 +438,8 @@ tui_update_gdb_sizes (void)
 
   if (tui_active)
     {
-      width = TUI_CMD_WIN->generic.width;
-      height = TUI_CMD_WIN->generic.height;
+      width = TUI_CMD_WIN->width;
+      height = TUI_CMD_WIN->height;
     }
   else
     {
@@ -460,10 +460,10 @@ tui_set_win_focus_to (struct tui_win_info *win_info)
       struct tui_win_info *win_with_focus = tui_win_with_focus ();
 
       if (win_with_focus != NULL
-         && win_with_focus->generic.type != CMD_WIN)
+         && win_with_focus->type != CMD_WIN)
        tui_unhighlight_win (win_with_focus);
       tui_set_win_with_focus (win_info);
-      if (win_info->generic.type != CMD_WIN)
+      if (win_info->type != CMD_WIN)
        tui_highlight_win (win_info);
     }
 }
@@ -473,7 +473,7 @@ void
 tui_win_info::forward_scroll (int num_to_scroll)
 {
   if (num_to_scroll == 0)
-    num_to_scroll = generic.height - 3;
+    num_to_scroll = height - 3;
 
   do_scroll_vertical (FORWARD_SCROLL, num_to_scroll);
 }
@@ -482,7 +482,7 @@ void
 tui_win_info::backward_scroll (int num_to_scroll)
 {
   if (num_to_scroll == 0)
-    num_to_scroll = generic.height - 3;
+    num_to_scroll = height - 3;
 
   do_scroll_vertical (BACKWARD_SCROLL, num_to_scroll);
 }
@@ -528,7 +528,7 @@ tui_refresh_all_win (void)
   tui_refresh_all (tui_win_list);
   for (type = SRC_WIN; type < MAX_MAJOR_WINDOWS; type++)
     {
-      if (tui_win_list[type] && tui_win_list[type]->generic.is_visible)
+      if (tui_win_list[type] && tui_win_list[type]->is_visible)
        tui_win_list[type]->refresh_all ();
     }
   tui_show_locator_content ();
@@ -569,7 +569,7 @@ tui_resize_all (void)
 #endif      
       /* Turn keypad off while we resize.  */
       if (win_with_focus != TUI_CMD_WIN)
-       keypad (TUI_CMD_WIN->generic.handle, FALSE);
+       keypad (TUI_CMD_WIN->handle, FALSE);
       tui_update_gdb_sizes ();
       tui_set_term_height_to (screenheight);
       tui_set_term_width_to (screenwidth);
@@ -597,57 +597,57 @@ tui_resize_all (void)
        case SRC_COMMAND:
        case DISASSEM_COMMAND:
          first_win = tui_source_windows ()[0];
-         first_win->generic.width += width_diff;
+         first_win->width += width_diff;
          locator->width += width_diff;
          /* Check for invalid heights.  */
          if (height_diff == 0)
-           new_height = first_win->generic.height;
-         else if ((first_win->generic.height + split_diff) >=
+           new_height = first_win->height;
+         else if ((first_win->height + split_diff) >=
                   (screenheight - MIN_CMD_WIN_HEIGHT - 1))
            new_height = screenheight - MIN_CMD_WIN_HEIGHT - 1;
-         else if ((first_win->generic.height + split_diff) <= 0)
+         else if ((first_win->height + split_diff) <= 0)
            new_height = MIN_WIN_HEIGHT;
          else
-           new_height = first_win->generic.height + split_diff;
+           new_height = first_win->height + split_diff;
 
          locator->origin.y = new_height + 1;
          make_invisible_and_set_new_height (first_win, new_height);
-         TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1;
-         TUI_CMD_WIN->generic.width += width_diff;
-         new_height = screenheight - TUI_CMD_WIN->generic.origin.y;
+         TUI_CMD_WIN->origin.y = locator->origin.y + 1;
+         TUI_CMD_WIN->width += width_diff;
+         new_height = screenheight - TUI_CMD_WIN->origin.y;
          make_invisible_and_set_new_height (TUI_CMD_WIN, new_height);
          make_visible_with_new_height (first_win);
          make_visible_with_new_height (TUI_CMD_WIN);
-         if (first_win->generic.content_size <= 0)
+         if (first_win->content_size <= 0)
            tui_erase_source_content (first_win, EMPTY_SOURCE_PROMPT);
          break;
        default:
          if (cur_layout == SRC_DISASSEM_COMMAND)
            {
              first_win = TUI_SRC_WIN;
-             first_win->generic.width += width_diff;
+             first_win->width += width_diff;
              second_win = TUI_DISASM_WIN;
-             second_win->generic.width += width_diff;
+             second_win->width += width_diff;
            }
          else
            {
              first_win = TUI_DATA_WIN;
-             first_win->generic.width += width_diff;
+             first_win->width += width_diff;
              second_win = tui_source_windows ()[0];
-             second_win->generic.width += width_diff;
+             second_win->width += width_diff;
            }
          /* Change the first window's height/width.  */
          /* Check for invalid heights.  */
          if (height_diff == 0)
-           new_height = first_win->generic.height;
-         else if ((first_win->generic.height +
-                   second_win->generic.height + (split_diff * 2)) >=
+           new_height = first_win->height;
+         else if ((first_win->height +
+                   second_win->height + (split_diff * 2)) >=
                   (screenheight - MIN_CMD_WIN_HEIGHT - 1))
            new_height = (screenheight - MIN_CMD_WIN_HEIGHT - 1) / 2;
-         else if ((first_win->generic.height + split_diff) <= 0)
+         else if ((first_win->height + split_diff) <= 0)
            new_height = MIN_WIN_HEIGHT;
          else
-           new_height = first_win->generic.height + split_diff;
+           new_height = first_win->height + split_diff;
          make_invisible_and_set_new_height (first_win, new_height);
 
          locator->width += width_diff;
@@ -655,9 +655,9 @@ tui_resize_all (void)
          /* Change the second window's height/width.  */
          /* Check for invalid heights.  */
          if (height_diff == 0)
-           new_height = second_win->generic.height;
-         else if ((first_win->generic.height +
-                   second_win->generic.height + (split_diff * 2)) >=
+           new_height = second_win->height;
+         else if ((first_win->height +
+                   second_win->height + (split_diff * 2)) >=
                   (screenheight - MIN_CMD_WIN_HEIGHT - 1))
            {
              new_height = screenheight - MIN_CMD_WIN_HEIGHT - 1;
@@ -666,24 +666,24 @@ tui_resize_all (void)
              else
                new_height /= 2;
            }
-         else if ((second_win->generic.height + split_diff) <= 0)
+         else if ((second_win->height + split_diff) <= 0)
            new_height = MIN_WIN_HEIGHT;
          else
-           new_height = second_win->generic.height + split_diff;
-         second_win->generic.origin.y = first_win->generic.height - 1;
+           new_height = second_win->height + split_diff;
+         second_win->origin.y = first_win->height - 1;
          make_invisible_and_set_new_height (second_win, new_height);
 
          /* Change the command window's height/width.  */
-         TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1;
+         TUI_CMD_WIN->origin.y = locator->origin.y + 1;
          make_invisible_and_set_new_height (TUI_CMD_WIN,
-                                            TUI_CMD_WIN->generic.height
+                                            TUI_CMD_WIN->height
                                             + cmd_split_diff);
          make_visible_with_new_height (first_win);
          make_visible_with_new_height (second_win);
          make_visible_with_new_height (TUI_CMD_WIN);
-         if (first_win->generic.content_size <= 0)
+         if (first_win->content_size <= 0)
            tui_erase_source_content (first_win, EMPTY_SOURCE_PROMPT);
-         if (second_win->generic.content_size <= 0)
+         if (second_win->content_size <= 0)
            tui_erase_source_content (second_win, EMPTY_SOURCE_PROMPT);
          break;
        }
@@ -693,7 +693,7 @@ tui_resize_all (void)
        {
          if (win_type != CMD_WIN 
              && (tui_win_list[win_type] != NULL)
-             && !tui_win_list[win_type]->generic.is_visible)
+             && !tui_win_list[win_type]->is_visible)
            {
              delete tui_win_list[win_type];
              tui_win_list[win_type] = NULL;
@@ -702,7 +702,7 @@ tui_resize_all (void)
       /* Turn keypad back on, unless focus is in the command
         window.  */
       if (win_with_focus != TUI_CMD_WIN)
-       keypad (TUI_CMD_WIN->generic.handle, TRUE);
+       keypad (TUI_CMD_WIN->handle, TRUE);
     }
 }
 
@@ -856,20 +856,20 @@ tui_set_focus (const char *arg, int from_tty)
       else
        win_info = tui_partial_win_by_name (buf_ptr);
 
-      if (win_info == NULL || !win_info->generic.is_visible)
+      if (win_info == NULL || !win_info->is_visible)
        warning (_("Invalid window specified. \n\
 The window name specified must be valid and visible.\n"));
       else
        {
          tui_set_win_focus_to (win_info);
-         keypad (TUI_CMD_WIN->generic.handle, (win_info != TUI_CMD_WIN));
+         keypad (TUI_CMD_WIN->handle, (win_info != TUI_CMD_WIN));
        }
 
-      if (TUI_DATA_WIN && TUI_DATA_WIN->generic.is_visible)
+      if (TUI_DATA_WIN && TUI_DATA_WIN->is_visible)
        TUI_DATA_WIN->refresh_all ();
       xfree (buf_ptr);
       printf_filtered (_("Focus set to %s window.\n"),
-                      tui_win_name (&tui_win_with_focus ()->generic));
+                      tui_win_name (tui_win_with_focus ()));
     }
   else
     warning (_("Incorrect Number of Arguments.\n%s"), FOCUS_USAGE);
@@ -892,16 +892,16 @@ tui_all_windows_info (const char *arg, int from_tty)
 
   for (type = SRC_WIN; (type < MAX_MAJOR_WINDOWS); type++)
     if (tui_win_list[type] 
-       && tui_win_list[type]->generic.is_visible)
+       && tui_win_list[type]->is_visible)
       {
        if (win_with_focus == tui_win_list[type])
          printf_filtered ("        %s\t(%d lines)  <has focus>\n",
-                          tui_win_name (&tui_win_list[type]->generic),
-                          tui_win_list[type]->generic.height);
+                          tui_win_name (tui_win_list[type]),
+                          tui_win_list[type]->height);
        else
          printf_filtered ("        %s\t(%d lines)\n",
-                          tui_win_name (&tui_win_list[type]->generic),
-                          tui_win_list[type]->generic.height);
+                          tui_win_name (tui_win_list[type]),
+                          tui_win_list[type]->height);
       }
 }
 
@@ -934,17 +934,17 @@ update_tab_width ()
      and redisplay of the window's contents, which will take
      the new tab width into account.  */
   if (tui_win_list[SRC_WIN]
-      && tui_win_list[SRC_WIN]->generic.is_visible)
+      && tui_win_list[SRC_WIN]->is_visible)
     {
       make_invisible_and_set_new_height (TUI_SRC_WIN,
-                                        TUI_SRC_WIN->generic.height);
+                                        TUI_SRC_WIN->height);
       make_visible_with_new_height (TUI_SRC_WIN);
     }
   if (tui_win_list[DISASSEM_WIN]
-      && tui_win_list[DISASSEM_WIN]->generic.is_visible)
+      && tui_win_list[DISASSEM_WIN]->is_visible)
     {
       make_invisible_and_set_new_height (TUI_DISASM_WIN,
-                                        TUI_DISASM_WIN->generic.height);
+                                        TUI_DISASM_WIN->height);
       make_visible_with_new_height (TUI_DISASM_WIN);
     }
 }
@@ -1025,7 +1025,7 @@ tui_set_win_height (const char *arg, int from_tty)
            wname[i] = tolower (wname[i]);
          win_info = tui_partial_win_by_name (wname);
 
-         if (win_info == NULL || !win_info->generic.is_visible)
+         if (win_info == NULL || !win_info->is_visible)
            warning (_("Invalid window specified. \n\
 The window name specified must be valid and visible.\n"));
          else
@@ -1055,7 +1055,7 @@ The window name specified must be valid and visible.\n"));
                      if (fixed_size)
                        new_height = input_no;
                      else
-                       new_height = win_info->generic.height + input_no;
+                       new_height = win_info->height + input_no;
 
                      /* Now change the window's height, and adjust
                         all other windows around it.  */
@@ -1098,21 +1098,21 @@ tui_adjust_win_heights (struct tui_win_info *primary_win_info,
   if (new_height_ok (primary_win_info, new_height))
     {
       status = TUI_SUCCESS;
-      if (new_height != primary_win_info->generic.height)
+      if (new_height != primary_win_info->height)
        {
          int diff;
          struct tui_win_info *win_info;
          struct tui_gen_win_info *locator = tui_locator_win_info_ptr ();
          enum tui_layout_type cur_layout = tui_current_layout ();
 
-         diff = (new_height - primary_win_info->generic.height) * (-1);
+         diff = (new_height - primary_win_info->height) * (-1);
          if (cur_layout == SRC_COMMAND 
              || cur_layout == DISASSEM_COMMAND)
            {
              struct tui_win_info *src_win_info;
 
              make_invisible_and_set_new_height (primary_win_info, new_height);
-             if (primary_win_info->generic.type == CMD_WIN)
+             if (primary_win_info->type == CMD_WIN)
                {
                  win_info = tui_source_windows ()[0];
                  src_win_info = win_info;
@@ -1123,11 +1123,11 @@ tui_adjust_win_heights (struct tui_win_info *primary_win_info,
                  src_win_info = primary_win_info;
                }
              make_invisible_and_set_new_height (win_info,
-                                            win_info->generic.height + diff);
-             TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1;
+                                            win_info->height + diff);
+             TUI_CMD_WIN->origin.y = locator->origin.y + 1;
              make_visible_with_new_height (win_info);
              make_visible_with_new_height (primary_win_info);
-             if (src_win_info->generic.content_size <= 0)
+             if (src_win_info->content_size <= 0)
                tui_erase_source_content (src_win_info, EMPTY_SOURCE_PROMPT);
            }
          else
@@ -1154,8 +1154,8 @@ tui_adjust_win_heights (struct tui_win_info *primary_win_info,
 
                  if (diff % 2)
                    {
-                     if (first_win->generic.height >
-                         second_win->generic.height)
+                     if (first_win->height >
+                         second_win->height)
                        if (diff < 0)
                          first_split_diff--;
                        else
@@ -1170,42 +1170,42 @@ tui_adjust_win_heights (struct tui_win_info *primary_win_info,
                    }
                  /* Make sure that the minimum hieghts are
                     honored.  */
-                 while ((first_win->generic.height + first_split_diff) < 3)
+                 while ((first_win->height + first_split_diff) < 3)
                    {
                      first_split_diff++;
                      second_split_diff--;
                    }
-                 while ((second_win->generic.height + second_split_diff) < 3)
+                 while ((second_win->height + second_split_diff) < 3)
                    {
                      second_split_diff++;
                      first_split_diff--;
                    }
                  make_invisible_and_set_new_height (
                                                  first_win,
-                                first_win->generic.height + first_split_diff);
-                 second_win->generic.origin.y = first_win->generic.height - 1;
+                                first_win->height + first_split_diff);
+                 second_win->origin.y = first_win->height - 1;
                  make_invisible_and_set_new_height (second_win,
-                                                    second_win->generic.height
+                                                    second_win->height
                                                     + second_split_diff);
-                 TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1;
+                 TUI_CMD_WIN->origin.y = locator->origin.y + 1;
                  make_invisible_and_set_new_height (TUI_CMD_WIN, new_height);
                }
              else
                {
-                 if ((TUI_CMD_WIN->generic.height + diff) < 1)
+                 if ((TUI_CMD_WIN->height + diff) < 1)
                    { /* If there is no way to increase the command
                         window take real estate from the 1st or 2nd
                         window.  */
-                     if ((TUI_CMD_WIN->generic.height + diff) < 1)
+                     if ((TUI_CMD_WIN->height + diff) < 1)
                        {
                          int i;
 
-                         for (i = TUI_CMD_WIN->generic.height + diff;
+                         for (i = TUI_CMD_WIN->height + diff;
                               (i < 1); i++)
                            if (primary_win_info == first_win)
-                             second_win->generic.height--;
+                             second_win->height--;
                            else
-                             first_win->generic.height--;
+                             first_win->height--;
                        }
                    }
                  if (primary_win_info == first_win)
@@ -1213,26 +1213,26 @@ tui_adjust_win_heights (struct tui_win_info *primary_win_info,
                  else
                    make_invisible_and_set_new_height (
                                                    first_win,
-                                                 first_win->generic.height);
-                 second_win->generic.origin.y = first_win->generic.height - 1;
+                                                 first_win->height);
+                 second_win->origin.y = first_win->height - 1;
                  if (primary_win_info == second_win)
                    make_invisible_and_set_new_height (second_win, new_height);
                  else
                    make_invisible_and_set_new_height (
-                                     second_win, second_win->generic.height);
-                 TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1;
-                 if ((TUI_CMD_WIN->generic.height + diff) < 1)
+                                     second_win, second_win->height);
+                 TUI_CMD_WIN->origin.y = locator->origin.y + 1;
+                 if ((TUI_CMD_WIN->height + diff) < 1)
                    make_invisible_and_set_new_height (TUI_CMD_WIN, 1);
                  else
                    make_invisible_and_set_new_height (TUI_CMD_WIN,
-                                                      TUI_CMD_WIN->generic.height + diff);
+                                                      TUI_CMD_WIN->height + diff);
                }
              make_visible_with_new_height (TUI_CMD_WIN);
              make_visible_with_new_height (second_win);
              make_visible_with_new_height (first_win);
-             if (first_win->generic.content_size <= 0)
+             if (first_win->content_size <= 0)
                tui_erase_source_content (first_win, EMPTY_SOURCE_PROMPT);
-             if (second_win->generic.content_size <= 0)
+             if (second_win->content_size <= 0)
                tui_erase_source_content (second_win, EMPTY_SOURCE_PROMPT);
            }
        }
@@ -1249,7 +1249,7 @@ tui_source_window_base::set_new_height (int height)
 {
   tui_make_invisible (execution_info);
   execution_info->height = height;
-  execution_info->origin.y = generic.origin.y;
+  execution_info->origin.y = origin.y;
   if (height > 1)
     execution_info->viewport_height = height - 1;
   else
@@ -1260,7 +1260,7 @@ tui_source_window_base::set_new_height (int height)
     {
       tui_gen_win_info *gen_win_info = tui_locator_win_info_ptr ();
       tui_make_invisible (gen_win_info);
-      gen_win_info->origin.y = generic.origin.y + height;
+      gen_win_info->origin.y = origin.y + height;
     }
 }
 
@@ -1270,10 +1270,10 @@ void
 tui_data_window::set_new_height (int height)
 {
   /* Delete all data item windows.  */
-  for (int i = 0; i < generic.content_size; i++)
+  for (int i = 0; i < content_size; i++)
     {
       struct tui_gen_win_info *gen_win_info
-       = generic.content[i]->which_element.data_window;
+       = content[i]->which_element.data_window;
       tui_delete_win (gen_win_info->handle);
       gen_win_info->handle = NULL;
     }
@@ -1286,14 +1286,14 @@ static void
 make_invisible_and_set_new_height (struct tui_win_info *win_info, 
                                   int height)
 {
-  tui_make_invisible (&win_info->generic);
-  win_info->generic.height = height;
+  tui_make_invisible (win_info);
+  win_info->height = height;
   if (height > 1)
-    win_info->generic.viewport_height = height - 1;
+    win_info->viewport_height = height - 1;
   else
-    win_info->generic.viewport_height = height;
+    win_info->viewport_height = height;
   if (win_info != TUI_CMD_WIN)
-    win_info->generic.viewport_height--;
+    win_info->viewport_height--;
 
   /* Now deal with the auxillary windows associated with win_info.  */
   win_info->set_new_height (height);
@@ -1308,17 +1308,17 @@ make_visible_with_new_height (struct tui_win_info *win_info)
 {
   struct symtab *s;
 
-  tui_make_visible (&win_info->generic);
+  tui_make_visible (win_info);
   tui_check_and_display_highlight_if_needed (win_info);
   tui_source_window_base *base;
-  switch (win_info->generic.type)
+  switch (win_info->type)
     {
     case SRC_WIN:
     case DISASSEM_WIN:
       base = (tui_source_window_base *) win_info;
       tui_free_win_content (base->execution_info);
       tui_make_visible (base->execution_info);
-      if (win_info->generic.content != NULL)
+      if (win_info->content != NULL)
        {
          struct gdbarch *gdbarch = base->gdbarch;
          struct tui_line_or_address line_or_addr;
@@ -1326,7 +1326,7 @@ make_visible_with_new_height (struct tui_win_info *win_info)
            = get_current_source_symtab_and_line ();
 
          line_or_addr = base->start_line_or_addr;
-         tui_free_win_content (&win_info->generic);
+         tui_free_win_content (win_info);
          tui_update_source_window (win_info, gdbarch,
                                    cursal.symtab, line_or_addr, TRUE);
        }
@@ -1339,7 +1339,7 @@ make_visible_with_new_height (struct tui_win_info *win_info)
          struct gdbarch *gdbarch = get_frame_arch (frame);
 
          s = find_pc_line_symtab (get_frame_pc (frame));
-         if (win_info->generic.type == SRC_WIN)
+         if (win_info->type == SRC_WIN)
            {
              line.loa = LOA_LINE;
              line.u.line_no = cursal.line;
@@ -1362,14 +1362,14 @@ make_visible_with_new_height (struct tui_win_info *win_info)
       break;
     case CMD_WIN:
 #ifdef HAVE_WRESIZE
-      wresize (TUI_CMD_WIN->generic.handle,
-              TUI_CMD_WIN->generic.height,
-              TUI_CMD_WIN->generic.width);
+      wresize (TUI_CMD_WIN->handle,
+              TUI_CMD_WIN->height,
+              TUI_CMD_WIN->width);
 #endif
-      mvwin (TUI_CMD_WIN->generic.handle,
-            TUI_CMD_WIN->generic.origin.y,
-            TUI_CMD_WIN->generic.origin.x);
-      wmove (win_info->generic.handle, 0, 0);
+      mvwin (TUI_CMD_WIN->handle,
+            TUI_CMD_WIN->origin.y,
+            TUI_CMD_WIN->origin.x);
+      wmove (win_info->handle, 0, 0);
       break;
     default:
       break;
@@ -1404,7 +1404,7 @@ new_height_ok (struct tui_win_info *primary_win_info,
       int diff;
       enum tui_layout_type cur_layout = tui_current_layout ();
 
-      diff = (new_height - primary_win_info->generic.height) * (-1);
+      diff = (new_height - primary_win_info->height) * (-1);
       if (cur_layout == SRC_COMMAND || cur_layout == DISASSEM_COMMAND)
        {
          ok = (new_height <= primary_win_info->max_height ()
@@ -1418,7 +1418,7 @@ new_height_ok (struct tui_win_info *primary_win_info,
              else
                win_info = TUI_CMD_WIN;
              ok = ((new_height +
-                    (win_info->generic.height + diff)) <= tui_term_height ());
+                    (win_info->height + diff)) <= tui_term_height ());
            }
        }
       else
@@ -1442,20 +1442,20 @@ new_height_ok (struct tui_win_info *primary_win_info,
             the line that the first and second windows share, and add
             one for the locator.  */
          total_height = cur_total_height =
-           (first_win->generic.height + second_win->generic.height - 1)
-           + TUI_CMD_WIN->generic.height + 1;  /* Locator. */
+           (first_win->height + second_win->height - 1)
+           + TUI_CMD_WIN->height + 1;  /* Locator. */
          if (primary_win_info == TUI_CMD_WIN)
            {
              /* Locator included since first & second win share a line.  */
-             ok = ((first_win->generic.height +
-                    second_win->generic.height + diff) >=
+             ok = ((first_win->height +
+                    second_win->height + diff) >=
                    (MIN_WIN_HEIGHT * 2) 
                    && new_height >= MIN_CMD_WIN_HEIGHT);
              if (ok)
                {
                  total_height = new_height + 
-                   (first_win->generic.height +
-                    second_win->generic.height + diff);
+                   (first_win->height +
+                    second_win->height + diff);
                  min_height = MIN_CMD_WIN_HEIGHT;
                }
            }
@@ -1466,25 +1466,25 @@ new_height_ok (struct tui_win_info *primary_win_info,
              /* First see if we can increase/decrease the command
                 window.  And make sure that the command window is at
                 least 1 line.  */
-             ok = ((TUI_CMD_WIN->generic.height + diff) > 0);
+             ok = ((TUI_CMD_WIN->height + diff) > 0);
              if (!ok)
                { /* Looks like we have to increase/decrease one of
                     the other windows.  */
                  if (primary_win_info == first_win)
-                   ok = (second_win->generic.height + diff) >= min_height;
+                   ok = (second_win->height + diff) >= min_height;
                  else
-                   ok = (first_win->generic.height + diff) >= min_height;
+                   ok = (first_win->height + diff) >= min_height;
                }
              if (ok)
                {
                  if (primary_win_info == first_win)
                    total_height = new_height +
-                     second_win->generic.height +
-                     TUI_CMD_WIN->generic.height + diff;
+                     second_win->height +
+                     TUI_CMD_WIN->height + diff;
                  else
                    total_height = new_height +
-                     first_win->generic.height +
-                     TUI_CMD_WIN->generic.height + diff;
+                     first_win->height +
+                     TUI_CMD_WIN->height + diff;
                }
            }
          /* Now make sure that the proposed total height doesn't
@@ -1557,7 +1557,7 @@ parse_scrolling_args (const char *arg,
          *win_to_scroll = tui_partial_win_by_name (wname);
 
          if (*win_to_scroll == NULL
-             || !(*win_to_scroll)->generic.is_visible)
+             || !(*win_to_scroll)->is_visible)
            error (_("Invalid window specified. \n\
 The window name specified must be valid and visible.\n"));
          else if (*win_to_scroll == TUI_CMD_WIN)
index 1647527e240a07eb3ec98c07795ed72722a2c78f..739272a5d032d6839e4570a394448e8c351bf9ba 100644 (file)
@@ -48,13 +48,13 @@ tui_first_data_item_displayed (void)
   int i;
 
   for (i = 0; 
-       i < TUI_DATA_WIN->generic.content_size && element_no < 0;
+       i < TUI_DATA_WIN->content_size && element_no < 0;
        i++)
     {
       struct tui_gen_win_info *data_item_win;
 
       data_item_win
-       = TUI_DATA_WIN->generic.content[i]->which_element.data_window;
+       = TUI_DATA_WIN->content[i]->which_element.data_window;
       if (data_item_win->handle != NULL
          && data_item_win->is_visible)
        element_no = i;
@@ -72,10 +72,10 @@ tui_delete_data_content_windows (void)
   int i;
   struct tui_gen_win_info *data_item_win_ptr;
 
-  for (i = 0; (i < TUI_DATA_WIN->generic.content_size); i++)
+  for (i = 0; (i < TUI_DATA_WIN->content_size); i++)
     {
       data_item_win_ptr
-       = TUI_DATA_WIN->generic.content[i]->which_element.data_window;
+       = TUI_DATA_WIN->content[i]->which_element.data_window;
       tui_delete_win (data_item_win_ptr->handle);
       data_item_win_ptr->handle = NULL;
       data_item_win_ptr->is_visible = false;
@@ -86,23 +86,23 @@ tui_delete_data_content_windows (void)
 void
 tui_erase_data_content (const char *prompt)
 {
-  werase (TUI_DATA_WIN->generic.handle);
+  werase (TUI_DATA_WIN->handle);
   tui_check_and_display_highlight_if_needed (TUI_DATA_WIN);
   if (prompt != NULL)
     {
-      int half_width = (TUI_DATA_WIN->generic.width - 2) / 2;
+      int half_width = (TUI_DATA_WIN->width - 2) / 2;
       int x_pos;
 
       if (strlen (prompt) >= half_width)
        x_pos = 1;
       else
        x_pos = half_width - strlen (prompt);
-      mvwaddstr (TUI_DATA_WIN->generic.handle,
-                (TUI_DATA_WIN->generic.height / 2),
+      mvwaddstr (TUI_DATA_WIN->handle,
+                (TUI_DATA_WIN->height / 2),
                 x_pos,
                 (char *) prompt);
     }
-  wrefresh (TUI_DATA_WIN->generic.handle);
+  wrefresh (TUI_DATA_WIN->handle);
 }
 
 
@@ -111,7 +111,7 @@ tui_erase_data_content (const char *prompt)
 void
 tui_display_all_data (void)
 {
-  if (TUI_DATA_WIN->generic.content_size <= 0)
+  if (TUI_DATA_WIN->content_size <= 0)
     tui_erase_data_content (NO_DATA_STRING);
   else
     {
@@ -196,7 +196,7 @@ void
 tui_data_window::refresh_all ()
 {
   tui_erase_data_content (NULL);
-  if (generic.content_size > 0)
+  if (content_size > 0)
     {
       int first_element = tui_first_data_item_displayed ();
 
@@ -214,7 +214,7 @@ tui_check_data_values (struct frame_info *frame)
   tui_check_register_values (frame);
 
   /* Now check any other data values that there are.  */
-  if (TUI_DATA_WIN != NULL && TUI_DATA_WIN->generic.is_visible)
+  if (TUI_DATA_WIN != NULL && TUI_DATA_WIN->is_visible)
     {
       int i;
 
index ccee399057a94aa9c90824f0ef5113359f52d121..06d7ad5a030b881d9cf67fc06eaa03c5b9ff1763 100644 (file)
@@ -110,10 +110,10 @@ void
 tui_unhighlight_win (struct tui_win_info *win_info)
 {
   if (win_info != NULL 
-      && win_info->generic.handle != NULL)
+      && win_info->handle != NULL)
     {
-      box_win (&win_info->generic, NO_HILITE);
-      wrefresh (win_info->generic.handle);
+      box_win (win_info, NO_HILITE);
+      wrefresh (win_info->handle);
       win_info->set_highlight (false);
     }
 }
@@ -124,10 +124,10 @@ tui_highlight_win (struct tui_win_info *win_info)
 {
   if (win_info != NULL
       && win_info->can_highlight
-      && win_info->generic.handle != NULL)
+      && win_info->handle != NULL)
     {
-      box_win (&win_info->generic, HILITE);
-      wrefresh (win_info->generic.handle);
+      box_win (win_info, HILITE);
+      wrefresh (win_info->handle);
       win_info->set_highlight (true);
     }
 }
@@ -135,7 +135,7 @@ tui_highlight_win (struct tui_win_info *win_info)
 void
 tui_check_and_display_highlight_if_needed (struct tui_win_info *win_info)
 {
-  if (win_info != NULL && win_info->generic.type != CMD_WIN)
+  if (win_info != NULL && win_info->type != CMD_WIN)
     {
       if (win_info->is_highlighted)
        tui_highlight_win (win_info);
@@ -214,7 +214,7 @@ tui_make_invisible (struct tui_gen_win_info *win_info)
 void
 tui_win_info::make_visible (bool visible)
 {
-  ::make_visible (&generic, visible);
+  ::make_visible (this, visible);
 }
 
 /* See tui-data.h.  */
@@ -259,8 +259,8 @@ tui_make_all_invisible (void)
 void
 tui_win_info::refresh ()
 {
-  touchwin (generic.handle);
-  tui_refresh_win (&generic);
+  touchwin (handle);
+  tui_refresh_win (this);
 }
 
 /* See tui-data.h.  */
@@ -283,7 +283,7 @@ tui_refresh_all (struct tui_win_info **list)
 
   for (type = SRC_WIN; (type < MAX_MAJOR_WINDOWS); type++)
     {
-      if (list[type] && list[type]->generic.is_visible)
+      if (list[type] && list[type]->is_visible)
        list[type]->refresh ();
     }
   if (locator->is_visible)
index 5946db75aaf4f0f729fa5cfa8d0fde829046b6ec..f63526bb446850228a4375bbba5e56637fcf7904 100644 (file)
@@ -94,7 +94,7 @@ tui_update_source_window_as_is (struct tui_win_info *win_info,
 {
   enum tui_status ret;
 
-  if (win_info->generic.type == SRC_WIN)
+  if (win_info->type == SRC_WIN)
     ret = tui_set_source_content (s, line_or_addr.u.line_no, noerror);
   else
     ret = tui_set_disassem_content (gdbarch, line_or_addr.u.addr);
@@ -109,12 +109,12 @@ tui_update_source_window_as_is (struct tui_win_info *win_info,
       tui_update_breakpoint_info (win_info, 0);
       tui_show_source_content (win_info);
       tui_update_exec_info (win_info);
-      if (win_info->generic.type == SRC_WIN)
+      if (win_info->type == SRC_WIN)
        {
          symtab_and_line sal;
 
          sal.line = line_or_addr.u.line_no +
-           (win_info->generic.content_size - 2);
+           (win_info->content_size - 2);
          sal.symtab = s;
          sal.pspace = SYMTAB_PSPACE (s);
          set_current_source_symtab_and_line (sal);
@@ -212,11 +212,11 @@ tui_clear_source_content (struct tui_win_info *win_info,
     {
       int i;
 
-      win_info->generic.content_in_use = FALSE;
+      win_info->content_in_use = FALSE;
       tui_erase_source_content (win_info, display_prompt);
-      for (i = 0; i < win_info->generic.content_size; i++)
+      for (i = 0; i < win_info->content_size; i++)
        {
-         struct tui_win_element *element = win_info->generic.content[i];
+         struct tui_win_element *element = win_info->content[i];
 
          element->which_element.source.has_break = FALSE;
          element->which_element.source.is_exec_point = FALSE;
@@ -230,17 +230,17 @@ tui_erase_source_content (struct tui_win_info *win_info,
                          int display_prompt)
 {
   int x_pos;
-  int half_width = (win_info->generic.width - 2) / 2;
+  int half_width = (win_info->width - 2) / 2;
 
-  if (win_info->generic.handle != NULL)
+  if (win_info->handle != NULL)
     {
-      werase (win_info->generic.handle);
+      werase (win_info->handle);
       tui_check_and_display_highlight_if_needed (win_info);
       if (display_prompt == EMPTY_SOURCE_PROMPT)
        {
          const char *no_src_str;
 
-         if (win_info->generic.type == SRC_WIN)
+         if (win_info->type == SRC_WIN)
            no_src_str = NO_SRC_STRING;
          else
            no_src_str = NO_DISASSEM_STRING;
@@ -248,8 +248,8 @@ tui_erase_source_content (struct tui_win_info *win_info,
            x_pos = 1;
          else
            x_pos = half_width - strlen (no_src_str);
-         mvwaddstr (win_info->generic.handle,
-                    (win_info->generic.height / 2),
+         mvwaddstr (win_info->handle,
+                    (win_info->height / 2),
                     x_pos,
                     (char *) no_src_str);
 
@@ -260,7 +260,7 @@ tui_erase_source_content (struct tui_win_info *win_info,
 
          tui_set_source_content_nil (win_info, no_src_str);
        }
-      tui_refresh_win (&win_info->generic);
+      tui_refresh_win (win_info);
     }
 }
 
@@ -272,41 +272,41 @@ tui_show_source_line (struct tui_win_info *win_info, int lineno)
   struct tui_win_element *line;
   int x;
 
-  line = win_info->generic.content[lineno - 1];
+  line = win_info->content[lineno - 1];
   if (line->which_element.source.is_exec_point)
-    tui_set_reverse_mode (win_info->generic.handle, true);
+    tui_set_reverse_mode (win_info->handle, true);
 
-  wmove (win_info->generic.handle, lineno, 1);
+  wmove (win_info->handle, lineno, 1);
   tui_puts (line->which_element.source.line,
-           win_info->generic.handle);
+           win_info->handle);
   if (line->which_element.source.is_exec_point)
-    tui_set_reverse_mode (win_info->generic.handle, false);
+    tui_set_reverse_mode (win_info->handle, false);
 
   /* Clear to end of line but stop before the border.  */
-  x = getcurx (win_info->generic.handle);
-  while (x + 1 < win_info->generic.width)
+  x = getcurx (win_info->handle);
+  while (x + 1 < win_info->width)
     {
-      waddch (win_info->generic.handle, ' ');
-      x = getcurx (win_info->generic.handle);
+      waddch (win_info->handle, ' ');
+      x = getcurx (win_info->handle);
     }
 }
 
 void
 tui_show_source_content (struct tui_win_info *win_info)
 {
-  if (win_info->generic.content_size > 0)
+  if (win_info->content_size > 0)
     {
       int lineno;
 
-      for (lineno = 1; lineno <= win_info->generic.content_size; lineno++)
+      for (lineno = 1; lineno <= win_info->content_size; lineno++)
         tui_show_source_line (win_info, lineno);
     }
   else
     tui_erase_source_content (win_info, TRUE);
 
   tui_check_and_display_highlight_if_needed (win_info);
-  tui_refresh_win (&win_info->generic);
-  win_info->generic.content_in_use = TRUE;
+  tui_refresh_win (win_info);
+  win_info->content_in_use = TRUE;
 }
 
 /* See tui-data.h.  */
@@ -316,7 +316,7 @@ tui_source_window_base::refill ()
 {
   symtab *s = nullptr;
 
-  if (generic.type == SRC_WIN)
+  if (type == SRC_WIN)
     {
       symtab_and_line cursal = get_current_source_symtab_and_line ();
       s = (cursal.symtab == NULL
@@ -325,7 +325,7 @@ tui_source_window_base::refill ()
     }
 
   tui_update_source_window_as_is (this, gdbarch, s,
-                                 generic.content[0]
+                                 content[0]
                                    ->which_element.source.line_or_addr,
                                  FALSE);
 }
@@ -336,7 +336,7 @@ void
 tui_source_window_base::do_scroll_horizontal
   (enum tui_scroll_direction direction, int num_to_scroll)
 {
-  if (generic.content != NULL)
+  if (content != NULL)
     {
       int offset;
 
@@ -362,10 +362,9 @@ tui_source_window_base::set_is_exec_point_at (struct tui_line_or_address l)
 {
   int changed = 0;
   int i;
-  tui_win_content content = generic.content;
 
   i = 0;
-  while (i < generic.content_size)
+  while (i < content_size)
     {
       int new_state;
       struct tui_line_or_address content_loa =
@@ -422,14 +421,14 @@ tui_update_breakpoint_info (struct tui_win_info *win,
   int need_refresh = 0;
   tui_source_window_base *src = (tui_source_window_base *) win;
 
-  for (i = 0; i < win->generic.content_size; i++)
+  for (i = 0; i < win->content_size; i++)
     {
       struct breakpoint *bp;
       extern struct breakpoint *breakpoint_chain;
       int mode;
       struct tui_source_element *line;
 
-      line = &win->generic.content[i]->which_element.source;
+      line = &win->content[i]->which_element.source;
       if (current_only && !line->is_exec_point)
          continue;
 
@@ -496,20 +495,20 @@ tui_set_exec_info_content (struct tui_win_info *win_info)
 
       if (exec_info_ptr->content == NULL)
        exec_info_ptr->content =
-         tui_alloc_content (win_info->generic.height, exec_info_ptr->type);
+         tui_alloc_content (win_info->height, exec_info_ptr->type);
       if (exec_info_ptr->content != NULL)
        {
          int i;
 
           tui_update_breakpoint_info (win_info, 1);
-         for (i = 0; i < win_info->generic.content_size; i++)
+         for (i = 0; i < win_info->content_size; i++)
            {
              struct tui_win_element *element;
              struct tui_win_element *src_element;
               int mode;
 
              element = exec_info_ptr->content[i];
-             src_element = win_info->generic.content[i];
+             src_element = win_info->content[i];
 
               memset(element->which_element.simple_string, ' ',
                      sizeof(element->which_element.simple_string));
@@ -533,7 +532,7 @@ tui_set_exec_info_content (struct tui_win_info *win_info)
               if (src_element->which_element.source.is_exec_point)
                 element->which_element.simple_string[TUI_EXEC_POS] = '>';
            }
-         exec_info_ptr->content_size = win_info->generic.content_size;
+         exec_info_ptr->content_size = win_info->content_size;
        }
       else
        ret = TUI_FAILURE;
@@ -598,16 +597,16 @@ tui_alloc_source_buffer (struct tui_win_info *win_info)
 
   /* The window width/height includes the highlight box.  Determine actual
      content dimensions, including string null-terminators.  */
-  max_lines = win_info->generic.height - 2;
-  line_width = win_info->generic.width - 2 + 1;
+  max_lines = win_info->height - 2;
+  line_width = win_info->width - 2 + 1;
 
   /* Allocate the buffer for the source lines.  */
-  if (win_info->generic.content == NULL)
+  if (win_info->content == NULL)
     {
       /* Allocate the content list.  */
-      win_info->generic.content = tui_alloc_content (max_lines, SRC_WIN);
+      win_info->content = tui_alloc_content (max_lines, SRC_WIN);
       for (i = 0; i < max_lines; i++)
-       win_info->generic.content[i]->which_element.source.line
+       win_info->content[i]->which_element.source.line
          = (char *) xmalloc (line_width);
     }
 
@@ -630,13 +629,13 @@ tui_line_is_displayed (int line,
   else
     threshold = 0;
   i = 0;
-  while (i < win_info->generic.content_size - threshold
+  while (i < win_info->content_size - threshold
         && !is_displayed)
     {
       is_displayed
-       = win_info->generic.content[i]
+       = win_info->content[i]
            ->which_element.source.line_or_addr.loa == LOA_LINE
-         && win_info->generic.content[i]
+         && win_info->content[i]
               ->which_element.source.line_or_addr.u.line_no == line;
       i++;
     }
@@ -660,13 +659,13 @@ tui_addr_is_displayed (CORE_ADDR addr,
   else
     threshold = 0;
   i = 0;
-  while (i < win_info->generic.content_size - threshold
+  while (i < win_info->content_size - threshold
         && !is_displayed)
     {
       is_displayed
-       = win_info->generic.content[i]
+       = win_info->content[i]
            ->which_element.source.line_or_addr.loa == LOA_ADDRESS
-         && win_info->generic.content[i]
+         && win_info->content[i]
               ->which_element.source.line_or_addr.u.addr == addr;
       i++;
     }
index 55a44e8840ec501d2d77b7181fb15bb0faf5729d..693c2ff4a03ead9c5e82460b09d84d1094d3d7af 100644 (file)
@@ -236,9 +236,9 @@ tui_rl_other_window (int count, int key)
   if (win_info)
     {
       tui_set_win_focus_to (win_info);
-      if (TUI_DATA_WIN && TUI_DATA_WIN->generic.is_visible)
+      if (TUI_DATA_WIN && TUI_DATA_WIN->is_visible)
        TUI_DATA_WIN->refresh_all ();
-      keypad (TUI_CMD_WIN->generic.handle, (win_info != TUI_CMD_WIN));
+      keypad (TUI_CMD_WIN->handle, (win_info != TUI_CMD_WIN));
     }
   return 0;
 }
@@ -476,8 +476,8 @@ tui_enable (void)
       tui_show_frame_info (0);
       tui_set_layout (SRC_COMMAND);
       tui_set_win_focus_to (TUI_SRC_WIN);
-      keypad (TUI_CMD_WIN->generic.handle, TRUE);
-      wrefresh (TUI_CMD_WIN->generic.handle);
+      keypad (TUI_CMD_WIN->handle, TRUE);
+      wrefresh (TUI_CMD_WIN->handle);
       tui_finish_init = 0;
     }
   else
@@ -664,7 +664,7 @@ tui_is_window_visible (enum tui_win_type type)
   if (tui_win_list[type] == 0)
     return false;
   
-  return tui_win_list[type]->generic.is_visible;
+  return tui_win_list[type]->is_visible;
 }
 
 int
@@ -676,8 +676,8 @@ tui_get_command_dimension (unsigned int *width,
       return 0;
     }
   
-  *width = TUI_CMD_WIN->generic.width;
-  *height = TUI_CMD_WIN->generic.height;
+  *width = TUI_CMD_WIN->width;
+  *height = TUI_CMD_WIN->height;
   return 1;
 }