]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/xscreen.C
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / xscreen.C
index c8ca235ce2e0643016314e2a30f59a369f554e3f..4375e57a423fd6d78da22d50014a5784f739fa1f 100644 (file)
@@ -6,33 +6,21 @@
  * \author unknown
  * \author John Levon
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-
-#include <algorithm>
-#include <X11/Xlib.h>
-
-#include "frontends/screen.h"
-#include "frontends/font_metrics.h"
-#include "XWorkArea.h"
 #include "xscreen.h"
-#include "lyxtext.h"
-#include "lyxrow.h"
-#include "Painter.h"
-#include "WorkArea.h"
-#include "buffer.h"
-#include "BufferView.h"
-#include "insets/insettext.h"
+
 #include "ColorHandler.h"
-#include "language.h"
+#include "XWorkArea.h"
+
 #include "debug.h"
+#include "LColor.h"
 
 using std::endl;
-using std::max;
-using std::min;
+
 
 namespace {
 
@@ -69,6 +57,12 @@ XScreen::~XScreen()
 }
 
 
+WorkArea & XScreen::workarea() const
+{
+       return owner_;
+}
+
+
 void XScreen::setCursorColor()
 {
        if (!lyxColorHandler.get())
@@ -169,57 +163,3 @@ void XScreen::expose(int x, int y, int w, int h)
                  x + owner_.xpos(),
                  y + owner_.ypos());
 }
-
-
-void XScreen::draw(LyXText * text, BufferView * bv, unsigned int y)
-{
-       int const old_first = text->top_y();
-       text->top_y(y);
-
-       // is any optimization possible?
-       if ((y - old_first) < owner_.workHeight()
-           && (old_first - y) < owner_.workHeight())
-       {
-               if (text->top_y() < old_first) {
-                       drawFromTo(text, bv, 0, old_first - text->top_y(), 0, 0);
-                       XCopyArea(fl_get_display(),
-                                 owner_.getWin(),
-                                 owner_.getWin(),
-                                 gc_copy,
-                                 owner_.xpos(),
-                                 owner_.ypos(),
-                                 owner_.workWidth(),
-                                 owner_.workHeight() - old_first + text->top_y(),
-                                 owner_.xpos(),
-                                 owner_.ypos() + old_first - text->top_y()
-                               );
-                       // expose the area drawn
-                       expose(0, 0,
-                              owner_.workWidth(),
-                              old_first - text->top_y());
-               } else  {
-                       drawFromTo(text, bv,
-                                  owner_.workHeight() + old_first - text->top_y(),
-                                  owner_.workHeight(), 0, 0);
-                       XCopyArea(fl_get_display(),
-                                 owner_.getWin(),
-                                 owner_.getWin(),
-                                 gc_copy,
-                                 owner_.xpos(),
-                                 owner_.ypos() + text->top_y() - old_first,
-                                 owner_.workWidth(),
-                                 owner_.workHeight() + old_first - text->top_y(),
-                                 owner_.xpos(),
-                                 owner_.ypos());
-                       // expose the area drawn
-                       expose(0, owner_.workHeight() + old_first - text->top_y(),
-                              owner_.workWidth(), text->top_y() - old_first);
-               }
-       } else {
-               // make a dumb new-draw
-               drawFromTo(text, bv, 0, owner_.workHeight(), 0, 0);
-               expose(0, 0, owner_.workWidth(), owner_.workHeight());
-       }
-
-       XSync(fl_get_display(), 0);
-}