+2004-01-23 Andrew Cagney <cagney@redhat.com>
+
+ * printcmd.c (display_command): Replace tui_set_display call with
+ tui_set_layout_for_display_command.
+ * tui/tui.h (enum tui_win_type): Define.
+ (tui_set_layout): Delete declaration.
+ (tui_set_layout_for_display_command): Rename set_tui_layout.
+ * tui/tui-data.h (enum tui_layout_type): Define.
+ * tui/tui-layout.h: Update copyright. Include "tui-data.h" and
+ "tui.h".
+ (tui_add_win_to_layout): Rename tuiAddWinToLayout.
+ (tui_default_win_height): Rename tuiDefaultWinHeight.
+ (tui_default_win_viewport_height): Rename
+ tuiDefaultWinViewportHeight.
+ (tui_set_layout): RenametuiSetLayout.
+ * tui/tui-layout.c: Update references.
+ * tui/tui.c: Update references.
+ * tui/tui-disasm.c: Update references.
+
2004-01-23 David Carlton <carlton@kealia.com>
Partial workaround for PR c++/1511:
/* NOTE: cagney/2003-02-13 The `tui_active' was previously
`tui_version'. */
if (tui_active && *exp == '$')
- display_it = (tui_set_layout (exp) == TUI_FAILURE);
+ display_it = (tui_set_layout_for_display_command (exp) == TUI_FAILURE);
#endif
if (display_it)
/* The kinds of layouts available */
-typedef enum
+typedef enum tui_layout_type
{
SRC_COMMAND,
DISASSEM_COMMAND,
TuiLineOrAddress val;
val.addr = startAddr;
- tuiAddWinToLayout (DISASSEM_WIN);
+ tui_add_win_to_layout (DISASSEM_WIN);
tuiUpdateSourceWindow (disassemWin, s, val, FALSE);
/*
** if the focus was in the src win, put it in the asm win, if the
/* Determine where to start the disassembly so that the pc is about in the
middle of the viewport. */
- pos = tuiDefaultWinViewportHeight (DISASSEM_WIN, DISASSEM_COMMAND) / 2;
+ pos = tui_default_win_viewport_height (DISASSEM_WIN, DISASSEM_COMMAND) / 2;
pc = tui_find_disassembly_address (pc, -pos);
if (pc < low)
}
-/*
- ** tuiSetLayout()
- ** Function to set the layout to SRC_COMMAND, DISASSEM_COMMAND,
- ** SRC_DISASSEM_COMMAND, SRC_DATA_COMMAND, or DISASSEM_DATA_COMMAND.
- ** If the layout is SRC_DATA_COMMAND, DISASSEM_DATA_COMMAND, or
- ** UNDEFINED_LAYOUT, then the data window is populated according
- ** to regsDisplayType.
- */
-TuiStatus
-tuiSetLayout (TuiLayoutType layoutType,
- TuiRegisterDisplayType regsDisplayType)
+/* Function to set the layout to SRC_COMMAND, DISASSEM_COMMAND,
+ SRC_DISASSEM_COMMAND, SRC_DATA_COMMAND, or DISASSEM_DATA_COMMAND.
+ If the layout is SRC_DATA_COMMAND, DISASSEM_DATA_COMMAND, or
+ UNDEFINED_LAYOUT, then the data window is populated according to
+ regsDisplayType. */
+enum tui_status
+tui_set_layout (enum tui_layout_type layoutType,
+ enum tui_register_display_type regsDisplayType)
{
TuiStatus status = TUI_SUCCESS;
return status;
}
-/*
- ** tuiAddWinToLayout().
- ** Add the specified window to the layout in a logical way.
- ** This means setting up the most logical layout given the
- ** window to be added.
- */
+/* Add the specified window to the layout in a logical way. This
+ means setting up the most logical layout given the window to be
+ added. */
void
-tuiAddWinToLayout (TuiWinType type)
+tui_add_win_to_layout (enum tui_win_type type)
{
TuiLayoutType curLayout = currentLayout ();
} /* tuiDefaultWinHeight */
-/*
- ** tuiDefaultWinViewportHeight().
- ** Answer the height of a window. If it hasn't been created yet,
- ** answer what the height of a window would be based upon its
- ** type and the layout.
- */
+/* Answer the height of a window. If it hasn't been created yet,
+ answer what the height of a window would be based upon its type and
+ the layout. */
int
-tuiDefaultWinViewportHeight (TuiWinType type, TuiLayoutType layout)
+tui_default_win_viewport_height (enum tui_win_type type,
+ enum tui_layout_type layout)
{
int h;
** $REGS, $GREGS, $FREGS, $SREGS.
*/
TuiStatus
-tui_set_layout (const char *layoutName)
+tui_set_layout_for_display_command (const char *layoutName)
{
TuiStatus status = TUI_SUCCESS;
status = TUI_FAILURE;
xfree (bufPtr);
- tuiSetLayout (newLayout, dpyType);
+ tui_set_layout (newLayout, dpyType);
}
}
else
{
if (layoutDef->split)
{
- tuiSetLayout (SRC_DISASSEM_COMMAND, TUI_UNDEFINED_REGS);
+ tui_set_layout (SRC_DISASSEM_COMMAND, TUI_UNDEFINED_REGS);
tuiSetWinFocusTo (winList[layoutDef->displayMode]);
}
else
{
if (layoutDef->displayMode == SRC_WIN)
- tuiSetLayout (SRC_COMMAND, TUI_UNDEFINED_REGS);
+ tui_set_layout (SRC_COMMAND, TUI_UNDEFINED_REGS);
else
- tuiSetLayout (DISASSEM_DATA_COMMAND, layoutDef->regsDisplayType);
+ tui_set_layout (DISASSEM_DATA_COMMAND, layoutDef->regsDisplayType);
}
tui_enable ();
/* Switch to the selected layout. */
- if (tui_set_layout (arg) != TUI_SUCCESS)
+ if (tui_set_layout_for_display_command (arg) != TUI_SUCCESS)
warning ("Invalid layout specified.\n%s", LAYOUT_USAGE);
}
/* TUI layout window management.
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ Copyright 1998, 1999, 2000, 2001, 2002, 2004 Free Software
+ Foundation, Inc.
+
Contributed by Hewlett-Packard Company.
This file is part of GDB.
#ifndef TUI_LAYOUT_H
#define TUI_LAYOUT_H
-extern void tuiAddWinToLayout (TuiWinType);
-extern int tuiDefaultWinHeight (TuiWinType, TuiLayoutType);
-extern int tuiDefaultWinViewportHeight (TuiWinType, TuiLayoutType);
-extern TuiStatus tuiSetLayout (TuiLayoutType, TuiRegisterDisplayType);
+#include "tui/tui.h"
+#include "tui/tui-data.h"
+
+extern void tui_add_win_to_layout (enum tui_win_type);
+extern int tui_default_win_height (enum tui_win_type, enum tui_layout_type);
+extern int tui_default_win_viewport_height (enum tui_win_type,
+ enum tui_layout_type);
+extern enum tui_status tui_set_layout (enum tui_layout_type,
+ enum tui_register_display_type);
#endif /*TUI_LAYOUT_H */
new_layout = SRC_COMMAND;
break;
}
- tuiSetLayout (new_layout, regs_type);
+ tui_set_layout (new_layout, regs_type);
}
return 0;
}
new_layout = DISASSEM_COMMAND;
break;
}
- tuiSetLayout (new_layout, regs_type);
+ tui_set_layout (new_layout, regs_type);
}
return 0;
}
def_prog_mode ();
tuiShowFrameInfo (0);
- tuiSetLayout (SRC_COMMAND, TUI_UNDEFINED_REGS);
+ tui_set_layout (SRC_COMMAND, TUI_UNDEFINED_REGS);
tuiSetWinFocusTo (srcWin);
keypad (cmdWin->generic.handle, TRUE);
wrefresh (cmdWin->generic.handle);
{
struct symtab_and_line cursal = get_current_source_symtab_and_line ();
/* make sure that the source window is displayed */
- tuiAddWinToLayout (SRC_WIN);
+ tui_add_win_to_layout (SRC_WIN);
tuiUpdateSourceWindowsWithLine (cursal.symtab, line);
tuiUpdateLocatorFilename (file);
void
tui_show_assembly (CORE_ADDR addr)
{
- tuiAddWinToLayout (DISASSEM_WIN);
+ tui_add_win_to_layout (DISASSEM_WIN);
tuiUpdateSourceWindowsWithAddr (addr);
}
TuiStatus, *TuiStatusPtr;
/* Types of windows */
- typedef enum
+typedef enum tui_win_type
{
SRC_WIN = 0,
DISASSEM_WIN,
extern struct ui_out *tui_out_new (struct ui_file *stream);
/* tuiLayout.c */
-extern TuiStatus tui_set_layout (const char *);
+extern enum tui_status tui_set_layout_for_display_command (const char *name);
/* tuiSourceWin.c */
extern void tuiUpdateAllExecInfos (void);