+2002-05-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * src/Makefile.am:
+ * src/PainterBase.C:
+ * src/PainterBase.h:
+ * src/Painter.C:
+ * src/Painter.h:
+ * src/WorkArea.C:
+ * src/WorkArea.h:
+ * src/screen.C:
+ * src/tabular.C:
+ * src/text.C:
+ * src/text2.C: move Painter to frontends/
+
2002-05-22 Lars Gullik Bjønnes <larsbj@birdstep.com>
* buffer.C: comment out some some code that depend upon lyx_format
#pragma interface
#endif
-#include "PainterBase.h"
+#include "frontends/Painter.h"
#include <boost/scoped_ptr.hpp>
Variables.C \
Variables.h \
counters.C \
- counters.h
+ counters.h \
+ tracer.C \
+ tracer.h
INCLUDES = $(SIGC_CFLAGS) $(BOOST_INCLUDES) $(PSPELL_INCLUDES)
LyXView.h \
MenuBackend.C \
MenuBackend.h \
- Painter.C \
- Painter.h \
- PainterBase.C \
- PainterBase.h \
ParagraphParameters.C \
ParagraphParameters.h \
ParameterStruct.h \
texrow.h \
text.C \
text2.C \
- tracer.C \
- tracer.h \
trans.C \
trans.h \
trans_decl.h \
undo.h \
undo_funcs.C \
undo_funcs.h \
- undostack.C \
- undostack.h \
vc-backend.C \
vc-backend.h \
version.C \
+++ /dev/null
-/* This file is part of
- * ======================================================
- *
- * LyX, The Document Processor
- *
- * Copyright 1998-2001 The LyX Team
- *
- *======================================================*/
-
-#include <config.h>
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include "Painter.h"
-#include "LString.h"
-#include "debug.h"
-#include "lyxfont.h"
-#include "WorkArea.h"
-#include "font.h"
-#include "ColorHandler.h"
-#include "lyxrc.h"
-#include "encoding.h"
-#include "language.h"
-
-#include "frontends/GUIRunTime.h"
-#include "graphics/GraphicsImage.h"
-
-#include "support/LAssert.h"
-#include "support/lstrings.h"
-
-#include <boost/scoped_array.hpp>
-
-#include <cmath>
-
-
-using std::endl;
-using std::max;
-
-namespace {
-
-inline
-Display * display()
-{
- return GUIRunTime::x11Display();
-}
-
-}
-
-
-Painter::Painter(WorkArea & wa)
- : PainterBase(wa)
-{}
-
-
-// Basic drawing routines
-
-PainterBase & Painter::point(int x, int y, LColor::color c)
-{
- XDrawPoint(display(), owner.getPixmap(),
- lyxColorHandler->getGCForeground(c), x, y);
- return *this;
-}
-
-
-PainterBase & Painter::line(int x1, int y1, int x2, int y2,
- LColor::color col,
- enum line_style ls,
- enum line_width lw)
-{
- XDrawLine(display(), owner.getPixmap(),
- lyxColorHandler->getGCLinepars(ls, lw, col),
- x1, y1, x2, y2);
- return *this;
-}
-
-
-PainterBase & Painter::lines(int const * xp, int const * yp, int np,
- LColor::color col,
- enum line_style ls,
- enum line_width lw)
-{
- boost::scoped_array<XPoint> points(new XPoint[np]);
-
- for (int i = 0; i < np; ++i) {
- points[i].x = xp[i];
- points[i].y = yp[i];
- }
-
- XDrawLines(display(), owner.getPixmap(),
- lyxColorHandler->getGCLinepars(ls, lw, col),
- points.get(), np, CoordModeOrigin);
-
- return *this;
-}
-
-
-PainterBase & Painter::rectangle(int x, int y, int w, int h,
- LColor::color col,
- enum line_style ls,
- enum line_width lw)
-{
- XDrawRectangle(display(), owner.getPixmap(),
- lyxColorHandler->getGCLinepars(ls, lw, col),
- x, y, w, h);
- return *this;
-}
-
-
-PainterBase & Painter::fillRectangle(int x, int y, int w, int h,
- LColor::color col)
-{
- XFillRectangle(display(), owner.getPixmap(),
- lyxColorHandler->getGCForeground(col), x, y, w, h);
- return *this;
-}
-
-
-PainterBase & Painter::fillPolygon(int const * xp, int const * yp, int np,
- LColor::color col)
-{
- boost::scoped_array<XPoint> points(new XPoint[np]);
-
- for (int i = 0; i < np; ++i) {
- points[i].x = xp[i];
- points[i].y = yp[i];
- }
-
- XFillPolygon(display(), owner.getPixmap(),
- lyxColorHandler->getGCForeground(col), points.get(), np,
- Nonconvex, CoordModeOrigin);
-
- return *this;
-}
-
-
-PainterBase & Painter::arc(int x, int y,
- unsigned int w, unsigned int h,
- int a1, int a2, LColor::color col)
-{
- XDrawArc(display(), owner.getPixmap(),
- lyxColorHandler->getGCForeground(col),
- x, y, w, h, a1, a2);
- return *this;
-}
-
-
-/// Draw lines from x1,y1 to x2,y2. They are arrays
-PainterBase & Painter::segments(int const * x1, int const * y1,
- int const * x2, int const * y2, int ns,
- LColor::color col,
- enum line_style ls, enum line_width lw)
-{
- boost::scoped_array<XSegment> s(new XSegment[ns]);
-
- for (int i = 0; i < ns; ++i) {
- s[i].x1 = x1[i];
- s[i].y1 = y1[i];
- s[i].x2 = x2[i];
- s[i].y2 = y2[i];
- }
- XDrawSegments(display(), owner.getPixmap(),
- lyxColorHandler->getGCLinepars(ls, lw, col),
- s.get(), ns);
-
- return *this;
-}
-
-
-PainterBase & Painter::image(int x, int y, int w, int h,
- grfx::GImage const & image)
-{
- XGCValues val;
- val.function = GXcopy;
- GC gc = XCreateGC(display(), owner.getPixmap(),
- GCFunction, &val);
- XCopyArea(display(), image.getPixmap(), owner.getPixmap(), gc,
- 0, 0, w, h, x, y);
- XFreeGC(display(), gc);
- return *this;
-}
-
-
-PainterBase & Painter::text(int x, int y, string const & s, LyXFont const & f)
-{
- return text(x, y, s.data(), s.length(), f);
-}
-
-
-PainterBase & Painter::text(int x, int y, char c, LyXFont const & f)
-{
- char s[2] = { c, '\0' };
- return text(x, y, s, 1, f);
-}
-
-
-PainterBase & Painter::text(int x, int y, char const * s, size_t ls,
- LyXFont const & f)
-{
- if (lyxrc.font_norm_type == LyXRC::ISO_10646_1) {
- boost::scoped_array<XChar2b> xs(new XChar2b[ls]);
- Encoding const * encoding = f.language()->encoding();
- LyXFont font(f);
- if (f.isSymbolFont()) {
-#ifdef USE_UNICODE_FOR_SYMBOLS
- font.setFamily(LyXFont::ROMAN_FAMILY);
- font.setShape(LyXFont::UP_SHAPE);
-#endif
- encoding = encodings.symbol_encoding();
- }
- for (size_t i = 0; i < ls; ++i) {
- Uchar c = encoding->ucs(s[i]);
- xs[i].byte1 = c >> 8;
- xs[i].byte2 = c & 0xff;
- }
- text(x , y, xs.get(), ls, font);
- return *this;
- }
-
- GC gc = lyxColorHandler->getGCForeground(f.realColor());
- if (f.realShape() != LyXFont::SMALLCAPS_SHAPE) {
- lyxfont::XSetFont(display(), gc, f);
- XDrawString(display(), owner.getPixmap(), gc, x, y, s, ls);
- } else {
- LyXFont smallfont(f);
- smallfont.decSize().decSize().setShape(LyXFont::UP_SHAPE);
- int tmpx = x;
- for (size_t i = 0; i < ls; ++i) {
- char const c = uppercase(s[i]);
- if (c != s[i]) {
- lyxfont::XSetFont(display(), gc, smallfont);
- XDrawString(display(), owner.getPixmap(), gc,
- tmpx, y, &c, 1);
- tmpx += lyxfont::XTextWidth(smallfont, &c, 1);
- } else {
- lyxfont::XSetFont(display(), gc, f);
- XDrawString(display(), owner.getPixmap(), gc,
- tmpx, y, &c, 1);
- tmpx += lyxfont::XTextWidth(f, &c, 1);
- }
- }
- }
-
- if (f.underbar() == LyXFont::ON) {
- underline(f, x, y, lyxfont::width(s, ls, f));
- }
-
- return *this;
-}
-
-
-PainterBase & Painter::text(int x, int y, XChar2b const * s, int ls,
- LyXFont const & f)
-{
- GC gc = lyxColorHandler->getGCForeground(f.realColor());
- if (f.realShape() != LyXFont::SMALLCAPS_SHAPE) {
- lyxfont::XSetFont(display(), gc, f);
- XDrawString16(display(), owner.getPixmap(), gc, x, y, s, ls);
- } else {
- LyXFont smallfont(f);
- smallfont.decSize().decSize().setShape(LyXFont::UP_SHAPE);
- static XChar2b c;
- int tmpx = x;
- for (int i = 0; i < ls; ++i) {
- if (s[i].byte1)
- c = s[i];
- else {
- c.byte1 = s[i].byte1;
- c.byte2 = uppercase(s[i].byte2);
- }
- if (c.byte2 != s[i].byte2) {
- lyxfont::XSetFont(display(), gc, smallfont);
- XDrawString16(display(), owner.getPixmap(), gc,
- tmpx, y, &c, 1);
- tmpx += lyxfont::XTextWidth16(smallfont, &c, 1);
- } else {
- lyxfont::XSetFont(display(), gc, f);
- XDrawString16(display(), owner.getPixmap(), gc,
- tmpx, y, &c, 1);
- tmpx += lyxfont::XTextWidth16(f, &c, 1);
- }
- }
- }
-
- if (f.underbar() == LyXFont::ON) {
- underline(f, x, y, lyxfont::width(s, ls, f));
- }
-
- return *this;
-}
-
-
-void Painter::underline(LyXFont const & f, int x, int y, int width)
-{
- int const below = max(lyxfont::maxDescent(f) / 2, 2);
- int const height = max((lyxfont::maxDescent(f) / 4) - 1, 1);
- if (height < 2)
- line(x, y + below, x + width, y + below, f.color());
- else
- fillRectangle(x, y + below, width, below + height,
- f.color());
-}
+++ /dev/null
-// -*- C++ -*-
-/* This file is part of
- * ======================================================
- *
- * LyX, The Document Processor
- *
- * Copyright 1995-2001 The LyX Team
- *
- * ======================================================*/
-
-#ifndef PAINTER_H
-#define PAINTER_H
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include "LString.h"
-
-// This is only included to provide stuff for the non-public sections
-#include <X11/Xlib.h>
-
-#include "PainterBase.h"
-
-class LyXFont;
-class WorkArea;
-
-/** An inplementation for the X Window System. Xlib.
- Classes similar to this one can be made for gtk+, Qt, etc.
-*/
-class Painter : public PainterBase {
-public:
- /// Constructor
- explicit Painter(WorkArea &);
-
- /// Draw a line from point to point
- PainterBase & line(int x1, int y1, int x2, int y2,
- LColor::color = LColor::foreground,
- enum line_style = line_solid,
- enum line_width = line_thin);
-
- /// Here xp and yp are arrays of points
- PainterBase & lines(int const * xp, int const * yp, int np,
- LColor::color = LColor::foreground,
- enum line_style = line_solid,
- enum line_width = line_thin);
-
- /// Here xp and yp are arrays of points
- PainterBase & fillPolygon(int const * xp, int const * yp, int np,
- LColor::color = LColor::foreground);
-
- /// Draw lines from x1,y1 to x2,y2. They are arrays
- PainterBase & segments(int const * x1, int const * y1,
- int const * x2, int const * y2, int ns,
- LColor::color = LColor::foreground,
- enum line_style = line_solid,
- enum line_width = line_thin);
-
- /// Draw a rectangle
- PainterBase & rectangle(int x, int y, int w, int h,
- LColor::color = LColor::foreground,
- enum line_style = line_solid,
- enum line_width = line_thin);
-
- /// Draw an arc
- PainterBase & arc(int x, int y, unsigned int w, unsigned int h,
- int a1, int a2,
- LColor::color = LColor::foreground);
-
- /// Draw a pixel
- PainterBase & point(int x, int y, LColor::color = LColor::foreground);
-
- /// Fill a rectangle
- PainterBase & fillRectangle(int x, int y, int w, int h,
- LColor::color);
-
- /// For the graphics inset.
- PainterBase & image(int x, int y, int w, int h,
- grfx::GImage const & image);
-
- /// Draw a string at position x, y (y is the baseline)
- PainterBase & text(int x, int y,
- string const & str, LyXFont const & f);
-
- /** Draw a string at position x, y (y is the baseline)
- This is just for fast drawing */
- PainterBase & text(int x, int y, char const * str, size_t l,
- LyXFont const & f);
-
- /// Draw a char at position x, y (y is the baseline)
- PainterBase & text(int x, int y, char c, LyXFont const & f);
-
- /// Draw a wide string at position x, y
- PainterBase & text(int x, int y, XChar2b const * str, int l,
- LyXFont const & f);
-private:
- /// Check the font, and if set, draw an underline
- void underline(LyXFont const & f, int x, int y, int width);
-};
-
-#endif
+++ /dev/null
-/* This file is part of
- * ======================================================
- *
- * LyX, The Document Processor
- *
- * Copyright 1998-2001 The LyX Team
- *
- *======================================================*/
-
-#include <config.h>
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include "PainterBase.h"
-#include "lyxfont.h"
-#include "WorkArea.h"
-#include "font.h"
-
-
-int PainterBase::paperMargin() const
-{
- return 20;
-}
-
-
-int PainterBase::paperWidth() const
-{
- return owner.workWidth();
-}
-
-
-int PainterBase::paperHeight() const
-{
- return owner.height();
-}
-
-
-PainterBase & PainterBase::circle(int x, int y, unsigned int d,
- LColor::color col)
-{
- return ellipse(x, y, d, d, col);
-}
-
-
-PainterBase & PainterBase::ellipse(int x, int y,
- unsigned int w, unsigned int h,
- LColor::color col)
-{
- return arc(x, y, w, h, 0, 0, col);
-}
-
-
-PainterBase & PainterBase::button(int x, int y, int w, int h)
-{
- fillRectangle(x, y, w, h, LColor::buttonbg);
- buttonFrame(x, y, w, h);
- return * this;
-}
-
-
-PainterBase & PainterBase::buttonFrame(int x, int y, int w, int h)
-{
- // Width of a side of the button
- int d = 2;
-
- fillRectangle(x, y, w, d, LColor::top);
- fillRectangle(x, (y+h-d), w, d, LColor::bottom);
-
- // Now a couple of trapezoids
- int x1[4], y1[4];
-
- x1[0] = x + d; y1[0] = y + d;
- x1[1] = x + d; y1[1] = (y + h - d);
- x1[2] = x; y1[2] = y + h;
- x1[3] = x; y1[3] = y;
- fillPolygon(x1, y1, 4, LColor::left);
-
- x1[0] = (x + w - d); y1[0] = y + d;
- x1[1] = (x + w - d); y1[1] = (y + h - d);
- x1[2] = x + w; y1[2] = (y + h - d);
- x1[3] = x + w; y1[3] = y;
- fillPolygon(x1, y1, 4, LColor::right);
-
- return *this;
-}
-
-
-PainterBase & PainterBase::rectText(int x, int baseline,
- string const & str,
- LyXFont const & font,
- LColor::color back,
- LColor::color frame)
-{
- int width;
- int ascent;
- int descent;
-
- lyxfont::rectText(str, font, width, ascent, descent);
- rectangle(x, baseline - ascent, width, ascent + descent, frame);
- fillRectangle(x + 1, baseline - ascent + 1, width - 1,
- ascent + descent - 1, back);
- text(x + 3, baseline, str, font);
- return *this;
-}
-
-
-PainterBase & PainterBase::buttonText(int x, int baseline,
- string const & str,
- LyXFont const & font)
-{
- int width;
- int ascent;
- int descent;
-
- lyxfont::buttonText(str, font, width, ascent, descent);
- button(x, baseline - ascent, width, descent + ascent);
- text(x + 4, baseline, str, font);
- return *this;
-}
+++ /dev/null
-// -*- C++ -*-
-/* This file is part of
- * ======================================================
- *
- * LyX, The Document Processor
- *
- * Copyright 1998-2001 The LyX Team
- *
- *======================================================*/
-
-#ifndef PAINTERBASE_H
-#define PAINTERBASE_H
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include "LString.h"
-#include "LColor.h"
-
-class WorkArea;
-class LyXFont;
-namespace grfx {
- class GImage;
-}
-
-/** A painter class to encapsulate all graphics parameters and operations
-
- Every graphics operation in LyX should be made by this class. It will
- be initialized and managed by the Screen class, and will be passed
- as a parameter to inset.
-
- It hides low level windows system parameters so insets and other
- clients don't have to worry about them and we can control graphics and
- GUI toolkit dependent drawing functions inside this single class.
-
- */
-class PainterBase {
-public:
- ///
- enum line_width {
- ///
- line_thin,
- ///
- line_thick
- };
-
- ///
- enum line_style {
- ///
- line_solid,
- ///
- line_doubledash,
- ///
- line_onoffdash
- };
-
- ///
- explicit PainterBase(WorkArea & wa) : owner(wa) {}
-
- ///
- virtual ~PainterBase() {}
-
- /* Screen geometry */
- ///
- int paperMargin() const;
- ///
- int paperWidth() const;
- ///
- int paperHeight() const;
-
- /// Draw a line from point to point
- virtual PainterBase & line(
- int x1, int y1, int x2, int y2,
- LColor::color = LColor::foreground,
- enum line_style = line_solid,
- enum line_width = line_thin) = 0;
-
- /** Draw the lines between the lines in xp and yp.
- xp and yp are arrays of points, and np is the
- number of them. */
- virtual PainterBase & lines(
- int const * xp, int const * yp, int np,
- LColor::color = LColor::foreground,
- enum line_style = line_solid,
- enum line_width = line_thin) = 0;
-
- /// Here xp and yp are arrays of points
- virtual PainterBase & fillPolygon(
- int const * xp, int const * yp,
- int np,
- LColor::color = LColor::foreground) = 0;
-
- /// Draw lines from x1,y1 to x2,y2. They are arrays
- virtual PainterBase & segments(
- int const * x1, int const * y1,
- int const * x2, int const * y2, int ns,
- LColor::color = LColor::foreground,
- enum line_style = line_solid,
- enum line_width = line_thin) = 0;
-
- /// Draw a rectangle
- virtual PainterBase & rectangle(
- int x, int y, int w, int h,
- LColor::color = LColor::foreground,
- enum line_style = line_solid,
- enum line_width = line_thin) = 0;
-
- /// Draw a circle, d is the diameter, not the radious
- virtual PainterBase & circle(
- int x, int y, unsigned int d,
- LColor::color = LColor::foreground);
-
- /// Draw an ellipse
- virtual PainterBase & ellipse(
- int x, int y,
- unsigned int w, unsigned int h,
- LColor::color = LColor::foreground);
-
- /// Draw an arc
- virtual PainterBase & arc(
- int x, int y,
- unsigned int w, unsigned int h,
- int a1, int a2,
- LColor::color = LColor::foreground) = 0;
-
- /// Draw a pixel
- virtual PainterBase & point(
- int x, int y,
- LColor::color = LColor::foreground) = 0;
-
- /// Fill a rectangle
- virtual PainterBase & fillRectangle(
- int x, int y, int w, int h,
- LColor::color) = 0;
-
- /// A filled rectangle with the shape of a 3D button
- virtual PainterBase & button(int x, int y, int w, int h);
-
- ///
- virtual PainterBase & buttonFrame(int x, int y, int w, int h);
-
-
- // For the figure inset
- virtual PainterBase & image(int x, int y, int w, int h,
- grfx::GImage const & image) = 0;
-
- /// Draw a string at position x, y (y is the baseline)
- virtual PainterBase & text(int x, int y,
- string const & str, LyXFont const & f) = 0;
-
- /** Draw a string at position x, y (y is the baseline)
- This is just for fast drawing */
- virtual PainterBase & text(int x, int y, char const * str, size_t l,
- LyXFont const & f) = 0;
-
- /// Draw a char at position x, y (y is the baseline)
- virtual PainterBase & text(int x, int y, char c, LyXFont const & f)=0;
-
- /** Draws a string and encloses it inside a rectangle. */
- PainterBase & rectText(int x, int baseline,
- string const & string,
- LyXFont const & font,
- LColor::color back,
- LColor::color frame);
-
- /** Draw a string and encloses it inside a button frame. */
- PainterBase & buttonText(int x, int baseline, string const & s,
- LyXFont const & font);
-protected:
- ///
- WorkArea & owner;
-};
-
-#endif
#include <sigc++/signal_system.h>
#include FORMS_H_LOCATION
-#include "Painter.h"
+#include "frontends/Painter.h"
///
class WorkArea {
+2002-05-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * Makefile.am:
+ * Painter.h:
+ * Painter.C: add PainterBase here
+
2002-05-22 Lars Gullik Bjønnes <larsbj@birdstep.com>
* Dialogs.h: use more specific smart_ptr header
Liason.h \
Menubar.C \
Menubar.h \
+ Painter.C \
+ Painter.h \
Timeout.C \
Timeout.h \
Toolbar.C \
--- /dev/null
+/* This file is part of
+ * ======================================================
+ *
+ * LyX, The Document Processor
+ *
+ * Copyright 1998-2001 The LyX Team
+ *
+ *======================================================*/
+
+#include <config.h>
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include "Painter.h"
+#include "lyxfont.h"
+#include "WorkArea.h"
+#include "font.h"
+
+
+int PainterBase::paperMargin() const
+{
+ return 20;
+}
+
+
+int PainterBase::paperWidth() const
+{
+ return owner.workWidth();
+}
+
+
+int PainterBase::paperHeight() const
+{
+ return owner.height();
+}
+
+
+PainterBase & PainterBase::circle(int x, int y, unsigned int d,
+ LColor::color col)
+{
+ return ellipse(x, y, d, d, col);
+}
+
+
+PainterBase & PainterBase::ellipse(int x, int y,
+ unsigned int w, unsigned int h,
+ LColor::color col)
+{
+ return arc(x, y, w, h, 0, 0, col);
+}
+
+
+PainterBase & PainterBase::button(int x, int y, int w, int h)
+{
+ fillRectangle(x, y, w, h, LColor::buttonbg);
+ buttonFrame(x, y, w, h);
+ return * this;
+}
+
+
+PainterBase & PainterBase::buttonFrame(int x, int y, int w, int h)
+{
+ // Width of a side of the button
+ int d = 2;
+
+ fillRectangle(x, y, w, d, LColor::top);
+ fillRectangle(x, (y+h-d), w, d, LColor::bottom);
+
+ // Now a couple of trapezoids
+ int x1[4], y1[4];
+
+ x1[0] = x + d; y1[0] = y + d;
+ x1[1] = x + d; y1[1] = (y + h - d);
+ x1[2] = x; y1[2] = y + h;
+ x1[3] = x; y1[3] = y;
+ fillPolygon(x1, y1, 4, LColor::left);
+
+ x1[0] = (x + w - d); y1[0] = y + d;
+ x1[1] = (x + w - d); y1[1] = (y + h - d);
+ x1[2] = x + w; y1[2] = (y + h - d);
+ x1[3] = x + w; y1[3] = y;
+ fillPolygon(x1, y1, 4, LColor::right);
+
+ return *this;
+}
+
+
+PainterBase & PainterBase::rectText(int x, int baseline,
+ string const & str,
+ LyXFont const & font,
+ LColor::color back,
+ LColor::color frame)
+{
+ int width;
+ int ascent;
+ int descent;
+
+ lyxfont::rectText(str, font, width, ascent, descent);
+ rectangle(x, baseline - ascent, width, ascent + descent, frame);
+ fillRectangle(x + 1, baseline - ascent + 1, width - 1,
+ ascent + descent - 1, back);
+ text(x + 3, baseline, str, font);
+ return *this;
+}
+
+
+PainterBase & PainterBase::buttonText(int x, int baseline,
+ string const & str,
+ LyXFont const & font)
+{
+ int width;
+ int ascent;
+ int descent;
+
+ lyxfont::buttonText(str, font, width, ascent, descent);
+ button(x, baseline - ascent, width, descent + ascent);
+ text(x + 4, baseline, str, font);
+ return *this;
+}
--- /dev/null
+// -*- C++ -*-
+/* This file is part of
+ * ======================================================
+ *
+ * LyX, The Document Processor
+ *
+ * Copyright 1998-2001 The LyX Team
+ *
+ *======================================================*/
+
+#ifndef PAINTERBASE_H
+#define PAINTERBASE_H
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#include "LString.h"
+#include "LColor.h"
+
+class WorkArea;
+class LyXFont;
+namespace grfx {
+ class GImage;
+}
+
+/** A painter class to encapsulate all graphics parameters and operations
+
+ Every graphics operation in LyX should be made by this class. It will
+ be initialized and managed by the Screen class, and will be passed
+ as a parameter to inset.
+
+ It hides low level windows system parameters so insets and other
+ clients don't have to worry about them and we can control graphics and
+ GUI toolkit dependent drawing functions inside this single class.
+
+ */
+class PainterBase {
+public:
+ ///
+ enum line_width {
+ ///
+ line_thin,
+ ///
+ line_thick
+ };
+
+ ///
+ enum line_style {
+ ///
+ line_solid,
+ ///
+ line_doubledash,
+ ///
+ line_onoffdash
+ };
+
+ ///
+ explicit PainterBase(WorkArea & wa) : owner(wa) {}
+
+ ///
+ virtual ~PainterBase() {}
+
+ /* Screen geometry */
+ ///
+ int paperMargin() const;
+ ///
+ int paperWidth() const;
+ ///
+ int paperHeight() const;
+
+ /// Draw a line from point to point
+ virtual PainterBase & line(
+ int x1, int y1, int x2, int y2,
+ LColor::color = LColor::foreground,
+ enum line_style = line_solid,
+ enum line_width = line_thin) = 0;
+
+ /** Draw the lines between the lines in xp and yp.
+ xp and yp are arrays of points, and np is the
+ number of them. */
+ virtual PainterBase & lines(
+ int const * xp, int const * yp, int np,
+ LColor::color = LColor::foreground,
+ enum line_style = line_solid,
+ enum line_width = line_thin) = 0;
+
+ /// Here xp and yp are arrays of points
+ virtual PainterBase & fillPolygon(
+ int const * xp, int const * yp,
+ int np,
+ LColor::color = LColor::foreground) = 0;
+
+ /// Draw lines from x1,y1 to x2,y2. They are arrays
+ virtual PainterBase & segments(
+ int const * x1, int const * y1,
+ int const * x2, int const * y2, int ns,
+ LColor::color = LColor::foreground,
+ enum line_style = line_solid,
+ enum line_width = line_thin) = 0;
+
+ /// Draw a rectangle
+ virtual PainterBase & rectangle(
+ int x, int y, int w, int h,
+ LColor::color = LColor::foreground,
+ enum line_style = line_solid,
+ enum line_width = line_thin) = 0;
+
+ /// Draw a circle, d is the diameter, not the radious
+ virtual PainterBase & circle(
+ int x, int y, unsigned int d,
+ LColor::color = LColor::foreground);
+
+ /// Draw an ellipse
+ virtual PainterBase & ellipse(
+ int x, int y,
+ unsigned int w, unsigned int h,
+ LColor::color = LColor::foreground);
+
+ /// Draw an arc
+ virtual PainterBase & arc(
+ int x, int y,
+ unsigned int w, unsigned int h,
+ int a1, int a2,
+ LColor::color = LColor::foreground) = 0;
+
+ /// Draw a pixel
+ virtual PainterBase & point(
+ int x, int y,
+ LColor::color = LColor::foreground) = 0;
+
+ /// Fill a rectangle
+ virtual PainterBase & fillRectangle(
+ int x, int y, int w, int h,
+ LColor::color) = 0;
+
+ /// A filled rectangle with the shape of a 3D button
+ virtual PainterBase & button(int x, int y, int w, int h);
+
+ ///
+ virtual PainterBase & buttonFrame(int x, int y, int w, int h);
+
+
+ // For the figure inset
+ virtual PainterBase & image(int x, int y, int w, int h,
+ grfx::GImage const & image) = 0;
+
+ /// Draw a string at position x, y (y is the baseline)
+ virtual PainterBase & text(int x, int y,
+ string const & str, LyXFont const & f) = 0;
+
+ /** Draw a string at position x, y (y is the baseline)
+ This is just for fast drawing */
+ virtual PainterBase & text(int x, int y, char const * str, size_t l,
+ LyXFont const & f) = 0;
+
+ /// Draw a char at position x, y (y is the baseline)
+ virtual PainterBase & text(int x, int y, char c, LyXFont const & f)=0;
+
+ /** Draws a string and encloses it inside a rectangle. */
+ PainterBase & rectText(int x, int baseline,
+ string const & string,
+ LyXFont const & font,
+ LColor::color back,
+ LColor::color frame);
+
+ /** Draw a string and encloses it inside a button frame. */
+ PainterBase & buttonText(int x, int baseline, string const & s,
+ LyXFont const & font);
+protected:
+ ///
+ WorkArea & owner;
+};
+
+// VERY temporary
+#include "xforms/XPainter.h"
+
+#endif
+2002-05-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * Makefile.am:
+ * XPainter.h:
+ * XPainter.C: move Painter here
+
2002-05-22 Lars Gullik Bjønnes <larsbj@birdstep.com>
* Menubar_pimpl.C: add scoped_ptr.hpp
Toolbar_pimpl.h \
Tooltips.C \
Tooltips.h \
+ XPainter.h \
+ XPainter.C \
xforms_helpers.C \
xforms_helpers.h \
xforms_resize.C \
--- /dev/null
+/* This file is part of
+ * ======================================================
+ *
+ * LyX, The Document Processor
+ *
+ * Copyright 1998-2001 The LyX Team
+ *
+ *======================================================*/
+
+#include <config.h>
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include "frontends/Painter.h"
+#include "LString.h"
+#include "debug.h"
+#include "lyxfont.h"
+#include "WorkArea.h"
+#include "font.h"
+#include "ColorHandler.h"
+#include "lyxrc.h"
+#include "encoding.h"
+#include "language.h"
+
+#include "frontends/GUIRunTime.h"
+#include "graphics/GraphicsImage.h"
+
+#include "support/LAssert.h"
+#include "support/lstrings.h"
+
+#include <boost/scoped_array.hpp>
+
+#include <cmath>
+
+
+using std::endl;
+using std::max;
+
+namespace {
+
+inline
+Display * display()
+{
+ return GUIRunTime::x11Display();
+}
+
+}
+
+
+Painter::Painter(WorkArea & wa)
+ : PainterBase(wa)
+{}
+
+
+// Basic drawing routines
+
+PainterBase & Painter::point(int x, int y, LColor::color c)
+{
+ XDrawPoint(display(), owner.getPixmap(),
+ lyxColorHandler->getGCForeground(c), x, y);
+ return *this;
+}
+
+
+PainterBase & Painter::line(int x1, int y1, int x2, int y2,
+ LColor::color col,
+ enum line_style ls,
+ enum line_width lw)
+{
+ XDrawLine(display(), owner.getPixmap(),
+ lyxColorHandler->getGCLinepars(ls, lw, col),
+ x1, y1, x2, y2);
+ return *this;
+}
+
+
+PainterBase & Painter::lines(int const * xp, int const * yp, int np,
+ LColor::color col,
+ enum line_style ls,
+ enum line_width lw)
+{
+ boost::scoped_array<XPoint> points(new XPoint[np]);
+
+ for (int i = 0; i < np; ++i) {
+ points[i].x = xp[i];
+ points[i].y = yp[i];
+ }
+
+ XDrawLines(display(), owner.getPixmap(),
+ lyxColorHandler->getGCLinepars(ls, lw, col),
+ points.get(), np, CoordModeOrigin);
+
+ return *this;
+}
+
+
+PainterBase & Painter::rectangle(int x, int y, int w, int h,
+ LColor::color col,
+ enum line_style ls,
+ enum line_width lw)
+{
+ XDrawRectangle(display(), owner.getPixmap(),
+ lyxColorHandler->getGCLinepars(ls, lw, col),
+ x, y, w, h);
+ return *this;
+}
+
+
+PainterBase & Painter::fillRectangle(int x, int y, int w, int h,
+ LColor::color col)
+{
+ XFillRectangle(display(), owner.getPixmap(),
+ lyxColorHandler->getGCForeground(col), x, y, w, h);
+ return *this;
+}
+
+
+PainterBase & Painter::fillPolygon(int const * xp, int const * yp, int np,
+ LColor::color col)
+{
+ boost::scoped_array<XPoint> points(new XPoint[np]);
+
+ for (int i = 0; i < np; ++i) {
+ points[i].x = xp[i];
+ points[i].y = yp[i];
+ }
+
+ XFillPolygon(display(), owner.getPixmap(),
+ lyxColorHandler->getGCForeground(col), points.get(), np,
+ Nonconvex, CoordModeOrigin);
+
+ return *this;
+}
+
+
+PainterBase & Painter::arc(int x, int y,
+ unsigned int w, unsigned int h,
+ int a1, int a2, LColor::color col)
+{
+ XDrawArc(display(), owner.getPixmap(),
+ lyxColorHandler->getGCForeground(col),
+ x, y, w, h, a1, a2);
+ return *this;
+}
+
+
+/// Draw lines from x1,y1 to x2,y2. They are arrays
+PainterBase & Painter::segments(int const * x1, int const * y1,
+ int const * x2, int const * y2, int ns,
+ LColor::color col,
+ enum line_style ls, enum line_width lw)
+{
+ boost::scoped_array<XSegment> s(new XSegment[ns]);
+
+ for (int i = 0; i < ns; ++i) {
+ s[i].x1 = x1[i];
+ s[i].y1 = y1[i];
+ s[i].x2 = x2[i];
+ s[i].y2 = y2[i];
+ }
+ XDrawSegments(display(), owner.getPixmap(),
+ lyxColorHandler->getGCLinepars(ls, lw, col),
+ s.get(), ns);
+
+ return *this;
+}
+
+
+PainterBase & Painter::image(int x, int y, int w, int h,
+ grfx::GImage const & image)
+{
+ XGCValues val;
+ val.function = GXcopy;
+ GC gc = XCreateGC(display(), owner.getPixmap(),
+ GCFunction, &val);
+ XCopyArea(display(), image.getPixmap(), owner.getPixmap(), gc,
+ 0, 0, w, h, x, y);
+ XFreeGC(display(), gc);
+ return *this;
+}
+
+
+PainterBase & Painter::text(int x, int y, string const & s, LyXFont const & f)
+{
+ return text(x, y, s.data(), s.length(), f);
+}
+
+
+PainterBase & Painter::text(int x, int y, char c, LyXFont const & f)
+{
+ char s[2] = { c, '\0' };
+ return text(x, y, s, 1, f);
+}
+
+
+PainterBase & Painter::text(int x, int y, char const * s, size_t ls,
+ LyXFont const & f)
+{
+ if (lyxrc.font_norm_type == LyXRC::ISO_10646_1) {
+ boost::scoped_array<XChar2b> xs(new XChar2b[ls]);
+ Encoding const * encoding = f.language()->encoding();
+ LyXFont font(f);
+ if (f.isSymbolFont()) {
+#ifdef USE_UNICODE_FOR_SYMBOLS
+ font.setFamily(LyXFont::ROMAN_FAMILY);
+ font.setShape(LyXFont::UP_SHAPE);
+#endif
+ encoding = encodings.symbol_encoding();
+ }
+ for (size_t i = 0; i < ls; ++i) {
+ Uchar c = encoding->ucs(s[i]);
+ xs[i].byte1 = c >> 8;
+ xs[i].byte2 = c & 0xff;
+ }
+ text(x , y, xs.get(), ls, font);
+ return *this;
+ }
+
+ GC gc = lyxColorHandler->getGCForeground(f.realColor());
+ if (f.realShape() != LyXFont::SMALLCAPS_SHAPE) {
+ lyxfont::XSetFont(display(), gc, f);
+ XDrawString(display(), owner.getPixmap(), gc, x, y, s, ls);
+ } else {
+ LyXFont smallfont(f);
+ smallfont.decSize().decSize().setShape(LyXFont::UP_SHAPE);
+ int tmpx = x;
+ for (size_t i = 0; i < ls; ++i) {
+ char const c = uppercase(s[i]);
+ if (c != s[i]) {
+ lyxfont::XSetFont(display(), gc, smallfont);
+ XDrawString(display(), owner.getPixmap(), gc,
+ tmpx, y, &c, 1);
+ tmpx += lyxfont::XTextWidth(smallfont, &c, 1);
+ } else {
+ lyxfont::XSetFont(display(), gc, f);
+ XDrawString(display(), owner.getPixmap(), gc,
+ tmpx, y, &c, 1);
+ tmpx += lyxfont::XTextWidth(f, &c, 1);
+ }
+ }
+ }
+
+ if (f.underbar() == LyXFont::ON) {
+ underline(f, x, y, lyxfont::width(s, ls, f));
+ }
+
+ return *this;
+}
+
+
+PainterBase & Painter::text(int x, int y, XChar2b const * s, int ls,
+ LyXFont const & f)
+{
+ GC gc = lyxColorHandler->getGCForeground(f.realColor());
+ if (f.realShape() != LyXFont::SMALLCAPS_SHAPE) {
+ lyxfont::XSetFont(display(), gc, f);
+ XDrawString16(display(), owner.getPixmap(), gc, x, y, s, ls);
+ } else {
+ LyXFont smallfont(f);
+ smallfont.decSize().decSize().setShape(LyXFont::UP_SHAPE);
+ static XChar2b c;
+ int tmpx = x;
+ for (int i = 0; i < ls; ++i) {
+ if (s[i].byte1)
+ c = s[i];
+ else {
+ c.byte1 = s[i].byte1;
+ c.byte2 = uppercase(s[i].byte2);
+ }
+ if (c.byte2 != s[i].byte2) {
+ lyxfont::XSetFont(display(), gc, smallfont);
+ XDrawString16(display(), owner.getPixmap(), gc,
+ tmpx, y, &c, 1);
+ tmpx += lyxfont::XTextWidth16(smallfont, &c, 1);
+ } else {
+ lyxfont::XSetFont(display(), gc, f);
+ XDrawString16(display(), owner.getPixmap(), gc,
+ tmpx, y, &c, 1);
+ tmpx += lyxfont::XTextWidth16(f, &c, 1);
+ }
+ }
+ }
+
+ if (f.underbar() == LyXFont::ON) {
+ underline(f, x, y, lyxfont::width(s, ls, f));
+ }
+
+ return *this;
+}
+
+
+void Painter::underline(LyXFont const & f, int x, int y, int width)
+{
+ int const below = max(lyxfont::maxDescent(f) / 2, 2);
+ int const height = max((lyxfont::maxDescent(f) / 4) - 1, 1);
+ if (height < 2)
+ line(x, y + below, x + width, y + below, f.color());
+ else
+ fillRectangle(x, y + below, width, below + height,
+ f.color());
+}
--- /dev/null
+// -*- C++ -*-
+/* This file is part of
+ * ======================================================
+ *
+ * LyX, The Document Processor
+ *
+ * Copyright 1995-2001 The LyX Team
+ *
+ * ======================================================*/
+
+#ifndef PAINTER_H
+#define PAINTER_H
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#include "LString.h"
+
+// This is only included to provide stuff for the non-public sections
+#include <X11/Xlib.h>
+
+#include "frontends/Painter.h"
+
+class LyXFont;
+class WorkArea;
+
+/** An inplementation for the X Window System. Xlib.
+ Classes similar to this one can be made for gtk+, Qt, etc.
+*/
+class Painter : public PainterBase {
+public:
+ /// Constructor
+ explicit Painter(WorkArea &);
+
+ /// Draw a line from point to point
+ PainterBase & line(int x1, int y1, int x2, int y2,
+ LColor::color = LColor::foreground,
+ enum line_style = line_solid,
+ enum line_width = line_thin);
+
+ /// Here xp and yp are arrays of points
+ PainterBase & lines(int const * xp, int const * yp, int np,
+ LColor::color = LColor::foreground,
+ enum line_style = line_solid,
+ enum line_width = line_thin);
+
+ /// Here xp and yp are arrays of points
+ PainterBase & fillPolygon(int const * xp, int const * yp, int np,
+ LColor::color = LColor::foreground);
+
+ /// Draw lines from x1,y1 to x2,y2. They are arrays
+ PainterBase & segments(int const * x1, int const * y1,
+ int const * x2, int const * y2, int ns,
+ LColor::color = LColor::foreground,
+ enum line_style = line_solid,
+ enum line_width = line_thin);
+
+ /// Draw a rectangle
+ PainterBase & rectangle(int x, int y, int w, int h,
+ LColor::color = LColor::foreground,
+ enum line_style = line_solid,
+ enum line_width = line_thin);
+
+ /// Draw an arc
+ PainterBase & arc(int x, int y, unsigned int w, unsigned int h,
+ int a1, int a2,
+ LColor::color = LColor::foreground);
+
+ /// Draw a pixel
+ PainterBase & point(int x, int y, LColor::color = LColor::foreground);
+
+ /// Fill a rectangle
+ PainterBase & fillRectangle(int x, int y, int w, int h,
+ LColor::color);
+
+ /// For the graphics inset.
+ PainterBase & image(int x, int y, int w, int h,
+ grfx::GImage const & image);
+
+ /// Draw a string at position x, y (y is the baseline)
+ PainterBase & text(int x, int y,
+ string const & str, LyXFont const & f);
+
+ /** Draw a string at position x, y (y is the baseline)
+ This is just for fast drawing */
+ PainterBase & text(int x, int y, char const * str, size_t l,
+ LyXFont const & f);
+
+ /// Draw a char at position x, y (y is the baseline)
+ PainterBase & text(int x, int y, char c, LyXFont const & f);
+
+ /// Draw a wide string at position x, y
+ PainterBase & text(int x, int y, XChar2b const * str, int l,
+ LyXFont const & f);
+private:
+ /// Check the font, and if set, draw an underline
+ void underline(LyXFont const & f, int x, int y, int width);
+};
+
+#endif
+2002-05-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * inset.C:
+ * insetbutton.C:
+ * insetcaption.C:
+ * insetcollapsable.C:
+ * insetcommand.C:
+ * inseterror.C:
+ * insetgraphics.C:
+ * insetgraphicsParams.C:
+ * insetlatexaccent.C:
+ * insetquotes.C:
+ * insetspecialchar.C:
+ * insettabular.C:
+ * insettext.C: move Painter to frontends/
+
2002-05-22 Lars Gullik Bjønnes <larsbj@birdstep.com>
* insettabular.h: use more specific smart_ptr header.
#include "debug.h"
#include "BufferView.h"
#include "support/lstrings.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "commandtags.h"
#include "support/lstrings.h"
#include "gettext.h"
#include "insetbutton.h"
#include "debug.h"
#include "BufferView.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "support/LAssert.h"
#include "lyxfont.h"
#include "font.h"
#endif
#include "insetcaption.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "font.h"
#include "BufferView.h"
#include "FloatList.h"
#include "gettext.h"
#include "lyxfont.h"
#include "BufferView.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "debug.h"
#include "lyxtext.h"
#include "font.h"
#include "insetcommand.h"
#include "debug.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "lyxlex.h"
using std::ostream;
#include "gettext.h"
#include "inseterror.h"
#include "LyXView.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "frontends/Dialogs.h"
using std::ostream;
#include "buffer.h"
#include "BufferView.h"
#include "converter.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "lyxrc.h"
#include "font.h" // For the lyxfont class.
#include "debug.h"
}
-bool InsetGraphicsParams::Read(LyXLex & lex, string const& token)
+bool InsetGraphicsParams::Read(LyXLex & lex, string const & token)
{
if (token == "filename") {
lex.next();
#include "lyxrc.h"
#include "support/lstrings.h"
#include "BufferView.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "font.h"
#include "language.h"
#include "support/lstrings.h"
#include "BufferView.h"
#include "LaTeXFeatures.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "buffer.h"
#include "debug.h"
#include "font.h"
#include "debug.h"
#include "LaTeXFeatures.h"
#include "BufferView.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "font.h"
#include "lyxlex.h"
#include "lyxfont.h"
#include "lyxfunc.h"
#include "debug.h"
#include "LaTeXFeatures.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "font.h"
#include "lyxtext.h"
#include "LyXView.h"
#include "BufferView.h"
#include "lyxtextclasslist.h"
#include "LaTeXFeatures.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "lyxtext.h"
#include "lyxcursor.h"
#include "CutAndPaste.h"
if ((top_x + drawTextXOffset + w) > pain.paperWidth())
w = pain.paperWidth();
// w -= TEXT_TO_INSET_OFFSET;
- pain.fillRectangle(top_x, ty, w+1, h+1, backgroundColor());
+ pain.fillRectangle(top_x + 1, ty + 1, w - 1, h - 1, backgroundColor());
cleared = true;
need_update = FULL;
frame_is_visible = false;
+2002-05-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * formula.C:
+ * formulabase.C:
+ * formulamacro.C:
+ * math_binaryopinset.C:
+ * math_casesinset.C:
+ * math_charinset.C:
+ * math_cursor.C:
+ * math_fracinset.C:
+ * math_funcinset.C:
+ * math_gridinset.C:
+ * math_hullinset.C:
+ * math_macro.C:
+ * math_macrotemplate.C:
+ * math_rootinset.C:
+ * math_spaceinset.C:
+ * math_sqrtinset.C:
+ * math_stringinset.C:
+ * math_support.C:
+ * math_unknowninset.C:
+ * math_xdata.C:
+ * math_xyarrowinset.C: move Painter to frontends/
+
2002-05-22 Lars Gullik Bjønnes <larsbj@birdstep.com>
* math_exintinset.C: use more specific smart_ptr header.
#include "support/systemcall.h"
#include "support/filetools.h" // LibFileSearch
#include "LyXView.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "lyxrc.h"
#include "math_hullinset.h"
#include "math_support.h"
#include "math_support.h"
#include "support/lstrings.h"
#include "LyXView.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "font.h"
#include "Lsstream.h"
#include "math_arrayinset.h"
#include "math_mathmlstream.h"
#include "BufferView.h"
#include "gettext.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "font.h"
#include "support/lyxlib.h"
#include "support/LOstream.h"
#endif
#include "math_binaryopinset.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "support/LOstream.h"
#include "math_support.h"
#include "math_mathmlstream.h"
#include "math_parser.h"
#include "math_mathmlstream.h"
#include "math_support.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
MathCasesInset::MathCasesInset(row_type n)
#include "math_charinset.h"
#include "LColor.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "support/LOstream.h"
#include "font.h"
#include "debug.h"
#include "support/LAssert.h"
#include "debug.h"
#include "LColor.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "math_cursor.h"
#include "formulabase.h"
#include "math_arrayinset.h"
#include "math_fracinset.h"
#include "math_support.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "math_mathmlstream.h"
#include "textpainter.h"
#include "math_funcinset.h"
#include "font.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "math_support.h"
#include "math_mathmlstream.h"
#include "math_streamstr.h"
#include "math_mathmlstream.h"
#include "math_streamstr.h"
#include "lyxfont.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "debug.h"
#include "math_streamstr.h"
#include "math_support.h"
#include "debug.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "textpainter.h"
#include "Lsstream.h"
#include "LaTeXFeatures.h"
#include "support/lstrings.h"
#include "support/LAssert.h"
#include "debug.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "LaTeXFeatures.h"
#include "math_macrotemplate.h"
#include "math_mathmlstream.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "debug.h"
#include "math_rootinset.h"
#include "math_mathmlstream.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
using std::max;
#include "math_spaceinset.h"
#include "math_support.h"
#include "LColor.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "math_mathmlstream.h"
#include "math_sqrtinset.h"
#include "math_mathmlstream.h"
#include "LColor.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "textpainter.h"
#include "math_mathmlstream.h"
#include "math_streamstr.h"
#include "LColor.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "math_support.h"
#include "math_parser.h"
#include "LaTeXFeatures.h"
#include "math_defs.h"
#include "math_inset.h"
#include "math_parser.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "debug.h"
#include "commandtags.h"
#include "math_unknowninset.h"
#include "font.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "math_support.h"
#include "math_mathmlstream.h"
#include "math_streamstr.h"
#include "math_scriptinset.h"
#include "math_support.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "textpainter.h"
#include "debug.h"
#include "math_mathmlstream.h"
#include "math_streamstr.h"
#include "math_support.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "debug.h"
#include "lyxscreen.h"
#include "lyxtext.h"
#include "lyxrow.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "WorkArea.h"
#include "buffer.h"
#include "BufferView.h"
#include "layout.h"
#include "buffer.h"
#include "BufferView.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "LaTeXFeatures.h"
#include "insets/insettabular.h"
#include "insets/insettext.h"
#include "debug.h"
#include "lyxrc.h"
#include "LyXView.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "tracer.h"
#include "font.h"
#include "encoding.h"
#include "BufferView.h"
#include "LyXView.h"
#include "CutAndPaste.h"
-#include "Painter.h"
+#include "frontends/Painter.h"
#include "font.h"
#include "debug.h"
#include "lyxrc.h"
freezeUndo();
cursor = selection.start;
while (cursor.par() != selection.end.par() ||
- (cursor.pos() < selection.end.pos()))
+ cursor.pos() < selection.end.pos())
{
if (cursor.pos() < cursor.par()->size()) {
- // an open footnote should behave
- // like a closed one
+ // an open footnote should behave like a closed one
setCharFont(bview, cursor.par(), cursor.pos(),
font, toggleall);
cursor.pos(cursor.pos() + 1);
void LyXText::status(BufferView * bview, LyXText::text_status st) const
{
- // well as much as I know && binds more then || so the above and the
- // below are identical (this for your known use of parentesis!)
- // Now some explanation:
// We should only go up with refreshing code so this means that if
// we have a MORE refresh we should never set it to LITTLE if we still
// didn't handle it (and then it will be UNCHANGED. Now as long as