3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 // Too hard to make concept checks work with this file
14 #ifdef _GLIBCXX_CONCEPT_CHECKS
15 #undef _GLIBCXX_CONCEPT_CHECKS
17 #ifdef _GLIBCPP_CONCEPT_CHECKS
18 #undef _GLIBCPP_CONCEPT_CHECKS
23 #include "GWorkArea.h"
26 #include "BufferView.h"
33 #include "frontends/Painter.h"
35 #include "insets/insettext.h"
39 // FIXME: defined in X.h, spuriously pulled in by some gui headers
45 //using lyx::frontend::CursorShape;
47 GScreen::GScreen(GWorkArea & o)
50 // the cursor isnt yet visible
63 void GScreen::setCursorColor(Glib::RefPtr<Gdk::GC> gc)
65 Gdk::Color * clr = owner_.getColorHandler().
66 getGdkColor(LColor::cursor);
67 gc->set_foreground(*clr);
71 void GScreen::showCursor(int x, int y, int h, CursorShape shape)
73 // Update the cursor color.
74 setCursorColor(owner_.getGC());
85 cursorW_ = cursorH_ / 3;
87 case REVERSED_L_SHAPE:
88 cursorW_ = cursorH_ / 3;
89 cursorX_ = x - cursorW_ + 1;
93 int fx, fy, fwidth, fheight, fdepth;
94 owner_.getWindow()->get_geometry(fx, fy, fwidth, fheight, fdepth);
95 cursorPixmap_ = Gdk::Pixmap::create(owner_.getWindow(),
99 cursorPixmap_->draw_drawable(owner_.getGC(),
101 owner_.xpos() + cursorX_,
102 owner_.ypos() + cursorY_,
106 owner_.getWindow()->draw_line(owner_.getGC(),
110 y + h - 1 + owner_.ypos());
115 case REVERSED_L_SHAPE:
116 owner_.getWindow()->draw_line(owner_.getGC(),
117 owner_.xpos() + cursorX_,
118 owner_.ypos() + y + h - 1,
119 owner_.xpos() + cursorX_ + cursorW_ - 1,
120 owner_.xpos() + y + h - 1);
126 void GScreen::removeCursor()
129 owner_.getWindow()->draw_drawable(owner_.getGC(),
132 cursorX_ + owner_.xpos(),
133 cursorY_ + owner_.ypos(),
139 void GScreen::expose(int x, int y, int w, int h)
141 lyxerr[Debug::GUI] << "expose " << w << 'x' << h
142 << '+' << x << '+' << y << std::endl;
143 owner_.getWindow()->draw_drawable(owner_.getGC(),
151 } // namespace frontend