2003-09-02 10:29:05 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2003-10-08 11:31:51 +00:00
|
|
|
* \file gtk/GView.h
|
2003-09-02 10:29:05 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Huang Ying
|
|
|
|
*
|
2003-09-02 17:02:32 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-09-02 10:29:05 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GVIEW_H
|
|
|
|
#define GVIEW_H
|
|
|
|
|
|
|
|
#include "frontends/LyXView.h"
|
|
|
|
#include "bufferview_funcs.h"
|
2004-09-26 13:18:29 +00:00
|
|
|
|
2004-09-26 18:36:07 +00:00
|
|
|
#include <gtkmm.h>
|
|
|
|
|
2004-04-27 14:48:13 +00:00
|
|
|
#include <map>
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2003-09-02 10:29:05 +00:00
|
|
|
class GMiniBuffer;
|
|
|
|
|
2004-09-26 13:18:29 +00:00
|
|
|
class GView : public LyXView, public Gtk::Window {
|
2003-09-02 10:29:05 +00:00
|
|
|
public:
|
2004-04-27 14:48:13 +00:00
|
|
|
enum Position {
|
|
|
|
Top,
|
|
|
|
Bottom,
|
|
|
|
Left,
|
|
|
|
Right,
|
|
|
|
Center
|
|
|
|
};
|
|
|
|
|
|
|
|
GView();
|
|
|
|
~GView();
|
|
|
|
|
|
|
|
Gtk::Box & getBox(Position pos);
|
2003-09-02 10:29:05 +00:00
|
|
|
|
|
|
|
virtual void prohibitInput() const;
|
|
|
|
virtual void allowInput() const;
|
2003-10-06 15:43:21 +00:00
|
|
|
virtual void message(std::string const &);
|
2004-04-27 14:48:13 +00:00
|
|
|
|
2003-09-02 10:29:05 +00:00
|
|
|
bool on_delete_event(GdkEventAny * event);
|
|
|
|
void focusWorkArea() { workArea_->grab_focus(); }
|
|
|
|
void setGWorkArea(Gtk::Widget * w) { workArea_ = w; }
|
2004-04-27 14:48:13 +00:00
|
|
|
|
2003-09-02 10:29:05 +00:00
|
|
|
/// show busy cursor
|
|
|
|
virtual void busy(bool) const;
|
|
|
|
/// clear any temporary message and replace with current status
|
|
|
|
virtual void clearMessage();
|
|
|
|
private:
|
|
|
|
void showViewState();
|
|
|
|
bool onFocusIn(GdkEventFocus * event);
|
2003-10-06 15:43:21 +00:00
|
|
|
virtual void setWindowTitle(std::string const & t, std::string const & it);
|
2004-04-27 14:48:13 +00:00
|
|
|
|
|
|
|
// The top-most box containing all other boxes.
|
|
|
|
Gtk::VBox top_box_;
|
|
|
|
|
|
|
|
// The physical store for the boxes making up the layout.
|
|
|
|
typedef boost::shared_ptr<Gtk::Box> BoxPtr;
|
|
|
|
typedef std::vector<BoxPtr> BoxStore;
|
|
|
|
BoxStore box_store_;
|
|
|
|
|
|
|
|
// Accessors to the various Boxes.
|
|
|
|
std::map<Position, BoxPtr> box_map_;
|
|
|
|
|
2003-09-02 10:29:05 +00:00
|
|
|
boost::scoped_ptr<GMiniBuffer> minibuffer_;
|
|
|
|
Gtk::Widget * workArea_;
|
|
|
|
};
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2003-09-02 10:29:05 +00:00
|
|
|
#endif
|