some small updates to Painter, and make the new painter the default.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@555 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2000-02-14 22:14:48 +00:00
parent bc4646a58e
commit d6f638ea96
36 changed files with 225 additions and 137 deletions

View File

@ -1,3 +1,14 @@
2000-02-14 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/Painter.C (text(int,int,char,LyXFont)): call text(int, int,
char const *, int, LyXFont)
(text(int, int, string, LyXFont)): ditto
* src/text.C (InsertCharInTable): attempt to fix the double-space
feature in tables too.
(BackspaceInTable): ditto.
(GetVisibleRow): make bottom pagebreak line be a onoff line.
2000-02-11 Lars Gullik Bjønnes <larsbj@lyx.org> 2000-02-11 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/text2.C (owner): only complain if owner_ is set and bv != 0 * src/text2.C (owner): only complain if owner_ is set and bv != 0

View File

@ -41,7 +41,6 @@ using std::for_each;
#endif #endif
#include "debug.h" #include "debug.h"
#include "lyxdraw.h"
#include "lyx_gui_misc.h" #include "lyx_gui_misc.h"
#include "BackStack.h" #include "BackStack.h"
#include "lyxtext.h" #include "lyxtext.h"
@ -53,6 +52,9 @@ using std::for_each;
#include "lyxrc.h" #include "lyxrc.h"
#include "lyxrow.h" #include "lyxrow.h"
#include "WorkArea.h" #include "WorkArea.h"
#ifndef USE_PAINTER
#include "lyxdraw.h"
#endif
using std::find_if; using std::find_if;

View File

@ -4,7 +4,7 @@
* *
* LyX, The Document Processor * LyX, The Document Processor
* *
* Copyright (C) 1997 Asger Alstrup * Copyright 1997 Asger Alstrup
* and the LyX Team. * and the LyX Team.
* *
* ====================================================== */ * ====================================================== */

View File

@ -16,6 +16,9 @@
#pragma interface #pragma interface
#endif #endif
#define USE_PAINTER 1
#include FORMS_H_LOCATION #include FORMS_H_LOCATION
#include "lyxfont.h" #include "lyxfont.h"
#include "LString.h" #include "LString.h"

View File

@ -10,8 +10,6 @@
#include <config.h> #include <config.h>
#ifdef USE_PAINTER
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation #pragma implementation
#endif #endif
@ -172,5 +170,3 @@ LColor::color LColor::getFromLyXName(string const & lyxname) const
// The evil global LColor instance // The evil global LColor instance
LColor lcolor; LColor lcolor;
#endif

View File

@ -8,8 +8,6 @@
* *
*======================================================*/ *======================================================*/
#ifdef USE_PAINTER
#ifndef LCOLOR_H #ifndef LCOLOR_H
#define LCOLOR_H #define LCOLOR_H
@ -206,5 +204,3 @@ private:
extern LColor lcolor; extern LColor lcolor;
#endif #endif
#endif

View File

@ -119,8 +119,6 @@ lyx_SOURCES = \
lyx_sty.C \ lyx_sty.C \
lyx_sty.h \ lyx_sty.h \
lyxcursor.h \ lyxcursor.h \
lyxdraw.C \
lyxdraw.h \
lyxfont.C \ lyxfont.C \
lyxfont.h \ lyxfont.h \
lyxfr0.C \ lyxfr0.C \

View File

@ -10,8 +10,6 @@
#include <config.h> #include <config.h>
#ifdef USE_PAINTER
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation #pragma implementation
#endif #endif
@ -35,7 +33,7 @@ Painter::Painter(WorkArea & wa)
{ {
colormap = fl_state[fl_get_vclass()].colormap; colormap = fl_state[fl_get_vclass()].colormap;
// Clear the GC cache // Clear the GC cache
for (int i=0; i <= LColor::ignore; ++i) { for (int i = 0; i <= LColor::ignore; ++i) {
colorGCcache[i] = 0; colorGCcache[i] = 0;
} }
} }
@ -43,14 +41,14 @@ Painter::Painter(WorkArea & wa)
Painter::~Painter() { Painter::~Painter() {
// Release all the registered GCs // Release all the registered GCs
for (int i=0; i <= LColor::ignore; ++i) { for (int i = 0; i <= LColor::ignore; ++i) {
if (colorGCcache[i] != 0) { if (colorGCcache[i] != 0) {
XFreeGC(display, colorGCcache[i]); XFreeGC(display, colorGCcache[i]);
} }
} }
// Iterate over the line cache and Free the GCs // Iterate over the line cache and Free the GCs
LineGCCache::iterator lit = lineGCcache.begin(); for (LineGCCache::iterator lit = lineGCcache.begin();
for (; lit != lineGCcache.end(); ++lit) { lit != lineGCcache.end(); ++lit) {
XFreeGC(display, (*lit).second); XFreeGC(display, (*lit).second);
} }
} }
@ -258,18 +256,14 @@ PainterBase & Painter::pixmap(int x, int y, int w, int h, Pixmap bitmap)
PainterBase & Painter::text(int x, int y, string const & s, LyXFont const & f) PainterBase & Painter::text(int x, int y, string const & s, LyXFont const & f)
{ {
if (lyxerr.debugging()) { return text(x, y, s.c_str(), s.length(), f);
if (!Lgb_bug_find_hack) }
lyxerr << "text not called from "
"workarea::workhandler\n";
lyxerr << "Painter drawable: " << drawable << endl; PainterBase & Painter::text(int x, int y, char c, LyXFont const & f)
} {
char s[2] = { c, '\0' };
GC gc = getGCForeground(f.realColor()); return text(x, y, s, 1, f);
XSetFont(display, gc, f.getFontID());
XDrawString(display, drawable, gc, x, y, s.c_str(), s.length());
underline(f, x, y, this->width(s, f));
return *this;
} }
@ -291,26 +285,8 @@ PainterBase & Painter::text(int x, int y, char const * s, int ls,
} }
PainterBase & Painter::text(int x, int y, char c, LyXFont const & f) void Painter::underline(LyXFont const & f, int x, int y, int width)
{ {
if (lyxerr.debugging()) {
if (!Lgb_bug_find_hack)
lyxerr << "text not called from "
"workarea::workhandler\n";
lyxerr << "Painter drawable: " << drawable << endl;
}
GC gc = getGCForeground(f.realColor());
XSetFont(display, gc, f.getFontID());
char s[2];
s[0] = c; s[1] = '\0';
XDrawString(display, drawable, gc, x, y, s, 1);
underline(f, x, y, this->width(c, f));
return *this;
}
void Painter::underline(LyXFont const & f, int x, int y, int width) {
// What about underbars? // What about underbars?
if (f.underbar() == LyXFont::ON && f.latex() != LyXFont::ON) { if (f.underbar() == LyXFont::ON && f.latex() != LyXFont::ON) {
int below = f.maxDescent() / 2; int below = f.maxDescent() / 2;
@ -347,9 +323,11 @@ GC Painter::getGCForeground(LColor::color c)
val.foreground = bla; val.foreground = bla;
// Try the exact RGB values first, then the approximate. // Try the exact RGB values first, then the approximate.
} else if (XAllocColor(display, colormap, &xcol) != 0) { } else if (XAllocColor(display, colormap, &xcol) != 0) {
lyxerr << _("LyX: X11 color ") << s if (lyxerr.debugging()) {
<< _(" allocated for ") lyxerr << _("LyX: X11 color ") << s
<< lcolor.getGUIName(c) << endl; << _(" allocated for ")
<< lcolor.getGUIName(c) << endl;
}
val.foreground = xcol.pixel; val.foreground = xcol.pixel;
} else if (XAllocColor(display, colormap, &ccol)) { } else if (XAllocColor(display, colormap, &ccol)) {
lyxerr << _("LyX: Using approximated X11 color ") << s lyxerr << _("LyX: Using approximated X11 color ") << s
@ -451,5 +429,3 @@ GC Painter::getGCLinepars(enum line_style ls,
GCForeground | GCLineStyle | GCLineWidth | GCForeground | GCLineStyle | GCLineWidth |
GCCapStyle | GCJoinStyle | GCFunction, &val); GCCapStyle | GCJoinStyle | GCFunction, &val);
} }
#endif

View File

@ -8,7 +8,7 @@
* *
* ======================================================*/ * ======================================================*/
#ifdef USE_PAINTER #define USE_PAINTER 1
#ifndef PAINTER_H #ifndef PAINTER_H
#define PAINTER_H #define PAINTER_H
@ -33,74 +33,75 @@ class LyXFont;
class WorkArea; class WorkArea;
/** An inplementation for the X Window System. Xlib. /** An inplementation for the X Window System. Xlib.
Classes similar to this one can be made for gtk+, Qt, etc. Classes similar to this one can be made for gtk+, Qt, etc.
*/ */
class Painter : public PainterBase { class Painter : public PainterBase {
public: public:
/// Constructor /// Constructor
Painter(WorkArea &); Painter(WorkArea &);
/// Destructor /// Destructor
~Painter(); ~Painter();
/**@Basic drawing routines */ /**@Basic drawing routines */
/// Draw a line from point to point /// Draw a line from point to point
PainterBase & line(int x1, int y1, int x2, int y2, 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, LColor::color = LColor::foreground,
enum line_style = line_solid, enum line_style = line_solid,
enum line_width = line_thin); enum line_width = line_thin);
/// Draw a rectangle /// Here xp and yp are arrays of points
PainterBase & rectangle(int x, int y, int w, int h, PainterBase & lines(int const * xp, int const * yp, int np,
LColor::color = LColor::foreground, LColor::color = LColor::foreground,
enum line_style = line_solid, enum line_style = line_solid,
enum line_width = line_thin); 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 /// Draw an arc
PainterBase & arc(int x, int y, unsigned int w, unsigned int h, PainterBase & arc(int x, int y, unsigned int w, unsigned int h,
int a1, int a2, int a1, int a2,
LColor::color = LColor::foreground); LColor::color = LColor::foreground);
/// Draw a pixel /// Draw a pixel
PainterBase & point(int x, int y, LColor::color = LColor::foreground); PainterBase & point(int x, int y, LColor::color = LColor::foreground);
/// Fill a rectangle /// Fill a rectangle
PainterBase & fillRectangle(int x, int y, int w, int h, PainterBase & fillRectangle(int x, int y, int w, int h,
LColor::color = LColor::background); LColor::color = LColor::background);
/**@Image stuff */ /**@Image stuff */
/// For the figure inset /// For the figure inset
PainterBase & pixmap(int x, int y, int w, int h, Pixmap bitmap); PainterBase & pixmap(int x, int y, int w, int h, Pixmap bitmap);
/**@String functions */ /**@String functions */
/// Draw a string at position x, y (y is the baseline) /// Draw a string at position x, y (y is the baseline)
PainterBase & text(int x, int y, string const & str, LyXFont const & f); PainterBase & text(int x, int y,
string const & str, LyXFont const & f);
/** Draw a string at position x, y (y is the baseline) /** Draw a string at position x, y (y is the baseline)
This is just for fast drawing */ This is just for fast drawing */
PainterBase & text(int x, int y, char const * str, int l, PainterBase & text(int x, int y, char const * str, int l,
LyXFont const & f); LyXFont const & f);
/// Draw a char at position x, y (y is the baseline) /// Draw a char at position x, y (y is the baseline)
PainterBase & text(int x, int y, char c, LyXFont const & f); PainterBase & text(int x, int y, char c, LyXFont const & f);
@ -109,19 +110,19 @@ protected:
friend class WorkArea; friend class WorkArea;
/// ///
PainterBase & setDisplay(Display * d) { display = d; return *this; } PainterBase & setDisplay(Display * d) { display = d; return *this; }
/// ///
PainterBase & setDrawable(Drawable d) { drawable = d; return *this; } PainterBase & setDrawable(Drawable d) { drawable = d; return *this; }
/// Get foreground color in ordinary GC /// Get foreground color in ordinary GC
GC getGCForeground(LColor::color c); GC getGCForeground(LColor::color c);
/// Set up GC according to line style /// Set up GC according to line style
GC getGCLinepars(enum line_style, enum line_width, LColor::color c); GC getGCLinepars(enum line_style, enum line_width, LColor::color c);
/// Check the font, and if set, draw an underline /// Check the font, and if set, draw an underline
void underline(LyXFont const & f, int x, int y, int width); void underline(LyXFont const & f, int x, int y, int width);
/**@Low level X parameters */ /**@Low level X parameters */
/// ///
Display * display; Display * display;
@ -129,7 +130,7 @@ protected:
Drawable drawable; Drawable drawable;
/// ///
Colormap colormap; Colormap colormap;
/// Caching of ordinary color GCs /// Caching of ordinary color GCs
GC colorGCcache[LColor::ignore + 1]; GC colorGCcache[LColor::ignore + 1];
/// Caching of GCs used for lines /// Caching of GCs used for lines
@ -138,5 +139,3 @@ protected:
LineGCCache lineGCcache; LineGCCache lineGCcache;
}; };
#endif #endif
#endif

View File

@ -9,8 +9,6 @@
#include <config.h> #include <config.h>
#ifdef USE_PAINTER
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation #pragma implementation
#endif #endif
@ -141,5 +139,3 @@ PainterBase & PainterBase::buttonText(int x, int baseline,
text(x + 4, baseline, str, font); text(x + 4, baseline, str, font);
return *this; return *this;
} }
#endif

View File

@ -8,8 +8,6 @@
* *
*======================================================*/ *======================================================*/
#ifdef USE_PAINTER
#ifndef PAINTERBASE_H #ifndef PAINTERBASE_H
#define PAINTERBASE_H #define PAINTERBASE_H
@ -202,5 +200,3 @@ private:
}; };
#endif #endif
#endif

View File

@ -11,7 +11,9 @@
#include "bmtable.h" #include "bmtable.h"
#include "support/filetools.h" #include "support/filetools.h"
#ifdef MONO
extern int mono_video; extern int mono_video;
#endif
FD_form_bullet *create_form_form_bullet(void) FD_form_bullet *create_form_form_bullet(void)
{ {
@ -29,15 +31,19 @@ FD_form_bullet *create_form_form_bullet(void)
fl_set_object_callback(obj, BulletBMTableCB, 0); fl_set_object_callback(obj, BulletBMTableCB, 0);
fl_set_object_lcol(obj, FL_BLUE); fl_set_object_lcol(obj, FL_BLUE);
fl_set_object_boxtype(obj, FL_UP_BOX); fl_set_object_boxtype(obj, FL_UP_BOX);
#ifdef MONO
if (mono_video) { if (mono_video) {
fl_set_bmtable_file(obj, 6, 6, fl_set_bmtable_file(obj, 6, 6,
LibFileSearch("images", LibFileSearch("images",
"standard.xbm").c_str()); "standard.xbm").c_str());
} else { } else {
#endif
fl_set_bmtable_pixmap_file(obj, 6, 6, fl_set_bmtable_pixmap_file(obj, 6, 6,
LibFileSearch("images", LibFileSearch("images",
"standard.xpm").c_str()); "standard.xpm").c_str());
#ifdef MONO
} }
#endif
fl_set_border_width(-1); fl_set_border_width(-1);
obj = fl_add_frame(FL_ENGRAVED_FRAME, 95, 20, 255, 70, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 95, 20, 255, 70, "");

View File

@ -11,7 +11,9 @@
#include "gettext.h" #include "gettext.h"
#include "lyx_gui_misc.h" // CancelCloseBoxCB + WriteAlert #include "lyx_gui_misc.h" // CancelCloseBoxCB + WriteAlert
#ifdef MONO
extern int mono_video; extern int mono_video;
#endif
extern BufferView * current_view; extern BufferView * current_view;
FD_form_bullet * fd_form_bullet; FD_form_bullet * fd_form_bullet;
@ -24,7 +26,10 @@ static int current_bullet_depth;
void bulletForm() void bulletForm()
{ {
if (!fd_form_bullet) { if (!fd_form_bullet) {
if (!mono_video && if (
#ifdef MONO
!mono_video &&
#endif
(XpmVersion < 4 (XpmVersion < 4
|| (XpmVersion == 4 && XpmRevision < 7))) { || (XpmVersion == 4 && XpmRevision < 7))) {
WriteAlert(_("Sorry, your libXpm is too old."), WriteAlert(_("Sorry, your libXpm is too old."),
@ -221,15 +226,19 @@ void BulletPanelCB(FL_OBJECT * /*ob*/, long data)
new_panel = "standard"; new_panel = "standard";
break; break;
} }
#ifdef MONO
if (mono_video) { if (mono_video) {
new_panel += ".xbm"; new_panel += ".xbm";
fl_set_bmtable_file(fd_form_bullet->bmtable_bullet_panel, 6, 6, fl_set_bmtable_file(fd_form_bullet->bmtable_bullet_panel, 6, 6,
LibFileSearch("images", new_panel.c_str()).c_str()); LibFileSearch("images", new_panel.c_str()).c_str());
} else { } else {
#endif
new_panel += ".xpm"; new_panel += ".xpm";
fl_set_bmtable_pixmap_file(fd_form_bullet->bmtable_bullet_panel, 6, 6, fl_set_bmtable_pixmap_file(fd_form_bullet->bmtable_bullet_panel, 6, 6,
LibFileSearch("images", new_panel.c_str()).c_str()); LibFileSearch("images", new_panel.c_str()).c_str());
#ifdef MONO
} }
#endif
fl_redraw_object(fd_form_bullet->bmtable_bullet_panel); fl_redraw_object(fd_form_bullet->bmtable_bullet_panel);
fl_unfreeze_form(fd_form_bullet->form_bullet); fl_unfreeze_form(fd_form_bullet->form_bullet);
} }

View File

@ -2,7 +2,9 @@
* figinset.C - part of LyX project * figinset.C - part of LyX project
*/ */
#ifdef MONO
extern int reverse_video; extern int reverse_video;
#endif
extern long int background_pixels; extern long int background_pixels;
/* Rework of path-handling (Matthias 04.07.1996 ) /* Rework of path-handling (Matthias 04.07.1996 )
@ -58,7 +60,9 @@ using std::flush;
#include "support/filetools.h" #include "support/filetools.h"
#include "LyXView.h" // just because of form_main #include "LyXView.h" // just because of form_main
#include "debug.h" #include "debug.h"
#ifndef USE_PAINTER
#include "lyxdraw.h" #include "lyxdraw.h"
#endif
#include "LaTeXFeatures.h" #include "LaTeXFeatures.h"
#include "lyxrc.h" #include "lyxrc.h"
#include "gettext.h" #include "gettext.h"
@ -644,15 +648,19 @@ static void runqueue()
} }
#ifdef USE_PAINTER #ifdef USE_PAINTER
#ifdef MONO
if (reverse_video) { if (reverse_video) {
sprintf(tbuf+1, " %ld %ld", WhitePixelOfScreen( sprintf(tbuf+1, " %ld %ld", WhitePixelOfScreen(
DefaultScreenOfDisplay(fl_display)), DefaultScreenOfDisplay(fl_display)),
fl_get_pixel(FL_BLACK)); fl_get_pixel(FL_BLACK));
} else { } else {
#endif
sprintf(tbuf+1, " %ld %ld", BlackPixelOfScreen( sprintf(tbuf+1, " %ld %ld", BlackPixelOfScreen(
DefaultScreenOfDisplay(fl_display)), DefaultScreenOfDisplay(fl_display)),
fl_get_pixel(FL_WHITE)); fl_get_pixel(FL_WHITE));
#ifdef MONO
} }
#endif
#else #else
if (reverse_video) { if (reverse_video) {
sprintf(tbuf+1, " %ld %ld", WhitePixelOfScreen( sprintf(tbuf+1, " %ld %ld", WhitePixelOfScreen(

View File

@ -15,7 +15,9 @@
#endif #endif
#include "insetcommand.h" #include "insetcommand.h"
#ifndef USE_PAINTER
#include "lyxdraw.h" #include "lyxdraw.h"
#endif
#include "debug.h" #include "debug.h"
#include "Painter.h" #include "Painter.h"

View File

@ -15,7 +15,9 @@
#endif #endif
#include "inseterror.h" #include "inseterror.h"
#ifndef USE_PAINTER
#include "lyxdraw.h" #include "lyxdraw.h"
#endif
#include "gettext.h" #include "gettext.h"
#include "lyx_gui_misc.h" // CancelCloseBoxCB #include "lyx_gui_misc.h" // CancelCloseBoxCB
#include "Painter.h" #include "Painter.h"

View File

@ -19,12 +19,14 @@
#include "insetinfo.h" #include "insetinfo.h"
#include "lyxparagraph.h" #include "lyxparagraph.h"
#include "debug.h" #include "debug.h"
#include "lyxdraw.h"
#include "gettext.h" #include "gettext.h"
#include "lyx_gui_misc.h" // CancelCloseBoxCB #include "lyx_gui_misc.h" // CancelCloseBoxCB
#include "buffer.h" #include "buffer.h"
#include "support/lstrings.h" #include "support/lstrings.h"
#include "Painter.h" #include "Painter.h"
#ifndef USE_PAINTER
#include "lyxdraw.h"
#endif
/* Info, used for the Info boxes */ /* Info, used for the Info boxes */

View File

@ -17,7 +17,9 @@
#include "insetlatexaccent.h" #include "insetlatexaccent.h"
#include "debug.h" #include "debug.h"
#include "lyxrc.h" #include "lyxrc.h"
#ifndef USE_PAINTER
#include "lyxdraw.h" #include "lyxdraw.h"
#endif
#include "support/lstrings.h" #include "support/lstrings.h"
#include "Painter.h" #include "Painter.h"
@ -534,6 +536,7 @@ void InsetLatexAccent::draw(Painter & pain, LyXFont const & font,
} }
case TILDE: // tilde case TILDE: // tilde
{ {
#if 0
if (hg35 > 2.0) hg35 -= 1.0; if (hg35 > 2.0) hg35 -= 1.0;
x2 += (hg35 / 2.0); x2 += (hg35 / 2.0);
int xp[4], yp[4]; int xp[4], yp[4];
@ -551,6 +554,11 @@ void InsetLatexAccent::draw(Painter & pain, LyXFont const & font,
yp[3] = int(y + hg35); yp[3] = int(y + hg35);
pain.lines(xp, yp, 4); pain.lines(xp, yp, 4);
#else
pain.text(x2 - font.width('~') / 2,
baseline - font.ascent('~'),
"~", 1, font);
#endif
break; break;
} }
case UNDERBAR: // underbar case UNDERBAR: // underbar
@ -665,6 +673,7 @@ void InsetLatexAccent::draw(Painter & pain, LyXFont const & font,
} }
case UMLAUT: // umlaut case UMLAUT: // umlaut
{ {
#if 0
float rad = hg / 2.0; float rad = hg / 2.0;
if (rad <= 1.0) { if (rad <= 1.0) {
pain.point(int(x2 - 4.0 * hg / 7.0), pain.point(int(x2 - 4.0 * hg / 7.0),
@ -683,6 +692,10 @@ void InsetLatexAccent::draw(Painter & pain, LyXFont const & font,
y + hg35, y + hg35,
rad, rad, 0, 360*64); rad, rad, 0, 360*64);
} }
#else
pain.text(x2 - font.width('¨') / 2, baseline,
"¨", 1, font);
#endif
break; break;
} }
case CIRCUMFLEX: // circumflex case CIRCUMFLEX: // circumflex
@ -964,7 +977,7 @@ void InsetLatexAccent::Draw(LyXFont font,
y + hg35, y + hg35,
rad, rad, 0, 360*64); rad, rad, 0, 360*64);
} }
//scr.drawText(font, "¨", 1, y + hg, x2); //scr.drawText(font, "¨", 1, baseline, x2);
break; break;
} }
case CIRCUMFLEX: // circumflex case CIRCUMFLEX: // circumflex

View File

@ -14,10 +14,12 @@
#endif #endif
#include "insetspecialchar.h" #include "insetspecialchar.h"
#include "lyxdraw.h"
#include "debug.h" #include "debug.h"
#include "LaTeXFeatures.h" #include "LaTeXFeatures.h"
#include "Painter.h" #include "Painter.h"
#ifndef USE_PAINTER
#include "lyxdraw.h"
#endif
InsetSpecialChar::InsetSpecialChar(Kind k) InsetSpecialChar::InsetSpecialChar(Kind k)
: kind(k) : kind(k)

View File

@ -16,6 +16,8 @@
#pragma interface #pragma interface
#endif #endif
#define USE_PAINTER 1
#include "gettext.h" #include "gettext.h"
#include "lyxfont.h" #include "lyxfont.h"
#include "lyxlex.h" #include "lyxlex.h"

View File

@ -31,7 +31,9 @@
#include "LyXView.h" #include "LyXView.h"
#include "buffer.h" #include "buffer.h"
#include "lyxserver.h" #include "lyxserver.h"
#ifndef USE_PAINTER
#include "lyxdraw.h" #include "lyxdraw.h"
#endif
#include "lyxrc.h" #include "lyxrc.h"
#include "gettext.h" #include "gettext.h"
#include "lyx_gui_misc.h" #include "lyx_gui_misc.h"
@ -77,9 +79,11 @@ FL_CMD_OPT cmdopt[] =
{"-height", "*.height", XrmoptionSepArg, "510"}, {"-height", "*.height", XrmoptionSepArg, "510"},
{"-xpos", "*.xpos", XrmoptionSepArg, "-1"}, {"-xpos", "*.xpos", XrmoptionSepArg, "-1"},
{"-ypos", "*.ypos", XrmoptionSepArg, "-1"}, {"-ypos", "*.ypos", XrmoptionSepArg, "-1"},
#ifdef MONO
{"-Reverse", "*.Reverse", XrmoptionNoArg, "1"}, {"-Reverse", "*.Reverse", XrmoptionNoArg, "1"},
{"-Mono", "*.Mono", XrmoptionNoArg, "1"}, {"-Mono", "*.Mono", XrmoptionNoArg, "1"},
{"-FastSelection", "*.FastSelection", XrmoptionNoArg, "1"}, {"-FastSelection", "*.FastSelection", XrmoptionNoArg, "1"},
#endif
{"-MathColor", "*.MathColor", XrmoptionSepArg, "blue"}, {"-MathColor", "*.MathColor", XrmoptionSepArg, "blue"},
{"-MathFrameColor", "*.MathFrameColor", XrmoptionSepArg, "magenta"}, {"-MathFrameColor", "*.MathFrameColor", XrmoptionSepArg, "magenta"},
{"-FootColor", "*.FootColor", XrmoptionSepArg, "red"}, {"-FootColor", "*.FootColor", XrmoptionSepArg, "red"},
@ -99,9 +103,11 @@ static int width;
static int height; static int height;
static int xpos; static int xpos;
static int ypos; static int ypos;
#ifdef MONO
int reverse_video; int reverse_video;
int mono_video; int mono_video;
int fast_selection; int fast_selection;
#endif
bool cursor_follows_scrollbar; bool cursor_follows_scrollbar;
char math_color[32]; char math_color[32];
char math_frame_color[32]; char math_frame_color[32];
@ -125,9 +131,11 @@ FL_resource res[] =
{"height", "heightClass", FL_INT, &height, "510", 0}, {"height", "heightClass", FL_INT, &height, "510", 0},
{"xpos", "xposClass", FL_INT, &xpos, "-1", 0}, {"xpos", "xposClass", FL_INT, &xpos, "-1", 0},
{"ypos", "yposClass", FL_INT, &ypos, "-1", 0}, {"ypos", "yposClass", FL_INT, &ypos, "-1", 0},
#ifdef MONO
{"Reverse", "reverseClass", FL_INT, &reverse_video, "0", 0}, {"Reverse", "reverseClass", FL_INT, &reverse_video, "0", 0},
{"Mono", "monoClass", FL_INT, &mono_video, "0", 0}, {"Mono", "monoClass", FL_INT, &mono_video, "0", 0},
{"FastSelection", "selectionClass", FL_INT, &fast_selection, "0", 0}, {"FastSelection", "selectionClass", FL_INT, &fast_selection, "0", 0},
#endif
{"MathColor", "colorClass", FL_STRING, math_color, "blue", 31}, {"MathColor", "colorClass", FL_STRING, math_color, "blue", 31},
{"MathFrameColor", "colorClass", FL_STRING, math_frame_color, "magenta", 31}, {"MathFrameColor", "colorClass", FL_STRING, math_frame_color, "magenta", 31},
{"FootColor", "colorClass", FL_STRING, foot_color, "red", 31}, {"FootColor", "colorClass", FL_STRING, foot_color, "red", 31},

View File

@ -1,8 +1,6 @@
#include <config.h> #include <config.h>
#ifndef USE_PAINTER
#include "lyxdraw.h" #include "lyxdraw.h"
#include "debug.h" #include "debug.h"
@ -556,5 +554,3 @@ GC getGC(gc_type typ)
} }
return gc; return gc;
} }
#endif

View File

@ -1,5 +1,4 @@
// -*- C++ -*- // -*- C++ -*-
#ifndef USE_PAINTER
#ifndef LYX_DRAW_H #ifndef LYX_DRAW_H
#define LYX_DRAW_H #define LYX_DRAW_H
@ -53,5 +52,3 @@ extern GC GetAccentGC(LyXFont const &f, int line_width);
extern GC GetColorGC(LyXFont::FONT_COLOR color); extern GC GetColorGC(LyXFont::FONT_COLOR color);
#endif #endif
#endif

View File

@ -22,7 +22,9 @@
#include "debug.h" #include "debug.h"
#include "lyxrc.h" #include "lyxrc.h"
#include "lyxlex.h" #include "lyxlex.h"
#ifndef USE_PAINTER
#include "lyxdraw.h" #include "lyxdraw.h"
#endif
#include "FontLoader.h" #include "FontLoader.h"
#include "support/lstrings.h" #include "support/lstrings.h"

View File

@ -15,6 +15,8 @@
#pragma interface #pragma interface
#endif #endif
#define USE_PAINTER 1
#include FORMS_H_LOCATION #include FORMS_H_LOCATION
#include "LString.h" #include "LString.h"
#include "debug.h" #include "debug.h"

View File

@ -36,7 +36,10 @@ using std::ios;
// this is crappy... why are those colors command line arguments and // this is crappy... why are those colors command line arguments and
// not in lyxrc?? (Matthias) // not in lyxrc?? (Matthias)
// Because nobody put them there. (Asger) // Because nobody put them there. (Asger)
#ifdef MONO
extern int fast_selection; extern int fast_selection;
#endif
extern string background_color; extern string background_color;
extern char selection_color[]; extern char selection_color[];
extern bool cursor_follows_scrollbar; extern bool cursor_follows_scrollbar;
@ -97,7 +100,9 @@ enum LyXRCTags {
RC_KBMAP, RC_KBMAP,
RC_KBMAP_PRIMARY, RC_KBMAP_PRIMARY,
RC_KBMAP_SECONDARY, RC_KBMAP_SECONDARY,
#ifdef MONO
RC_FAST_SELECTION, RC_FAST_SELECTION,
#endif
RC_SELECTION_COLOR, RC_SELECTION_COLOR,
RC_BACKGROUND_COLOR, RC_BACKGROUND_COLOR,
RC_FAX_COMMAND, RC_FAX_COMMAND,
@ -165,7 +170,9 @@ static keyword_item lyxrcTags[] = {
{ "\\dvi_to_ps_command", RC_DVI_TO_PS_COMMAND }, { "\\dvi_to_ps_command", RC_DVI_TO_PS_COMMAND },
{ "\\escape_chars", RC_ESC_CHARS }, { "\\escape_chars", RC_ESC_CHARS },
{ "\\exit_confirmation", RC_EXIT_CONFIRMATION }, { "\\exit_confirmation", RC_EXIT_CONFIRMATION },
#ifdef MONO
{ "\\fast_selection", RC_FAST_SELECTION }, { "\\fast_selection", RC_FAST_SELECTION },
#endif
{ "\\fax_command", RC_FAX_COMMAND }, { "\\fax_command", RC_FAX_COMMAND },
{ "\\fax_program", RC_FAXPROGRAM }, { "\\fax_program", RC_FAXPROGRAM },
{ "\\font_encoding", RC_FONT_ENCODING }, { "\\font_encoding", RC_FONT_ENCODING },
@ -831,10 +838,12 @@ int LyXRC::read(string const & filename)
cursor_follows_scrollbar = lexrc.GetBool(); cursor_follows_scrollbar = lexrc.GetBool();
break; break;
#ifdef MONO
case RC_FAST_SELECTION: case RC_FAST_SELECTION:
if (lexrc.next()) if (lexrc.next())
fast_selection = lexrc.GetBool(); fast_selection = lexrc.GetBool();
break; break;
#endif
case RC_BACKGROUND_COLOR: case RC_BACKGROUND_COLOR:
if (lexrc.next()) if (lexrc.next())
@ -1167,9 +1176,11 @@ void LyXRC::output(ostream & os) const
case RC_CURSOR_FOLLOWS_SCROLLBAR: case RC_CURSOR_FOLLOWS_SCROLLBAR:
os << "\\cursor_follows_scrollbar " os << "\\cursor_follows_scrollbar "
<< tostr(cursor_follows_scrollbar) << "\n"; << tostr(cursor_follows_scrollbar) << "\n";
#ifdef MONO
case RC_FAST_SELECTION: case RC_FAST_SELECTION:
os << "\\fast_selection " os << "\\fast_selection "
<< tostr(static_cast<bool>(fast_selection)) << "\n"; << tostr(static_cast<bool>(fast_selection)) << "\n";
#endif
case RC_BACKGROUND_COLOR: case RC_BACKGROUND_COLOR:
os << "\\background_color \"" << background_color << "\"\n"; os << "\\background_color \"" << background_color << "\"\n";
case RC_SELECTION_COLOR: case RC_SELECTION_COLOR:

View File

@ -18,7 +18,12 @@
#include FORMS_H_LOCATION #include FORMS_H_LOCATION
#include <X11/Xlib.h> #include <X11/Xlib.h>
#define USE_PAINTER 1
#ifndef USE_PAINTER
#include "lyxdraw.h" #include "lyxdraw.h"
#endif
class LyXText; class LyXText;
struct Row; struct Row;
@ -48,11 +53,13 @@ public:
/// ///
~LyXScreen(); ~LyXScreen();
#ifndef USE_PAINTER
/** Return the forground pixmap. This function is a _hack_, /** Return the forground pixmap. This function is a _hack_,
we should be rid of it as soon as possible. But to do that we should be rid of it as soon as possible. But to do that
a lot in the mathcode and the figinset has to be rewritten. a lot in the mathcode and the figinset has to be rewritten.
Tasks for 0.13. */ Tasks for 0.13. */
Pixmap getForeground() { return foreground; }; Pixmap getForeground() { return foreground; };
#endif
/** Draws the screen form textposition y. Uses as much of /** Draws the screen form textposition y. Uses as much of
the already printed pixmap as possible */ the already printed pixmap as possible */
@ -189,7 +196,7 @@ private:
/// ///
Row * screen_refresh_row; Row * screen_refresh_row;
/// ///
friend class InsetFormula; //friend class InsetFormula;
#ifdef USE_PAINTER #ifdef USE_PAINTER
/// ///
GC gc_copy; GC gc_copy;

View File

@ -31,7 +31,9 @@
#include "minibuffer.h" #include "minibuffer.h"
#include "BufferView.h" #include "BufferView.h"
#include "lyxscreen.h" #include "lyxscreen.h"
#ifndef USE_PAINTER
#include "lyxdraw.h" #include "lyxdraw.h"
#endif
#include "lyxtext.h" #include "lyxtext.h"
#include "gettext.h" #include "gettext.h"
#include "LaTeXFeatures.h" #include "LaTeXFeatures.h"
@ -43,11 +45,16 @@
extern void UpdateInset(BufferView *, Inset * inset, bool mark_dirty = true); extern void UpdateInset(BufferView *, Inset * inset, bool mark_dirty = true);
#ifndef USE_PAINTER
extern GC canvasGC, mathGC, mathLineGC, latexGC, cursorGC, mathFrameGC; extern GC canvasGC, mathGC, mathLineGC, latexGC, cursorGC, mathFrameGC;
#endif
extern char * mathed_label; extern char * mathed_label;
#ifdef MONO
extern int mono_video; extern int mono_video;
extern int fast_selection; extern int fast_selection;
#endif
extern BufferView * current_view; extern BufferView * current_view;
extern char const * latex_special_chars; extern char const * latex_special_chars;
@ -857,8 +864,10 @@ bool InsetFormula::LocalDispatch(int action, char const * arg)
static MathSpaceInset * sp= 0; static MathSpaceInset * sp= 0;
HideInsetCursor(); HideInsetCursor();
#ifdef MONO
if (mathcursor->Selection() && (fast_selection || mono_video)) if (mathcursor->Selection() && (fast_selection || mono_video))
ToggleInsetSelection(); ToggleInsetSelection();
#endif
if (mathcursor->getLastCode() == LM_TC_TEX) { if (mathcursor->getLastCode() == LM_TC_TEX) {
varcode = LM_TC_TEX; varcode = LM_TC_TEX;
@ -1316,7 +1325,11 @@ bool InsetFormula::LocalDispatch(int action, char const * arg)
&& action != LFUN_BACKSPACE) && action != LFUN_BACKSPACE)
UpdateLocal(); UpdateLocal();
if (sp && !space_on) sp = 0; if (sp && !space_on) sp = 0;
if (mathcursor->Selection() || (was_selection && !(fast_selection || mono_video))) if (mathcursor->Selection() || (was_selection
#ifdef MONO
&& !(fast_selection || mono_video)
#endif
))
ToggleInsetSelection(); ToggleInsetSelection();
if (result) if (result)
@ -1336,11 +1349,13 @@ MathFuncInset::draw(Painter & pain, int x, int y)
LyXFont font = WhichFont(LM_TC_TEXTRM, size); LyXFont font = WhichFont(LM_TC_TEXTRM, size);
font.setLatex(LyXFont::ON); font.setLatex(LyXFont::ON);
x += (font.textWidth("I", 1) + 3) / 4; x += (font.textWidth("I", 1) + 3) / 4;
#ifdef MONO
if (mono_video) { if (mono_video) {
int a = font.maxAscent(); int a = font.maxAscent();
int d = font.maxDescent(); int d = font.maxDescent();
pain.fillRectangle(x, y - a, font.textWidth(name, strlen(name)), a + d); pain.fillRectangle(x, y - a, font.textWidth(name, strlen(name)), a + d);
} }
#endif
pain.text(x, y, name, font); pain.text(x, y, name, font);
} }
} }

View File

@ -29,7 +29,9 @@
#include "lyx_cb.h" #include "lyx_cb.h"
#include "BufferView.h" #include "BufferView.h"
#include "lyxscreen.h" #include "lyxscreen.h"
#ifndef USE_PAINTER
#include "lyxdraw.h" #include "lyxdraw.h"
#endif
#include "gettext.h" #include "gettext.h"
#include "Painter.h" #include "Painter.h"

View File

@ -31,9 +31,13 @@
#include "LColor.h" #include "LColor.h"
#include "Painter.h" #include "Painter.h"
#ifndef USE_PAINTER
extern void mathed_set_font(short type, int style); extern void mathed_set_font(short type, int style);
#endif
#ifndef USE_PAINTER
extern GC canvasGC, mathGC, latexGC, cursorGC, mathFrameGC; extern GC canvasGC, mathGC, latexGC, cursorGC, mathFrameGC;
#endif
static LyxArrayBase * selarray = 0; static LyxArrayBase * selarray = 0;

View File

@ -24,6 +24,8 @@
#pragma interface #pragma interface
#endif #endif
#define USE_PAINTER 1
#include "support/LIstream.h" #include "support/LIstream.h"
#include "LString.h" #include "LString.h"

View File

@ -231,7 +231,9 @@ typedef float matriz_data[2][2];
const matriz_data MATIDEN= { {1, 0}, {0, 1}}; const matriz_data MATIDEN= { {1, 0}, {0, 1}};
#ifndef USE_PAINTER
extern void mathed_set_font(short type, int style); extern void mathed_set_font(short type, int style);
#endif
extern int mathed_char_width(short type, int style, byte c); extern int mathed_char_width(short type, int style, byte c);
extern int mathed_char_height(short, int, byte, int&, int&); extern int mathed_char_height(short, int, byte, int&, int&);
@ -288,7 +290,9 @@ void Matriz::transf(float xp, float yp, float &x, float &y)
y = m[1][0]*xp + m[1][1]*yp; y = m[1][0]*xp + m[1][1]*yp;
} }
#ifndef USE_PAINTER
extern GC latexGC, mathGC, mathLineGC, cursorGC; extern GC latexGC, mathGC, mathLineGC, cursorGC;
#endif
static int search_deco(int code) static int search_deco(int code)
{ {

View File

@ -32,8 +32,10 @@ extern int mathed_char_width(short type, int style, byte c);
extern int mathed_string_width(short type, int style, byte const* s, int ls); extern int mathed_string_width(short type, int style, byte const* s, int ls);
extern int mathed_string_height(short, int, byte const*, int, int&, int&); extern int mathed_string_height(short, int, byte const*, int, int&, int&);
extern int mathed_char_height(short, int, byte, int&, int&); extern int mathed_char_height(short, int, byte, int&, int&);
#ifndef USE_PAINTER
GC canvasGC= 0, mathGC= 0, mathLineGC= 0, latexGC= 0, cursorGC= 0, mathFrameGC= 0; GC canvasGC= 0, mathGC= 0, mathLineGC= 0, latexGC= 0, cursorGC= 0, mathFrameGC= 0;
#endif
#ifndef USE_PAINTER #ifndef USE_PAINTER

View File

@ -47,7 +47,9 @@ ostream & operator<<(ostream & o, MathedMacroFlag mmf)
return o << int(mmf); return o << int(mmf);
} }
#ifndef USE_PAINTER
extern GC mathGC, mathFrameGC, latexGC; extern GC mathGC, mathFrameGC, latexGC;
#endif
extern int mathed_string_width(short type, int style, byte const* s, int ls); extern int mathed_string_width(short type, int style, byte const* s, int ls);
extern int mathed_string_height(short, int, byte const*, int, int&, int&); extern int mathed_string_height(short, int, byte const*, int, int&, int&);
@ -126,7 +128,7 @@ void MathMacro::draw(Painter & pain, int x, int y)
Metrics(); Metrics();
tmplate->update(this); tmplate->update(this);
tmplate->SetStyle(size); tmplate->SetStyle(size);
mathGC = latexGC; //mathGC = latexGC;
tmplate->draw(pain, x, y); tmplate->draw(pain, x, y);
for (int i = 0; i < nargs; ++i) for (int i = 0; i < nargs; ++i)
tmplate->GetMacroXY(i, args[i].x, args[i].y); tmplate->GetMacroXY(i, args[i].x, args[i].y);

View File

@ -15,14 +15,18 @@
#endif #endif
#include "lyxscreen.h" #include "lyxscreen.h"
#include "lyxdraw.h"
#include "lyxtext.h" #include "lyxtext.h"
#include "lyxrow.h" #include "lyxrow.h"
#include "BufferView.h" #include "BufferView.h"
#include "Painter.h" #include "Painter.h"
#ifndef USE_PAINTER
#include "lyxdraw.h"
#endif
#ifdef MONO
extern int mono_video; extern int mono_video;
extern int fast_selection; extern int fast_selection;
#endif
#ifdef USE_PAINTER #ifdef USE_PAINTER
static static
@ -407,9 +411,11 @@ int LyXScreen::FitManualCursor(long /*x*/, long y, int asc, int desc)
void LyXScreen::HideManualCursor(long x, long y, int asc, int desc) void LyXScreen::HideManualCursor(long x, long y, int asc, int desc)
{ {
#ifdef MONO
if (fast_selection || mono_video) if (fast_selection || mono_video)
ShowManualCursor(x, y, asc, desc); ShowManualCursor(x, y, asc, desc);
else else
#endif
HideCursor(); HideCursor();
} }

View File

@ -21,7 +21,6 @@
#include "lyxtext.h" #include "lyxtext.h"
#include "support/textutils.h" #include "support/textutils.h"
#include "lyx_gui_misc.h" #include "lyx_gui_misc.h"
#include "lyxdraw.h"
#include "gettext.h" #include "gettext.h"
#include "bufferparams.h" #include "bufferparams.h"
#include "buffer.h" #include "buffer.h"
@ -32,15 +31,21 @@
#include "LyXView.h" #include "LyXView.h"
#include "lyxrow.h" #include "lyxrow.h"
#include "Painter.h" #include "Painter.h"
#ifndef USE_PAINTER
#include "lyxdraw.h"
#endif
using std::max; using std::max;
using std::min; using std::min;
static const int LYX_PAPER_MARGIN = 20; static const int LYX_PAPER_MARGIN = 20;
#ifdef MONO
extern int mono_video; extern int mono_video;
extern int reverse_video; extern int reverse_video;
extern int fast_selection; extern int fast_selection;
#endif
extern BufferView * current_view; extern BufferView * current_view;
extern LyXRC * lyxrc; extern LyXRC * lyxrc;
@ -2779,16 +2784,17 @@ void LyXText::InsertCharInTable(char c)
jumped_over_space = false; jumped_over_space = false;
if (IsLineSeparatorChar(c)) { if (IsLineSeparatorChar(c)) {
#ifndef FIX_DOUBLE_SPACE
/* avoid double blanks but insert the new blank because /* avoid double blanks but insert the new blank because
* of a possible font change */ * of a possible font change */
if (cursor.pos < lastpos && if (cursor.pos < lastpos &&
cursor.par->IsLineSeparator(cursor.pos)) cursor.par->IsLineSeparator(cursor.pos)) {
{
cursor.par->Erase(cursor.pos); cursor.par->Erase(cursor.pos);
jumped_over_space = true; jumped_over_space = true;
} } else
else if ((cursor.pos > 0 && #endif
if ((cursor.pos > 0 &&
cursor.par->IsLineSeparator(cursor.pos - 1)) cursor.par->IsLineSeparator(cursor.pos - 1))
|| (cursor.pos > 0 && cursor.par->IsNewline(cursor.pos - 1)) || (cursor.pos > 0 && cursor.par->IsNewline(cursor.pos - 1))
|| (cursor.pos == 0 && || (cursor.pos == 0 &&
@ -2796,8 +2802,7 @@ void LyXText::InsertCharInTable(char c)
&& cursor.par->Previous()->footnoteflag && cursor.par->Previous()->footnoteflag
== LyXParagraph::OPEN_FOOTNOTE))) == LyXParagraph::OPEN_FOOTNOTE)))
return; return;
} } else if (IsNewlineChar(c)) {
else if (IsNewlineChar(c)) {
if (!IsEmptyTableCell()) { if (!IsEmptyTableCell()) {
TableFeatures(LyXTable::APPEND_CONT_ROW); TableFeatures(LyXTable::APPEND_CONT_ROW);
CursorDown(); CursorDown();
@ -2897,13 +2902,12 @@ void LyXText::BackspaceInTable()
/* no pasting of table paragraphs */ /* no pasting of table paragraphs */
CursorLeft(); CursorLeft();
} } else {
else {
/* this is the code for a normal backspace, not pasting /* this is the code for a normal backspace, not pasting
* any paragraphs */ * any paragraphs */
SetUndo(Undo::DELETE, SetUndo(Undo::DELETE,
cursor.par->ParFromPos(cursor.pos)->previous, cursor.par->ParFromPos(cursor.pos)->previous,
cursor.par->ParFromPos(cursor.pos)->next); cursor.par->ParFromPos(cursor.pos)->next);
CursorLeftIntern(); CursorLeftIntern();
@ -2930,7 +2934,8 @@ void LyXText::BackspaceInTable()
tmprow = tmprow->next; tmprow = tmprow->next;
tmprow->pos--; tmprow->pos--;
} }
#ifndef FIX_DOUBLE_SPACE
/* delete superfluous blanks */ /* delete superfluous blanks */
if (cursor.pos < cursor.par->Last() - 1 && if (cursor.pos < cursor.par->Last() - 1 &&
(cursor.par->IsLineSeparator(cursor.pos))) { (cursor.par->IsLineSeparator(cursor.pos))) {
@ -2950,6 +2955,7 @@ void LyXText::BackspaceInTable()
cursor.pos--; cursor.pos--;
} }
} }
#endif
} }
CheckParagraphInTable(cursor.par, cursor.pos); CheckParagraphInTable(cursor.par, cursor.pos);
@ -4106,7 +4112,11 @@ void LyXText::GetVisibleRow(int offset,
pain.fillRectangle(0, offset, paperwidth, row_ptr->height); pain.fillRectangle(0, offset, paperwidth, row_ptr->height);
// check for NOT FAST SELECTION // check for NOT FAST SELECTION
if (!fast_selection && !mono_video && selection) { if (
#ifdef MONO
!fast_selection && !mono_video &&
#endif
selection) {
/* selection code */ /* selection code */
if (sel_start_cursor.row == row_ptr && if (sel_start_cursor.row == row_ptr &&
sel_end_cursor.row == row_ptr) { sel_end_cursor.row == row_ptr) {
@ -4120,8 +4130,7 @@ void LyXText::GetVisibleRow(int offset,
sel_start_cursor.x - sel_end_cursor.x, sel_start_cursor.x - sel_end_cursor.x,
row_ptr->height, row_ptr->height,
LColor::selection); LColor::selection);
} } else if (sel_start_cursor.row == row_ptr) {
else if (sel_start_cursor.row == row_ptr) {
if (direction == LYX_DIR_LEFT_TO_RIGHT) if (direction == LYX_DIR_LEFT_TO_RIGHT)
pain.fillRectangle(sel_start_cursor.x, offset, pain.fillRectangle(sel_start_cursor.x, offset,
paperwidth - sel_start_cursor.x, paperwidth - sel_start_cursor.x,
@ -4447,7 +4456,7 @@ void LyXText::GetVisibleRow(int offset,
pain.line(0, offset + y_bottom - 2 * DefaultHeight(), pain.line(0, offset + y_bottom - 2 * DefaultHeight(),
paperwidth, paperwidth,
offset + y_bottom - 2 * DefaultHeight(), offset + y_bottom - 2 * DefaultHeight(),
LColor::pagebreak); LColor::pagebreak, Painter::line_onoffdash);
y_bottom -= 3 * DefaultHeight(); y_bottom -= 3 * DefaultHeight();
} }