X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBufferView_pimpl.h;h=e011a08990783a5bcca3d6c504d0e3e83dc12e17;hb=5d3718cad2a2ef6a4d6a495054ab0705ba27b6b5;hp=25f4715165dcde89c39cd020956bd4e1b90f9d62;hpb=76938908d7da15b92bad3908e71eb969c9449c0e;p=lyx.git diff --git a/src/BufferView_pimpl.h b/src/BufferView_pimpl.h index 25f4715165..e011a08990 100644 --- a/src/BufferView_pimpl.h +++ b/src/BufferView_pimpl.h @@ -1,52 +1,114 @@ // -*- C++ -*- +/** + * \file BufferView_pimpl.h + * Copyright 2002 the LyX Team + * Read the file COPYING + * + * \author various + */ #ifndef BUFFERVIEW_PIMPL_H #define BUFFERVIEW_PIMPL_H #include "BufferView.h" -#include "UpdateInset.h" -#include "BackStack.h" +#include "frontends/Timeout.h" +#include "frontends/key_state.h" +#include "frontends/LyXKeySym.h" +#include "support/types.h" -#ifdef __GNUG__ -#pragma interface -#endif +#include +#include + +class Change; class LyXView; class WorkArea; class LyXScreen; +class FuncRequest; -struct BufferView::Pimpl { +/// +struct BufferView::Pimpl : public boost::signals::trackable { + /// Pimpl(BufferView * i, LyXView * o, int xpos, int ypos, int width, int height); - - /// Update pixmap of screen - void updateScreen(); /// - void workAreaExpose(); + Painter & painter() const; + /// return the screen for this bview + LyXScreen & screen() const; + /// + void buffer(Buffer *); + /// Return true if the cursor was fitted. + bool fitCursor(); + /// + void redoCurrentBuffer(); + /// + int resizeCurrentBuffer(); + /// + void update(); + // + void update(LyXText *, BufferView::UpdateCodes); + /** + * Repaint pixmap. Used for when we've made a visible + * change but don't need the full update() logic + */ + void repaint(); + /// + void workAreaResize(); + /// + void updateScrollbar(); + /// + void scrollDocView(int value); + /** + * Wheel mouse scroll, move by multiples of text->defaultRowHeight(). + */ + void scroll(int lines); + /// + void workAreaKeyPress(LyXKeySymPtr key, key_modifier::state state); + /// + void selectionRequested(); /// - void scrollUpOnePage(); + void selectionLost(); /// - void scrollDownOnePage(); + void cursorToggle(); /// - void create_view(); + bool available() const; + /// get the change at the cursor position + Change const getCurrentChange(); /// - Inset * checkInsetHit(int & x, int & y, unsigned int button); - /// - int scrollUp(long time); + void beforeChange(LyXText *); /// - int scrollDown(long time); + void savePosition(unsigned int i); /// - void workAreaMotionNotify(int x, int y, unsigned int state); + void restorePosition(unsigned int i); /// - void workAreaButtonPress(int x, int y, unsigned int button); + bool isSavedPosition(unsigned int i); /// - void workAreaButtonRelease(int x, int y, unsigned int button); + void switchKeyMap(); /// - void workAreaSelectionNotify(Window win, XEvent * event); + void insetUnlock(); /// - void doubleClick(int x, int y, unsigned int button); + void showCursor(); /// - void tripleClick(int x, int y, unsigned int button); + void hideCursor(); + /// + void toggleSelection(bool = true); + /// + void toggleToggle(); + /// + void center(); + /// + bool insertInset(Inset * inset, string const & lout = string()); + /// + void updateInset(Inset * inset, bool mark_dirty); + /// + bool dispatch(FuncRequest const & ev); +private: + /// track changes for the document + void trackChanges(); + + /// + friend class BufferView; + /// BufferView * bv_; /// @@ -54,24 +116,36 @@ struct BufferView::Pimpl { /// Buffer * buffer_; /// - LyXScreen * screen; - /// - long current_scrollbar_value; + boost::scoped_ptr screen_; /// - bool lyx_focus; + boost::scoped_ptr workarea_; /// - bool work_area_focus; + Timeout cursor_timeout; /// - FL_OBJECT * figinset_canvas; + void stuffClipboard(string const &) const; /// - FL_OBJECT * timer_cursor; - /// - BackStack backstack; + bool using_xterm_cursor; /// - int last_click_x, last_click_y; + struct Position { + /// Filename + string filename; + /// Cursor paragraph Id + int par_id; + /// Cursor position + lyx::pos_type par_pos; + /// + Position() : par_id(0), par_pos(0) {} + /// + Position(string const & f, int id, lyx::pos_type pos) + : filename(f), par_id(id), par_pos(pos) {} + }; /// - WorkArea * workarea; + std::vector saved_positions; + /// Get next inset of this class from current cursor position + Inset * getInsetByCode(Inset::Code code); /// - UpdateInset updatelist; + void MenuInsertLyXFile(string const & filen); + /// our workarea + WorkArea & workarea() const; }; -#endif +#endif // BUFFERVIEW_PIMPL_H