string const & text() const { return text_; }
///
LyXFont const & font() const { return font_; }
+ ///
+ void connect(grfx::Loader::slot_type const & slot) const {
+ loader_.connect(slot);
+ }
+ ///
+ void startLoading() const {
+ if (loader_.status() == grfx::WaitingToLoad)
+ loader_.startLoading();
+ }
private:
/** Make the c-tor private so we can control how many objects
// Load up the graphics file
loader_.reset(file);
- // We aren't interested here in when the image is loaded.
- // If it isn't ready when we want it, then we ignore it.
-// loader_->statusChanged.connect(
-// boost::bind(&SplashScreen::statusChanged, this));
- if (loader_.status() == grfx::WaitingToLoad)
- loader_.startLoading();
}
} // namespace anon
LyXScreen::LyXScreen()
- : force_clear_(true), cursor_visible_(false)
+ : cursor_visible_(false), force_clear_(true), greyed_out_(false)
{
// Start loading the pixmap as soon as possible
- SplashScreen::get();
+ if (lyxrc.show_banner) {
+ SplashScreen const & splash = SplashScreen::get();
+ splash.connect(boost::bind(&LyXScreen::greyOut, this));
+ splash.startLoading();
+ }
}
void LyXScreen::redraw(LyXText * text, BufferView * bv)
{
+ greyed_out_ = !text;
+
workarea().getPainter().start();
- if (!text) {
+ if (greyed_out_) {
greyOut();
- expose(0, 0, workarea().workWidth(), workarea().workHeight());
- workarea().getPainter().end();
return;
}
void LyXScreen::greyOut()
{
+ if (!greyed_out_)
+ return;
+
workarea().getPainter().fillRectangle(0, 0,
workarea().workWidth(),
workarea().workHeight(),
workarea().getPainter().text(x, y, splash_text, splash_font);
}
+ expose(0, 0, workarea().workWidth(), workarea().workHeight());
+ workarea().getPainter().end();
}
virtual void drawOneRow(LyXText *, BufferView *, Row * row,
int y_text, int y_offset = 0, int x_offset = 0);
+ /// is the blinking cursor currently drawn
+ bool cursor_visible_;
+
+private:
/// grey out (no buffer)
void greyOut();
/// FIXME ?
bool force_clear_;
- /// is the blinking cursor currently drawn
- bool cursor_visible_;
+ /// is the screen displaying text or the splash screen?
+ bool greyed_out_;
};
#endif // SCREEN_H