mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-02 08:10:39 +00:00
text2 chane, XFormsView
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2175 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
e546fb9b37
commit
b9d61343fc
@ -9,6 +9,7 @@ src/converter.C
|
||||
src/CutAndPaste.C
|
||||
src/debug.C
|
||||
src/exporter.C
|
||||
src/ext_l10n.h
|
||||
src/figure_form.C
|
||||
src/figureForm.C
|
||||
src/FontLoader.C
|
||||
|
@ -289,7 +289,7 @@ int BufferView::Pimpl::resizeCurrentBuffer()
|
||||
bool selection = false;
|
||||
bool mark_set = false;
|
||||
|
||||
ProhibitInput(bv_);
|
||||
owner_->prohibitInput();
|
||||
|
||||
owner_->message(_("Formatting document..."));
|
||||
|
||||
@ -350,7 +350,7 @@ int BufferView::Pimpl::resizeCurrentBuffer()
|
||||
redraw();
|
||||
|
||||
setState();
|
||||
AllowInput(bv_);
|
||||
owner_->allowInput();
|
||||
|
||||
/// clear the "Formatting Document" message
|
||||
owner_->message("");
|
||||
|
@ -1,3 +1,24 @@
|
||||
2001-07-03 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* text2.C (redoHeightOfParagraph): comment out stuff we don't need
|
||||
in NEW_INSETS
|
||||
(redoDrawingOfParagraph): ditto
|
||||
(redoParagraphs): ditto
|
||||
|
||||
* bufferview_funcs.[Ch]: move ProhibitInput and AllowInput to
|
||||
LyXview (+ rename)
|
||||
|
||||
2001-07-03 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* modifications to some other files because of this.
|
||||
|
||||
* Makefile.am (lyx_SOURCES): add XFormsView
|
||||
|
||||
* XFormsView.[Ch]: new files
|
||||
|
||||
* LyXView.[Ch]: make LyXView a base class for the gui handling for
|
||||
the main window. Move the gui dependand stuff to XFormsView
|
||||
|
||||
2001-07-03 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* tabular.C (GetCellInset): update cur_cell also in the row/col
|
||||
|
@ -15,9 +15,10 @@
|
||||
#pragma implementation "FontLoader.h"
|
||||
#endif
|
||||
|
||||
#include "gettext.h"
|
||||
#include FORMS_H_LOCATION
|
||||
#include "FontLoader.h"
|
||||
#include "FontInfo.h"
|
||||
#include "gettext.h"
|
||||
#include "debug.h"
|
||||
#include "lyxrc.h" // lyxrc.font_*
|
||||
#include "BufferView.h"
|
||||
|
177
src/LyXView.C
177
src/LyXView.C
@ -19,23 +19,17 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "LyXView.h"
|
||||
#include "lyx_main.h"
|
||||
#if FL_REVISION < 89 || (FL_REVISION == 89 && FL_FIXLEVEL < 5)
|
||||
#include "lyxlookup.h"
|
||||
#endif
|
||||
#include "minibuffer.h"
|
||||
#include "debug.h"
|
||||
#include "intl.h"
|
||||
#include "lyxrc.h"
|
||||
#include "support/filetools.h" // OnlyFilename()
|
||||
#include "layout.h"
|
||||
#include "lyxtext.h"
|
||||
#include "buffer.h"
|
||||
#include "frontends/Dialogs.h"
|
||||
#include "frontends/Toolbar.h"
|
||||
#include "frontends/Menubar.h"
|
||||
#include "MenuBackend.h"
|
||||
#include "ToolbarDefaults.h"
|
||||
#include "lyx_gui_misc.h" // [update,Close,Redraw]AllBufferRelatedDialogs
|
||||
#include "bufferview_funcs.h" // CurrentState()
|
||||
#include "gettext.h"
|
||||
@ -46,33 +40,17 @@ using std::endl;
|
||||
|
||||
extern void AutoSave(BufferView *);
|
||||
extern void QuitLyX();
|
||||
|
||||
LyXTextClass::size_type current_layout = 0;
|
||||
|
||||
// This is very temporary
|
||||
BufferView * current_view;
|
||||
|
||||
extern "C" int C_LyXView_atCloseMainFormCB(FL_FORM *, void *);
|
||||
|
||||
|
||||
LyXView::LyXView(int width, int height)
|
||||
LyXView::LyXView()
|
||||
{
|
||||
create_form_form_main(width, height);
|
||||
fl_set_form_atclose(form_, C_LyXView_atCloseMainFormCB, 0);
|
||||
lyxerr[Debug::INIT] << "Initializing LyXFunc" << endl;
|
||||
lyxfunc = new LyXFunc(this);
|
||||
|
||||
// Connect the minibuffer signals
|
||||
minibuffer->stringReady.connect(SigC::slot(lyxfunc,
|
||||
&LyXFunc::miniDispatch));
|
||||
minibuffer->timeout.connect(SigC::slot(lyxfunc,
|
||||
&LyXFunc::initMiniBuffer));
|
||||
|
||||
intl = new Intl;
|
||||
|
||||
// Make sure the buttons are disabled if needed.
|
||||
toolbar->update();
|
||||
menubar->update();
|
||||
|
||||
dialogs_ = new Dialogs(this);
|
||||
// temporary until all dialogs moved into Dialogs.
|
||||
dialogs_->updateBufferDependent
|
||||
@ -96,14 +74,6 @@ LyXView::~LyXView()
|
||||
}
|
||||
|
||||
|
||||
/// Redraw the main form.
|
||||
void LyXView::redraw() {
|
||||
lyxerr[Debug::INFO] << "LyXView::redraw()" << endl;
|
||||
fl_redraw_form(form_);
|
||||
minibuffer->redraw();
|
||||
}
|
||||
|
||||
|
||||
void LyXView::resize()
|
||||
{
|
||||
view()->resize();
|
||||
@ -123,12 +93,6 @@ BufferView * LyXView::view() const
|
||||
}
|
||||
|
||||
|
||||
FL_FORM * LyXView::getForm() const
|
||||
{
|
||||
return form_;
|
||||
}
|
||||
|
||||
|
||||
Toolbar * LyXView::getToolbar() const
|
||||
{
|
||||
return toolbar;
|
||||
@ -217,139 +181,6 @@ void LyXView::resetAutosaveTimer()
|
||||
}
|
||||
|
||||
|
||||
// Callback for close main form from window manager
|
||||
int LyXView::atCloseMainFormCB(FL_FORM *, void *)
|
||||
{
|
||||
QuitLyX();
|
||||
return FL_IGNORE;
|
||||
}
|
||||
|
||||
|
||||
// Wrapper for the above
|
||||
extern "C"
|
||||
int C_LyXView_atCloseMainFormCB(FL_FORM * form, void * p)
|
||||
{
|
||||
return LyXView::atCloseMainFormCB(form, p);
|
||||
}
|
||||
|
||||
|
||||
void LyXView::setPosition(int x, int y)
|
||||
{
|
||||
fl_set_form_position(form_, x, y);
|
||||
}
|
||||
|
||||
|
||||
void LyXView::show(int place, int border, string const & title)
|
||||
{
|
||||
fl_show_form(form_, place, border, title.c_str());
|
||||
lyxfunc->initMiniBuffer();
|
||||
#if FL_REVISION < 89 || (FL_REVISION == 89 && FL_FIXLEVEL < 5)
|
||||
InitLyXLookup(fl_get_display(), form_->window);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void LyXView::create_form_form_main(int width, int height)
|
||||
/* to make this work as it should, .lyxrc should have been
|
||||
* read first; OR maybe this one should be made dynamic.
|
||||
* Hmmmm. Lgb.
|
||||
* We will probably not have lyxrc before the main form is
|
||||
* initialized, because error messages from lyxrc parsing
|
||||
* are presented (and rightly so) in GUI popups. Asger.
|
||||
*/
|
||||
{
|
||||
// the main form
|
||||
form_ = fl_bgn_form(FL_NO_BOX, width, height);
|
||||
form_->u_vdata = this;
|
||||
FL_OBJECT * obj = fl_add_box(FL_FLAT_BOX, 0, 0, width, height, "");
|
||||
fl_set_object_color(obj, FL_MCOL, FL_MCOL);
|
||||
|
||||
// Parameters for the appearance of the main form
|
||||
int const air = 2;
|
||||
int const bw = abs(fl_get_border_width());
|
||||
|
||||
//
|
||||
// THE MENUBAR
|
||||
//
|
||||
menubar = new Menubar(this, menubackend);
|
||||
|
||||
//
|
||||
// TOOLBAR
|
||||
//
|
||||
|
||||
toolbar = new Toolbar(this, air, 30 + air + bw, toolbardefaults);
|
||||
|
||||
// Setup the toolbar
|
||||
toolbar->set(true);
|
||||
|
||||
//
|
||||
// WORKAREA
|
||||
//
|
||||
|
||||
int const ywork = 60 + 2 * air + bw;
|
||||
int const workheight = height - ywork - (25 + 2 * air);
|
||||
|
||||
::current_view = bufferview = new BufferView(this, air, ywork,
|
||||
width - 3 * air,
|
||||
workheight);
|
||||
|
||||
//
|
||||
// MINIBUFFER
|
||||
//
|
||||
|
||||
minibuffer = new MiniBuffer(this, air, height - (25 + air),
|
||||
width - (2 * air), 25);
|
||||
|
||||
//
|
||||
// TIMERS
|
||||
//
|
||||
|
||||
autosave_timeout.timeout.connect(SigC::slot(this, &LyXView::AutoSave));
|
||||
|
||||
//
|
||||
// Misc
|
||||
//
|
||||
|
||||
// assign an icon to main form
|
||||
string iconname = LibFileSearch("images", "lyx", "xpm");
|
||||
if (!iconname.empty()) {
|
||||
unsigned int w, h;
|
||||
Pixmap lyx_p, lyx_mask;
|
||||
lyx_p = fl_read_pixmapfile(fl_root,
|
||||
iconname.c_str(),
|
||||
&w,
|
||||
&h,
|
||||
&lyx_mask,
|
||||
0,
|
||||
0,
|
||||
0); // this leaks
|
||||
fl_set_form_icon(form_, lyx_p, lyx_mask);
|
||||
}
|
||||
|
||||
// set min size
|
||||
fl_set_form_minsize(form_, 50, 50);
|
||||
|
||||
fl_end_form();
|
||||
}
|
||||
|
||||
|
||||
void LyXView::init()
|
||||
{
|
||||
// Set the textclass choice
|
||||
invalidateLayoutChoice();
|
||||
updateLayoutChoice();
|
||||
updateMenubar();
|
||||
|
||||
// Start autosave timer
|
||||
if (lyxrc.autosave) {
|
||||
autosave_timeout.setTimeout(lyxrc.autosave * 1000);
|
||||
autosave_timeout.start();
|
||||
}
|
||||
|
||||
intl->InitKeyMapper(lyxrc.use_kbmap);
|
||||
}
|
||||
|
||||
|
||||
void LyXView::invalidateLayoutChoice()
|
||||
{
|
||||
last_textclass = -1;
|
||||
@ -401,10 +232,8 @@ void LyXView::updateWindowTitle()
|
||||
title += _(" (read only)");
|
||||
}
|
||||
}
|
||||
// Don't update title if it's the same as last time
|
||||
if (title != last_title) {
|
||||
fl_set_form_title(form_, title.c_str());
|
||||
last_title = title;
|
||||
setWindowTitle(title);
|
||||
}
|
||||
}
|
||||
|
||||
|
103
src/LyXView.h
103
src/LyXView.h
@ -1,63 +1,44 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
* ====================================================== */
|
||||
|
||||
#ifndef LyXView_H
|
||||
#define LyXView_H
|
||||
#ifndef LYXVIEW_BASE_H
|
||||
#define LYXVIEW_BASE_H
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include <config.h>
|
||||
#include FORMS_H_LOCATION
|
||||
#include <boost/utility.hpp>
|
||||
#include <sigc++/signal_system.h>
|
||||
|
||||
#include "LString.h"
|
||||
#include "frontends/Timeout.h"
|
||||
#include <boost/utility.hpp>
|
||||
#include "layout.h"
|
||||
|
||||
class LyXFunc;
|
||||
class Buffer;
|
||||
class Toolbar;
|
||||
class MiniBuffer;
|
||||
class Intl;
|
||||
class Buffer;
|
||||
class Menubar;
|
||||
|
||||
class BufferView;
|
||||
class Dialogs;
|
||||
class LyXFunc;
|
||||
|
||||
/**
|
||||
This class is the form containing the view of the buffer. The actual buffer
|
||||
view is supposed (at least IMHO) to be another class, that shows its output
|
||||
in one or more LyXView's.
|
||||
*/
|
||||
///
|
||||
class LyXView : public SigC::Object, boost::noncopyable {
|
||||
public:
|
||||
/// constructor
|
||||
LyXView(int w, int h);
|
||||
|
||||
/// destructor
|
||||
~LyXView();
|
||||
|
||||
/// Where to place the form.
|
||||
void setPosition(int, int);
|
||||
|
||||
/// Show the main form.
|
||||
void show(int, int, string const & t = string("LyX"));
|
||||
|
||||
/// init (should probably be removed later) (Lgb)
|
||||
void init();
|
||||
|
||||
///
|
||||
LyXView();
|
||||
///
|
||||
virtual ~LyXView();
|
||||
///
|
||||
virtual void init() = 0;
|
||||
///
|
||||
virtual void setPosition(int, int) = 0;
|
||||
///
|
||||
virtual void show(int, int, string const &) = 0;
|
||||
/// Redraw the main form.
|
||||
void redraw();
|
||||
virtual void redraw() = 0;
|
||||
|
||||
/// Resize all BufferViews in this LyXView (because the width changed)
|
||||
void resize();
|
||||
@ -68,9 +49,6 @@ public:
|
||||
///
|
||||
BufferView * view() const;
|
||||
|
||||
/// returns a pointer to the form.
|
||||
FL_FORM * getForm() const;
|
||||
|
||||
/// return a pointer to the toolbar
|
||||
Toolbar * getToolbar() const;
|
||||
|
||||
@ -116,39 +94,36 @@ public:
|
||||
|
||||
/// Reset autosave timer
|
||||
void resetAutosaveTimer();
|
||||
private:
|
||||
///
|
||||
LyXFunc * lyxfunc;
|
||||
///
|
||||
Toolbar * toolbar;
|
||||
///
|
||||
MiniBuffer * minibuffer;
|
||||
///
|
||||
virtual void prohibitInput() const = 0;
|
||||
///
|
||||
virtual void allowInput() const = 0;
|
||||
protected:
|
||||
///
|
||||
Menubar * menubar;
|
||||
///
|
||||
Intl * intl;
|
||||
///
|
||||
Dialogs * dialogs_;
|
||||
|
||||
///
|
||||
Toolbar * toolbar;
|
||||
/** This is supposed to be a pointer or a list of pointers to the
|
||||
BufferViews currently being shown in the LyXView. So far
|
||||
this is not used, but that should change pretty soon. (Lgb) */
|
||||
BufferView * bufferview;
|
||||
///
|
||||
MiniBuffer * minibuffer;
|
||||
///
|
||||
void invalidateLayoutChoice();
|
||||
public:
|
||||
/** This callback is run when a close event is sent from the
|
||||
window manager. */
|
||||
static int atCloseMainFormCB(FL_FORM *, void *);
|
||||
/// A callback
|
||||
void AutoSave();
|
||||
private:
|
||||
Intl * intl;
|
||||
///
|
||||
Timeout autosave_timeout;
|
||||
/// makes the main form.
|
||||
void create_form_form_main(int width, int height);
|
||||
/// A pointer to the form.
|
||||
FL_FORM * form_;
|
||||
/// A callback
|
||||
void AutoSave();
|
||||
///
|
||||
void invalidateLayoutChoice();
|
||||
private:
|
||||
///
|
||||
LyXFunc * lyxfunc;
|
||||
///
|
||||
Dialogs * dialogs_;
|
||||
///
|
||||
virtual void setWindowTitle(string const &) = 0;
|
||||
/** The last textclass layout list in the layout choice selector
|
||||
This should probably be moved to the toolbar, but for now it's
|
||||
here. (Asger) */
|
||||
|
@ -83,6 +83,8 @@ lyx_SOURCES = \
|
||||
Variables.h \
|
||||
WorkArea.C \
|
||||
WorkArea.h \
|
||||
XFormsView.C \
|
||||
XFormsView.h \
|
||||
broken_headers.h \
|
||||
buffer.C \
|
||||
buffer.h \
|
||||
|
257
src/XFormsView.C
Normal file
257
src/XFormsView.C
Normal file
@ -0,0 +1,257 @@
|
||||
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
* ====================================================== */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation
|
||||
#endif
|
||||
|
||||
//#include <sys/time.h>
|
||||
//#include <unistd.h>
|
||||
|
||||
#include "XFormsView.h"
|
||||
#if FL_REVISION < 89 || (FL_REVISION == 89 && FL_FIXLEVEL < 5)
|
||||
#include "lyxlookup.h"
|
||||
#endif
|
||||
#include "minibuffer.h"
|
||||
#include "debug.h"
|
||||
#include "intl.h"
|
||||
#include "lyxrc.h"
|
||||
#include "support/filetools.h" // OnlyFilename()
|
||||
#include "frontends/Toolbar.h"
|
||||
#include "frontends/Menubar.h"
|
||||
#include "MenuBackend.h"
|
||||
#include "ToolbarDefaults.h"
|
||||
#include "lyxfunc.h"
|
||||
#include "BufferView.h"
|
||||
|
||||
using std::endl;
|
||||
|
||||
//extern void AutoSave(BufferView *);
|
||||
extern void QuitLyX();
|
||||
|
||||
// This is very temporary
|
||||
BufferView * current_view;
|
||||
|
||||
extern "C" int C_XFormsView_atCloseMainFormCB(FL_FORM *, void *);
|
||||
|
||||
|
||||
XFormsView::XFormsView(int width, int height)
|
||||
: LyXView()
|
||||
{
|
||||
create_form_form_main(width, height);
|
||||
fl_set_form_atclose(form_, C_XFormsView_atCloseMainFormCB, 0);
|
||||
|
||||
// Connect the minibuffer signals
|
||||
minibuffer->stringReady.connect(SigC::slot(getLyXFunc(),
|
||||
&LyXFunc::miniDispatch));
|
||||
minibuffer->timeout.connect(SigC::slot(getLyXFunc(),
|
||||
&LyXFunc::initMiniBuffer));
|
||||
|
||||
// Make sure the buttons are disabled if needed.
|
||||
updateToolbar();
|
||||
}
|
||||
|
||||
|
||||
XFormsView::~XFormsView() {}
|
||||
|
||||
|
||||
/// Redraw the main form.
|
||||
void XFormsView::redraw() {
|
||||
lyxerr[Debug::INFO] << "XFormsView::redraw()" << endl;
|
||||
fl_redraw_form(form_);
|
||||
getMiniBuffer()->redraw();
|
||||
}
|
||||
|
||||
|
||||
FL_FORM * XFormsView::getForm() const
|
||||
{
|
||||
return form_;
|
||||
}
|
||||
|
||||
|
||||
// Callback for close main form from window manager
|
||||
int XFormsView::atCloseMainFormCB(FL_FORM *, void *)
|
||||
{
|
||||
QuitLyX();
|
||||
return FL_IGNORE;
|
||||
}
|
||||
|
||||
|
||||
// Wrapper for the above
|
||||
extern "C"
|
||||
int C_XFormsView_atCloseMainFormCB(FL_FORM * form, void * p)
|
||||
{
|
||||
return XFormsView::atCloseMainFormCB(form, p);
|
||||
}
|
||||
|
||||
|
||||
void XFormsView::setPosition(int x, int y)
|
||||
{
|
||||
fl_set_form_position(form_, x, y);
|
||||
}
|
||||
|
||||
|
||||
void XFormsView::show(int place, int border, string const & title)
|
||||
{
|
||||
fl_show_form(form_, place, border, title.c_str());
|
||||
getLyXFunc()->initMiniBuffer();
|
||||
#if FL_REVISION < 89 || (FL_REVISION == 89 && FL_FIXLEVEL < 5)
|
||||
InitLyXLookup(fl_get_display(), form_->window);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void XFormsView::create_form_form_main(int width, int height)
|
||||
/* to make this work as it should, .lyxrc should have been
|
||||
* read first; OR maybe this one should be made dynamic.
|
||||
* Hmmmm. Lgb.
|
||||
* We will probably not have lyxrc before the main form is
|
||||
* initialized, because error messages from lyxrc parsing
|
||||
* are presented (and rightly so) in GUI popups. Asger.
|
||||
*/
|
||||
{
|
||||
// the main form
|
||||
form_ = fl_bgn_form(FL_NO_BOX, width, height);
|
||||
form_->u_vdata = this;
|
||||
FL_OBJECT * obj = fl_add_box(FL_FLAT_BOX, 0, 0, width, height, "");
|
||||
fl_set_object_color(obj, FL_MCOL, FL_MCOL);
|
||||
|
||||
// Parameters for the appearance of the main form
|
||||
int const air = 2;
|
||||
int const bw = abs(fl_get_border_width());
|
||||
|
||||
//
|
||||
// THE MENUBAR
|
||||
//
|
||||
menubar = new Menubar(this, menubackend);
|
||||
|
||||
//
|
||||
// TOOLBAR
|
||||
//
|
||||
|
||||
toolbar = new Toolbar(this, air, 30 + air + bw, toolbardefaults);
|
||||
|
||||
// Setup the toolbar
|
||||
toolbar->set(true);
|
||||
|
||||
//
|
||||
// WORKAREA
|
||||
//
|
||||
|
||||
int const ywork = 60 + 2 * air + bw;
|
||||
int const workheight = height - ywork - (25 + 2 * air);
|
||||
|
||||
::current_view = bufferview = new BufferView(this, air, ywork,
|
||||
width - 3 * air,
|
||||
workheight);
|
||||
|
||||
//
|
||||
// MINIBUFFER
|
||||
//
|
||||
|
||||
minibuffer = new MiniBuffer(this, air, height - (25 + air),
|
||||
width - (2 * air), 25);
|
||||
|
||||
//
|
||||
// TIMERS
|
||||
//
|
||||
|
||||
autosave_timeout.timeout.connect(SigC::slot(this, &XFormsView::AutoSave));
|
||||
|
||||
//
|
||||
// Misc
|
||||
//
|
||||
|
||||
// assign an icon to main form
|
||||
string iconname = LibFileSearch("images", "lyx", "xpm");
|
||||
if (!iconname.empty()) {
|
||||
unsigned int w, h;
|
||||
Pixmap lyx_p, lyx_mask;
|
||||
lyx_p = fl_read_pixmapfile(fl_root,
|
||||
iconname.c_str(),
|
||||
&w,
|
||||
&h,
|
||||
&lyx_mask,
|
||||
0,
|
||||
0,
|
||||
0); // this leaks
|
||||
fl_set_form_icon(form_, lyx_p, lyx_mask);
|
||||
}
|
||||
|
||||
// set min size
|
||||
fl_set_form_minsize(form_, 50, 50);
|
||||
|
||||
fl_end_form();
|
||||
}
|
||||
|
||||
|
||||
void XFormsView::init()
|
||||
{
|
||||
// Set the textclass choice
|
||||
invalidateLayoutChoice();
|
||||
updateLayoutChoice();
|
||||
updateMenubar();
|
||||
|
||||
// Start autosave timer
|
||||
if (lyxrc.autosave) {
|
||||
autosave_timeout.setTimeout(lyxrc.autosave * 1000);
|
||||
autosave_timeout.start();
|
||||
}
|
||||
|
||||
intl->InitKeyMapper(lyxrc.use_kbmap);
|
||||
}
|
||||
|
||||
|
||||
void XFormsView::setWindowTitle(string const & title)
|
||||
{
|
||||
fl_set_form_title(form_, title.c_str());
|
||||
}
|
||||
|
||||
|
||||
// How should this actually work? Should it prohibit input in all BufferViews,
|
||||
// or just in the current one? If "just the current one", then it should be
|
||||
// placed in BufferView. If "all BufferViews" then LyXGUI (I think) should
|
||||
// run "prohibitInput" on all LyXViews which will run prohibitInput on all
|
||||
// BufferViews. Or is it perhaps just the (input in) BufferViews in the
|
||||
// current LyxView that should be prohibited (Lgb) (This applies to
|
||||
// "allowInput" as well.)
|
||||
void XFormsView::prohibitInput() const
|
||||
{
|
||||
view()->hideCursor();
|
||||
|
||||
static Cursor cursor;
|
||||
static bool cursor_undefined = true;
|
||||
|
||||
if (cursor_undefined){
|
||||
cursor = XCreateFontCursor(fl_get_display(), XC_watch);
|
||||
XFlush(fl_get_display());
|
||||
cursor_undefined = false;
|
||||
}
|
||||
|
||||
/* set the cursor to the watch for all forms and the canvas */
|
||||
XDefineCursor(fl_get_display(), getForm()->window, cursor);
|
||||
|
||||
XFlush(fl_get_display());
|
||||
fl_deactivate_all_forms();
|
||||
}
|
||||
|
||||
|
||||
void XFormsView::allowInput() const
|
||||
{
|
||||
/* reset the cursor from the watch for all forms and the canvas */
|
||||
|
||||
XUndefineCursor(fl_get_display(), getForm()->window);
|
||||
|
||||
XFlush(fl_get_display());
|
||||
fl_activate_all_forms();
|
||||
}
|
60
src/XFormsView.h
Normal file
60
src/XFormsView.h
Normal file
@ -0,0 +1,60 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
* ====================================================== */
|
||||
|
||||
#ifndef LyXView_H
|
||||
#define LyXView_H
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include <config.h>
|
||||
#include FORMS_H_LOCATION
|
||||
|
||||
#include "LyXView.h"
|
||||
|
||||
/**
|
||||
This class is the form containing the view of the buffer. The actual buffer
|
||||
view is supposed (at least IMHO) to be another class, that shows its output
|
||||
in one or more LyXView's.
|
||||
*/
|
||||
class XFormsView : public LyXView {
|
||||
public:
|
||||
/// constructor
|
||||
XFormsView(int w, int h);
|
||||
/// destructor
|
||||
~XFormsView();
|
||||
/// Where to place the form.
|
||||
virtual void setPosition(int, int);
|
||||
/// Show the main form.
|
||||
virtual void show(int, int, string const & t = string("LyX"));
|
||||
/// init (should probably be removed later) (Lgb)
|
||||
virtual void init();
|
||||
/// Redraw the main form.
|
||||
virtual void redraw();
|
||||
/// returns a pointer to the form.
|
||||
FL_FORM * getForm() const;
|
||||
///
|
||||
virtual void prohibitInput() const;
|
||||
///
|
||||
virtual void allowInput() const;
|
||||
/** This callback is run when a close event is sent from the
|
||||
window manager. */
|
||||
static int atCloseMainFormCB(FL_FORM *, void *);
|
||||
private:
|
||||
///
|
||||
virtual void setWindowTitle(string const &);
|
||||
/// makes the main form.
|
||||
void create_form_form_main(int width, int height);
|
||||
/// A pointer to the form.
|
||||
FL_FORM * form_;
|
||||
};
|
||||
#endif
|
@ -3229,7 +3229,7 @@ int Buffer::runChktex()
|
||||
{
|
||||
if (!users->text) return 0;
|
||||
|
||||
ProhibitInput(users);
|
||||
users->owner()->prohibitInput();
|
||||
|
||||
// get LaTeX-Filename
|
||||
string const name = getLatexName();
|
||||
@ -3267,7 +3267,7 @@ int Buffer::runChktex()
|
||||
users->redraw();
|
||||
users->fitCursor(users->text);
|
||||
}
|
||||
AllowInput(users);
|
||||
users->owner()->allowInput();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ bool BufferList::close(Buffer * buf)
|
||||
if (buf->getUser()) buf->getUser()->insetUnlock();
|
||||
if (buf->paragraph && !buf->isLyxClean() && !quitting) {
|
||||
if (buf->getUser())
|
||||
ProhibitInput(buf->getUser());
|
||||
buf->getUser()->owner()->prohibitInput();
|
||||
string fname;
|
||||
if (buf->isUnnamed())
|
||||
fname = OnlyFilename(buf->fileName());
|
||||
@ -193,7 +193,7 @@ bool BufferList::close(Buffer * buf)
|
||||
reask = false;
|
||||
} else {
|
||||
if (buf->getUser())
|
||||
AllowInput(buf->getUser());
|
||||
buf->getUser()->owner()->allowInput();
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@ -205,12 +205,12 @@ bool BufferList::close(Buffer * buf)
|
||||
break;
|
||||
case 3: // Cancel
|
||||
if (buf->getUser())
|
||||
AllowInput(buf->getUser());
|
||||
buf->getUser()->owner()->allowInput();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (buf->getUser())
|
||||
AllowInput(buf->getUser());
|
||||
buf->getUser()->owner()->allowInput();
|
||||
}
|
||||
|
||||
bstore.release(buf);
|
||||
|
@ -103,46 +103,6 @@ void changeDepth(BufferView * bv, LyXText * text, int decInc)
|
||||
}
|
||||
|
||||
|
||||
// How should this actually work? Should it prohibit input in all BufferViews,
|
||||
// or just in the current one? If "just the current one", then it should be
|
||||
// placed in BufferView. If "all BufferViews" then LyXGUI (I think) should
|
||||
// run "ProhibitInput" on all LyXViews which will run prohibitInput on all
|
||||
// BufferViews. Or is it perhaps just the (input in) BufferViews in the
|
||||
// current LyxView that should be prohibited (Lgb) (This applies to
|
||||
// "AllowInput" as well.)
|
||||
void ProhibitInput(BufferView * bv)
|
||||
{
|
||||
bv->hideCursor();
|
||||
|
||||
static Cursor cursor;
|
||||
static bool cursor_undefined = true;
|
||||
|
||||
if (cursor_undefined){
|
||||
cursor = XCreateFontCursor(fl_get_display(), XC_watch);
|
||||
XFlush(fl_get_display());
|
||||
cursor_undefined = false;
|
||||
}
|
||||
|
||||
/* set the cursor to the watch for all forms and the canvas */
|
||||
XDefineCursor(fl_get_display(), bv->owner()->getForm()->window,
|
||||
cursor);
|
||||
|
||||
XFlush(fl_get_display());
|
||||
fl_deactivate_all_forms();
|
||||
}
|
||||
|
||||
|
||||
void AllowInput(BufferView * bv)
|
||||
{
|
||||
/* reset the cursor from the watch for all forms and the canvas */
|
||||
|
||||
XUndefineCursor(fl_get_display(), bv->owner()->getForm()->window);
|
||||
|
||||
XFlush(fl_get_display());
|
||||
fl_activate_all_forms();
|
||||
}
|
||||
|
||||
|
||||
void Code(BufferView * bv)
|
||||
{
|
||||
LyXFont font(LyXFont::ALL_IGNORE);
|
||||
|
@ -41,10 +41,6 @@ extern void Tex(BufferView *);
|
||||
///
|
||||
extern void changeDepth(BufferView *, LyXText *, int);
|
||||
///
|
||||
extern void ProhibitInput(BufferView *);
|
||||
///
|
||||
extern void AllowInput(BufferView *);
|
||||
///
|
||||
extern void Code(BufferView *);
|
||||
///
|
||||
extern void Sans(BufferView *);
|
||||
|
@ -761,7 +761,7 @@ bool Converters::scanLog(Buffer const * buffer, string const & command,
|
||||
BufferView * bv = buffer->getUser();
|
||||
bool need_redraw = false;
|
||||
if (bv) {
|
||||
ProhibitInput(bv);
|
||||
bv->owner()->prohibitInput();
|
||||
// Remove all error insets
|
||||
need_redraw = bv->removeAutoInsets();
|
||||
}
|
||||
@ -779,7 +779,7 @@ bool Converters::scanLog(Buffer const * buffer, string const & command,
|
||||
bv->redraw();
|
||||
bv->fitCursor(bv->text);
|
||||
}
|
||||
AllowInput(bv);
|
||||
bv->owner()->allowInput();
|
||||
}
|
||||
|
||||
if ((result & LaTeX::ERRORS)) {
|
||||
@ -819,7 +819,7 @@ bool Converters::runLaTeX(Buffer const * buffer, string const & command)
|
||||
bool need_redraw = false;
|
||||
|
||||
if (bv) {
|
||||
ProhibitInput(bv);
|
||||
bv->owner()->prohibitInput();
|
||||
bv->owner()->message(_("Running LaTeX..."));
|
||||
// Remove all error insets
|
||||
need_redraw = bv->removeAutoInsets();
|
||||
@ -873,7 +873,7 @@ bool Converters::runLaTeX(Buffer const * buffer, string const & command)
|
||||
}
|
||||
|
||||
if (bv)
|
||||
AllowInput(bv);
|
||||
bv->owner()->allowInput();
|
||||
|
||||
int const ERROR_MASK =
|
||||
LaTeX::NO_LOGFILE |
|
||||
|
@ -1,3 +1,7 @@
|
||||
2001-07-03 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* GUIRunTime.h: add createMainView
|
||||
|
||||
2001-06-27 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* Dialogs.h: add showSpellcheckerPreferences
|
||||
|
@ -15,6 +15,8 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
class LyXView;
|
||||
|
||||
/** The LyX GUI independent guiruntime class
|
||||
The GUI interface is implemented in the corresponding
|
||||
frontends GUIRunTime.C file.
|
||||
@ -33,5 +35,8 @@ public:
|
||||
/// This is run first in the LyXGUI constructor.
|
||||
static
|
||||
void setDefaults();
|
||||
///
|
||||
static
|
||||
LyXView * createMainView(int w, int h);
|
||||
};
|
||||
#endif
|
||||
|
@ -1,3 +1,10 @@
|
||||
2001-07-03 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* Toolbar_pimpl.h: make owner be a XFormsView, small changes
|
||||
because of this.
|
||||
|
||||
* GUIRunTime.C (createMainView): implement
|
||||
|
||||
2001-06-22 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* FormCharacter.C:
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
#include "support/lstrings.h"
|
||||
|
||||
// temp. hack until Allow/ProhibitInput is not
|
||||
// temp. hack until Allow/prohibitInput is not
|
||||
// needed any more in src/ - for now it's simplest
|
||||
// to leave it there
|
||||
#include "LyXView.h"
|
||||
@ -67,14 +67,14 @@ FileDialog::Result const FileDialog::Select(string const & path, string const &
|
||||
|
||||
// no support for asynchronous selection yet
|
||||
|
||||
ProhibitInput(lv_->view());
|
||||
lv_->prohibitInput();
|
||||
|
||||
FileDialog::Result result;
|
||||
|
||||
result.first = FileDialog::Chosen;
|
||||
result.second = private_->Select(title_, path, filter, suggested);
|
||||
|
||||
AllowInput(lv_->view());
|
||||
lv_->allowInput();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -1025,7 +1025,7 @@ void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long)
|
||||
if (!ob)
|
||||
ob = class_->choice_doc_class;
|
||||
|
||||
ProhibitInput(lv_->view());
|
||||
lv_->prohibitInput();
|
||||
|
||||
unsigned int tc = combo_doc_class->get() - 1;
|
||||
if (textclasslist.Load(tc)) {
|
||||
@ -1047,7 +1047,7 @@ void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long)
|
||||
_("Reverting to original document class."));
|
||||
combo_doc_class->select(int(lv_->buffer()->params.textclass) + 1);
|
||||
}
|
||||
AllowInput(lv_->view());
|
||||
lv_->allowInput();
|
||||
}
|
||||
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
#endif
|
||||
|
||||
#include "GUIRunTime.h"
|
||||
#include "XFormsView.h"
|
||||
#include "debug.h"
|
||||
|
||||
// I keep these here so that it will be processed as early in
|
||||
@ -110,3 +111,9 @@ void GUIRunTime::setDefaults()
|
||||
| FL_PDMenuFontSize
|
||||
| FL_PDBorderWidth, &cntl);
|
||||
}
|
||||
|
||||
|
||||
LyXView * GUIRunTime::createMainView(int w, int h)
|
||||
{
|
||||
return new XFormsView(w, h);
|
||||
}
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "kbmap.h"
|
||||
#include "buffer.h"
|
||||
#include "Dialogs.h"
|
||||
#include "LyXView.h"
|
||||
#include "XFormsView.h"
|
||||
#include "lyxfunc.h"
|
||||
#include "FloatList.h"
|
||||
#include "support/lstrings.h"
|
||||
@ -97,7 +97,7 @@ Menubar::Pimpl::Pimpl(LyXView * view, MenuBackend const & mb)
|
||||
|
||||
void Menubar::Pimpl::makeMenubar(Menu const & menu)
|
||||
{
|
||||
FL_FORM * form = owner_->getForm();
|
||||
FL_FORM * form = static_cast<XFormsView *>(owner_)->getForm();
|
||||
int moffset = 0;
|
||||
|
||||
// Create menu frame if there is non yet.
|
||||
@ -565,8 +565,8 @@ void Menubar::Pimpl::MenuCallback(FL_OBJECT * ob, long button)
|
||||
item->submenu(), submenus);
|
||||
if (menu != -1) {
|
||||
// place popup
|
||||
fl_setpup_position(view->getForm()->x + ob->x,
|
||||
view->getForm()->y + ob->y + ob->h + 10);
|
||||
fl_setpup_position(static_cast<XFormsView *>(view)->getForm()->x + ob->x,
|
||||
static_cast<XFormsView *>(view)->getForm()->y + ob->y + ob->h + 10);
|
||||
int choice = fl_dopup(menu);
|
||||
|
||||
if (button == 1) {
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#include "Toolbar_pimpl.h"
|
||||
#include "debug.h"
|
||||
#include "LyXView.h"
|
||||
#include "XFormsView.h"
|
||||
#include "lyxfunc.h"
|
||||
#include "func_status.h"
|
||||
#include "BufferView.h"
|
||||
@ -81,7 +81,7 @@ Toolbar::Pimpl::toolbarItem::operator=(toolbarItem const & ti) {
|
||||
|
||||
|
||||
Toolbar::Pimpl::Pimpl(LyXView * o, int x, int y)
|
||||
: owner(o), sxpos(x), sypos(y)
|
||||
: owner(static_cast<XFormsView *>(o)), sxpos(x), sypos(y)
|
||||
{
|
||||
combox = 0;
|
||||
#if FL_REVISION < 89
|
||||
@ -268,7 +268,7 @@ namespace {
|
||||
|
||||
void ToolbarCB(FL_OBJECT * ob, long ac)
|
||||
{
|
||||
LyXView * owner = static_cast<LyXView *>(ob->u_vdata);
|
||||
XFormsView * owner = static_cast<XFormsView *>(ob->u_vdata);
|
||||
|
||||
string res = owner->getLyXFunc()->Dispatch(int(ac));
|
||||
if (!res.empty())
|
||||
@ -530,6 +530,7 @@ void Toolbar::Pimpl::reset()
|
||||
lightReset();
|
||||
}
|
||||
|
||||
|
||||
void Toolbar::Pimpl::lightReset() {
|
||||
xpos = sxpos - standardspacing;
|
||||
ypos = sypos;
|
||||
|
@ -27,6 +27,8 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
class XFormsView;
|
||||
|
||||
/** The LyX xforms toolbar class
|
||||
*/
|
||||
struct Toolbar::Pimpl {
|
||||
@ -98,7 +100,7 @@ public:
|
||||
/// The list containing all the buttons
|
||||
ToolbarList toollist;
|
||||
///
|
||||
LyXView * owner;
|
||||
XFormsView * owner;
|
||||
#if FL_REVISION < 89
|
||||
///
|
||||
FL_OBJECT * bubble_timer;
|
||||
|
@ -1702,7 +1702,7 @@ void InsetText::resizeLyXText(BufferView * bv, bool force) const
|
||||
bool selection = false;
|
||||
bool mark_set = false;
|
||||
|
||||
// ProhibitInput(bv);
|
||||
// bv->owner()->prohibitInput();
|
||||
|
||||
if (locked) {
|
||||
LyXText * t = getLyXText(bv);
|
||||
@ -1746,7 +1746,7 @@ void InsetText::resizeLyXText(BufferView * bv, bool force) const
|
||||
|
||||
// this will scroll the screen such that the cursor becomes visible
|
||||
bv->updateScrollbar();
|
||||
// AllowInput(bv);
|
||||
// bv->owner()->allowInput();
|
||||
if (the_locking_inset) {
|
||||
/// then resize all LyXText in text-insets
|
||||
inset_x = cx(bv) - top_x + drawTextXOffset;
|
||||
|
@ -472,7 +472,7 @@ void InsertAsciiFile(BufferView * bv, string const & f, bool asParagraph)
|
||||
void MenuInsertLabel(BufferView * bv, string const & arg)
|
||||
{
|
||||
string label(arg);
|
||||
ProhibitInput(bv);
|
||||
bv->owner()->prohibitInput();
|
||||
if (label.empty()) {
|
||||
Paragraph * par = bv->text->cursor.par();
|
||||
LyXLayout const * layout =
|
||||
@ -520,7 +520,7 @@ void MenuInsertLabel(BufferView * bv, string const & arg)
|
||||
InsetLabel * inset = new InsetLabel( p );
|
||||
bv->insertInset( inset );
|
||||
}
|
||||
AllowInput(bv);
|
||||
bv->owner()->allowInput();
|
||||
}
|
||||
|
||||
|
||||
|
@ -49,7 +49,6 @@ FD_form_figure * fd_form_figure;
|
||||
extern LyXServer * lyxserver;
|
||||
extern bool finished; // flag, that we are quitting the program
|
||||
extern BufferList bufferlist;
|
||||
extern GUIRunTime guiruntime;
|
||||
extern string user_lyxdir;
|
||||
|
||||
FL_CMD_OPT cmdopt[] =
|
||||
@ -267,7 +266,7 @@ void LyXGUI::init()
|
||||
void LyXGUI::create_forms()
|
||||
{
|
||||
lyxerr[Debug::INIT] << "Initializing LyXView..." << endl;
|
||||
lyxViews = new LyXView(width, height);
|
||||
lyxViews = GUIRunTime::createMainView(width, height);
|
||||
lyxerr[Debug::INIT] << "Initializing LyXView...done" << endl;
|
||||
|
||||
// From here down should be done by somebody else. (Lgb)
|
||||
@ -312,7 +311,7 @@ void LyXGUI::runTime()
|
||||
{
|
||||
if (!gui) return;
|
||||
|
||||
guiruntime.runTime();
|
||||
GUIRunTime::runTime();
|
||||
}
|
||||
|
||||
|
||||
|
@ -137,12 +137,12 @@ void WriteAlert(string const & s1, string const & s2, string const & s3)
|
||||
lview = current_view->owner();
|
||||
if (lview) {
|
||||
/// Write to minibuffer
|
||||
ProhibitInput(current_view);
|
||||
lview->prohibitInput();
|
||||
string const msg = s1 + ' ' + s2 + ' ' + s3;
|
||||
lview->message(msg);
|
||||
fl_set_resource("flAlert.dismiss.label", _("Dismiss"));
|
||||
fl_show_alert(s1.c_str(), s2.c_str(), s3.c_str(), 0);
|
||||
AllowInput(current_view);
|
||||
lview->allowInput();
|
||||
} else {
|
||||
/// Write to lyxerr
|
||||
lyxerr << "----------------------------------------" << endl
|
||||
|
@ -1070,25 +1070,25 @@ string const LyXFunc::Dispatch(int ac,
|
||||
setErrorMessage(N_("Missing argument"));
|
||||
break;
|
||||
}
|
||||
ProhibitInput(owner->view());
|
||||
owner->prohibitInput();
|
||||
string const fname = i18nLibFileSearch("doc", arg, "lyx");
|
||||
if (fname.empty()) {
|
||||
lyxerr << "LyX: unable to find documentation file `"
|
||||
<< arg << "'. Bad installation?" << endl;
|
||||
AllowInput(owner->view());
|
||||
owner->allowInput();
|
||||
break;
|
||||
}
|
||||
ostringstream str;
|
||||
str << _("Opening help file") << ' '
|
||||
<< MakeDisplayPath(fname) << "...";
|
||||
owner->message(str.str().c_str());
|
||||
owner->view()->buffer(bufferlist.loadLyXFile(fname,false));
|
||||
AllowInput(owner->view());
|
||||
owner->view()->buffer(bufferlist.loadLyXFile(fname, false));
|
||||
owner->allowInput();
|
||||
break;
|
||||
}
|
||||
|
||||
case LFUN_HELP_VERSION: {
|
||||
ProhibitInput(owner->view());
|
||||
owner->prohibitInput();
|
||||
string msg(_("LyX Version "));
|
||||
msg += LYX_VERSION;
|
||||
msg += " of ";
|
||||
@ -1098,7 +1098,7 @@ string const LyXFunc::Dispatch(int ac,
|
||||
+ MakeDisplayPath(system_lyxdir)).c_str(),
|
||||
(_("User directory: ")
|
||||
+ MakeDisplayPath(user_lyxdir)).c_str());
|
||||
AllowInput(owner->view());
|
||||
owner->allowInput();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "support/lyxalgo.h"
|
||||
#include "support/filetools.h"
|
||||
#include "LyXView.h"
|
||||
#include "XFormsView.h"
|
||||
#include "gettext.h"
|
||||
#include "LyXAction.h"
|
||||
#include "BufferView.h"
|
||||
@ -246,7 +247,8 @@ void MiniBuffer::prepare()
|
||||
text.erase();
|
||||
fl_set_input(the_buffer, "");
|
||||
activate();
|
||||
fl_set_focus_object(owner_->getForm(), the_buffer);
|
||||
fl_set_focus_object(static_cast<XFormsView *>(owner_)->getForm(),
|
||||
the_buffer);
|
||||
}
|
||||
|
||||
|
||||
|
43
src/text2.C
43
src/text2.C
@ -758,6 +758,8 @@ void LyXText::redoHeightOfParagraph(BufferView * bview, LyXCursor const & cur)
|
||||
int y = cur.y() - tmprow->baseline();
|
||||
|
||||
setHeightOfRow(bview, tmprow);
|
||||
|
||||
#if 0
|
||||
Paragraph * first_phys_par = tmprow->par();
|
||||
|
||||
// find the first row of the paragraph
|
||||
@ -773,6 +775,13 @@ void LyXText::redoHeightOfParagraph(BufferView * bview, LyXCursor const & cur)
|
||||
y -= tmprow->height();
|
||||
setHeightOfRow(bview, tmprow);
|
||||
}
|
||||
#else
|
||||
while (tmprow->previous() && tmprow->previous()->par() == tmprow->par()) {
|
||||
tmprow = tmprow->previous();
|
||||
y -= tmprow->height();
|
||||
setHeightOfRow(bview, tmprow);
|
||||
}
|
||||
#endif
|
||||
|
||||
// we can set the refreshing parameters now
|
||||
status = LyXText::NEED_MORE_REFRESH;
|
||||
@ -788,6 +797,8 @@ void LyXText::redoDrawingOfParagraph(BufferView * bview, LyXCursor const & cur)
|
||||
|
||||
int y = cur.y() - tmprow->baseline();
|
||||
setHeightOfRow(bview, tmprow);
|
||||
|
||||
#if 0
|
||||
Paragraph * first_phys_par = tmprow->par();
|
||||
|
||||
// find the first row of the paragraph
|
||||
@ -800,7 +811,12 @@ void LyXText::redoDrawingOfParagraph(BufferView * bview, LyXCursor const & cur)
|
||||
tmprow = tmprow->previous();
|
||||
y -= tmprow->height();
|
||||
}
|
||||
|
||||
#else
|
||||
while (tmprow->previous() && tmprow->previous()->par() == tmprow->par()) {
|
||||
tmprow = tmprow->previous();
|
||||
y -= tmprow->height();
|
||||
}
|
||||
#endif
|
||||
// we can set the refreshing parameters now
|
||||
if (status == LyXText::UNCHANGED || y < refresh_y) {
|
||||
refresh_y = y;
|
||||
@ -818,13 +834,15 @@ void LyXText::redoParagraphs(BufferView * bview, LyXCursor const & cur,
|
||||
Paragraph const * endpar) const
|
||||
{
|
||||
Row * tmprow2;
|
||||
Paragraph * tmppar = 0, * first_phys_par = 0;
|
||||
Paragraph * tmppar = 0;
|
||||
Paragraph * first_phys_par = 0;
|
||||
|
||||
Row * tmprow = cur.row();
|
||||
|
||||
int y = cur.y() - tmprow->baseline();
|
||||
|
||||
if (!tmprow->previous()){
|
||||
|
||||
#if 0
|
||||
if (!tmprow->previous()) {
|
||||
first_phys_par = firstParagraph(); // a trick/hack for UNDO
|
||||
} else {
|
||||
first_phys_par = tmprow->par();
|
||||
@ -841,7 +859,22 @@ void LyXText::redoParagraphs(BufferView * bview, LyXCursor const & cur,
|
||||
y -= tmprow->height();
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
if (!tmprow->previous()) {
|
||||
// a trick/hack for UNDO
|
||||
// Can somebody please tell me _why_ this solves
|
||||
// anything. (Lgb)
|
||||
first_phys_par = firstParagraph();
|
||||
} else {
|
||||
first_phys_par = tmprow->par();
|
||||
while (tmprow->previous()
|
||||
&& tmprow->previous()->par() == first_phys_par) {
|
||||
tmprow = tmprow->previous();
|
||||
y -= tmprow->height();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// we can set the refreshing parameters now
|
||||
status = LyXText::NEED_MORE_REFRESH;
|
||||
refresh_y = y;
|
||||
|
Loading…
Reference in New Issue
Block a user