~ubuntu-branches/ubuntu/karmic/ddd/karmic

« back to all changes in this revision

Viewing changes to ddd/status.h

  • Committer: Bazaar Package Importer
  • Author(s): J.H.M. Dassen (Ray)
  • Date: 2002-04-20 16:30:46 UTC
  • Revision ID: james.westby@ubuntu.com-20020420163046-9d8kr3forrzvqyve
Tags: upstream-3.3.1
ImportĀ upstreamĀ versionĀ 3.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// $Id: status.h,v 1.20 2000/12/11 12:21:48 zeller Exp $ -*- C++ -*-
 
2
// Interpret GDB output
 
3
 
 
4
// Copyright (C) 1996 Technische Universitaet Braunschweig, Germany.
 
5
// Written by Andreas Zeller <zeller@gnu.org>.
 
6
// 
 
7
// This file is part of DDD.
 
8
// 
 
9
// DDD is free software; you can redistribute it and/or
 
10
// modify it under the terms of the GNU General Public
 
11
// License as published by the Free Software Foundation; either
 
12
// version 2 of the License, or (at your option) any later version.
 
13
// 
 
14
// DDD is distributed in the hope that it will be useful,
 
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
17
// See the GNU General Public License for more details.
 
18
// 
 
19
// You should have received a copy of the GNU General Public
 
20
// License along with DDD -- see the file COPYING.
 
21
// If not, write to the Free Software Foundation, Inc.,
 
22
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
23
// 
 
24
// DDD is the data display debugger.
 
25
// For details, see the DDD World-Wide-Web page, 
 
26
// `http://www.gnu.org/software/ddd/',
 
27
// or send a mail to the DDD developers <ddd@gnu.org>.
 
28
 
 
29
#ifndef _DDD_status_h
 
30
#define _DDD_status_h
 
31
 
 
32
#ifdef __GNUG__
 
33
#pragma interface
 
34
#endif
 
35
 
 
36
#include "strclass.h"
 
37
#include "bool.h"
 
38
#include "Delay.h"
 
39
#include "MString.h"
 
40
#include <X11/Intrinsic.h>
 
41
 
 
42
// Show MESSAGE in status window.
 
43
// If TEMPORARY is set, override locks and do not add to status history.
 
44
void set_status(string message, bool temporary = false);
 
45
 
 
46
// Same, but use an MString.
 
47
void set_status_mstring(MString text, bool temporary = false);
 
48
 
 
49
// Return current contents of status line
 
50
extern const MString& current_status(void);
 
51
 
 
52
// Status history
 
53
extern Widget status_history(Widget parent);
 
54
 
 
55
// Buttons and state
 
56
void set_buttons_from_gdb(Widget w, string& text);
 
57
void set_status_from_gdb(const string& text);
 
58
 
 
59
 // True if last cmd came from GDB window
 
60
extern bool gdb_keyboard_command;
 
61
 
 
62
// True if asking `yes or no'
 
63
extern bool gdb_asks_yn;
 
64
 
 
65
// True if the next line is to be displayed in the status line
 
66
extern bool show_next_line_in_status;
 
67
 
 
68
// Number of messages to keep in status history
 
69
extern int status_history_size;
 
70
 
 
71
// Status lock
 
72
void lock_status(void);         // Place a lock on status
 
73
void unlock_status(void);               // Remove lock from status
 
74
void reset_status_lock(void);   // Remove all locks from status
 
75
 
 
76
// These are convenient for setting the status during a function
 
77
class _StatusMsg {
 
78
private:
 
79
    string cause;
 
80
 
 
81
public:
 
82
    string outcome;
 
83
 
 
84
    _StatusMsg(const string& c)
 
85
        : cause(c), outcome("done")
 
86
    {
 
87
        set_status(cause + "...");
 
88
    }
 
89
 
 
90
    virtual ~_StatusMsg()
 
91
    {
 
92
        set_status(cause + "..." + outcome + ".");
 
93
    }
 
94
};
 
95
 
 
96
class StatusMsg: public _StatusMsg {
 
97
public:
 
98
    StatusMsg(const string& c)
 
99
        : _StatusMsg(c)
 
100
    {
 
101
        lock_status();
 
102
    }
 
103
    virtual ~StatusMsg()
 
104
    {
 
105
        unlock_status();
 
106
    }
 
107
};
 
108
 
 
109
class StatusDelay: public StatusMsg, public Delay {
 
110
public:
 
111
    StatusDelay(const string& c)
 
112
        : StatusMsg(c)
 
113
    {}
 
114
};
 
115
 
 
116
#endif // _DDD_status_h
 
117
// DON'T ADD ANYTHING BEHIND THIS #endif