1999-10-07 18:44:17 +00:00
|
|
|
|
// -*- C++ -*-
|
2003-08-23 00:17:00 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file debug.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:27:08 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author Jean-Marc Lasgouttes
|
2002-03-21 17:27:08 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
1999-10-07 18:44:17 +00:00
|
|
|
|
|
|
|
|
|
#ifndef LYXDEBUG_H
|
|
|
|
|
#define LYXDEBUG_H
|
|
|
|
|
|
2000-03-28 02:18:55 +00:00
|
|
|
|
|
2003-09-05 17:23:11 +00:00
|
|
|
|
#include "support/std_string.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),
|
|
|
|
|
///
|
2001-11-09 13:44:48 +00:00
|
|
|
|
FILES = (1 << 18),
|
|
|
|
|
///
|
2001-11-28 16:09:25 +00:00
|
|
|
|
WORKAREA = (1 << 19),
|
|
|
|
|
///
|
2002-02-16 12:33:19 +00:00
|
|
|
|
INSETTEXT = (1 << 20),
|
|
|
|
|
///
|
2003-02-08 19:18:01 +00:00
|
|
|
|
GRAPHICS = (1 << 21),
|
|
|
|
|
/// change tracking
|
2003-09-04 17:01:00 +00:00
|
|
|
|
CHANGES = (1 << 22),
|
|
|
|
|
///
|
|
|
|
|
EXTERNAL = (1 << 23)
|
1999-10-07 18:44:17 +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.
|
|
|
|
|
*/
|
2002-03-21 17:27:08 +00:00
|
|
|
|
static Debug::type value(string const & val);
|
1999-12-13 15:31:52 +00:00
|
|
|
|
|
2002-03-21 17:27:08 +00:00
|
|
|
|
/** Display the tags and descriptions of the current debug level
|
|
|
|
|
of ds
|
1999-12-13 15:31:52 +00:00
|
|
|
|
*/
|
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
|