2004-01-20 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / tui / tui.h
CommitLineData
f377b406 1/* External/Public TUI Header File.
65f05602
AC
2
3 Copyright 1998, 1999, 2000, 2001, 2004 Free Software Foundation,
4 Inc.
5
f377b406
SC
6 Contributed by Hewlett-Packard Company.
7
8 This file is part of GDB.
9
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. */
c906108c
SS
24
25#ifndef TUI_H
26#define TUI_H
c906108c 27
c906108c 28#include <stdarg.h>
2a5127c4 29#include <string.h>
c906108c
SS
30#include "ansidecl.h"
31
32#if defined(reg)
33#undef reg
34#endif
35#if defined(chtype)
36#undef chtype
37#endif
38
4a4b3fed
AC
39struct ui_file;
40
c906108c
SS
41/* Opaque data type */
42typedef char *Opaque;
c5aa993b 43typedef
507f3c78 44Opaque (*OpaqueFuncPtr) (va_list);
c5aa993b
JM
45 typedef char **OpaqueList;
46 typedef OpaqueList OpaquePtr;
c906108c
SS
47
48/* Generic function pointer */
507f3c78
KB
49 typedef void (*TuiVoidFuncPtr) (va_list);
50 typedef int (*TuiIntFuncPtr) (va_list);
c906108c 51/*
507f3c78 52 typedef Opaque (*TuiOpaqueFuncPtr) (va_list);
c5aa993b
JM
53 */
54 typedef OpaqueFuncPtr TuiOpaqueFuncPtr;
c906108c 55
297d1607 56extern void strcat_to_buf (char *, int, const char *);
c906108c
SS
57
58/* Types of error returns */
65f05602 59 typedef enum tui_status
c5aa993b
JM
60 {
61 TUI_SUCCESS,
62 TUI_FAILURE
63 }
64TuiStatus, *TuiStatusPtr;
c906108c
SS
65
66/* Types of windows */
c5aa993b
JM
67 typedef enum
68 {
69 SRC_WIN = 0,
70 DISASSEM_WIN,
71 DATA_WIN,
72 CMD_WIN,
73 /* This must ALWAYS be AFTER the major windows last */
74 MAX_MAJOR_WINDOWS,
75 /* auxillary windows */
76 LOCATOR_WIN,
77 EXEC_INFO_WIN,
78 DATA_ITEM_WIN,
79 /* This must ALWAYS be next to last */
80 MAX_WINDOWS,
81 UNDEFINED_WIN /* LAST */
82 }
83TuiWinType, *TuiWinTypePtr;
c906108c
SS
84
85/* This is a point definition */
c5aa993b
JM
86 typedef struct _TuiPoint
87 {
88 int x, y;
89 }
90TuiPoint, *TuiPointPtr;
c906108c 91
c906108c
SS
92/* GENERAL TUI FUNCTIONS */
93/* tui.c */
a14ed312 94extern void tuiFree (char *);
39db33d6 95extern CORE_ADDR tuiGetLowDisassemblyAddress (CORE_ADDR, CORE_ADDR);
1403b519
SC
96extern void tui_show_assembly (CORE_ADDR addr);
97extern int tui_is_window_visible (TuiWinType type);
98extern int tui_get_command_dimension (int *width, int *height);
39db33d6
SC
99
100/* Initialize readline and configure the keymap for the switching
101 key shortcut. */
102extern void tui_initialize_readline (void);
103
104/* Enter in the tui mode (curses). */
105extern void tui_enable (void);
106
107/* Leave the tui mode. */
108extern void tui_disable (void);
c906108c 109
e09d2eba
SC
110enum tui_key_mode
111{
112 /* Plain command mode to enter gdb commands. */
113 tui_command_mode,
114
115 /* SingleKey mode with some keys bound to gdb commands. */
116 tui_single_key_mode,
117
118 /* Read/edit one command and return to SingleKey after it's processed. */
119 tui_one_command_mode
120};
121
122extern enum tui_key_mode tui_current_key_mode;
123
124/* Change the TUI key mode by installing the appropriate readline keymap. */
125extern void tui_set_key_mode (enum tui_key_mode mode);
126
c6f60bcd
SC
127extern void tui_initialize_io (void);
128
129extern void tui_initialize_readline (void);
130
131extern int tui_active;
132
133extern void tui_install_hooks (void);
134extern void tui_remove_hooks (void);
135
136extern void tui_show_source (const char *file, int line);
137
138extern struct ui_out *tui_out_new (struct ui_file *stream);
139
c906108c 140/* tuiLayout.c */
7cacb6a3 141extern TuiStatus tui_set_layout (const char *);
c906108c
SS
142
143/* tuiSourceWin.c */
a14ed312 144extern void tuiUpdateAllExecInfos (void);
c906108c 145
c906108c 146#endif /* TUI_H */
This page took 0.413012 seconds and 4 git commands to generate.