1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
1999-11-15 12:01:38 +00:00
|
|
|
* ======================================================
|
1999-11-04 01:40:20 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
2000-01-24 18:34:46 +00:00
|
|
|
* Copyright 1995 Matthias Ettrich
|
|
|
|
* Copyright 1995-2000 The LyX Team.
|
1999-11-04 01:40:20 +00:00
|
|
|
*
|
1999-11-15 12:01:38 +00:00
|
|
|
* ====================================================== */
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
#ifndef BUFFER_VIEW_H
|
|
|
|
#define BUFFER_VIEW_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include FORMS_H_LOCATION
|
2000-02-04 09:38:32 +00:00
|
|
|
#include "undo.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
class LyXView;
|
2000-02-04 09:38:32 +00:00
|
|
|
class LyXText;
|
2000-04-08 17:02:02 +00:00
|
|
|
class TeXErrors;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
class BufferView {
|
|
|
|
public:
|
|
|
|
///
|
1999-12-21 06:10:21 +00:00
|
|
|
BufferView(LyXView * owner, int , int , int, int);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-12-10 00:07:59 +00:00
|
|
|
~BufferView();
|
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
Buffer * buffer() const;
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
|
|
|
Painter & painter();
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-09 23:52:04 +00:00
|
|
|
void buffer(Buffer * b);
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
|
|
|
void resize(int, int, int, int);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
void resize();
|
|
|
|
///
|
|
|
|
void redraw();
|
|
|
|
///
|
|
|
|
void fitCursor();
|
|
|
|
///
|
|
|
|
void update();
|
1999-12-10 00:07:59 +00:00
|
|
|
///
|
|
|
|
void update(signed char f);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-01-06 02:44:26 +00:00
|
|
|
void smallUpdate(signed char f);
|
|
|
|
///
|
1999-09-27 18:44:28 +00:00
|
|
|
void updateScrollbar();
|
|
|
|
///
|
|
|
|
void redoCurrentBuffer();
|
|
|
|
///
|
|
|
|
int resizeCurrentBuffer();
|
|
|
|
///
|
|
|
|
void gotoError();
|
|
|
|
///
|
|
|
|
void cursorPrevious();
|
|
|
|
///
|
|
|
|
void cursorNext();
|
|
|
|
///
|
|
|
|
bool available() const;
|
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
LyXView * owner() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-01-07 03:42:16 +00:00
|
|
|
void beforeChange();
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
void savePosition();
|
|
|
|
///
|
|
|
|
void restorePosition();
|
1999-12-10 00:07:59 +00:00
|
|
|
/** This holds the mapping between buffer paragraphs and screen rows.
|
|
|
|
This should be private...but not yet. (Lgb)
|
|
|
|
*/
|
|
|
|
LyXText * text;
|
2000-01-07 03:42:16 +00:00
|
|
|
///
|
2000-02-25 12:06:15 +00:00
|
|
|
unsigned short paperWidth() const;
|
|
|
|
///
|
2000-01-07 03:42:16 +00:00
|
|
|
UpdatableInset * the_locking_inset;
|
|
|
|
///
|
2000-02-25 12:06:15 +00:00
|
|
|
void updateInset(Inset * inset, bool mark_dirty);
|
|
|
|
///
|
2000-01-07 03:42:16 +00:00
|
|
|
bool inset_slept;
|
|
|
|
///
|
|
|
|
int slx;
|
|
|
|
///
|
|
|
|
int sly;
|
|
|
|
///
|
|
|
|
void insetUnlock();
|
|
|
|
///
|
|
|
|
void insetSleep();
|
|
|
|
///
|
|
|
|
void insetWakeup();
|
2000-01-08 21:02:58 +00:00
|
|
|
///
|
|
|
|
void replaceWord(string const & replacestring);
|
|
|
|
///
|
|
|
|
void endOfSpellCheck();
|
|
|
|
///
|
|
|
|
void selectLastWord();
|
|
|
|
///
|
|
|
|
char * nextWord(float & value);
|
|
|
|
///
|
|
|
|
void insertCorrectQuote();
|
|
|
|
///
|
|
|
|
void gotoNote();
|
|
|
|
///
|
|
|
|
bool gotoLabel(string const & label);
|
|
|
|
///
|
|
|
|
void paste();
|
|
|
|
///
|
|
|
|
void cut();
|
|
|
|
///
|
|
|
|
void copy();
|
|
|
|
///
|
|
|
|
void pasteEnvironment();
|
|
|
|
///
|
|
|
|
void copyEnvironment();
|
|
|
|
///
|
|
|
|
void hfill();
|
|
|
|
///
|
|
|
|
void protectedBlank();
|
|
|
|
///
|
|
|
|
void newline();
|
|
|
|
///
|
|
|
|
void menuSeparator();
|
|
|
|
///
|
|
|
|
void endOfSentenceDot();
|
|
|
|
///
|
|
|
|
void ldots();
|
|
|
|
///
|
|
|
|
void hyphenationPoint();
|
|
|
|
///
|
|
|
|
void menuUndo();
|
|
|
|
///
|
|
|
|
void menuRedo();
|
|
|
|
///
|
|
|
|
void toggleFloat();
|
|
|
|
///
|
|
|
|
void openStuff();
|
|
|
|
///
|
|
|
|
void insertNote();
|
|
|
|
///
|
|
|
|
void allFloats(char flag, char figmar);
|
|
|
|
/// removes all autodeletable insets
|
|
|
|
bool removeAutoInsets();
|
|
|
|
///
|
|
|
|
void insertErrors(TeXErrors & terr);
|
|
|
|
///
|
|
|
|
void setCursorFromRow(int row);
|
|
|
|
/** Insert an inset into the buffer
|
|
|
|
Insert inset into buffer, placing it in a layout of lout,
|
|
|
|
if no_table make sure that it doesn't end up in a table. */
|
|
|
|
void insertInset(Inset * inset, string const & lout = string(),
|
|
|
|
bool no_table = false);
|
|
|
|
/// open and lock an updatable inset
|
|
|
|
void open_new_inset(UpdatableInset * new_inset);
|
|
|
|
/// Inserts a lyx file at cursor position. Returns false if it fails.
|
|
|
|
bool insertLyXFile(string const & file);
|
|
|
|
///
|
|
|
|
int lockInset(UpdatableInset * inset);
|
|
|
|
///
|
|
|
|
void showLockedInsetCursor(long x, long y, int asc, int desc);
|
|
|
|
///
|
2000-02-17 19:59:08 +00:00
|
|
|
void hideLockedInsetCursor();
|
2000-01-08 21:02:58 +00:00
|
|
|
///
|
|
|
|
void fitLockedInsetCursor(long x, long y, int asc, int desc);
|
|
|
|
///
|
|
|
|
int unlockInset(UpdatableInset * inset);
|
|
|
|
///
|
|
|
|
void lockedInsetStoreUndo(Undo::undo_kind kind);
|
2000-02-17 19:59:08 +00:00
|
|
|
///
|
|
|
|
void showCursor();
|
|
|
|
///
|
|
|
|
void hideCursor();
|
|
|
|
///
|
|
|
|
void toggleSelection(bool = true);
|
|
|
|
///
|
|
|
|
void toggleToggle();
|
|
|
|
///
|
|
|
|
void center();
|
|
|
|
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
|
|
|
bool focus() const;
|
|
|
|
///
|
|
|
|
void focus(bool);
|
|
|
|
///
|
|
|
|
bool active() const;
|
2000-02-23 16:39:03 +00:00
|
|
|
///
|
|
|
|
bool belowMouse() const;
|
2000-02-10 17:53:36 +00:00
|
|
|
/// A callback for the up arrow in the scrollbar.
|
2000-02-17 19:59:08 +00:00
|
|
|
void upCB(long time, int button);
|
2000-02-10 17:53:36 +00:00
|
|
|
/// A callback for the slider in the scrollbar.
|
2000-02-17 19:59:08 +00:00
|
|
|
void scrollCB(double);
|
2000-02-10 17:53:36 +00:00
|
|
|
/// A callback for the down arrow in the scrollbar.
|
2000-02-17 19:59:08 +00:00
|
|
|
void downCB(long time, int button);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-10-25 14:18:30 +00:00
|
|
|
///
|
2000-02-17 19:59:08 +00:00
|
|
|
static void cursorToggleCB(FL_OBJECT * ob, long);
|
2000-02-03 19:51:27 +00:00
|
|
|
|
|
|
|
///
|
2000-02-17 19:59:08 +00:00
|
|
|
void setState();
|
2000-02-03 19:51:27 +00:00
|
|
|
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
void pushIntoUpdateList(Inset * i);
|
|
|
|
///
|
|
|
|
void workAreaExpose();
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-02-17 19:59:08 +00:00
|
|
|
void workAreaButtonPress(int x, int y, unsigned int button);
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-02-17 19:59:08 +00:00
|
|
|
void workAreaButtonRelease(int x, int y, unsigned int button);
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
void workAreaMotionNotify(int x, int y, unsigned int state);
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-02-23 16:39:03 +00:00
|
|
|
void doubleClick(int x, int y, unsigned int button);
|
|
|
|
///
|
2000-02-29 02:19:17 +00:00
|
|
|
void tripleClick(int x, int y, unsigned int button);
|
2000-02-23 16:39:03 +00:00
|
|
|
///
|
2000-04-14 19:20:33 +00:00
|
|
|
void enterView();
|
|
|
|
///
|
|
|
|
void leaveView();
|
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
void workAreaSelectionNotify(Window win, XEvent * event);
|
|
|
|
private:
|
|
|
|
struct Pimpl;
|
|
|
|
Pimpl * pimpl_;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|