X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmetricsinfo.h;h=dc3bef45e2eeaef2db63bbc27b008a2784ff2128;hb=ff6706002f89b9c10b98ebd08c00962aacf0a4c7;hp=f48e6bd4d3b3facb550f15848909c75e9ff20019;hpb=99b64f351e737f9593e96d247b256377f62ca5a5;p=lyx.git diff --git a/src/metricsinfo.h b/src/metricsinfo.h index f48e6bd4d3..dc3bef45e2 100644 --- a/src/metricsinfo.h +++ b/src/metricsinfo.h @@ -1,8 +1,20 @@ +// -*- C++ -*- +/** + * \file metricsinfo.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author André Pönitz + * + * Full author contact details are available in file CREDITS. + */ + #ifndef METRICSINFO_H #define METRICSINFO_H #include "lyxfont.h" -#include "LString.h" + +#include class Painter; class BufferView; @@ -21,7 +33,7 @@ enum Styles { }; -// +// // This is the part common to MetricsInfo and PainterInfo // struct MetricsBase { @@ -36,17 +48,15 @@ struct MetricsBase { LyXFont font; /// current math style (display/text/script/..) Styles style; - /// name of current font - string fontname; - /// if this is set... - bool restrictwidth; - /// ... this is valid + /// name of current font - mathed specific + std::string fontname; + /// This is the width available in pixels int textwidth; }; // -// This contains a Metricsbase and Information that's only relevant during +// This contains a MetricsBase and information that's only relevant during // the first phase of the two-phase draw // struct MetricsInfo { @@ -61,12 +71,12 @@ struct MetricsInfo { // -// This contains a Metricsbase and Information that's only relevant during +// This contains a MetricsBase and information that's only relevant during // the second phase of the two-phase draw // struct PainterInfo { /// - explicit PainterInfo(BufferView * bv); + PainterInfo(BufferView * bv, Painter & pain); /// void draw(int x, int y, char c); @@ -74,8 +84,6 @@ struct PainterInfo { MetricsBase base; /// Painter & pain; - /// width of current item - int width; }; @@ -166,4 +174,12 @@ struct WidthChanger : public Changer }; +// temporarily change the used color +struct ColorChanger : public Changer { + /// + ColorChanger(LyXFont & font, std::string const & color); + /// + ~ColorChanger(); +}; + #endif