+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>
* src/text2.C (owner): only complain if owner_ is set and bv != 0
#endif
#include "debug.h"
-#include "lyxdraw.h"
#include "lyx_gui_misc.h"
#include "BackStack.h"
#include "lyxtext.h"
#include "lyxrc.h"
#include "lyxrow.h"
#include "WorkArea.h"
+#ifndef USE_PAINTER
+#include "lyxdraw.h"
+#endif
using std::find_if;
*
* LyX, The Document Processor
*
- * Copyright (C) 1997 Asger Alstrup
+ * Copyright 1997 Asger Alstrup
* and the LyX Team.
*
* ====================================================== */
#pragma interface
#endif
+#define USE_PAINTER 1
+
+
#include FORMS_H_LOCATION
#include "lyxfont.h"
#include "LString.h"
#include <config.h>
-#ifdef USE_PAINTER
-
#ifdef __GNUG__
#pragma implementation
#endif
// The evil global LColor instance
LColor lcolor;
-
-#endif
*
*======================================================*/
-#ifdef USE_PAINTER
-
#ifndef LCOLOR_H
#define LCOLOR_H
extern LColor lcolor;
#endif
-
-#endif
lyx_sty.C \
lyx_sty.h \
lyxcursor.h \
- lyxdraw.C \
- lyxdraw.h \
lyxfont.C \
lyxfont.h \
lyxfr0.C \
#include <config.h>
-#ifdef USE_PAINTER
-
#ifdef __GNUG__
#pragma implementation
#endif
{
colormap = fl_state[fl_get_vclass()].colormap;
// Clear the GC cache
- for (int i=0; i <= LColor::ignore; ++i) {
+ for (int i = 0; i <= LColor::ignore; ++i) {
colorGCcache[i] = 0;
}
}
Painter::~Painter() {
// 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) {
XFreeGC(display, colorGCcache[i]);
}
}
// Iterate over the line cache and Free the GCs
- LineGCCache::iterator lit = lineGCcache.begin();
- for (; lit != lineGCcache.end(); ++lit) {
+ for (LineGCCache::iterator lit = lineGCcache.begin();
+ lit != lineGCcache.end(); ++lit) {
XFreeGC(display, (*lit).second);
}
}
PainterBase & Painter::text(int x, int y, string const & s, LyXFont const & f)
{
- 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());
- XDrawString(display, drawable, gc, x, y, s.c_str(), s.length());
- underline(f, x, y, this->width(s, f));
- return *this;
+ return text(x, y, s.c_str(), 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 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?
if (f.underbar() == LyXFont::ON && f.latex() != LyXFont::ON) {
int below = f.maxDescent() / 2;
val.foreground = bla;
// Try the exact RGB values first, then the approximate.
} else if (XAllocColor(display, colormap, &xcol) != 0) {
- lyxerr << _("LyX: X11 color ") << s
- << _(" allocated for ")
- << lcolor.getGUIName(c) << endl;
+ if (lyxerr.debugging()) {
+ lyxerr << _("LyX: X11 color ") << s
+ << _(" allocated for ")
+ << lcolor.getGUIName(c) << endl;
+ }
val.foreground = xcol.pixel;
} else if (XAllocColor(display, colormap, &ccol)) {
lyxerr << _("LyX: Using approximated X11 color ") << s
GCForeground | GCLineStyle | GCLineWidth |
GCCapStyle | GCJoinStyle | GCFunction, &val);
}
-
-#endif
*
* ======================================================*/
-#ifdef USE_PAINTER
+#define USE_PAINTER 1
#ifndef PAINTER_H
#define PAINTER_H
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
Painter(WorkArea &);
-
+
/// Destructor
~Painter();
-
+
/**@Basic drawing routines */
/// 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);
-
+ 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);
-
+ 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);
-
+ 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);
-
+ 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);
-
+ 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);
+ 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 = LColor::background);
+ LColor::color = LColor::background);
/**@Image stuff */
/// For the figure inset
PainterBase & pixmap(int x, int y, int w, int h, Pixmap bitmap);
-
+
/**@String functions */
/// 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)
This is just for fast drawing */
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)
PainterBase & text(int x, int y, char c, LyXFont const & f);
friend class WorkArea;
///
PainterBase & setDisplay(Display * d) { display = d; return *this; }
-
+
///
PainterBase & setDrawable(Drawable d) { drawable = d; return *this; }
-
+
/// Get foreground color in ordinary GC
GC getGCForeground(LColor::color c);
/// Set up GC according to line style
GC getGCLinepars(enum line_style, enum line_width, LColor::color c);
-
+
/// Check the font, and if set, draw an underline
void underline(LyXFont const & f, int x, int y, int width);
-
+
/**@Low level X parameters */
///
Display * display;
Drawable drawable;
///
Colormap colormap;
-
+
/// Caching of ordinary color GCs
GC colorGCcache[LColor::ignore + 1];
/// Caching of GCs used for lines
LineGCCache lineGCcache;
};
#endif
-
-#endif
#include <config.h>
-#ifdef USE_PAINTER
-
#ifdef __GNUG__
#pragma implementation
#endif
text(x + 4, baseline, str, font);
return *this;
}
-
-#endif
*
*======================================================*/
-#ifdef USE_PAINTER
-
#ifndef PAINTERBASE_H
#define PAINTERBASE_H
};
#endif
-
-#endif
#include "bmtable.h"
#include "support/filetools.h"
+#ifdef MONO
extern int mono_video;
+#endif
FD_form_bullet *create_form_form_bullet(void)
{
fl_set_object_callback(obj, BulletBMTableCB, 0);
fl_set_object_lcol(obj, FL_BLUE);
fl_set_object_boxtype(obj, FL_UP_BOX);
+#ifdef MONO
if (mono_video) {
fl_set_bmtable_file(obj, 6, 6,
LibFileSearch("images",
"standard.xbm").c_str());
} else {
+#endif
fl_set_bmtable_pixmap_file(obj, 6, 6,
LibFileSearch("images",
"standard.xpm").c_str());
+#ifdef MONO
}
+#endif
fl_set_border_width(-1);
obj = fl_add_frame(FL_ENGRAVED_FRAME, 95, 20, 255, 70, "");
#include "gettext.h"
#include "lyx_gui_misc.h" // CancelCloseBoxCB + WriteAlert
+#ifdef MONO
extern int mono_video;
+#endif
extern BufferView * current_view;
FD_form_bullet * fd_form_bullet;
void bulletForm()
{
if (!fd_form_bullet) {
- if (!mono_video &&
+ if (
+#ifdef MONO
+ !mono_video &&
+#endif
(XpmVersion < 4
|| (XpmVersion == 4 && XpmRevision < 7))) {
WriteAlert(_("Sorry, your libXpm is too old."),
new_panel = "standard";
break;
}
+#ifdef MONO
if (mono_video) {
new_panel += ".xbm";
fl_set_bmtable_file(fd_form_bullet->bmtable_bullet_panel, 6, 6,
LibFileSearch("images", new_panel.c_str()).c_str());
} else {
+#endif
new_panel += ".xpm";
fl_set_bmtable_pixmap_file(fd_form_bullet->bmtable_bullet_panel, 6, 6,
LibFileSearch("images", new_panel.c_str()).c_str());
+#ifdef MONO
}
+#endif
fl_redraw_object(fd_form_bullet->bmtable_bullet_panel);
fl_unfreeze_form(fd_form_bullet->form_bullet);
}
* figinset.C - part of LyX project
*/
+#ifdef MONO
extern int reverse_video;
+#endif
extern long int background_pixels;
/* Rework of path-handling (Matthias 04.07.1996 )
#include "support/filetools.h"
#include "LyXView.h" // just because of form_main
#include "debug.h"
+#ifndef USE_PAINTER
#include "lyxdraw.h"
+#endif
#include "LaTeXFeatures.h"
#include "lyxrc.h"
#include "gettext.h"
}
#ifdef USE_PAINTER
+#ifdef MONO
if (reverse_video) {
sprintf(tbuf+1, " %ld %ld", WhitePixelOfScreen(
DefaultScreenOfDisplay(fl_display)),
fl_get_pixel(FL_BLACK));
} else {
+#endif
sprintf(tbuf+1, " %ld %ld", BlackPixelOfScreen(
DefaultScreenOfDisplay(fl_display)),
fl_get_pixel(FL_WHITE));
+#ifdef MONO
}
+#endif
#else
if (reverse_video) {
sprintf(tbuf+1, " %ld %ld", WhitePixelOfScreen(
#endif
#include "insetcommand.h"
+#ifndef USE_PAINTER
#include "lyxdraw.h"
+#endif
#include "debug.h"
#include "Painter.h"
#endif
#include "inseterror.h"
+#ifndef USE_PAINTER
#include "lyxdraw.h"
+#endif
#include "gettext.h"
#include "lyx_gui_misc.h" // CancelCloseBoxCB
#include "Painter.h"
#include "insetinfo.h"
#include "lyxparagraph.h"
#include "debug.h"
-#include "lyxdraw.h"
#include "gettext.h"
#include "lyx_gui_misc.h" // CancelCloseBoxCB
#include "buffer.h"
#include "support/lstrings.h"
#include "Painter.h"
+#ifndef USE_PAINTER
+#include "lyxdraw.h"
+#endif
/* Info, used for the Info boxes */
#include "insetlatexaccent.h"
#include "debug.h"
#include "lyxrc.h"
+#ifndef USE_PAINTER
#include "lyxdraw.h"
+#endif
#include "support/lstrings.h"
#include "Painter.h"
}
case TILDE: // tilde
{
+#if 0
if (hg35 > 2.0) hg35 -= 1.0;
x2 += (hg35 / 2.0);
int xp[4], yp[4];
yp[3] = int(y + hg35);
pain.lines(xp, yp, 4);
+#else
+ pain.text(x2 - font.width('~') / 2,
+ baseline - font.ascent('~'),
+ "~", 1, font);
+#endif
break;
}
case UNDERBAR: // underbar
}
case UMLAUT: // umlaut
{
+#if 0
float rad = hg / 2.0;
if (rad <= 1.0) {
pain.point(int(x2 - 4.0 * hg / 7.0),
y + hg35,
rad, rad, 0, 360*64);
}
+#else
+ pain.text(x2 - font.width('¨') / 2, baseline,
+ "¨", 1, font);
+#endif
break;
}
case CIRCUMFLEX: // circumflex
y + hg35,
rad, rad, 0, 360*64);
}
- //scr.drawText(font, "¨", 1, y + hg, x2);
+ //scr.drawText(font, "¨", 1, baseline, x2);
break;
}
case CIRCUMFLEX: // circumflex
#endif
#include "insetspecialchar.h"
-#include "lyxdraw.h"
#include "debug.h"
#include "LaTeXFeatures.h"
#include "Painter.h"
+#ifndef USE_PAINTER
+#include "lyxdraw.h"
+#endif
InsetSpecialChar::InsetSpecialChar(Kind k)
: kind(k)
#pragma interface
#endif
+#define USE_PAINTER 1
+
#include "gettext.h"
#include "lyxfont.h"
#include "lyxlex.h"
#include "LyXView.h"
#include "buffer.h"
#include "lyxserver.h"
+#ifndef USE_PAINTER
#include "lyxdraw.h"
+#endif
#include "lyxrc.h"
#include "gettext.h"
#include "lyx_gui_misc.h"
{"-height", "*.height", XrmoptionSepArg, "510"},
{"-xpos", "*.xpos", XrmoptionSepArg, "-1"},
{"-ypos", "*.ypos", XrmoptionSepArg, "-1"},
+#ifdef MONO
{"-Reverse", "*.Reverse", XrmoptionNoArg, "1"},
{"-Mono", "*.Mono", XrmoptionNoArg, "1"},
{"-FastSelection", "*.FastSelection", XrmoptionNoArg, "1"},
+#endif
{"-MathColor", "*.MathColor", XrmoptionSepArg, "blue"},
{"-MathFrameColor", "*.MathFrameColor", XrmoptionSepArg, "magenta"},
{"-FootColor", "*.FootColor", XrmoptionSepArg, "red"},
static int height;
static int xpos;
static int ypos;
+#ifdef MONO
int reverse_video;
int mono_video;
int fast_selection;
+#endif
bool cursor_follows_scrollbar;
char math_color[32];
char math_frame_color[32];
{"height", "heightClass", FL_INT, &height, "510", 0},
{"xpos", "xposClass", FL_INT, &xpos, "-1", 0},
{"ypos", "yposClass", FL_INT, &ypos, "-1", 0},
+#ifdef MONO
{"Reverse", "reverseClass", FL_INT, &reverse_video, "0", 0},
{"Mono", "monoClass", FL_INT, &mono_video, "0", 0},
{"FastSelection", "selectionClass", FL_INT, &fast_selection, "0", 0},
+#endif
{"MathColor", "colorClass", FL_STRING, math_color, "blue", 31},
{"MathFrameColor", "colorClass", FL_STRING, math_frame_color, "magenta", 31},
{"FootColor", "colorClass", FL_STRING, foot_color, "red", 31},
#include <config.h>
-#ifndef USE_PAINTER
-
#include "lyxdraw.h"
#include "debug.h"
}
return gc;
}
-
-#endif
// -*- C++ -*-
-#ifndef USE_PAINTER
#ifndef LYX_DRAW_H
#define LYX_DRAW_H
extern GC GetColorGC(LyXFont::FONT_COLOR color);
#endif
-
-#endif
#include "debug.h"
#include "lyxrc.h"
#include "lyxlex.h"
+#ifndef USE_PAINTER
#include "lyxdraw.h"
+#endif
#include "FontLoader.h"
#include "support/lstrings.h"
#pragma interface
#endif
+#define USE_PAINTER 1
+
#include FORMS_H_LOCATION
#include "LString.h"
#include "debug.h"
// this is crappy... why are those colors command line arguments and
// not in lyxrc?? (Matthias)
// Because nobody put them there. (Asger)
+#ifdef MONO
extern int fast_selection;
+#endif
+
extern string background_color;
extern char selection_color[];
extern bool cursor_follows_scrollbar;
RC_KBMAP,
RC_KBMAP_PRIMARY,
RC_KBMAP_SECONDARY,
+#ifdef MONO
RC_FAST_SELECTION,
+#endif
RC_SELECTION_COLOR,
RC_BACKGROUND_COLOR,
RC_FAX_COMMAND,
{ "\\dvi_to_ps_command", RC_DVI_TO_PS_COMMAND },
{ "\\escape_chars", RC_ESC_CHARS },
{ "\\exit_confirmation", RC_EXIT_CONFIRMATION },
+#ifdef MONO
{ "\\fast_selection", RC_FAST_SELECTION },
+#endif
{ "\\fax_command", RC_FAX_COMMAND },
{ "\\fax_program", RC_FAXPROGRAM },
{ "\\font_encoding", RC_FONT_ENCODING },
cursor_follows_scrollbar = lexrc.GetBool();
break;
+#ifdef MONO
case RC_FAST_SELECTION:
if (lexrc.next())
fast_selection = lexrc.GetBool();
break;
+#endif
case RC_BACKGROUND_COLOR:
if (lexrc.next())
case RC_CURSOR_FOLLOWS_SCROLLBAR:
os << "\\cursor_follows_scrollbar "
<< tostr(cursor_follows_scrollbar) << "\n";
+#ifdef MONO
case RC_FAST_SELECTION:
os << "\\fast_selection "
<< tostr(static_cast<bool>(fast_selection)) << "\n";
+#endif
case RC_BACKGROUND_COLOR:
os << "\\background_color \"" << background_color << "\"\n";
case RC_SELECTION_COLOR:
#include FORMS_H_LOCATION
#include <X11/Xlib.h>
+
+#define USE_PAINTER 1
+
+#ifndef USE_PAINTER
#include "lyxdraw.h"
+#endif
class LyXText;
struct Row;
///
~LyXScreen();
+#ifndef USE_PAINTER
/** Return the forground pixmap. This function is a _hack_,
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.
Tasks for 0.13. */
Pixmap getForeground() { return foreground; };
+#endif
/** Draws the screen form textposition y. Uses as much of
the already printed pixmap as possible */
///
Row * screen_refresh_row;
///
- friend class InsetFormula;
+ //friend class InsetFormula;
#ifdef USE_PAINTER
///
GC gc_copy;
#include "minibuffer.h"
#include "BufferView.h"
#include "lyxscreen.h"
+#ifndef USE_PAINTER
#include "lyxdraw.h"
+#endif
#include "lyxtext.h"
#include "gettext.h"
#include "LaTeXFeatures.h"
extern void UpdateInset(BufferView *, Inset * inset, bool mark_dirty = true);
+#ifndef USE_PAINTER
extern GC canvasGC, mathGC, mathLineGC, latexGC, cursorGC, mathFrameGC;
+#endif
+
extern char * mathed_label;
+#ifdef MONO
extern int mono_video;
extern int fast_selection;
+#endif
extern BufferView * current_view;
extern char const * latex_special_chars;
static MathSpaceInset * sp= 0;
HideInsetCursor();
+#ifdef MONO
if (mathcursor->Selection() && (fast_selection || mono_video))
ToggleInsetSelection();
+#endif
if (mathcursor->getLastCode() == LM_TC_TEX) {
varcode = LM_TC_TEX;
&& action != LFUN_BACKSPACE)
UpdateLocal();
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();
if (result)
LyXFont font = WhichFont(LM_TC_TEXTRM, size);
font.setLatex(LyXFont::ON);
x += (font.textWidth("I", 1) + 3) / 4;
+#ifdef MONO
if (mono_video) {
int a = font.maxAscent();
int d = font.maxDescent();
pain.fillRectangle(x, y - a, font.textWidth(name, strlen(name)), a + d);
}
+#endif
pain.text(x, y, name, font);
}
}
#include "lyx_cb.h"
#include "BufferView.h"
#include "lyxscreen.h"
+#ifndef USE_PAINTER
#include "lyxdraw.h"
+#endif
#include "gettext.h"
#include "Painter.h"
#include "LColor.h"
#include "Painter.h"
+#ifndef USE_PAINTER
extern void mathed_set_font(short type, int style);
+#endif
+#ifndef USE_PAINTER
extern GC canvasGC, mathGC, latexGC, cursorGC, mathFrameGC;
+#endif
static LyxArrayBase * selarray = 0;
#pragma interface
#endif
+#define USE_PAINTER 1
+
#include "support/LIstream.h"
#include "LString.h"
const matriz_data MATIDEN= { {1, 0}, {0, 1}};
+#ifndef USE_PAINTER
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_height(short, int, byte, int&, int&);
y = m[1][0]*xp + m[1][1]*yp;
}
+#ifndef USE_PAINTER
extern GC latexGC, mathGC, mathLineGC, cursorGC;
+#endif
static int search_deco(int code)
{
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_char_height(short, int, byte, int&, int&);
-
+
+#ifndef USE_PAINTER
GC canvasGC= 0, mathGC= 0, mathLineGC= 0, latexGC= 0, cursorGC= 0, mathFrameGC= 0;
+#endif
#ifndef USE_PAINTER
return o << int(mmf);
}
+#ifndef USE_PAINTER
extern GC mathGC, mathFrameGC, latexGC;
+#endif
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&);
Metrics();
tmplate->update(this);
tmplate->SetStyle(size);
- mathGC = latexGC;
+ //mathGC = latexGC;
tmplate->draw(pain, x, y);
for (int i = 0; i < nargs; ++i)
tmplate->GetMacroXY(i, args[i].x, args[i].y);
#endif
#include "lyxscreen.h"
-#include "lyxdraw.h"
#include "lyxtext.h"
#include "lyxrow.h"
#include "BufferView.h"
#include "Painter.h"
+#ifndef USE_PAINTER
+#include "lyxdraw.h"
+#endif
+#ifdef MONO
extern int mono_video;
extern int fast_selection;
+#endif
#ifdef USE_PAINTER
static
void LyXScreen::HideManualCursor(long x, long y, int asc, int desc)
{
+#ifdef MONO
if (fast_selection || mono_video)
ShowManualCursor(x, y, asc, desc);
else
+#endif
HideCursor();
}
#include "lyxtext.h"
#include "support/textutils.h"
#include "lyx_gui_misc.h"
-#include "lyxdraw.h"
#include "gettext.h"
#include "bufferparams.h"
#include "buffer.h"
#include "LyXView.h"
#include "lyxrow.h"
#include "Painter.h"
+#ifndef USE_PAINTER
+#include "lyxdraw.h"
+#endif
using std::max;
using std::min;
static const int LYX_PAPER_MARGIN = 20;
+#ifdef MONO
extern int mono_video;
extern int reverse_video;
extern int fast_selection;
+#endif
+
extern BufferView * current_view;
extern LyXRC * lyxrc;
jumped_over_space = false;
if (IsLineSeparatorChar(c)) {
-
+
+#ifndef FIX_DOUBLE_SPACE
/* avoid double blanks but insert the new blank because
* of a possible font change */
if (cursor.pos < lastpos &&
- cursor.par->IsLineSeparator(cursor.pos))
- {
+ cursor.par->IsLineSeparator(cursor.pos)) {
cursor.par->Erase(cursor.pos);
jumped_over_space = true;
- }
- else if ((cursor.pos > 0 &&
+ } else
+#endif
+ if ((cursor.pos > 0 &&
cursor.par->IsLineSeparator(cursor.pos - 1))
|| (cursor.pos > 0 && cursor.par->IsNewline(cursor.pos - 1))
|| (cursor.pos == 0 &&
&& cursor.par->Previous()->footnoteflag
== LyXParagraph::OPEN_FOOTNOTE)))
return;
- }
- else if (IsNewlineChar(c)) {
+ } else if (IsNewlineChar(c)) {
if (!IsEmptyTableCell()) {
TableFeatures(LyXTable::APPEND_CONT_ROW);
CursorDown();
/* no pasting of table paragraphs */
CursorLeft();
- }
- else {
+ } else {
/* this is the code for a normal backspace, not pasting
* any paragraphs */
- SetUndo(Undo::DELETE,
- cursor.par->ParFromPos(cursor.pos)->previous,
- cursor.par->ParFromPos(cursor.pos)->next);
+ SetUndo(Undo::DELETE,
+ cursor.par->ParFromPos(cursor.pos)->previous,
+ cursor.par->ParFromPos(cursor.pos)->next);
CursorLeftIntern();
tmprow = tmprow->next;
tmprow->pos--;
}
-
+
+#ifndef FIX_DOUBLE_SPACE
/* delete superfluous blanks */
if (cursor.pos < cursor.par->Last() - 1 &&
(cursor.par->IsLineSeparator(cursor.pos))) {
cursor.pos--;
}
}
+#endif
}
CheckParagraphInTable(cursor.par, cursor.pos);
pain.fillRectangle(0, offset, paperwidth, row_ptr->height);
// check for NOT FAST SELECTION
- if (!fast_selection && !mono_video && selection) {
+ if (
+#ifdef MONO
+ !fast_selection && !mono_video &&
+#endif
+ selection) {
/* selection code */
if (sel_start_cursor.row == row_ptr &&
sel_end_cursor.row == row_ptr) {
sel_start_cursor.x - sel_end_cursor.x,
row_ptr->height,
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)
pain.fillRectangle(sel_start_cursor.x, offset,
paperwidth - sel_start_cursor.x,
pain.line(0, offset + y_bottom - 2 * DefaultHeight(),
paperwidth,
offset + y_bottom - 2 * DefaultHeight(),
- LColor::pagebreak);
+ LColor::pagebreak, Painter::line_onoffdash);
y_bottom -= 3 * DefaultHeight();
}