X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBufferView_pimpl.h;h=e011a08990783a5bcca3d6c504d0e3e83dc12e17;hb=5d3718cad2a2ef6a4d6a495054ab0705ba27b6b5;hp=e7db7acae9d5d0849946ffad9440e802a5d565ed;hpb=105116682d41fd297782175c05c7384d71d1942e;p=lyx.git diff --git a/src/BufferView_pimpl.h b/src/BufferView_pimpl.h index e7db7acae9..e011a08990 100644 --- a/src/BufferView_pimpl.h +++ b/src/BufferView_pimpl.h @@ -1,34 +1,42 @@ // -*- 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 "Timeout.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 : public SigC::Object { +/// +struct BufferView::Pimpl : public boost::signals::trackable { + /// Pimpl(BufferView * i, LyXView * o, int xpos, int ypos, int width, int height); /// - Painter & painter(); + Painter & painter() const; + /// return the screen for this bview + LyXScreen & screen() const; /// void buffer(Buffer *); - /// - void resize(int xpos, int ypos, int width, int height); - /// - void resize(); - /// - void redraw(); /// Return true if the cursor was fitted. bool fitCursor(); /// @@ -37,71 +45,48 @@ struct BufferView::Pimpl : public SigC::Object { 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 update(BufferView::UpdateCodes); - /// - void gotoError(); - /// Update pixmap of screen - void updateScreen(); - /// - void workAreaExpose(); + void workAreaResize(); /// void updateScrollbar(); /// - void scrollCB(double value); - /// - Inset * checkInsetHit(int & x, int & y, unsigned int button); - /// - int scrollUp(long time); - /// - int scrollDown(long time); - /// - void workAreaMotionNotify(int x, int y, unsigned int state); + void scrollDocView(int value); + /** + * Wheel mouse scroll, move by multiples of text->defaultRowHeight(). + */ + void scroll(int lines); /// - void workAreaButtonPress(int x, int y, unsigned int button); + void workAreaKeyPress(LyXKeySymPtr key, key_modifier::state state); /// - void workAreaButtonRelease(int x, int y, unsigned int button); + void selectionRequested(); /// - void doubleClick(int x, int y, unsigned int button); - /// - void tripleClick(int x, int y, unsigned int button); - /// - void enterView(); - /// - void leaveView(); + void selectionLost(); /// void cursorToggle(); /// - void cursorPrevious(); - /// - void cursorNext(); - /// bool available() const; + /// get the change at the cursor position + Change const getCurrentChange(); /// - void beforeChange(); + void beforeChange(LyXText *); /// - void savePosition(); + void savePosition(unsigned int i); /// - void restorePosition(); + void restorePosition(unsigned int i); /// - bool NoSavedPositions(); + bool isSavedPosition(unsigned int i); /// - void setState(); - /// - void insetSleep(); - /// - void insetWakeup(); + void switchKeyMap(); /// void insetUnlock(); /// - bool focus() const; - /// - void focus(bool); - /// - bool active() const; - /// - bool belowMouse() const; - /// void showCursor(); /// void hideCursor(); @@ -112,36 +97,55 @@ struct BufferView::Pimpl : public SigC::Object { /// void center(); /// - BufferView * bv_; - /// - LyXView * owner_; - /// - Buffer * buffer_; - /// - LyXScreen * screen_; + bool insertInset(Inset * inset, string const & lout = string()); /// - long current_scrollbar_value; + void updateInset(Inset * inset, bool mark_dirty); /// - bool lyx_focus; + bool dispatch(FuncRequest const & ev); +private: + /// track changes for the document + void trackChanges(); + /// - bool work_area_focus; + friend class BufferView; + /// - FL_OBJECT * figinset_canvas; + BufferView * bv_; /// - Timeout cursor_timeout; - /// - BackStack backstack; + LyXView * owner_; /// - int last_click_x, last_click_y; + Buffer * buffer_; /// - WorkArea * workarea_; + boost::scoped_ptr screen_; /// - UpdateInset updatelist; + boost::scoped_ptr workarea_; /// - void pasteClipboard(bool asPara); + Timeout cursor_timeout; /// void stuffClipboard(string const &) const; -private: + /// bool using_xterm_cursor; + /// + 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) {} + }; + /// + std::vector saved_positions; + /// Get next inset of this class from current cursor position + Inset * getInsetByCode(Inset::Code code); + /// + void MenuInsertLyXFile(string const & filen); + /// our workarea + WorkArea & workarea() const; }; -#endif +#endif // BUFFERVIEW_PIMPL_H