]> git.lyx.org Git - features.git/commitdiff
Remove enter/leaveView since core has no right to know when
authorJohn Levon <levon@movementarian.org>
Wed, 12 Jun 2002 00:51:45 +0000 (00:51 +0000)
committerJohn Levon <levon@movementarian.org>
Wed, 12 Jun 2002 00:51:45 +0000 (00:51 +0000)
that happens, and rename wa->height to workHeight() for consistency

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4373 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/BufferView_pimpl.h
src/ChangeLog
src/frontends/ChangeLog
src/frontends/Painter.C
src/frontends/WorkArea.h
src/frontends/screen.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/XWorkArea.C
src/frontends/xforms/XWorkArea.h

index 669255ad92472512565efe042b075a2c94c21c2c..c3c918535b7b9139fb2bf99ce76ac8d600d0ae25 100644 (file)
@@ -145,10 +145,6 @@ BufferView::Pimpl::Pimpl(BufferView * b, LyXView * o,
        workarea().scrollCB.connect(boost::bind(&BufferView::Pimpl::scrollCB, this, _1));
        workarea().workAreaExpose
                .connect(boost::bind(&BufferView::Pimpl::workAreaExpose, this));
-       workarea().workAreaEnter
-               .connect(boost::bind(&BufferView::Pimpl::enterView, this));
-       workarea().workAreaLeave
-               .connect(boost::bind(&BufferView::Pimpl::leaveView, this));
        workarea().workAreaButtonPress
                .connect(boost::bind(&BufferView::Pimpl::workAreaButtonPress, this, _1, _2, _3));
        workarea().workAreaButtonRelease
@@ -424,7 +420,7 @@ void BufferView::Pimpl::updateScrollbar()
        }
 
        long const text_height = bv_->text->height;
-       long const work_height = workarea().height();
+       long const work_height = workarea().workHeight();
 
        double const lineh = bv_->text->defaultHeight();
        double const slider_size =
@@ -474,7 +470,7 @@ void BufferView::Pimpl::scrollCB(double value)
 
        int const height = vbt->defaultHeight();
        int const first = static_cast<int>((bv_->text->first_y + height));
-       int const last = static_cast<int>((bv_->text->first_y + workarea().height() - height));
+       int const last = static_cast<int>((bv_->text->first_y + workarea().workHeight() - height));
 
        if (vbt->cursor.y() < first)
                vbt->setCursorFromCoordinates(bv_, 0, first);
@@ -499,11 +495,11 @@ int BufferView::Pimpl::scrollUp(long time)
        float add_value =  (bv_->text->defaultHeight()
                            + float(time) * float(time) * 0.125);
 
-       if (add_value > workarea().height())
-               add_value = float(workarea().height() -
+       if (add_value > workarea().workHeight())
+               add_value = float(workarea().workHeight() -
                                  bv_->text->defaultHeight());
 #else
-       float add_value =  float(workarea().height()) * float(time) / 100;
+       float add_value =  float(workarea().workHeight()) * float(time) / 100;
 #endif
 
        value -= add_value;
@@ -534,11 +530,11 @@ int BufferView::Pimpl::scrollDown(long time)
        float add_value =  (bv_->text->defaultHeight()
                            + float(time) * float(time) * 0.125);
 
-       if (add_value > workarea().height())
-               add_value = float(workarea().height() -
+       if (add_value > workarea().workHeight())
+               add_value = float(workarea().workHeight() -
                                  bv_->text->defaultHeight());
 #else
-       float add_value =  float(workarea().height()) * float(time) / 100;
+       float add_value =  float(workarea().workHeight()) * float(time) / 100;
 #endif
 
        value += add_value;
@@ -607,7 +603,7 @@ void BufferView::Pimpl::workAreaMotionNotify(int x, int y, mouse_button::state s
 #endif
        // This is to allow jumping over large insets
        if (cursorrow == bv_->text->cursor.row()) {
-               if (y >= int(workarea().height())) {
+               if (y >= int(workarea().workHeight())) {
                        bv_->text->cursorDown(bv_, false);
                } else if (y < 0) {
                        bv_->text->cursorUp(bv_, false);
@@ -829,24 +825,6 @@ void BufferView::Pimpl::selectionLost()
 }
 
 
-void BufferView::Pimpl::enterView()
-{
-       if (available()) {
-               SetXtermCursor(workarea().getWin());
-               using_xterm_cursor = true;
-       }
-}
-
-
-void BufferView::Pimpl::leaveView()
-{
-       if (using_xterm_cursor) {
-               XUndefineCursor(fl_get_display(), workarea().getWin());
-               using_xterm_cursor = false;
-       }
-}
-
-
 void BufferView::Pimpl::workAreaButtonRelease(int x, int y,
                                              mouse_button::state button)
 {
@@ -1045,11 +1023,11 @@ void BufferView::Pimpl::workAreaExpose()
        static unsigned int work_area_height;
 
        bool const widthChange = workarea().workWidth() != work_area_width;
-       bool const heightChange = workarea().height() != work_area_height;
+       bool const heightChange = workarea().workHeight() != work_area_height;
 
        // update from work area
        work_area_width = workarea().workWidth();
-       work_area_height = workarea().height();
+       work_area_height = workarea().workHeight();
        if (buffer_ != 0) {
                if (widthChange) {
                        // The visible LyXView need a resize
@@ -1212,7 +1190,7 @@ void BufferView::Pimpl::cursorPrevious(LyXText * text)
 {
        if (!text->cursor.row()->previous()) {
                if (text->first_y > 0) {
-                       int new_y = bv_->text->first_y - workarea().height();
+                       int new_y = bv_->text->first_y - workarea().workHeight();
                        screen().draw(bv_->text, bv_, new_y < 0 ? 0 : new_y);
                        updateScrollbar();
                }
@@ -1232,18 +1210,18 @@ void BufferView::Pimpl::cursorPrevious(LyXText * text)
                // as we move the cursor or do something while inside the row (it may
                // span several workarea-heights) we'll move to the top again, but this
                // is better than just jump down and only display part of the row.
-               new_y = bv_->text->first_y - workarea().height();
+               new_y = bv_->text->first_y - workarea().workHeight();
        } else {
                if (text->inset_owner) {
                        new_y = bv_->text->cursor.iy()
                                + bv_->theLockingInset()->insetInInsetY() + y
                                + text->cursor.row()->height()
-                               - workarea().height() + 1;
+                               - workarea().workHeight() + 1;
                } else {
                        new_y = text->cursor.y()
                                - text->cursor.row()->baseline()
                                + text->cursor.row()->height()
-                               - workarea().height() + 1;
+                               - workarea().workHeight() + 1;
                }
        }
        screen().draw(bv_->text, bv_,  new_y < 0 ? 0 : new_y);
@@ -1264,15 +1242,15 @@ void BufferView::Pimpl::cursorNext(LyXText * text)
        if (!text->cursor.row()->next()) {
                int y = text->cursor.y() - text->cursor.row()->baseline() +
                        text->cursor.row()->height();
-               if (y > int(text->first_y + workarea().height())) {
+               if (y > int(text->first_y + workarea().workHeight())) {
                        screen().draw(bv_->text, bv_,
-                                                 bv_->text->first_y + workarea().height());
+                                                 bv_->text->first_y + workarea().workHeight());
                        updateScrollbar();
                }
                return;
        }
 
-       int y = text->first_y + workarea().height();
+       int y = text->first_y + workarea().workHeight();
        if (text->inset_owner && !text->first_y) {
                y -= (bv_->text->cursor.iy()
                          - bv_->text->first_y
@@ -1281,7 +1259,7 @@ void BufferView::Pimpl::cursorNext(LyXText * text)
        text->getRowNearY(y);
 
        Row * cursorrow = text->cursor.row();
-       text->setCursorFromCoordinates(bv_, text->cursor.x_fix(), y); // + workarea().height());
+       text->setCursorFromCoordinates(bv_, text->cursor.x_fix(), y); // + workarea().workHeight());
        finishUndo();
        int new_y;
        if (cursorrow == bv_->text->cursor.row()) {
@@ -1290,7 +1268,7 @@ void BufferView::Pimpl::cursorNext(LyXText * text)
                // as we move the cursor or do something while inside the row (it may
                // span several workarea-heights) we'll move to the top again, but this
                // is better than just jump down and only display part of the row.
-               new_y = bv_->text->first_y + workarea().height();
+               new_y = bv_->text->first_y + workarea().workHeight();
        } else {
                if (text->inset_owner) {
                        new_y = bv_->text->cursor.iy()
@@ -1305,7 +1283,7 @@ void BufferView::Pimpl::cursorNext(LyXText * text)
                LyXCursor cur;
                text->setCursor(bv_, cur, text->cursor.row()->next()->par(),
                                                text->cursor.row()->next()->pos(), false);
-               if (cur.y() < int(text->first_y + workarea().height())) {
+               if (cur.y() < int(text->first_y + workarea().workHeight())) {
                        text->cursorDown(bv_, true);
                }
        }
@@ -1481,8 +1459,8 @@ void BufferView::Pimpl::toggleToggle()
 void BufferView::Pimpl::center()
 {
        beforeChange(bv_->text);
-       if (bv_->text->cursor.y() > static_cast<int>((workarea().height() / 2))) {
-               screen().draw(bv_->text, bv_, bv_->text->cursor.y() - workarea().height() / 2);
+       if (bv_->text->cursor.y() > static_cast<int>((workarea().workHeight() / 2))) {
+               screen().draw(bv_->text, bv_, bv_->text->cursor.y() - workarea().workHeight() / 2);
        } else {
                screen().draw(bv_->text, bv_, 0);
        }
index ee9ee98e340d304f91ed37c4f4f6c9bc13af3bf4..e768918ac902a0d7335c70b888bd13a07a68f810 100644 (file)
@@ -90,10 +90,6 @@ struct BufferView::Pimpl : public boost::signals::trackable {
        ///
        void selectionLost();
        ///
-       void enterView();
-       ///
-       void leaveView();
-       ///
        void cursorToggle();
        ///
        void cursorPrevious(LyXText *);
index 3e83ded21f0e06d77afb403362f32bec58c2068a..bac7537f246eb3e790958982c0114acaa7e9f2c1 100644 (file)
@@ -1,3 +1,9 @@
+2002-06-12  John Levon  <moz@compsoc.man.ac.uk>
+
+       * BufferView_pimpl.h:
+       * BufferView_pimpl.C: remove enter/leaveView,
+         use workHeight()
 2002-06-12  John Levon  <moz@compsoc.man.ac.uk>
 
        * BufferView.h:
index 45ef5467544db7945d5cc2abcd5799483ebd71b7..230627035687175a76a55f4e9c1acd7597162795 100644 (file)
@@ -1,3 +1,10 @@
+2002-06-12  John Levon  <moz@compsoc.man.ac.uk>
+
+       * screen.C:
+       * Painter.C: use workHeight()
+
+       * WorkArea.h: remove confusing duplicate unused code
 2002-06-12  John Levon  <moz@compsoc.man.ac.uk>
 
        * screen.h:
index 6787f32a1d3fedd2ffff361fd54910abfb16d698..c2726fd9512641fa187fdd2f409d9a7ab6abcc9c 100644 (file)
@@ -33,7 +33,7 @@ int PainterBase::paperWidth() const
 
 int PainterBase::paperHeight() const
 {
-       return owner.height();
+       return owner.workHeight();
 }
 
 
index c990863234dd52479e3c7a4c93c3d2d1d2d5cbac..a3751bf52ebdc1ff0837da60b0f50b3bac72dd85 100644 (file)
@@ -1,169 +1,2 @@
-// -*- C++ -*-
-/* This file is part of
- * ======================================================
- *
- *           LyX, The Document Processor
- *
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2001 The LyX Team.
- *
- * ======================================================*/
-
-#ifndef WORKAREA_H
-#define WORKAREA_H
-
-#if 1
+// temporary
 #include "frontends/xforms/XWorkArea.h"
-#else
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include "frontends/Painter.h"
-
-#include FORMS_H_LOCATION
-
-#include <boost/signals/signal0.hpp>
-#include <boost/signals/signal1.hpp>
-#include <boost/signals/signal2.hpp>
-#include <boost/signals/signal3.hpp>
-
-#include <utility>
-
-
-///
-class WorkArea {
-public:
-       ///
-       WorkArea(int xpos, int ypos, int width, int height);
-       ///
-       ~WorkArea();
-       ///
-       Painter & getPainter() { return painter_; }
-       ///
-       int workWidth() const { return work_area->w; }
-       ///
-       unsigned int width() const { return work_area->w + scrollbar->w; }
-       //unsigned int width() const { return backgroundbox->w + 15; }
-       ///
-       unsigned int height() const { return work_area->h; }
-       //unsigned int height() const { return backgroundbox->h; }
-       ///
-       int xpos() const { return work_area->x; }
-       //int xpos() const { return backgroundbox->x; }
-       ///
-       int ypos() const { return work_area->y; }
-       //int ypos() const { return backgroundbox->y; }
-       ///
-       void resize(int xpos, int ypos, int width, int height);
-       ///
-       void redraw() const {
-               fl_redraw_object(work_area);
-               fl_redraw_object(scrollbar);
-       }
-       ///
-       void setFocus() const;
-       ///
-       Window getWin() const { return work_area->form->window; }
-       ///
-       bool hasFocus() const { return work_area->focus; }
-       ///
-       bool active() const { return work_area->active; }
-       ///
-       bool belowMouse() const;
-       ///
-       bool visible() const { return work_area->form->visible; }
-       ///
-       void greyOut() const;
-       ///
-       void setScrollbar(double pos, double length_fraction) const;
-       ///
-       void setScrollbarValue(double y) const {
-               fl_set_scrollbar_value(scrollbar, y);
-       }
-       ///
-       void setScrollbarBounds(double, double) const;
-       ///
-       void setScrollbarIncrements(double inc) const;
-       ///
-       double getScrollbarValue() const {
-               return fl_get_scrollbar_value(scrollbar);
-       }
-       ///
-       std::pair<float, float> const getScrollbarBounds() const {
-               std::pair<float, float> p;
-               fl_get_scrollbar_bounds(scrollbar, &p.first, &p.second);
-               return p;
-       }
-       ///
-       Pixmap getPixmap() const { return workareapixmap; }
-       /// xforms callback
-       static int work_area_handler(FL_OBJECT *, int event,
-                                    FL_Coord, FL_Coord,
-                                    int /*key*/, void * xev);
-       /// xforms callback
-       static void scroll_cb(FL_OBJECT *, long);
-       /// a selection exists
-       void haveSelection(bool) const;
-       ///
-       string const getClipboard() const;
-       ///
-       void putClipboard(string const &) const;
-       // Signals
-       ///
-       boost::signal0<void> workAreaExpose;
-       ///
-       boost::signal1<void, double> scrollCB;
-       ///
-       boost::signal2<void, KeySym, unsigned int> workAreaKeyPress;
-       ///
-       boost::signal3<void, int, int, unsigned int> workAreaButtonPress;
-       ///
-       boost::signal3<void, int, int, unsigned int> workAreaButtonRelease;
-       ///
-       boost::signal3<void, int, int, unsigned int> workAreaMotionNotify;
-       ///
-       boost::signal0<void> workAreaFocus;
-       ///
-       boost::signal0<void> workAreaUnfocus;
-       ///
-       boost::signal0<void> workAreaEnter;
-       ///
-       boost::signal0<void> workAreaLeave;
-       ///
-       boost::signal3<void, int, int, unsigned int> workAreaDoubleClick;
-       ///
-       boost::signal3<void, int, int, unsigned int> workAreaTripleClick;
-       /// emitted when an X client has requested our selection
-       boost::signal0<void> selectionRequested;
-       /// emitted when another X client has stolen our selection
-       boost::signal0<void> selectionLost;
-
-       /// handles SelectionRequest X Event, to fill the clipboard
-       int event_cb(XEvent * xev);
-private:
-       ///
-       void createPixmap(int, int);
-
-       ///
-       FL_OBJECT * backgroundbox;
-       ///
-       FL_OBJECT * work_area;
-       ///
-       FL_OBJECT * scrollbar;
-       ///
-       mutable FL_OBJECT * splash_;
-       ///
-       mutable FL_OBJECT * splash_text_;
-       /// The pixmap overlay on the workarea
-       Pixmap workareapixmap;
-       ///
-       Painter painter_;
-       /// if we call redraw with true needed for locking-insets
-       bool screen_cleared;
-};
-
-#endif
-
-#endif
index 9262d4bb79bf6085a2beb4b97a4966c512d573c4..e9f64b0e29fd7973b84e3ef073413e388f3ac4fc 100644 (file)
@@ -105,8 +105,8 @@ void LScreen::setCursorColor()
 
 void LScreen::redraw(LyXText * text, BufferView * bv)
 {
-       drawFromTo(text, bv, 0, owner.height(), 0, 0, text == bv->text);
-       expose(0, 0, owner.workWidth(), owner.height());
+       drawFromTo(text, bv, 0, owner.workHeight(), 0, 0, text == bv->text);
+       expose(0, 0, owner.workWidth(), owner.workHeight());
        if (cursor_visible) {
                cursor_visible = false;
                bv->showCursor();
@@ -180,7 +180,7 @@ void LScreen::drawOneRow(LyXText * text, BufferView * bv, Row * row,
        int const y = y_text - text->first_y + y_offset;
 
        if (((y + row->height()) > 0) &&
-           ((y - row->height()) <= static_cast<int>(owner.height()))) {
+           ((y - row->height()) <= static_cast<int>(owner.workHeight()))) {
                // ok there is something visible
                text->getVisibleRow(bv, y, x_offset, row, y + text->first_y);
        }
@@ -199,8 +199,8 @@ void LScreen::draw(LyXText * text, BufferView * bv, unsigned int y)
        text->first_y = y;
 
        // is any optimiziation possible?
-       if ((y - old_first) < owner.height()
-           && (old_first - y) < owner.height())
+       if ((y - old_first) < owner.workHeight()
+           && (old_first - y) < owner.workHeight())
        {
                if (text->first_y < old_first) {
                        drawFromTo(text, bv, 0,
@@ -212,7 +212,7 @@ void LScreen::draw(LyXText * text, BufferView * bv, unsigned int y)
                                   owner.xpos(),
                                   owner.ypos(),
                                   owner.workWidth(),
-                                  owner.height() - old_first + text->first_y,
+                                  owner.workHeight() - old_first + text->first_y,
                                   owner.xpos(),
                                   owner.ypos() + old_first - text->first_y
                                );
@@ -222,8 +222,8 @@ void LScreen::draw(LyXText * text, BufferView * bv, unsigned int y)
                               old_first - text->first_y);
                } else  {
                        drawFromTo(text, bv,
-                                  owner.height() + old_first - text->first_y,
-                                  owner.height(), 0, 0, internal);
+                                  owner.workHeight() + old_first - text->first_y,
+                                  owner.workHeight(), 0, 0, internal);
                        XCopyArea (fl_get_display(),
                                   owner.getWin(),
                                   owner.getWin(),
@@ -231,17 +231,17 @@ void LScreen::draw(LyXText * text, BufferView * bv, unsigned int y)
                                   owner.xpos(),
                                   owner.ypos() + text->first_y - old_first,
                                   owner.workWidth(),
-                                  owner.height() + old_first - text->first_y,
+                                  owner.workHeight() + old_first - text->first_y,
                                   owner.xpos(),
                                   owner.ypos());
                        // expose the area drawn
-                       expose(0, owner.height() + old_first - text->first_y,
+                       expose(0, owner.workHeight() + old_first - text->first_y,
                               owner.workWidth(), text->first_y - old_first);
                }
        } else {
                // make a dumb new-draw
-               drawFromTo(text, bv, 0, owner.height(), 0, 0, internal);
-               expose(0, 0, owner.workWidth(), owner.height());
+               drawFromTo(text, bv, 0, owner.workHeight(), 0, 0, internal);
+               expose(0, 0, owner.workWidth(), owner.workHeight());
        }
 }
 
@@ -270,11 +270,11 @@ bool LScreen::fitManualCursor(LyXText * text, BufferView * bv,
 {
        int newtop = text->first_y;
 
-       if (y + desc - text->first_y >= static_cast<int>(owner.height()))
-               newtop = y - 3 * owner.height() / 4;  // the scroll region must be so big!!
+       if (y + desc - text->first_y >= static_cast<int>(owner.workHeight()))
+               newtop = y - 3 * owner.workHeight() / 4;  // the scroll region must be so big!!
        else if (y - asc < text->first_y
                && text->first_y > 0) {
-               newtop = y - owner.height() / 4;
+               newtop = y - owner.workHeight() / 4;
        }
 
        newtop = max(newtop, 0); // can newtop ever be < 0? (Lgb)
@@ -296,7 +296,7 @@ void LScreen::showManualCursor(LyXText const * text, int x, int y,
 
        int const y1 = max(y - text->first_y - asc, 0);
        int const y_tmp = min(y - text->first_y + desc,
-                             static_cast<int>(owner.height()));
+                             static_cast<int>(owner.workHeight()));
 
        // Secure against very strange situations
        int const y2 = max(y_tmp, y1);
@@ -306,7 +306,7 @@ void LScreen::showManualCursor(LyXText const * text, int x, int y,
                cursor_pixmap = 0;
        }
 
-       if (y2 > 0 && y1 < int(owner.height())) {
+       if (y2 > 0 && y1 < int(owner.workHeight())) {
                cursor_pixmap_h = y2 - y1 + 1;
                cursor_pixmap_y = y1;
 
@@ -406,26 +406,26 @@ unsigned int LScreen::topCursorVisible(LyXText const * text)
                return max(newtop, 0);
 
        if (text->cursor.y() - row->baseline() + row->height()
-           - text->first_y >= owner.height()) {
-               if (row->height() < owner.height()
-                   && row->height() > owner.height() / 4) {
+           - text->first_y >= owner.workHeight()) {
+               if (row->height() < owner.workHeight()
+                   && row->height() > owner.workHeight() / 4) {
                        newtop = text->cursor.y()
                                + row->height()
-                               - row->baseline() - owner.height();
+                               - row->baseline() - owner.workHeight();
                } else {
                        // scroll down
                        newtop = text->cursor.y()
-                               - owner.height() / 2;   /* the scroll region must be so big!! */
+                               - owner.workHeight() / 2;   /* the scroll region must be so big!! */
                }
 
        } else if (static_cast<int>((text->cursor.y()) - row->baseline()) <
                   text->first_y && text->first_y > 0) {
-               if (row->height() < owner.height()
-                   && row->height() > owner.height() / 4) {
+               if (row->height() < owner.workHeight()
+                   && row->height() > owner.workHeight() / 4) {
                        newtop = text->cursor.y() - row->baseline();
                } else {
                        // scroll up
-                       newtop = text->cursor.y() - owner.height() / 2;
+                       newtop = text->cursor.y() - owner.workHeight() / 2;
                        newtop = min(newtop, text->first_y);
                }
        }
@@ -456,13 +456,13 @@ void LScreen::update(LyXText * text, BufferView * bv,
        case LyXText::NEED_MORE_REFRESH:
        {
                int const y = max(int(text->refresh_y - text->first_y), 0);
-               drawFromTo(text, bv, y, owner.height(), y_offset, x_offset);
+               drawFromTo(text, bv, y, owner.workHeight(), y_offset, x_offset);
                text->refresh_y = 0;
                // otherwise this is called ONLY from BufferView_pimpl(update)
                // or we should see to set this flag accordingly
                if (text != bv->text)
                        text->status(bv, LyXText::UNCHANGED);
-               expose(0, y, owner.workWidth(), owner.height() - y);
+               expose(0, y, owner.workWidth(), owner.workHeight() - y);
        }
        break;
        case LyXText::NEED_VERY_LITTLE_REFRESH:
@@ -502,12 +502,12 @@ void LScreen::toggleSelection(LyXText * text, BufferView * bv,
                                     - text->selection.end.row()->baseline()
                                     + text->selection.end.row()->height()),
                    text->first_y),
-               static_cast<int>(text->first_y + owner.height()));
+               static_cast<int>(text->first_y + owner.workHeight()));
        int const top = min(
                max(static_cast<int>(text->selection.start.y() -
                                     text->selection.start.row()->baseline()),
                    text->first_y),
-               static_cast<int>(text->first_y + owner.height()));
+               static_cast<int>(text->first_y + owner.workHeight()));
 
        if (kill_selection)
                text->selection.set(false);
@@ -534,9 +534,9 @@ void LScreen::toggleToggle(LyXText * text, BufferView * bv,
 
        int const offset = y_offset < 0 ? y_offset : 0;
        int const bottom = min(max(bottom_tmp, text->first_y),
-                    static_cast<int>(text->first_y + owner.height()))-offset;
+                    static_cast<int>(text->first_y + owner.workHeight()))-offset;
        int const top = min(max(top_tmp, text->first_y),
-                 static_cast<int>(text->first_y + owner.height()))-offset;
+                 static_cast<int>(text->first_y + owner.workHeight()))-offset;
 
        drawFromTo(text, bv, top - text->first_y,
                   bottom - text->first_y, y_offset,
index 7d79949d292ec5456f86b274323fcb0584411563..5b377396564e344c5d96447a6bbfb36d7fd71842 100644 (file)
@@ -1,3 +1,8 @@
+2002-06-12  John Levon  <moz@compsoc.man.ac.uk>
+
+       * XWorkArea.h:
+       * XWorkArea.C: use workHeight(), remove enter/leaveView
 2002-06-11  John Levon  <moz@compsoc.man.ac.uk>
 
        * XWorkArea.h:
index 97aff9cf7aa92148ea9fdddcba731f5ca8304d46..456829c779542638ce60314fc43193088c385e56 100644 (file)
@@ -391,7 +391,7 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event,
                    !area->work_area->form->visible)
                        return 1;
                lyxerr[Debug::WORKAREA] << "Workarea event: DRAW" << endl;
-               area->createPixmap(area->workWidth(), area->height());
+               area->createPixmap(area->workWidth(), area->workHeight());
                area->workAreaExpose();
                break;
        case FL_PUSH:
@@ -552,11 +552,9 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event,
                break;
        case FL_ENTER:
                lyxerr[Debug::WORKAREA] << "Workarea event: ENTER" << endl;
-               area->workAreaEnter();
                break;
        case FL_LEAVE:
                lyxerr[Debug::WORKAREA] << "Workarea event: LEAVE" << endl;
-               area->workAreaLeave();
                break;
        case FL_DBLCLICK:
                if (!ev) break;
index 292ca0cf2b75167a177ef1c2f18f0c8afe133737..7c44d3385ab21e29d5ec38cee0fc52de465d215b 100644 (file)
@@ -40,12 +40,11 @@ public:
        ///
        int workWidth() const { return work_area->w; }
        ///
+       int workHeight() const { return work_area->h; }
+       ///
        unsigned int width() const { return work_area->w + scrollbar->w; }
        //unsigned int width() const { return backgroundbox->w + 15; }
        ///
-       unsigned int height() const { return work_area->h; }
-       //unsigned int height() const { return backgroundbox->h; }
-       ///
        int xpos() const { return work_area->x; }
        //int xpos() const { return backgroundbox->x; }
        ///
@@ -120,10 +119,6 @@ public:
        ///
        boost::signal0<void> workAreaUnfocus;
        ///
-       boost::signal0<void> workAreaEnter;
-       ///
-       boost::signal0<void> workAreaLeave;
-       ///
        boost::signal3<void, int, int, mouse_button::state> workAreaDoubleClick;
        ///
        boost::signal3<void, int, int, mouse_button::state> workAreaTripleClick;