1999-10-07 18:44:17 +00:00
|
|
|
// -*- C++ -*-
|
2000-07-24 13:53:19 +00:00
|
|
|
/* This file is part of
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
|
|
|
* Copyright 1995 Matthias Ettrich
|
2001-05-30 13:53:44 +00:00
|
|
|
* Copyright 1995-2001 The LyX Team.
|
2000-07-24 13:53:19 +00:00
|
|
|
*
|
|
|
|
* ====================================================== */
|
1999-10-07 18:44:17 +00:00
|
|
|
|
|
|
|
#ifndef LYXDEBUG_H
|
|
|
|
#define LYXDEBUG_H
|
|
|
|
|
2000-07-24 13:53:19 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2000-03-28 02:18:55 +00:00
|
|
|
#include <iosfwd>
|
|
|
|
|
1999-10-07 18:44:17 +00:00
|
|
|
#include "LString.h"
|
1999-11-25 17:29:19 +00:00
|
|
|
#include "support/lstrings.h"
|
1999-10-07 18:44:17 +00:00
|
|
|
|
|
|
|
/** Ideally this should have been a namespace, but since we try to be
|
|
|
|
compilable on older C++ compilators too, we use a struct instead.
|
|
|
|
This is all the different debug levels that we have.
|
|
|
|
*/
|
|
|
|
struct Debug {
|
|
|
|
///
|
|
|
|
enum type {
|
|
|
|
///
|
|
|
|
NONE = 0,
|
|
|
|
///
|
|
|
|
INFO = (1 << 0), // 1
|
|
|
|
///
|
|
|
|
INIT = (1 << 1), // 2
|
|
|
|
///
|
|
|
|
KEY = (1 << 2), // 4
|
|
|
|
///
|
2000-07-24 13:53:19 +00:00
|
|
|
GUI = (1 << 3), // 8
|
1999-10-07 18:44:17 +00:00
|
|
|
///
|
|
|
|
PARSER = (1 << 4), // 16
|
|
|
|
///
|
|
|
|
LYXRC = (1 << 5), // 32
|
|
|
|
///
|
|
|
|
KBMAP = (1 << 6), // 64
|
|
|
|
///
|
|
|
|
LATEX = (1 << 7), // 128
|
|
|
|
///
|
|
|
|
MATHED = (1 << 8), // 256 // Alejandro, please use this.
|
|
|
|
///
|
|
|
|
FONT = (1 << 9), // 512
|
|
|
|
///
|
|
|
|
TCLASS = (1 << 10), // 1024
|
|
|
|
///
|
|
|
|
LYXVC = (1 << 11), // 2048
|
|
|
|
///
|
|
|
|
LYXSERVER = (1 << 12), // 4096
|
|
|
|
///
|
1999-11-25 17:29:19 +00:00
|
|
|
ROFF = (1 << 13), // 8192
|
|
|
|
///
|
2000-01-06 02:44:26 +00:00
|
|
|
ACTION = (1 << 14), // 16384
|
|
|
|
///
|
2000-01-25 12:35:27 +00:00
|
|
|
LYXLEX = (1 << 15),
|
|
|
|
///
|
2000-04-19 14:42:19 +00:00
|
|
|
DEPEND = (1 << 16),
|
|
|
|
///
|
2000-11-14 02:01:57 +00:00
|
|
|
INSETS = (1 << 17),
|
|
|
|
///
|
|
|
|
FILES = (1 << 18)
|
1999-10-07 18:44:17 +00:00
|
|
|
};
|
|
|
|
///
|
2000-10-11 21:06:43 +00:00
|
|
|
// static const type ANY = type(INFO | INIT | KEY | GUI |
|
|
|
|
// PARSER | LYXRC | KBMAP | LATEX |
|
|
|
|
// MATHED | FONT | TCLASS | LYXVC |
|
|
|
|
// LYXSERVER | ROFF | ACTION | LYXLEX |
|
|
|
|
// DEPEND | INSETS);
|
1999-11-04 01:40:20 +00:00
|
|
|
///
|
2000-10-11 21:06:43 +00:00
|
|
|
static type const ANY;
|
|
|
|
|
1999-10-07 18:44:17 +00:00
|
|
|
/** A function to convert symbolic string names on debug levels
|
|
|
|
to their numerical value.
|
|
|
|
*/
|
1999-12-13 15:31:52 +00:00
|
|
|
static Debug::type value(string const & val);
|
|
|
|
|
|
|
|
/** Display the tags and descriptions of the current debug level
|
|
|
|
of ds
|
|
|
|
*/
|
2000-04-04 00:19:15 +00:00
|
|
|
static void showLevel(std::ostream & o, type level);
|
1999-12-13 15:31:52 +00:00
|
|
|
|
|
|
|
/** show all the possible tags that can be used for debugging */
|
2000-04-04 00:19:15 +00:00
|
|
|
static void showTags(std::ostream & o);
|
1999-12-13 15:31:52 +00:00
|
|
|
|
1999-10-07 18:44:17 +00:00
|
|
|
};
|
1999-12-13 15:31:52 +00:00
|
|
|
|
1999-12-13 21:59:26 +00:00
|
|
|
|
2000-07-15 23:51:46 +00:00
|
|
|
|
2000-03-07 01:14:37 +00:00
|
|
|
inline
|
2000-10-11 21:06:43 +00:00
|
|
|
void operator|=(Debug::type & d1, Debug::type d2)
|
1999-11-04 01:40:20 +00:00
|
|
|
{
|
|
|
|
d1 = static_cast<Debug::type>(d1 | d2);
|
|
|
|
}
|
1999-10-07 18:44:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
#include "support/DebugStream.h"
|
|
|
|
|
1999-12-13 21:59:26 +00:00
|
|
|
|
2000-07-15 23:51:46 +00:00
|
|
|
|
2000-04-04 00:19:15 +00:00
|
|
|
std::ostream & operator<<(std::ostream & o, Debug::type t);
|
1999-10-13 10:34:07 +00:00
|
|
|
|
1999-10-07 18:44:17 +00:00
|
|
|
extern DebugStream lyxerr;
|
|
|
|
|
|
|
|
#endif
|