2000-02-25 12:06:15 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/* This file is part of
|
|
|
|
|
* ======================================================
|
2002-03-21 17:09:55 +00:00
|
|
|
|
*
|
2000-02-25 12:06:15 +00:00
|
|
|
|
* LyX, The Document Processor
|
|
|
|
|
*
|
2000-02-25 13:35:38 +00:00
|
|
|
|
* Copyright 1998 The LyX Team.
|
2000-02-25 12:06:15 +00:00
|
|
|
|
*
|
2000-08-23 15:18:19 +00:00
|
|
|
|
*
|
2000-02-25 12:06:15 +00:00
|
|
|
|
*======================================================
|
|
|
|
|
*/
|
|
|
|
|
// The pristine updatable inset: Text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef INSETTEXT_H
|
|
|
|
|
#define INSETTEXT_H
|
|
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
|
#pragma interface
|
|
|
|
|
#endif
|
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
#include "inset.h"
|
2000-02-25 12:06:15 +00:00
|
|
|
|
#include "LString.h"
|
2001-07-06 15:57:54 +00:00
|
|
|
|
#include "LColor.h"
|
|
|
|
|
#include "paragraph.h"
|
2000-04-19 14:42:19 +00:00
|
|
|
|
#include "lyxcursor.h"
|
2001-12-18 03:21:10 +00:00
|
|
|
|
|
2001-07-05 14:52:08 +00:00
|
|
|
|
#include <boost/smart_ptr.hpp>
|
2000-02-25 12:06:15 +00:00
|
|
|
|
|
|
|
|
|
class Painter;
|
|
|
|
|
class BufferView;
|
2000-03-08 13:52:57 +00:00
|
|
|
|
class Buffer;
|
2002-03-03 20:25:07 +00:00
|
|
|
|
class BufferParams;
|
2000-05-15 14:49:36 +00:00
|
|
|
|
class LyXCursor;
|
2000-06-12 11:27:15 +00:00
|
|
|
|
class LyXText;
|
2000-06-21 15:07:57 +00:00
|
|
|
|
class LyXScreen;
|
2001-07-06 15:57:54 +00:00
|
|
|
|
class Row;
|
2000-02-25 12:06:15 +00:00
|
|
|
|
|
2000-06-12 11:27:15 +00:00
|
|
|
|
/**
|
2000-09-14 17:53:12 +00:00
|
|
|
|
A text inset is like a TeX box to write full text
|
2002-03-21 17:09:55 +00:00
|
|
|
|
(including styles and other insets) in a given space.
|
2000-09-14 17:53:12 +00:00
|
|
|
|
@author: J<EFBFBD>rgen Vigna
|
2000-06-12 11:27:15 +00:00
|
|
|
|
*/
|
2000-02-25 12:06:15 +00:00
|
|
|
|
class InsetText : public UpdatableInset {
|
|
|
|
|
public:
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
|
|
|
|
/// numbers need because of test if codeA < codeB
|
|
|
|
|
///
|
|
|
|
|
enum UpdateCodes {
|
|
|
|
|
///
|
|
|
|
|
NONE = 0,
|
|
|
|
|
///
|
|
|
|
|
CURSOR = 1,
|
|
|
|
|
///
|
|
|
|
|
CLEAR_FRAME = 2,
|
|
|
|
|
///
|
|
|
|
|
DRAW_FRAME = 4,
|
|
|
|
|
///
|
|
|
|
|
SELECTION = 8,
|
|
|
|
|
///
|
|
|
|
|
CURSOR_PAR = 16,
|
|
|
|
|
///
|
|
|
|
|
FULL = 32,
|
|
|
|
|
///
|
|
|
|
|
INIT = 64
|
|
|
|
|
};
|
|
|
|
|
///
|
|
|
|
|
enum DrawFrame {
|
|
|
|
|
///
|
|
|
|
|
NEVER = 0,
|
|
|
|
|
///
|
|
|
|
|
LOCKED,
|
|
|
|
|
///
|
|
|
|
|
ALWAYS
|
|
|
|
|
};
|
|
|
|
|
///
|
2002-03-03 20:25:07 +00:00
|
|
|
|
InsetText(BufferParams const &);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
|
|
|
|
explicit
|
2001-07-06 15:57:54 +00:00
|
|
|
|
InsetText(InsetText const &, bool same_id = false);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
|
|
|
|
~InsetText();
|
|
|
|
|
///
|
2001-07-06 15:57:54 +00:00
|
|
|
|
Inset * clone(Buffer const &, bool same_id = false) const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
|
|
|
|
InsetText & operator=(InsetText const & it);
|
|
|
|
|
///
|
|
|
|
|
void clear();
|
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void read(Buffer const *, LyXLex &);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void write(Buffer const *, std::ostream &) const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
|
|
|
|
int ascent(BufferView *, LyXFont const &) const;
|
|
|
|
|
///
|
|
|
|
|
int descent(BufferView *, LyXFont const &) const;
|
|
|
|
|
///
|
|
|
|
|
int width(BufferView *, LyXFont const & f) const;
|
|
|
|
|
///
|
2001-08-06 14:55:02 +00:00
|
|
|
|
int textWidth(BufferView *, bool fordraw = false) const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
|
|
|
|
void draw(BufferView *, LyXFont const &, int , float &, bool) const;
|
|
|
|
|
///
|
2001-12-18 03:21:10 +00:00
|
|
|
|
void update(BufferView *, LyXFont const &, bool = false);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void setUpdateStatus(BufferView *, int what) const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
string const editMessage() const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void edit(BufferView *, int, int, unsigned int);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-07-20 14:18:48 +00:00
|
|
|
|
void edit(BufferView *, bool front = true);
|
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
bool isTextInset() const { return true; }
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-04-27 14:03:25 +00:00
|
|
|
|
bool doClearArea() const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void insetUnlock(BufferView *);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
bool lockInsetInInset(BufferView *, UpdatableInset *);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
bool unlockInsetInInset(BufferView *,
|
|
|
|
|
UpdatableInset *, bool lr = false);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
bool updateInsetInInset(BufferView *, Inset *);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-12-17 13:33:22 +00:00
|
|
|
|
bool insetButtonRelease(BufferView *, int, int, int);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void insetButtonPress(BufferView *, int, int, int);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void insetMotionNotify(BufferView *, int, int, int);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void insetKeyPress(XKeyEvent *);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
UpdatableInset::RESULT localDispatch(BufferView *,
|
|
|
|
|
kb_action, string const &);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
int latex(Buffer const *, std::ostream &,
|
2001-04-04 22:08:13 +00:00
|
|
|
|
bool fragile, bool free_spc) const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
int ascii(Buffer const *, std::ostream &, int linelen) const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
int linuxdoc(Buffer const *, std::ostream &) const { return 0; }
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-09-04 11:02:09 +00:00
|
|
|
|
int docbook(Buffer const *, std::ostream &) const ;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void validate(LaTeXFeatures & features) const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
Inset::Code lyxCode() const { return Inset::TEXT_CODE; }
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void getCursorPos(BufferView *, int & x, int & y) const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
unsigned int insetInInsetY();
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void toggleInsetCursor(BufferView *);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-12-18 03:21:10 +00:00
|
|
|
|
void showInsetCursor(BufferView *, bool show = true);
|
2001-07-20 14:18:48 +00:00
|
|
|
|
///
|
|
|
|
|
void hideInsetCursor(BufferView *);
|
|
|
|
|
///
|
|
|
|
|
void fitInsetCursor(BufferView *) const;
|
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
bool insertInset(BufferView *, Inset *);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-07-19 08:52:59 +00:00
|
|
|
|
bool insetAllowed(Inset::Code) const;
|
2001-07-09 14:19:41 +00:00
|
|
|
|
///
|
2001-07-12 12:26:06 +00:00
|
|
|
|
UpdatableInset * getLockingInset() const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
UpdatableInset * getFirstLockingInsetOfType(Inset::Code);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void setFont(BufferView *, LyXFont const &,
|
|
|
|
|
bool toggleall = false,
|
2002-03-21 17:09:55 +00:00
|
|
|
|
bool selectall = false);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
|
|
|
|
int getMaxWidth(BufferView *, UpdatableInset const *) const;
|
|
|
|
|
///
|
2001-07-06 15:57:54 +00:00
|
|
|
|
void init(InsetText const * ins = 0, bool same_id = false);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void writeParagraphData(Buffer const *, std::ostream &) const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-11-30 16:10:24 +00:00
|
|
|
|
void setParagraphData(Paragraph *, bool same_id = false);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2002-03-26 11:05:30 +00:00
|
|
|
|
void setText(string const &, LyXFont const &);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void setAutoBreakRows(bool);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-07-31 09:53:40 +00:00
|
|
|
|
bool getAutoBreakRows() const { return autoBreakRows; }
|
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void setDrawFrame(BufferView *, DrawFrame);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void setFrameColor(BufferView *, LColor::color);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-27 14:10:35 +00:00
|
|
|
|
LyXText * getLyXText(BufferView const *,
|
|
|
|
|
bool const recursive = false) const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-27 14:10:35 +00:00
|
|
|
|
void deleteLyXText(BufferView *, bool recursive = true) const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-27 14:10:35 +00:00
|
|
|
|
void resizeLyXText(BufferView *, bool force = false) const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
bool showInsetDialog(BufferView *) const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-04-05 08:03:26 +00:00
|
|
|
|
std::vector<string> const getLabelList() const;
|
2001-04-04 23:00:42 +00:00
|
|
|
|
///
|
2001-04-27 14:03:25 +00:00
|
|
|
|
bool nodraw() const;
|
|
|
|
|
///
|
2001-12-18 03:21:10 +00:00
|
|
|
|
int scroll(bool recursive = true) const;
|
2001-06-27 14:10:35 +00:00
|
|
|
|
///
|
2001-12-18 03:21:10 +00:00
|
|
|
|
void scroll(BufferView * bv, float sx) const {
|
2001-04-27 14:03:25 +00:00
|
|
|
|
UpdatableInset::scroll(bv, sx);
|
|
|
|
|
}
|
2001-06-27 14:10:35 +00:00
|
|
|
|
///
|
2001-12-18 03:21:10 +00:00
|
|
|
|
void scroll(BufferView * bv, int offset) const {
|
2001-04-27 14:03:25 +00:00
|
|
|
|
UpdatableInset::scroll(bv, offset);
|
|
|
|
|
}
|
2001-05-28 15:11:24 +00:00
|
|
|
|
///
|
2001-12-18 03:21:10 +00:00
|
|
|
|
void selectAll(BufferView * bv);
|
2001-05-28 15:11:24 +00:00
|
|
|
|
///
|
2001-12-18 03:21:10 +00:00
|
|
|
|
void clearSelection(BufferView * bv);
|
2001-07-06 15:57:54 +00:00
|
|
|
|
///
|
|
|
|
|
Paragraph * getParFromID(int id) const;
|
|
|
|
|
///
|
|
|
|
|
Inset * getInsetFromID(int id) const;
|
|
|
|
|
///
|
|
|
|
|
Paragraph * firstParagraph() const;
|
|
|
|
|
///
|
2001-09-01 21:26:34 +00:00
|
|
|
|
Paragraph * getFirstParagraph(int) const;
|
|
|
|
|
///
|
2001-07-06 15:57:54 +00:00
|
|
|
|
LyXCursor const & cursor(BufferView *) const;
|
|
|
|
|
///
|
|
|
|
|
Paragraph * paragraph() const;
|
|
|
|
|
///
|
|
|
|
|
void paragraph(Paragraph *);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-10-19 15:40:01 +00:00
|
|
|
|
bool allowSpellcheck() { return true; }
|
2001-12-18 03:21:10 +00:00
|
|
|
|
///
|
|
|
|
|
string const selectNextWordToSpellcheck(BufferView *,
|
|
|
|
|
float & value) const;
|
2001-07-17 15:39:12 +00:00
|
|
|
|
void selectSelectedWord(BufferView *);
|
2001-12-18 03:21:10 +00:00
|
|
|
|
///
|
2001-07-17 15:39:12 +00:00
|
|
|
|
void toggleSelection(BufferView *, bool kill_selection);
|
|
|
|
|
///
|
2001-07-20 14:18:48 +00:00
|
|
|
|
bool searchForward(BufferView *, string const &,
|
2002-03-21 17:09:55 +00:00
|
|
|
|
bool = true, bool = false);
|
2001-12-18 03:21:10 +00:00
|
|
|
|
///
|
2001-07-20 14:18:48 +00:00
|
|
|
|
bool searchBackward(BufferView *, string const &,
|
2002-03-21 17:09:55 +00:00
|
|
|
|
bool = true, bool = false);
|
2001-10-22 09:45:31 +00:00
|
|
|
|
///
|
|
|
|
|
bool checkInsertChar(LyXFont &);
|
|
|
|
|
///
|
2002-02-20 14:55:17 +00:00
|
|
|
|
void getDrawFont(LyXFont &) const;
|
|
|
|
|
///
|
2002-03-21 15:58:54 +00:00
|
|
|
|
void appendParagraphs(BufferParams const & bparams, Paragraph *);
|
|
|
|
|
///
|
2001-07-20 14:18:48 +00:00
|
|
|
|
//
|
|
|
|
|
// Public structures and variables
|
|
|
|
|
///
|
2001-04-02 14:02:58 +00:00
|
|
|
|
mutable int need_update;
|
2000-02-25 12:06:15 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-07-20 14:18:48 +00:00
|
|
|
|
void updateLocal(BufferView *, int what, bool mark_dirty) const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-12-14 11:55:58 +00:00
|
|
|
|
void lockInset(BufferView *, UpdatableInset *);
|
|
|
|
|
///
|
2001-04-02 14:02:58 +00:00
|
|
|
|
mutable int drawTextXOffset;
|
|
|
|
|
///
|
|
|
|
|
mutable int drawTextYOffset;
|
|
|
|
|
///
|
|
|
|
|
bool autoBreakRows;
|
|
|
|
|
///
|
2001-04-27 14:03:25 +00:00
|
|
|
|
DrawFrame drawFrame_;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
|
|
|
|
LColor::color frame_color;
|
2000-02-25 12:06:15 +00:00
|
|
|
|
|
|
|
|
|
private:
|
2001-12-18 03:21:10 +00:00
|
|
|
|
///
|
2001-07-12 12:26:06 +00:00
|
|
|
|
struct InnerCache {
|
2001-12-18 03:21:10 +00:00
|
|
|
|
///
|
2001-07-12 12:26:06 +00:00
|
|
|
|
InnerCache(boost::shared_ptr<LyXText>);
|
2001-12-18 03:21:10 +00:00
|
|
|
|
///
|
2001-07-12 12:26:06 +00:00
|
|
|
|
boost::shared_ptr<LyXText> text;
|
2001-12-18 03:21:10 +00:00
|
|
|
|
///
|
2001-07-12 12:26:06 +00:00
|
|
|
|
bool remove;
|
|
|
|
|
};
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-12-18 03:21:10 +00:00
|
|
|
|
typedef std::map<BufferView *, InnerCache> Cache;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
|
|
|
|
typedef Cache::value_type value_type;
|
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
int beginningOfMainBody(Buffer const *, Paragraph * par) const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
UpdatableInset::RESULT moveRight(BufferView *,
|
|
|
|
|
bool activate_inset = true,
|
2001-04-04 22:08:13 +00:00
|
|
|
|
bool selecting = false);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
UpdatableInset::RESULT moveLeft(BufferView *,
|
|
|
|
|
bool activate_inset = true,
|
2001-04-04 22:08:13 +00:00
|
|
|
|
bool selecting = false);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
|
|
|
|
UpdatableInset::RESULT moveRightIntern(BufferView *, bool behind,
|
2001-04-04 22:08:13 +00:00
|
|
|
|
bool activate_inset = true,
|
|
|
|
|
bool selecting = false);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2002-03-21 17:09:55 +00:00
|
|
|
|
UpdatableInset::RESULT moveLeftIntern(BufferView *, bool behind,
|
2001-04-04 22:08:13 +00:00
|
|
|
|
bool activate_inset = true,
|
|
|
|
|
bool selecting = false);
|
2001-01-08 16:14:09 +00:00
|
|
|
|
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
|
|
|
|
UpdatableInset::RESULT moveUp(BufferView *);
|
|
|
|
|
///
|
|
|
|
|
UpdatableInset::RESULT moveDown(BufferView *);
|
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void setCharFont(Buffer const *, int pos, LyXFont const & font);
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
|
|
|
|
bool checkAndActivateInset(BufferView * bv, bool behind);
|
|
|
|
|
///
|
|
|
|
|
bool checkAndActivateInset(BufferView * bv, int x = 0, int y = 0,
|
2002-03-21 17:09:55 +00:00
|
|
|
|
int button = 0);
|
2001-04-27 14:03:25 +00:00
|
|
|
|
///
|
2001-04-02 14:02:58 +00:00
|
|
|
|
void removeNewlines();
|
|
|
|
|
///
|
|
|
|
|
int cx(BufferView *) const;
|
|
|
|
|
///
|
|
|
|
|
int cy(BufferView *) const;
|
|
|
|
|
///
|
2002-04-11 15:08:22 +00:00
|
|
|
|
int ciy(BufferView *) const;
|
|
|
|
|
///
|
2001-11-27 10:34:16 +00:00
|
|
|
|
lyx::pos_type cpos(BufferView *) const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
|
Paragraph * cpar(BufferView *) const;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
|
|
|
|
bool cboundary(BufferView *) const;
|
|
|
|
|
///
|
|
|
|
|
Row * crow(BufferView *) const;
|
2001-04-27 14:03:25 +00:00
|
|
|
|
///
|
|
|
|
|
void drawFrame(Painter &, bool cleared) const;
|
2001-06-28 10:25:20 +00:00
|
|
|
|
///
|
2001-04-27 14:03:25 +00:00
|
|
|
|
void clearFrame(Painter &, bool cleared) const;
|
|
|
|
|
///
|
2001-12-04 16:10:19 +00:00
|
|
|
|
void clearInset(BufferView *, int baseline, bool & cleared) const;
|
2001-07-12 12:26:06 +00:00
|
|
|
|
///
|
|
|
|
|
void saveLyXTextState(LyXText *) const;
|
2001-12-18 03:21:10 +00:00
|
|
|
|
///
|
2001-07-12 12:26:06 +00:00
|
|
|
|
void restoreLyXTextState(BufferView *, LyXText *) const;
|
2001-07-31 09:53:40 +00:00
|
|
|
|
///
|
2001-08-10 12:21:42 +00:00
|
|
|
|
void reinitLyXText() const;
|
2001-12-18 12:35:53 +00:00
|
|
|
|
///
|
|
|
|
|
void collapseParagraphs(BufferParams const & bparams) const;
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2001-04-02 14:02:58 +00:00
|
|
|
|
/* Private structures and variables */
|
|
|
|
|
///
|
2001-07-06 15:57:54 +00:00
|
|
|
|
Paragraph * par;
|
|
|
|
|
///
|
2001-04-02 14:02:58 +00:00
|
|
|
|
mutable bool locked;
|
|
|
|
|
///
|
|
|
|
|
mutable int insetAscent;
|
|
|
|
|
///
|
|
|
|
|
mutable int insetDescent;
|
|
|
|
|
///
|
|
|
|
|
mutable int insetWidth;
|
|
|
|
|
///
|
|
|
|
|
mutable int top_y;
|
|
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
|
Paragraph * inset_par;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
2001-11-27 10:34:16 +00:00
|
|
|
|
lyx::pos_type inset_pos;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
|
|
|
|
bool inset_boundary;
|
|
|
|
|
///
|
|
|
|
|
mutable int inset_x;
|
|
|
|
|
///
|
|
|
|
|
mutable int inset_y;
|
|
|
|
|
///
|
2001-08-02 14:55:06 +00:00
|
|
|
|
mutable int old_max_width;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
///
|
|
|
|
|
bool no_selection;
|
|
|
|
|
///
|
|
|
|
|
mutable float xpos;
|
|
|
|
|
///
|
|
|
|
|
UpdatableInset * the_locking_inset;
|
|
|
|
|
///
|
2001-07-20 14:18:48 +00:00
|
|
|
|
mutable Paragraph * old_par;
|
2001-04-02 14:02:58 +00:00
|
|
|
|
/// The cache.
|
|
|
|
|
mutable Cache cache;
|
|
|
|
|
///
|
|
|
|
|
mutable int last_drawn_width;
|
2001-04-27 14:03:25 +00:00
|
|
|
|
///
|
|
|
|
|
mutable bool frame_is_visible;
|
2001-07-02 15:29:23 +00:00
|
|
|
|
///
|
|
|
|
|
mutable BufferView * cached_bview;
|
2001-07-05 14:52:08 +00:00
|
|
|
|
///
|
|
|
|
|
mutable boost::shared_ptr<LyXText> cached_text;
|
2001-07-12 12:26:06 +00:00
|
|
|
|
///
|
2001-12-18 03:21:10 +00:00
|
|
|
|
struct save_state {
|
2001-07-12 12:26:06 +00:00
|
|
|
|
Paragraph * lpar;
|
|
|
|
|
Paragraph * selstartpar;
|
|
|
|
|
Paragraph * selendpar;
|
2001-11-27 10:34:16 +00:00
|
|
|
|
lyx::pos_type pos;
|
|
|
|
|
lyx::pos_type selstartpos;
|
|
|
|
|
lyx::pos_type selendpos;
|
2001-07-12 12:26:06 +00:00
|
|
|
|
bool boundary;
|
|
|
|
|
bool selstartboundary;
|
|
|
|
|
bool selendboundary;
|
|
|
|
|
bool selection;
|
|
|
|
|
bool mark_set;
|
2001-08-02 14:55:06 +00:00
|
|
|
|
bool refresh;
|
2001-12-18 03:21:10 +00:00
|
|
|
|
};
|
|
|
|
|
///
|
|
|
|
|
mutable save_state sstate;
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2001-07-12 12:26:06 +00:00
|
|
|
|
///
|
|
|
|
|
// this is needed globally so we know that we're using it actually and
|
|
|
|
|
// so the LyXText-Cache is not erased until used!
|
|
|
|
|
mutable LyXText * lt;
|
2001-07-31 09:53:40 +00:00
|
|
|
|
///
|
|
|
|
|
// to remember old painted frame dimensions to clear it on the right spot!
|
|
|
|
|
///
|
|
|
|
|
mutable int frame_x;
|
|
|
|
|
mutable int frame_y;
|
|
|
|
|
mutable int frame_w;
|
|
|
|
|
mutable int frame_h;
|
2001-08-01 15:42:53 +00:00
|
|
|
|
///
|
|
|
|
|
bool in_update; /* as update is not reentrant! */
|
2001-08-13 11:04:49 +00:00
|
|
|
|
mutable BufferView * do_resize;
|
|
|
|
|
mutable bool do_reinit;
|
2001-12-05 15:34:41 +00:00
|
|
|
|
mutable bool in_insetAllowed;
|
2001-12-24 14:36:31 +00:00
|
|
|
|
///
|
|
|
|
|
// these are used to check for mouse movement in Motion selection code
|
|
|
|
|
///
|
|
|
|
|
int mouse_x;
|
|
|
|
|
int mouse_y;
|
2000-02-25 12:06:15 +00:00
|
|
|
|
};
|
|
|
|
|
#endif
|