From 60b905b88519e0c6a2a41d991521793afbf0e8d5 Mon Sep 17 00:00:00 2001 From: John Levon Date: Thu, 20 Jun 2002 20:37:42 +0000 Subject: [PATCH] Merge the working bits of the resize patch, and fix a couple of things that broke. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4441 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView.C | 14 +------------- src/BufferView.h | 4 ---- src/BufferView_pimpl.C | 30 ++++++------------------------ src/BufferView_pimpl.h | 6 +----- src/ChangeLog | 8 ++++++++ src/frontends/ChangeLog | 4 ++++ src/frontends/WorkArea.h | 6 ++---- src/frontends/qt2/ChangeLog | 4 ++++ src/frontends/qt2/QWorkArea.h | 2 -- src/frontends/xforms/ChangeLog | 5 +++++ src/frontends/xforms/XWorkArea.C | 29 +---------------------------- src/frontends/xforms/XWorkArea.h | 2 -- 12 files changed, 32 insertions(+), 82 deletions(-) diff --git a/src/BufferView.C b/src/BufferView.C index 89f27a7b10..170a348c65 100644 --- a/src/BufferView.C +++ b/src/BufferView.C @@ -65,15 +65,9 @@ void BufferView::buffer(Buffer * b) } -void BufferView::resize(int xpos, int ypos, int width, int height) -{ - pimpl_->resize(xpos, ypos, width, height); -} - - void BufferView::resize() { - pimpl_->resize(); + pimpl_->resizeCurrentBuffer(); } @@ -119,12 +113,6 @@ void BufferView::redoCurrentBuffer() } -int BufferView::resizeCurrentBuffer() -{ - return pimpl_->resizeCurrentBuffer(); -} - - void BufferView::cursorPrevious(LyXText * text) { pimpl_->cursorPrevious(text); diff --git a/src/BufferView.h b/src/BufferView.h index 0e33c43e7b..9168849a68 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -58,8 +58,6 @@ public: /// void buffer(Buffer * b); /// - void resize(int, int, int, int); - /// void resize(); /// void redraw(); @@ -76,8 +74,6 @@ public: /// void redoCurrentBuffer(); /// - int resizeCurrentBuffer(); - /// void cursorPrevious(LyXText *); /// void cursorNext(LyXText *); diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 0eff78a4fe..370afc9fed 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -133,8 +133,8 @@ BufferView::Pimpl::Pimpl(BufferView * b, LyXView * o, // Setup the signals workarea().scrollDocView.connect(boost::bind(&BufferView::Pimpl::scrollDocView, this, _1)); - workarea().workAreaExpose - .connect(boost::bind(&BufferView::Pimpl::workAreaExpose, this)); + workarea().workAreaResize + .connect(boost::bind(&BufferView::Pimpl::workAreaResize, this)); workarea().workAreaButtonPress .connect(boost::bind(&BufferView::Pimpl::workAreaButtonPress, this, _1, _2, _3)); workarea().workAreaButtonRelease @@ -244,21 +244,6 @@ void BufferView::Pimpl::buffer(Buffer * b) } -void BufferView::Pimpl::resize(int xpos, int ypos, int width, int height) -{ - workarea().resize(xpos, ypos, width, height); - update(bv_->text, SELECT); - redraw(); -} - - -void BufferView::Pimpl::resize() -{ - if (buffer_) - resizeCurrentBuffer(); -} - - void BufferView::Pimpl::redraw() { lyxerr[Debug::INFO] << "BufferView::redraw()" << endl; @@ -288,7 +273,7 @@ void BufferView::Pimpl::redoCurrentBuffer() { lyxerr[Debug::INFO] << "BufferView::redoCurrentBuffer" << endl; if (buffer_ && bv_->text) { - resize(); + resizeCurrentBuffer(); owner_->updateLayoutChoice(); } } @@ -349,8 +334,6 @@ int BufferView::Pimpl::resizeCurrentBuffer() } } - updateScreen(); - if (par) { bv_->text->selection.set(true); // At this point just to avoid the Delete-Empty-Paragraph- @@ -916,7 +899,7 @@ Inset * BufferView::Pimpl::checkInsetHit(LyXText * text, int & x, int & y) } -void BufferView::Pimpl::workAreaExpose() +void BufferView::Pimpl::workAreaResize() { static int work_area_width; static unsigned int work_area_height; @@ -930,7 +913,7 @@ void BufferView::Pimpl::workAreaExpose() if (buffer_ != 0) { if (widthChange) { // The visible LyXView need a resize - owner_->view()->resize(); + resizeCurrentBuffer(); // Remove all texts from the textcache // This is not _really_ what we want to do. What @@ -941,10 +924,9 @@ void BufferView::Pimpl::workAreaExpose() if (lyxerr.debugging()) textcache.show(lyxerr, "Expose delete all"); textcache.clear(); + // FIXME: this is aalready done in resizeCurrentBuffer() ?? buffer_->resizeInsets(bv_); } else if (heightChange) { - // Rebuild image of current screen - updateScreen(); // fitCursor() ensures we don't jump back // to the start of the document on vertical // resize diff --git a/src/BufferView_pimpl.h b/src/BufferView_pimpl.h index 33e75ff208..79af7c390f 100644 --- a/src/BufferView_pimpl.h +++ b/src/BufferView_pimpl.h @@ -45,10 +45,6 @@ struct BufferView::Pimpl : public boost::signals::trackable { /// 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(); @@ -63,7 +59,7 @@ struct BufferView::Pimpl : public boost::signals::trackable { /// Update pixmap of screen void updateScreen(); /// - void workAreaExpose(); + void workAreaResize(); /// void updateScrollbar(); /// diff --git a/src/ChangeLog b/src/ChangeLog index d8d02ee341..52bfe6be88 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2002-06-20 John Levon + + * BufferView.h: + * BufferView.C: + * BufferView_pimpl.h: + * BufferView_pimpl.C: clean up resize() stuff, + and unnecessary updateScreen()s + 2002-06-20 John Levon * BufferView.h: diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index 72a38aec45..9646213750 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,7 @@ +2002-06-20 John Levon + + * WorkArea.h: remove unused resize(..) and change name + 2002-06-20 John Levon * LyXKeySym.h: diff --git a/src/frontends/WorkArea.h b/src/frontends/WorkArea.h index e39b76255c..0c7a78b9d0 100644 --- a/src/frontends/WorkArea.h +++ b/src/frontends/WorkArea.h @@ -46,8 +46,6 @@ public: /// return the height of the work area in pixels virtual int workHeight() const = 0; - /// FIXME: GUII - virtual void resize(int xpos, int ypos, int width, int height) = 0; /// FIXME: GUII virtual void redraw() const = 0; @@ -67,8 +65,8 @@ public: /// fill the clipboard virtual void putClipboard(string const &) const = 0; - /// FIXME: GUII - boost::signal0 workAreaExpose; + /// work area dimensions have changed + boost::signal0 workAreaResize; /// the scrollbar has changed boost::signal1 scrollDocView; /// a key combination has been pressed diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index ef172b25ae..0f2e09d474 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2002-06-20 John Levon + + * QWorkArea.h: remove unused resize(...) + 2002-06-20 John Levon * QWorkArea.h: remove unused stuff diff --git a/src/frontends/qt2/QWorkArea.h b/src/frontends/qt2/QWorkArea.h index b0afa29a62..d85d05a3d7 100644 --- a/src/frontends/qt2/QWorkArea.h +++ b/src/frontends/qt2/QWorkArea.h @@ -48,8 +48,6 @@ public: virtual int workWidth() const { return content_->width(); } /// return the height of the content pane virtual int workHeight() const { return content_->height(); } - /// resize this widget - virtual void resize(int xpos, int ypos, int width, int height); /// FIXME: makes no sense ? virtual void redraw() const { } /// diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 0aa6fa5744..e15b34ba9c 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,8 @@ +2002-06-20 John Levon + + * XWorkArea.h: + * XWorkArea.C: remove unused code, name change + 2002-06-20 John Levon * XLyXKeySym.h: diff --git a/src/frontends/xforms/XWorkArea.C b/src/frontends/xforms/XWorkArea.C index bcf2db5254..bb98702ad0 100644 --- a/src/frontends/xforms/XWorkArea.C +++ b/src/frontends/xforms/XWorkArea.C @@ -256,33 +256,6 @@ XWorkArea::~XWorkArea() } -void XWorkArea::resize(int xpos, int ypos, int width, int height) -{ - fl_freeze_all_forms(); - - int const bw = int(abs(fl_get_border_width())); - - // a box - fl_set_object_geometry(backgroundbox, xpos, ypos, width - 15, height); - - // - // THE SCROLLBAR - // - fl_set_object_geometry(scrollbar, xpos + width - 15, - ypos, 17, height); - - // Create the workarea pixmap - createPixmap(width - 15 - 2 * bw, height - 2 * bw); - - // the free object - fl_set_object_geometry(work_area, xpos + bw, ypos + bw, - width - 15 - 2 * bw, - height - 2 * bw); - - fl_unfreeze_all_forms(); -} - - namespace { void destroy_object(FL_OBJECT * obj) { @@ -407,7 +380,7 @@ int XWorkArea::work_area_handler(FL_OBJECT * ob, int event, return 1; lyxerr[Debug::WORKAREA] << "Workarea event: DRAW" << endl; area->createPixmap(area->workWidth(), area->workHeight()); - area->workAreaExpose(); + area->workAreaResize(); break; case FL_PUSH: if (!ev || ev->xbutton.button == 0) break; diff --git a/src/frontends/xforms/XWorkArea.h b/src/frontends/xforms/XWorkArea.h index caf25444c4..ddbe34b6af 100644 --- a/src/frontends/xforms/XWorkArea.h +++ b/src/frontends/xforms/XWorkArea.h @@ -34,8 +34,6 @@ public: /// virtual int workHeight() const { return work_area->h; } /// - virtual void resize(int xpos, int ypos, int width, int height); - /// virtual void redraw() const { fl_redraw_object(work_area); fl_redraw_object(scrollbar); -- 2.39.5