remove some more unneeded focus stuff

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4436 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2002-06-19 23:55:55 +00:00
parent ace550953a
commit 64488b06af
18 changed files with 73 additions and 147 deletions

View File

@ -185,18 +185,6 @@ void BufferView::insetUnlock()
}
bool BufferView::focus() const
{
return pimpl_->focus();
}
void BufferView::focus(bool f)
{
pimpl_->focus(f);
}
int BufferView::workWidth() const
{
return pimpl_->workarea().workWidth();

View File

@ -181,10 +181,6 @@ public:
///
void center();
///
bool focus() const;
///
void focus(bool);
/// Scroll the view by a number of pixels
void scrollDocView(int);

View File

@ -154,7 +154,6 @@ BufferView::Pimpl::Pimpl(BufferView * b, LyXView * o,
cursor_timeout.timeout.connect(boost::bind(&BufferView::Pimpl::cursorToggle, this));
cursor_timeout.start();
workarea().setFocus();
saved_positions.resize(saved_positions_num);
}
@ -957,8 +956,7 @@ void BufferView::Pimpl::workAreaExpose()
screen().redraw(bv_->text, bv_);
}
} else {
// Grey box when we don't have a buffer
workarea().greyOut();
screen().redraw(bv_->text, bv_);
}
// always make sure that the scrollbar is sane.
@ -1293,18 +1291,6 @@ void BufferView::Pimpl::insetUnlock()
}
bool BufferView::Pimpl::focus() const
{
return workarea().hasFocus();
}
void BufferView::Pimpl::focus(bool f)
{
if (f) workarea().setFocus();
}
void BufferView::Pimpl::showCursor()
{
if (bv_->theLockingInset())

View File

@ -114,10 +114,6 @@ struct BufferView::Pimpl : public boost::signals::trackable {
///
void insetUnlock();
///
bool focus() const;
///
void focus(bool);
///
void showCursor();
///
void hideCursor();

View File

@ -1,3 +1,14 @@
2002-06-20 John Levon <moz@compsoc.man.ac.uk>
* BufferView.h:
* BufferView.C:
* BufferView_pimpl.h:
* BufferView_pimpl.C:
* lyxfind.h:
* lyxfind.C:
* minibuffer.C: remove focus management of workarea,
not needed. Use screen's greyOut()
2002-06-17 Herbert Voss <voss@lyx.org>
* converter.C: (convert) do not post a message, when converting

View File

@ -1,3 +1,12 @@
2002-06-20 John Levon <moz@compsoc.man.ac.uk>
* LyXKeySym.h:
* LyXKeySym.C: remove un-needed file
* WorkArea.h:
* WorkArea.C: remove un-needed file. Add back
comments. Remove focus management, greyOut()
2002-06-19 John Levon <moz@compsoc.man.ac.uk>
* WorkArea.h: remove focus/unfocus events

View File

@ -1,15 +0,0 @@
/**
* \file LyXKeySym.C
* Copyright 2002 the LyX Team
* Read the file COPYING
*
* \author Asger and Juergen
*/
#include <config.h>
#ifdef __GNUG__
#pragma implementation
#endif
#include "LyXKeySym.h"

View File

@ -10,10 +10,6 @@
#ifndef LYXKEYSYM_H
#define LYXKEYSYM_H
#ifdef __GNUG__
#pragma interface
#endif
#include "LString.h"
#include <boost/shared_ptr.hpp>

View File

@ -23,7 +23,6 @@ libfrontends_la_SOURCES = \
FileDialog.h \
Liason.C \
Liason.h \
LyXKeySym.C \
LyXKeySym.h \
LyXKeySymFactory.h \
LyXScreenFactory.h \
@ -37,7 +36,6 @@ libfrontends_la_SOURCES = \
Timeout.h \
Toolbar.C \
Toolbar.h \
WorkArea.C \
WorkArea.h \
WorkAreaFactory.h \
font_loader.h \

View File

@ -1,23 +0,0 @@
/**
* \file WorkArea.C
* Copyright 2002 the LyX Team
* Read the file COPYING
*
* \author Asger and Juergen
*/
#include <config.h>
#ifdef __GNUG__
#pragma implementation
#endif
#include "WorkArea.h"

View File

@ -11,11 +11,6 @@
#ifndef WORKAREA_H
#define WORKAREA_H
#ifdef __GNUG__
#pragma interface
#endif
#include "frontends/Painter.h"
#include "frontends/mouse_state.h"
#include "frontends/key_state.h"
#include "frontends/LyXKeySym.h"
@ -27,55 +22,66 @@
#include <utility>
///
class Painter;
/**
* The work area class represents the widget that provides the
* view onto a document. It is owned by the BufferView, and
* is responsible for handing events back to its owning BufferView.
* It works in concert with the LyXScreen class to update the
* widget view of a document.
*/
class WorkArea {
public:
///
WorkArea() {}
///
virtual ~WorkArea() {}
///
/// return the painter object for this work area
virtual Painter & getPainter() = 0;
///
/// return the width of the work area in pixels
virtual int workWidth() const = 0;
///
/// 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;
///
virtual void setFocus() const = 0;
///
virtual bool hasFocus() const = 0;
///
virtual void greyOut() const = 0;
///
virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
/**
* Update the scrollbar.
* @param height the total document height in pixels
* @param pos the current position in the document, in pixels
* @param line_height the line-scroll amount, in pixels
*/
virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
// FIXME: this is an odd place to have it, but xforms needs it here ...
/// a selection exists
virtual void haveSelection(bool) const = 0;
///
/// get the X clipboard contents
virtual string const getClipboard() const = 0;
///
/// fill the clipboard
virtual void putClipboard(string const &) const = 0;
// Signals
///
/// FIXME: GUII
boost::signal0<void> workAreaExpose;
///
/// the scrollbar has changed
boost::signal1<void, int> scrollDocView;
///
/// a key combination has been pressed
boost::signal2<void, LyXKeySymPtr, key_modifier::state> workAreaKeyPress;
///
/// a mouse button has been pressed
boost::signal3<void, int, int, mouse_button::state> workAreaButtonPress;
///
/// a mouse button has been released
boost::signal3<void, int, int, mouse_button::state> workAreaButtonRelease;
///
/// the mouse has moved
boost::signal3<void, int, int, mouse_button::state> workAreaMotionNotify;
///
/// a mouse button has been double-clicked
boost::signal3<void, int, int, mouse_button::state> workAreaDoubleClick;
///
/// a mouse button has been triple-clicked
boost::signal3<void, int, int, mouse_button::state> workAreaTripleClick;
/// emitted when an X client has requested our selection
boost::signal0<void> selectionRequested;

View File

@ -1,3 +1,7 @@
2002-06-20 John Levon <moz@compsoc.man.ac.uk>
* QWorkArea.h: remove unused stuff
2002-06-19 John Levon <moz@compsoc.man.ac.uk>
* QContentPane.h:

View File

@ -41,9 +41,6 @@ public:
QWorkArea(int x, int y, int w, int h);
// FIXME:
virtual void greyOut() const { }
virtual ~QWorkArea();
/// return this widget's painter
virtual Painter & getPainter() { return painter_; }
@ -55,10 +52,6 @@ public:
virtual void resize(int xpos, int ypos, int width, int height);
/// FIXME: makes no sense ?
virtual void redraw() const { }
/// set focus to this widget
virtual void setFocus() const { /* FIXME */ }
/// does this widget have the focus ?
virtual bool hasFocus() const { /* FIXME */ return true; }
///
virtual void setScrollbarParams(int height, int pos, int line_height);

View File

@ -1,3 +1,7 @@
2002-06-20 John Levon <moz@compsoc.man.ac.uk>
* XWorkArea.h: remove focus stuff, greyOut()
2002-06-19 John Levon <moz@compsoc.man.ac.uk>
* XWorkArea.C: remove focus/unfocus events

View File

@ -336,22 +336,6 @@ void XWorkArea::createPixmap(int width, int height)
}
void XWorkArea::greyOut() const
{
if (!splash_) {
fl_winset(FL_ObjWin(work_area));
fl_rectangle(1, work_area->x, work_area->y,
work_area->w, work_area->h, FL_GRAY63);
}
}
void XWorkArea::setFocus() const
{
fl_set_focus_object(work_area->form, work_area);
}
void XWorkArea::setScrollbarParams(int height, int pos, int line_height)
{
// we need to cache this for scroll_cb

View File

@ -41,13 +41,7 @@ public:
fl_redraw_object(scrollbar);
}
///
virtual void setFocus() const;
///
Window getWin() const { return work_area->form->window; }
///
virtual bool hasFocus() const { return work_area->focus; }
///
virtual void greyOut() const;
///
virtual void setScrollbarParams(int height, int pos, int line_height);
///

View File

@ -96,11 +96,9 @@ int LyXReplace(BufferView * bv,
found = LyXFind(bv, searchstr, fw, casesens, matchwrd);
} while (!once && replaceall && found);
if (bv->focus())
bv->showCursor();
return replace_count;
}
bool LyXFind(BufferView * bv,
string const & searchstr, bool forward,
@ -157,11 +155,10 @@ bool LyXFind(BufferView * bv,
bv->update(text, BufferView::SELECT|BufferView::FITCUR);
found = false;
}
if (result != SR_FOUND_NOUPDATE && bv->focus())
bv->showCursor();
return found;
}
SearchResult LyXFind(BufferView * bv, LyXText * text,
string const & searchstr, bool forward,

View File

@ -209,7 +209,8 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, int key)
case 27:
case XK_Escape:
// Abort
owner_->view()->focus(true);
// FIXME: really needed ? when ?
//owner_->view()->focus(true);
init();
deactivate();
//escape.emit();
@ -235,7 +236,8 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, int key)
#endif
// Return the inputted string
deactivate();
owner_->view()->focus(true);
// FIXME: really needed ? when ?
//owner_->view()->focus(true);
if (!input.empty()) {
history_->push_back(input);
}