/**
* \file xscreen.C
- * Copyright 1995-2002 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
* \author unknown
- * \author John Levon <moz@compsoc.man.ac.uk>
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS
*/
#include <config.h>
GC createGC()
{
XGCValues val;
- val.foreground = BlackPixel(fl_get_display(),
+ val.foreground = BlackPixel(fl_get_display(),
DefaultScreen(fl_get_display()));
-
+
val.function = GXcopy;
val.graphics_exposures = false;
val.line_style = LineSolid;
val.line_width = 0;
- return XCreateGC(fl_get_display(), RootWindow(fl_get_display(), 0),
+ return XCreateGC(fl_get_display(), RootWindow(fl_get_display(), 0),
GCForeground | GCFunction | GCGraphicsExposures
- | GCLineWidth | GCLineStyle , &val);
+ | GCLineWidth | GCLineStyle, &val);
}
} // namespace anon
XFreeGC(fl_get_display(), gc_copy);
}
-
-void XScreen::setCursorColor()
+
+void XScreen::setCursorColor()
{
if (!lyxColorHandler.get()) return;
GC gc = lyxColorHandler->getGCForeground(LColor::cursor);
-
+
XGCValues val;
XGetGCValues(fl_get_display(),
gc, GCForeground, &val);
{
// Update the cursor color.
setCursorColor();
-
+
int const y1 = max(y - text->first_y - asc, 0);
int const y_tmp = min(y - text->first_y + desc,
static_cast<int>(owner_.workHeight()));
// Secure against very strange situations
int const y2 = max(y_tmp, y1);
-
+
if (cursor_pixmap) {
XFreePixmap(fl_get_display(), cursor_pixmap);
cursor_pixmap = 0;
break;
}
- cursor_pixmap =
+ cursor_pixmap =
XCreatePixmap (fl_get_display(),
fl_root,
cursor_pixmap_w,
if (!cursor_visible_) return;
if (cursor_pixmap) {
- XCopyArea (fl_get_display(),
+ XCopyArea (fl_get_display(),
cursor_pixmap,
owner_.getWin(),
gc_copy,
- 0, 0,
+ 0, 0,
cursor_pixmap_w, cursor_pixmap_h,
cursor_pixmap_x + owner_.xpos(),
cursor_pixmap_y + owner_.ypos());
cursor_visible_ = false;
}
-
+
void XScreen::expose(int x, int y, int w, int h)
{
lyxerr[Debug::GUI] << "expose " << w << "x" << h
if (cursor_visible_) hideCursor();
int const old_first = text->first_y;
- bool internal = (text == bv->text);
+ bool const internal = (text == bv->text);
text->first_y = y;
// is any optimization possible?
old_first - text->first_y);
} else {
drawFromTo(text, bv,
- owner_.workHeight() + old_first - text->first_y,
- owner_.workHeight(), 0, 0, internal);
+ owner_.workHeight() + old_first - text->first_y,
+ owner_.workHeight(), 0, 0, internal);
XCopyArea (fl_get_display(),
owner_.getWin(),
owner_.getWin(),
owner_.workWidth(), text->first_y - old_first);
}
} else {
- // make a dumb new-draw
+ // make a dumb new-draw
drawFromTo(text, bv, 0, owner_.workHeight(), 0, 0, internal);
expose(0, 0, owner_.workWidth(), owner_.workHeight());
}