2000-04-08 17:02:02 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
|
|
|
|
#ifndef BUFFERVIEW_PIMPL_H
|
|
|
|
#define BUFFERVIEW_PIMPL_H
|
|
|
|
|
2001-03-06 19:29:58 +00:00
|
|
|
#include <boost/smart_ptr.hpp>
|
|
|
|
|
2000-04-08 17:02:02 +00:00
|
|
|
#include "BufferView.h"
|
|
|
|
#include "UpdateInset.h"
|
2001-02-23 16:10:03 +00:00
|
|
|
#include "commandtags.h"
|
2001-02-07 16:44:49 +00:00
|
|
|
#include "frontends/Timeout.h"
|
2001-03-06 19:29:58 +00:00
|
|
|
#include "WorkArea.h"
|
2000-04-08 17:02:02 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class LyXView;
|
|
|
|
class WorkArea;
|
|
|
|
class LyXScreen;
|
|
|
|
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2001-03-15 18:21:56 +00:00
|
|
|
struct BufferView::Pimpl : public SigC::Object {
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
Pimpl(BufferView * i, LyXView * o,
|
|
|
|
int xpos, int ypos, int width, int height);
|
2000-04-09 22:48:51 +00:00
|
|
|
///
|
|
|
|
Painter & painter();
|
|
|
|
///
|
|
|
|
void buffer(Buffer *);
|
|
|
|
///
|
|
|
|
void resize(int xpos, int ypos, int width, int height);
|
|
|
|
///
|
|
|
|
void resize();
|
|
|
|
///
|
|
|
|
void redraw();
|
2000-04-26 13:57:28 +00:00
|
|
|
/// Return true if the cursor was fitted.
|
2000-09-28 14:05:24 +00:00
|
|
|
bool fitCursor(LyXText *);
|
2000-04-09 22:48:51 +00:00
|
|
|
///
|
|
|
|
void redoCurrentBuffer();
|
|
|
|
///
|
|
|
|
int resizeCurrentBuffer();
|
|
|
|
///
|
|
|
|
void update();
|
2000-08-07 20:58:24 +00:00
|
|
|
//
|
2001-02-14 08:38:21 +00:00
|
|
|
void update(LyXText *, BufferView::UpdateCodes);
|
2000-04-08 17:02:02 +00:00
|
|
|
/// Update pixmap of screen
|
|
|
|
void updateScreen();
|
|
|
|
///
|
|
|
|
void workAreaExpose();
|
|
|
|
///
|
2000-04-09 22:48:51 +00:00
|
|
|
void updateScrollbar();
|
|
|
|
///
|
|
|
|
void scrollCB(double value);
|
2000-04-08 17:02:02 +00:00
|
|
|
///
|
2000-08-07 20:58:24 +00:00
|
|
|
Inset * checkInsetHit(LyXText *, int & x, int & y,
|
|
|
|
unsigned int button);
|
2000-04-08 17:02:02 +00:00
|
|
|
///
|
|
|
|
int scrollUp(long time);
|
|
|
|
///
|
|
|
|
int scrollDown(long time);
|
|
|
|
///
|
2000-08-14 15:31:16 +00:00
|
|
|
void workAreaKeyPress(KeySym, unsigned int state);
|
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
void workAreaMotionNotify(int x, int y, unsigned int state);
|
|
|
|
///
|
|
|
|
void workAreaButtonPress(int x, int y, unsigned int button);
|
|
|
|
///
|
|
|
|
void workAreaButtonRelease(int x, int y, unsigned int button);
|
|
|
|
///
|
|
|
|
void doubleClick(int x, int y, unsigned int button);
|
|
|
|
///
|
|
|
|
void tripleClick(int x, int y, unsigned int button);
|
|
|
|
///
|
2000-04-14 19:20:33 +00:00
|
|
|
void enterView();
|
|
|
|
///
|
|
|
|
void leaveView();
|
|
|
|
///
|
2000-04-09 22:48:51 +00:00
|
|
|
void cursorToggle();
|
|
|
|
///
|
2000-10-10 10:38:11 +00:00
|
|
|
void cursorPrevious(LyXText *);
|
2000-04-09 22:48:51 +00:00
|
|
|
///
|
2000-10-10 10:38:11 +00:00
|
|
|
void cursorNext(LyXText *);
|
2000-04-09 22:48:51 +00:00
|
|
|
///
|
|
|
|
bool available() const;
|
|
|
|
///
|
2001-02-14 10:11:22 +00:00
|
|
|
void beforeChange(LyXText *);
|
2000-04-09 22:48:51 +00:00
|
|
|
///
|
2001-01-28 18:31:36 +00:00
|
|
|
void savePosition(unsigned int i);
|
2000-04-09 22:48:51 +00:00
|
|
|
///
|
2001-01-28 18:31:36 +00:00
|
|
|
void restorePosition(unsigned int i);
|
2000-04-09 22:48:51 +00:00
|
|
|
///
|
2001-01-28 18:31:36 +00:00
|
|
|
bool isSavedPosition(unsigned int i);
|
2000-06-05 15:12:09 +00:00
|
|
|
///
|
2000-04-09 22:48:51 +00:00
|
|
|
void setState();
|
|
|
|
///
|
|
|
|
void insetSleep();
|
|
|
|
///
|
|
|
|
void insetWakeup();
|
|
|
|
///
|
|
|
|
void insetUnlock();
|
|
|
|
///
|
|
|
|
bool focus() const;
|
|
|
|
///
|
|
|
|
void focus(bool);
|
|
|
|
///
|
|
|
|
bool active() const;
|
|
|
|
///
|
|
|
|
bool belowMouse() const;
|
|
|
|
///
|
|
|
|
void showCursor();
|
|
|
|
///
|
|
|
|
void hideCursor();
|
|
|
|
///
|
|
|
|
void toggleSelection(bool = true);
|
|
|
|
///
|
|
|
|
void toggleToggle();
|
|
|
|
///
|
|
|
|
void center();
|
|
|
|
///
|
2001-02-23 16:10:03 +00:00
|
|
|
bool Dispatch(kb_action action, string const & argument);
|
2001-03-06 19:29:58 +00:00
|
|
|
private:
|
|
|
|
///
|
|
|
|
friend class BufferView;
|
2001-05-18 07:37:14 +00:00
|
|
|
/// open and lock an updatable inset
|
|
|
|
bool open_new_inset(UpdatableInset * new_inset, bool behind = false);
|
|
|
|
///
|
2001-05-29 09:50:02 +00:00
|
|
|
void protectedBlank(LyXText * lt);
|
|
|
|
///
|
|
|
|
void newline();
|
|
|
|
///
|
|
|
|
void hfill();
|
|
|
|
///
|
|
|
|
void menuSeparator();
|
|
|
|
///
|
|
|
|
void endOfSentenceDot();
|
|
|
|
///
|
|
|
|
void ldots();
|
|
|
|
///
|
|
|
|
void hyphenationPoint();
|
|
|
|
///
|
2001-05-18 07:37:14 +00:00
|
|
|
void insertNote();
|
2001-02-23 16:10:03 +00:00
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
BufferView * bv_;
|
|
|
|
///
|
|
|
|
LyXView * owner_;
|
|
|
|
///
|
|
|
|
Buffer * buffer_;
|
|
|
|
///
|
2001-03-06 19:29:58 +00:00
|
|
|
boost::scoped_ptr<LyXScreen> screen_;
|
2000-04-08 17:02:02 +00:00
|
|
|
///
|
|
|
|
long current_scrollbar_value;
|
|
|
|
///
|
2000-06-08 23:16:16 +00:00
|
|
|
Timeout cursor_timeout;
|
2000-04-08 17:02:02 +00:00
|
|
|
///
|
2000-09-14 17:53:12 +00:00
|
|
|
int last_click_x;
|
|
|
|
///
|
|
|
|
int last_click_y;
|
2000-04-08 17:02:02 +00:00
|
|
|
///
|
2001-03-06 19:29:58 +00:00
|
|
|
WorkArea workarea_;
|
2000-04-08 17:02:02 +00:00
|
|
|
///
|
|
|
|
UpdateInset updatelist;
|
2000-05-20 01:38:25 +00:00
|
|
|
///
|
2000-05-20 21:37:05 +00:00
|
|
|
void pasteClipboard(bool asPara);
|
|
|
|
///
|
|
|
|
void stuffClipboard(string const &) const;
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2000-04-14 19:20:33 +00:00
|
|
|
bool using_xterm_cursor;
|
2001-03-06 19:29:58 +00:00
|
|
|
///
|
2001-01-28 18:31:36 +00:00
|
|
|
struct Position {
|
|
|
|
/// Filename
|
|
|
|
string filename;
|
|
|
|
/// Cursor paragraph Id
|
|
|
|
int par_id;
|
|
|
|
/// Cursor position
|
2001-01-29 17:45:29 +00:00
|
|
|
LyXParagraph::size_type par_pos;
|
2001-01-28 18:31:36 +00:00
|
|
|
///
|
|
|
|
Position() : par_id(0), par_pos(0) {}
|
|
|
|
///
|
2001-01-29 17:45:29 +00:00
|
|
|
Position(string const & f, int id, LyXParagraph::size_type pos)
|
2001-01-28 18:31:36 +00:00
|
|
|
: filename(f), par_id(id), par_pos(pos) {}
|
|
|
|
};
|
2001-03-06 19:29:58 +00:00
|
|
|
///
|
2001-01-28 18:33:17 +00:00
|
|
|
std::vector<Position> saved_positions;
|
2001-03-06 19:29:58 +00:00
|
|
|
///
|
2001-02-23 16:10:03 +00:00
|
|
|
void moveCursorUpdate(bool selecting);
|
|
|
|
/// Get next inset of this class from current cursor position
|
|
|
|
Inset * getInsetByCode(Inset::Code code);
|
2001-03-06 19:29:58 +00:00
|
|
|
///
|
2001-02-23 16:10:03 +00:00
|
|
|
void MenuInsertLyXFile(string const & filen);
|
2000-04-08 17:02:02 +00:00
|
|
|
};
|
|
|
|
#endif
|