#ifndef TUI_H
#define TUI_H
-#if defined (HAVE_NCURSES_H)
-#include <ncurses.h>
-#elif defined (HAVE_CURSES_H)
-#include <curses.h>
-#endif
-#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
+#include <string.h>
#include "ansidecl.h"
#if defined(reg)
*/
typedef OpaqueFuncPtr TuiOpaqueFuncPtr;
-extern Opaque vcatch_errors (OpaqueFuncPtr, ...);
-extern Opaque va_catch_errors (OpaqueFuncPtr, va_list);
-
-extern void strcat_to_buf (char *, int, char *);
-extern void strcat_to_buf_with_fmt (char *, int, char *, ...);
+extern void strcat_to_buf (char *, int, const char *);
/* Types of error returns */
typedef enum
}
TuiPoint, *TuiPointPtr;
-/* Generic window information */
- typedef struct _TuiGenWinInfo
- {
- WINDOW *handle; /* window handle */
- TuiWinType type; /* type of window */
- int width; /* window width */
- int height; /* window height */
- TuiPoint origin; /* origin of window */
- OpaquePtr content; /* content of window */
- int contentSize; /* Size of content (# of elements) */
- int contentInUse; /* Can it be used, or is it already used? */
- int viewportHeight; /* viewport height */
- int lastVisibleLine; /* index of last visible line */
- int isVisible; /* whether the window is visible or not */
- }
-TuiGenWinInfo, *TuiGenWinInfoPtr;
-
/* GENERAL TUI FUNCTIONS */
/* tui.c */
-extern void tuiInit (char *argv0);
-extern void tuiInitWindows (void);
-extern void tuiResetScreen (void);
-extern void tuiCleanUp (void);
-extern void tuiError (char *, int);
-extern void tui_vError (va_list);
extern void tuiFree (char *);
-extern Opaque tuiDo (TuiOpaqueFuncPtr, ...);
-extern Opaque tuiDoAndReturnToTop (TuiOpaqueFuncPtr, ...);
-extern Opaque tuiGetLowDisassemblyAddress (Opaque, Opaque);
-extern Opaque tui_vGetLowDisassemblyAddress (va_list);
-extern void tui_vSelectSourceSymtab (va_list);
+extern CORE_ADDR tuiGetLowDisassemblyAddress (CORE_ADDR, CORE_ADDR);
+extern void tui_show_assembly (CORE_ADDR addr);
+extern int tui_is_window_visible (TuiWinType type);
+extern int tui_get_command_dimension (int *width, int *height);
+
+/* Initialize readline and configure the keymap for the switching
+ key shortcut. */
+extern void tui_initialize_readline (void);
+
+/* Enter in the tui mode (curses). */
+extern void tui_enable (void);
+
+/* Leave the tui mode. */
+extern void tui_disable (void);
+
+enum tui_key_mode
+{
+ /* Plain command mode to enter gdb commands. */
+ tui_command_mode,
+
+ /* SingleKey mode with some keys bound to gdb commands. */
+ tui_single_key_mode,
+
+ /* Read/edit one command and return to SingleKey after it's processed. */
+ tui_one_command_mode
+};
+
+extern enum tui_key_mode tui_current_key_mode;
+
+/* Change the TUI key mode by installing the appropriate readline keymap. */
+extern void tui_set_key_mode (enum tui_key_mode mode);
+
+extern void tui_initialize_io (void);
+
+extern void tui_initialize_readline (void);
+
+extern int tui_active;
+
+extern void tui_install_hooks (void);
+extern void tui_remove_hooks (void);
-/* tuiDataWin.c */
-extern void tui_vCheckDataValues (va_list);
+extern void tui_show_source (const char *file, int line);
-/* tuiIO.c */
-extern void tui_vStartNewLines (va_list);
+extern struct ui_out *tui_out_new (struct ui_file *stream);
/* tuiLayout.c */
-extern void tui_vAddWinToLayout (va_list);
-extern TuiStatus tui_vSetLayoutTo (va_list);
+extern TuiStatus tui_set_layout (const char *);
/* tuiSourceWin.c */
-extern void tuiDisplayMainFunction (void);
extern void tuiUpdateAllExecInfos (void);
-extern void tuiUpdateOnEnd (void);
-extern void tui_vAllSetHasBreakAt (va_list);
-extern void tui_vUpdateSourceWindowsWithAddr (va_list);
-/* tuiStack.c */
-extern void tui_vShowFrameInfo (va_list);
-extern void tui_vUpdateLocatorFilename (va_list);
#endif /* TUI_H */