From: John Levon Date: Thu, 23 May 2002 12:08:47 +0000 (+0000) Subject: guii2 X-Git-Tag: 1.6.10~19226 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=435d527581277fab8b1aa67888f17d8439d07693;p=features.git guii2 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4190 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/BufferView2.C b/src/BufferView2.C index a3e6691c44..996791f362 100644 --- a/src/BufferView2.C +++ b/src/BufferView2.C @@ -14,7 +14,7 @@ #include "buffer.h" #include "lyxcursor.h" #include "lyxtext.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "bufferlist.h" #include "lyxscreen.h" #include "LaTeX.h" diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 73e690de18..613cc3b363 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -10,7 +10,7 @@ #include "lyxtext.h" #include "lyxrow.h" #include "paragraph.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "commandtags.h" #include "lyxfunc.h" #include "debug.h" diff --git a/src/ChangeLog b/src/ChangeLog index 72ccf19648..1e1f157dee 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,16 +1,44 @@ 2002-05-23 John Levon - * src/Makefile.am: - * src/PainterBase.C: - * src/PainterBase.h: - * src/Painter.C: - * src/Painter.h: - * src/WorkArea.C: - * src/WorkArea.h: - * src/screen.C: - * src/tabular.C: - * src/text.C: - * src/text2.C: move Painter to frontends/ + * BufferView2.C: + * BufferView_pimpl.C: + * FontLoader.C: + * LyXView.h: + * LyXView.C: + * Makefile.am: + * WorkArea.C: + * XFormsView.h: + * XFormsView.C: + * buffer.C: + * bufferlist.C: + * bufferview_funcs.C: + * converter.C: + * importer.C: + * lyx_cb.C: + * lyx_gui.C: + * lyx_main.C: + * lyx_find.C: + * lyxfunc.C: + * lyxvc.C: + * minibuffer.C: + * text.C: + * text2.C: + * trans.C: + * vc-backend.C: move LyX/XFormsView into frontends/ + +2002-05-23 John Levon + + * Makefile.am: + * PainterBase.C: + * PainterBase.h: + * Painter.C: + * Painter.h: + * WorkArea.C: + * WorkArea.h: + * screen.C: + * tabular.C: + * text.C: + * text2.C: move Painter to frontends/ 2002-05-22 Lars Gullik Bjønnes diff --git a/src/FontLoader.C b/src/FontLoader.C index 7567dde5be..8d08bb9dd8 100644 --- a/src/FontLoader.C +++ b/src/FontLoader.C @@ -21,7 +21,7 @@ #include "debug.h" #include "lyxrc.h" // lyxrc.font_* #include "BufferView.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "frontends/GUIRunTime.h" using std::endl; diff --git a/src/LyXView.C b/src/LyXView.C deleted file mode 100644 index 561e644f1c..0000000000 --- a/src/LyXView.C +++ /dev/null @@ -1,247 +0,0 @@ -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright 1995 Matthias Ettrich - * Copyright 1995-2001 The LyX Team. - * - * ====================================================== */ - -#include - -#ifdef __GNUG__ -#pragma implementation -#endif - -#include "LyXView.h" -#include "minibuffer.h" -#include "debug.h" -#include "intl.h" -#include "lyxrc.h" -#include "lyxtext.h" -#include "buffer.h" -#include "MenuBackend.h" -#include "bufferview_funcs.h" // CurrentState() -#include "gettext.h" -#include "lyxfunc.h" -#include "BufferView.h" -#include "lyxtextclasslist.h" - -#include "frontends/Dialogs.h" -#include "frontends/Toolbar.h" -#include "frontends/Timeout.h" -#include "frontends/Menubar.h" - -#include "support/filetools.h" // OnlyFilename() - -#include -#include - -using std::endl; - -extern void AutoSave(BufferView *); -extern void QuitLyX(); - -string current_layout; - - -LyXView::LyXView() -{ - lyxerr[Debug::INIT] << "Initializing LyXFunc" << endl; - lyxfunc = new LyXFunc(this); - - intl = new Intl; - - // Give the timeout some default sensible value. - autosave_timeout = new Timeout(5000); - - dialogs_ = new Dialogs(this); - Dialogs::redrawGUI.connect(SigC::slot(this, &LyXView::redraw)); -} - - -LyXView::~LyXView() -{ - delete menubar; - delete toolbar; - delete bufferview; - delete minibuffer; - delete lyxfunc; - delete intl; - delete autosave_timeout; - delete dialogs_; -} - - -void LyXView::resize() -{ - view()->resize(); -} - - -/// returns the buffer currently shown in the main form. -Buffer * LyXView::buffer() const -{ - return bufferview->buffer(); -} - - -BufferView * LyXView::view() const -{ - return bufferview; -} - - -Toolbar * LyXView::getToolbar() const -{ - return toolbar; -} - - -void LyXView::setLayout(string const & layout) -{ - toolbar->setLayout(layout); -} - - -void LyXView::updateToolbar() -{ - toolbar->update(); -} - - -LyXFunc * LyXView::getLyXFunc() const -{ - return lyxfunc; -} - - -MiniBuffer * LyXView::getMiniBuffer() const -{ - return minibuffer; -} - - -void LyXView::message(string const & str) -{ - minibuffer->message(str); -} - - -void LyXView::messagePush(string const & str) -{ - minibuffer->messagePush(str); -} - - -void LyXView::messagePop() -{ - minibuffer->messagePop(); -} - - -Menubar * LyXView::getMenubar() const -{ - return menubar; -} - - -void LyXView::updateMenubar() -{ - if ((!view() || !view()->buffer()) - && menubackend.hasMenu("main_nobuffer")) - menubar->set("main_nobuffer"); - else - menubar->set("main"); - menubar->update(); -} - - -Intl * LyXView::getIntl() const -{ - return intl; -} - - -// Callback for autosave timer -void LyXView::AutoSave() -{ - lyxerr[Debug::INFO] << "Running AutoSave()" << endl; - if (view()->available()) - ::AutoSave(view()); -} - - -/// Reset autosave timer -void LyXView::resetAutosaveTimer() -{ - if (lyxrc.autosave) - autosave_timeout->restart(); -} - - -void LyXView::invalidateLayoutChoice() -{ - last_textclass = -1; -} - - -void LyXView::updateLayoutChoice() -{ - // This has a side-effect that the layouts are not showed when no - // document is loaded. - if (!view() || !view()->buffer()) { - toolbar->clearLayoutList(); - return; - } - - // Update the layout display - if (last_textclass != int(buffer()->params.textclass)) { - toolbar->updateLayoutList(true); - last_textclass = int(buffer()->params.textclass); - current_layout = textclasslist[last_textclass].defaultLayoutName(); - } else { - toolbar->updateLayoutList(false); - } - - string const & layout = - bufferview->getLyXText()->cursor.par()->layout(); - - if (layout != current_layout) { - toolbar->setLayout(layout); - current_layout = layout; - } -} - - -// Updates the title of the window with the filename of the current document -void LyXView::updateWindowTitle() -{ - static string last_title = "LyX"; - string title = "LyX"; - string icon_title = "LyX"; - - if (view()->available()) { - string const cur_title = buffer()->fileName(); - if (!cur_title.empty()) { - title += ": " + MakeDisplayPath(cur_title, 30); - if (!buffer()->isLyxClean()) - title += _(" (Changed)"); - if (buffer()->isReadonly()) - title += _(" (read only)"); - /* Show only the filename if it's available. */ - icon_title = OnlyFilename(cur_title); - } - } - if (title != last_title) { - setWindowTitle(title, icon_title); - last_title = title; - } -} - - -void LyXView::showState() -{ - message(currentState(view())); -} diff --git a/src/LyXView.h b/src/LyXView.h deleted file mode 100644 index 425469ac88..0000000000 --- a/src/LyXView.h +++ /dev/null @@ -1,131 +0,0 @@ -// -*- C++ -*- - -#ifndef LYXVIEW_BASE_H -#define LYXVIEW_BASE_H - -#ifdef __GNUG__ -#pragma interface -#endif - -#include -#include - -#include "LString.h" -#include "support/types.h" - -class Buffer; -class Toolbar; -class MiniBuffer; -class Intl; -class Menubar; - -class BufferView; -class Dialogs; -class LyXFunc; -class Timeout; - -/// -class LyXView : public SigC::Object, boost::noncopyable { -public: - /// - 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. - virtual void redraw() = 0; - - /// Resize all BufferViews in this LyXView (because the width changed) - void resize(); - - /// returns the buffer currently shown in the main form. - Buffer * buffer() const; - - /// - BufferView * view() const; - - /// return a pointer to the toolbar - Toolbar * getToolbar() const; - - /// sets the layout in the toolbar layout combox - void setLayout(string const & layout); - /// update the toolbar - void updateToolbar(); - - /// return a pointer to the lyxfunc - LyXFunc * getLyXFunc() const; - - /// return a pointer to the minibuffer - MiniBuffer * getMiniBuffer() const; - - /// - void message(string const &); - /// - void messagePush(string const & str); - /// - void messagePop(); - - /// - Menubar * getMenubar() const; - - /// - void updateMenubar(); - - /// - Intl * getIntl() const; - - /// - Dialogs * getDialogs() { return dialogs_; } - - /// - void updateLayoutChoice(); - - /// Updates the title of the window - void updateWindowTitle(); - - /// Show state (toolbar and font in minibuffer) - void showState(); - - /// Reset autosave timer - void resetAutosaveTimer(); - /// - virtual void prohibitInput() const = 0; - /// - virtual void allowInput() const = 0; -protected: - /// - Menubar * menubar; - /// - 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; - /// - Intl * intl; - /// - Timeout * autosave_timeout; - /// A callback - void AutoSave(); - /// - void invalidateLayoutChoice(); -private: - /// - LyXFunc * lyxfunc; - /// - Dialogs * dialogs_; - /// - virtual void setWindowTitle(string const &, 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) */ - int last_textclass; -}; -#endif diff --git a/src/Makefile.am b/src/Makefile.am index 6265f693e8..ab93038cc3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -76,8 +76,6 @@ lyx_SOURCES = \ Lsstream.h \ LyXAction.C \ LyXAction.h \ - LyXView.C \ - LyXView.h \ MenuBackend.C \ MenuBackend.h \ ParagraphParameters.C \ @@ -95,8 +93,6 @@ lyx_SOURCES = \ ToolbarDefaults.h \ WorkArea.C \ WorkArea.h \ - XFormsView.C \ - XFormsView.h \ box.h \ box.C \ broken_headers.h \ @@ -218,8 +214,6 @@ lyx_SOURCES = \ undo.h \ undo_funcs.C \ undo_funcs.h \ - undostack.C \ - undostack.h \ vc-backend.C \ vc-backend.h \ version.C \ diff --git a/src/WorkArea.C b/src/WorkArea.C index cb114c60e0..d2235da633 100644 --- a/src/WorkArea.C +++ b/src/WorkArea.C @@ -16,7 +16,7 @@ #include "WorkArea.h" #include "debug.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxrc.h" // lyxrc.show_banner #include "version.h" // lyx_version @@ -574,12 +574,10 @@ int WorkArea::event_cb(XEvent * xev) case SelectionRequest: lyxerr[Debug::GUI] << "X requested selection." << endl; selectionRequested.emit(); -// ret = 1; break; case SelectionClear: lyxerr[Debug::GUI] << "Lost selection." << endl; selectionLost.emit(); -// ret = 1; break; } return ret; diff --git a/src/XFormsView.C b/src/XFormsView.C deleted file mode 100644 index bb73db762b..0000000000 --- a/src/XFormsView.C +++ /dev/null @@ -1,258 +0,0 @@ -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright 1995 Matthias Ettrich - * Copyright 1995-2001 The LyX Team. - * - * ====================================================== */ - -#include - -#ifdef __GNUG__ -#pragma implementation -#endif - -#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 "frontends/Timeout.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" { - -static -int C_XFormsView_atCloseMainFormCB(FL_FORM * form, void * p) -{ - return XFormsView::atCloseMainFormCB(form, p); -} - -} - - -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; -} - - -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_set_form_minsize(form_, form_->w, form_->h); - 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(); - - minibuffer->dd_init(); -} - - -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, string const & icon_title) -{ - fl_set_form_title(form_, title.c_str()); - fl_winicontitle(form_->window, icon_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(); -} diff --git a/src/XFormsView.h b/src/XFormsView.h deleted file mode 100644 index f96cc9d5e9..0000000000 --- a/src/XFormsView.h +++ /dev/null @@ -1,59 +0,0 @@ -// -*- 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 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: - /// pass the title, and the iconified title - virtual void setWindowTitle(string const &, string const &); - /// makes the main form. - void create_form_form_main(int width, int height); - /// A pointer to the form. - FL_FORM * form_; -}; -#endif diff --git a/src/buffer.C b/src/buffer.C index 5aee0fe97e..3da303c631 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -31,7 +31,7 @@ #include "version.h" #include "LaTeX.h" #include "Chktex.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "debug.h" #include "LaTeXFeatures.h" #include "lyxtext.h" @@ -735,7 +735,6 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par, LyXLex nylex(0, 0); nylex.setStream(istr); inset->read(this, nylex); - par->insertInset(pos, inset, font); ++pos; insertErtContents(par, pos); @@ -1768,7 +1767,6 @@ bool Buffer::save() const */ // Should probably have some more error checking here. - // Should be cleaned up in 0.13, at least a bit. // Doing it this way, also makes the inodes stay the same. // This is still not a very good solution, in particular we // might loose the owner of the backup. @@ -3610,7 +3608,6 @@ void Buffer::simpleDocBookOnePar(ostream & os, } -// This should be enabled when the Chktex class is implemented. (Asger) // chktex should be run with these flags disabled: 3, 22, 25, 30, 38(?) // Other flags: -wall -v0 -x int Buffer::runChktex() diff --git a/src/bufferlist.C b/src/bufferlist.C index 3b69c1d071..e93dddae89 100644 --- a/src/bufferlist.C +++ b/src/bufferlist.C @@ -28,7 +28,7 @@ #include "bufferview_funcs.h" #include "BufferView.h" #include "gettext.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "vc-backend.h" #include "TextCache.h" #include "lyxtextclasslist.h" diff --git a/src/bufferview_funcs.C b/src/bufferview_funcs.C index 768f700a9b..d6f804083a 100644 --- a/src/bufferview_funcs.C +++ b/src/bufferview_funcs.C @@ -15,7 +15,7 @@ #endif #include "bufferview_funcs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "BufferView.h" #include "paragraph.h" #include "lyxfont.h" @@ -206,7 +206,7 @@ string const currentState(BufferView * bv) } -/* -------> Does the actual toggle job of the XxxCB() calls above. +/* Does the actual toggle job of the calls above. * Also shows the current font state. */ void toggleAndShow(BufferView * bv, LyXFont const & font, bool toggleall) diff --git a/src/converter.C b/src/converter.C index d192e26aca..843d8477ed 100644 --- a/src/converter.C +++ b/src/converter.C @@ -21,7 +21,7 @@ #include "buffer.h" #include "bufferview_funcs.h" #include "LaTeX.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyx_cb.h" // ShowMessage() #include "gettext.h" #include "BufferView.h" diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index 69d9685f28..70fd733d9c 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,10 @@ +2002-05-23 John Levon + + * Liason.C: + * LyXView.h: + * LyXView.C: + * Makefile.am: move LyXView here + 2002-05-23 John Levon * Makefile.am: diff --git a/src/frontends/Liason.C b/src/frontends/Liason.C index ee8d456c83..cda33f196f 100644 --- a/src/frontends/Liason.C +++ b/src/frontends/Liason.C @@ -18,7 +18,7 @@ #include "lyxrc.h" #include "PrinterParams.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "BufferView.h" #include "buffer.h" #include "exporter.h" diff --git a/src/frontends/LyXView.C b/src/frontends/LyXView.C new file mode 100644 index 0000000000..63f7559d7b --- /dev/null +++ b/src/frontends/LyXView.C @@ -0,0 +1,247 @@ +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 1995 Matthias Ettrich + * Copyright 1995-2001 The LyX Team. + * + * ====================================================== */ + +#include + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include "frontends/LyXView.h" +#include "minibuffer.h" +#include "debug.h" +#include "intl.h" +#include "lyxrc.h" +#include "lyxtext.h" +#include "buffer.h" +#include "MenuBackend.h" +#include "bufferview_funcs.h" // CurrentState() +#include "gettext.h" +#include "lyxfunc.h" +#include "BufferView.h" +#include "lyxtextclasslist.h" + +#include "frontends/Dialogs.h" +#include "frontends/Toolbar.h" +#include "frontends/Timeout.h" +#include "frontends/Menubar.h" + +#include "support/filetools.h" // OnlyFilename() + +#include +#include + +using std::endl; + +extern void AutoSave(BufferView *); +extern void QuitLyX(); + +string current_layout; + + +LyXView::LyXView() +{ + lyxerr[Debug::INIT] << "Initializing LyXFunc" << endl; + lyxfunc = new LyXFunc(this); + + intl = new Intl; + + // Give the timeout some default sensible value. + autosave_timeout = new Timeout(5000); + + dialogs_ = new Dialogs(this); + Dialogs::redrawGUI.connect(SigC::slot(this, &LyXView::redraw)); +} + + +LyXView::~LyXView() +{ + delete menubar; + delete toolbar; + delete bufferview; + delete minibuffer; + delete lyxfunc; + delete intl; + delete autosave_timeout; + delete dialogs_; +} + + +void LyXView::resize() +{ + view()->resize(); +} + + +/// returns the buffer currently shown in the main form. +Buffer * LyXView::buffer() const +{ + return bufferview->buffer(); +} + + +BufferView * LyXView::view() const +{ + return bufferview; +} + + +Toolbar * LyXView::getToolbar() const +{ + return toolbar; +} + + +void LyXView::setLayout(string const & layout) +{ + toolbar->setLayout(layout); +} + + +void LyXView::updateToolbar() +{ + toolbar->update(); +} + + +LyXFunc * LyXView::getLyXFunc() const +{ + return lyxfunc; +} + + +MiniBuffer * LyXView::getMiniBuffer() const +{ + return minibuffer; +} + + +void LyXView::message(string const & str) +{ + minibuffer->message(str); +} + + +void LyXView::messagePush(string const & str) +{ + minibuffer->messagePush(str); +} + + +void LyXView::messagePop() +{ + minibuffer->messagePop(); +} + + +Menubar * LyXView::getMenubar() const +{ + return menubar; +} + + +void LyXView::updateMenubar() +{ + if ((!view() || !view()->buffer()) + && menubackend.hasMenu("main_nobuffer")) + menubar->set("main_nobuffer"); + else + menubar->set("main"); + menubar->update(); +} + + +Intl * LyXView::getIntl() const +{ + return intl; +} + + +// Callback for autosave timer +void LyXView::AutoSave() +{ + lyxerr[Debug::INFO] << "Running AutoSave()" << endl; + if (view()->available()) + ::AutoSave(view()); +} + + +/// Reset autosave timer +void LyXView::resetAutosaveTimer() +{ + if (lyxrc.autosave) + autosave_timeout->restart(); +} + + +void LyXView::invalidateLayoutChoice() +{ + last_textclass = -1; +} + + +void LyXView::updateLayoutChoice() +{ + // This has a side-effect that the layouts are not showed when no + // document is loaded. + if (!view() || !view()->buffer()) { + toolbar->clearLayoutList(); + return; + } + + // Update the layout display + if (last_textclass != int(buffer()->params.textclass)) { + toolbar->updateLayoutList(true); + last_textclass = int(buffer()->params.textclass); + current_layout = textclasslist[last_textclass].defaultLayoutName(); + } else { + toolbar->updateLayoutList(false); + } + + string const & layout = + bufferview->getLyXText()->cursor.par()->layout(); + + if (layout != current_layout) { + toolbar->setLayout(layout); + current_layout = layout; + } +} + + +// Updates the title of the window with the filename of the current document +void LyXView::updateWindowTitle() +{ + static string last_title = "LyX"; + string title = "LyX"; + string icon_title = "LyX"; + + if (view()->available()) { + string const cur_title = buffer()->fileName(); + if (!cur_title.empty()) { + title += ": " + MakeDisplayPath(cur_title, 30); + if (!buffer()->isLyxClean()) + title += _(" (Changed)"); + if (buffer()->isReadonly()) + title += _(" (read only)"); + /* Show only the filename if it's available. */ + icon_title = OnlyFilename(cur_title); + } + } + if (title != last_title) { + setWindowTitle(title, icon_title); + last_title = title; + } +} + + +void LyXView::showState() +{ + message(currentState(view())); +} diff --git a/src/frontends/LyXView.h b/src/frontends/LyXView.h new file mode 100644 index 0000000000..425469ac88 --- /dev/null +++ b/src/frontends/LyXView.h @@ -0,0 +1,131 @@ +// -*- C++ -*- + +#ifndef LYXVIEW_BASE_H +#define LYXVIEW_BASE_H + +#ifdef __GNUG__ +#pragma interface +#endif + +#include +#include + +#include "LString.h" +#include "support/types.h" + +class Buffer; +class Toolbar; +class MiniBuffer; +class Intl; +class Menubar; + +class BufferView; +class Dialogs; +class LyXFunc; +class Timeout; + +/// +class LyXView : public SigC::Object, boost::noncopyable { +public: + /// + 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. + virtual void redraw() = 0; + + /// Resize all BufferViews in this LyXView (because the width changed) + void resize(); + + /// returns the buffer currently shown in the main form. + Buffer * buffer() const; + + /// + BufferView * view() const; + + /// return a pointer to the toolbar + Toolbar * getToolbar() const; + + /// sets the layout in the toolbar layout combox + void setLayout(string const & layout); + /// update the toolbar + void updateToolbar(); + + /// return a pointer to the lyxfunc + LyXFunc * getLyXFunc() const; + + /// return a pointer to the minibuffer + MiniBuffer * getMiniBuffer() const; + + /// + void message(string const &); + /// + void messagePush(string const & str); + /// + void messagePop(); + + /// + Menubar * getMenubar() const; + + /// + void updateMenubar(); + + /// + Intl * getIntl() const; + + /// + Dialogs * getDialogs() { return dialogs_; } + + /// + void updateLayoutChoice(); + + /// Updates the title of the window + void updateWindowTitle(); + + /// Show state (toolbar and font in minibuffer) + void showState(); + + /// Reset autosave timer + void resetAutosaveTimer(); + /// + virtual void prohibitInput() const = 0; + /// + virtual void allowInput() const = 0; +protected: + /// + Menubar * menubar; + /// + 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; + /// + Intl * intl; + /// + Timeout * autosave_timeout; + /// A callback + void AutoSave(); + /// + void invalidateLayoutChoice(); +private: + /// + LyXFunc * lyxfunc; + /// + Dialogs * dialogs_; + /// + virtual void setWindowTitle(string const &, 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) */ + int last_textclass; +}; +#endif diff --git a/src/frontends/Makefile.am b/src/frontends/Makefile.am index f4f4bbbf7f..f54c3cca05 100644 --- a/src/frontends/Makefile.am +++ b/src/frontends/Makefile.am @@ -31,4 +31,6 @@ libfrontends_la_SOURCES = \ Timeout.C \ Timeout.h \ Toolbar.C \ - Toolbar.h + Toolbar.h \ + LyXView.C \ + LyXView.h diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 013220b30c..c9028c63f8 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,36 @@ +2002-05-23 John Levon + + * ControlAboutlyx.C: + * ControlBibitem.C: + * ControlBibtex.C: + * ControlCharacter.C: + * ControlCitation.C: + * ControlCommand.C: + * ControlConnections.C: + * ControlERT.C: + * ControlError.C: + * ControlExternal.C: + * ControlFloat.C: + * ControlForks.C: + * ControlGraphics.C: + * ControlInclude.C: + * ControlIndex.C: + * ControlLog.C: + * ControlMinipage.C: + * ControlPreamble.C: + * ControlPrint.C: + * ControlRef.C: + * ControlSearch.C: + * ControlSendto.C: + * ControlShowFile.C: + * ControlSpellchecker.C: + * ControlTabularCreate.C: + * ControlTexinfo.C: + * ControlThesaurus.C: + * ControlToc.C: + * ControlUrl.C: + * ControlVCLog.C: LyXView moved into frontends + 2002-05-22 Lars Gullik Bjønnes * ControlExternal.C: add scoped_ptr.hpp diff --git a/src/frontends/controllers/ControlAboutlyx.C b/src/frontends/controllers/ControlAboutlyx.C index d7d5412d1d..744f4bcd58 100644 --- a/src/frontends/controllers/ControlAboutlyx.C +++ b/src/frontends/controllers/ControlAboutlyx.C @@ -18,7 +18,7 @@ #include "ButtonControllerBase.h" #include "ControlAboutlyx.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "Lsstream.h" #include "BufferView.h" #include "gettext.h" diff --git a/src/frontends/controllers/ControlBibitem.C b/src/frontends/controllers/ControlBibitem.C index b1e2b884b5..01aca77208 100644 --- a/src/frontends/controllers/ControlBibitem.C +++ b/src/frontends/controllers/ControlBibitem.C @@ -23,7 +23,7 @@ #include "ButtonControllerBase.h" #include "ControlBibitem.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "buffer.h" #include "BufferView.h" diff --git a/src/frontends/controllers/ControlBibtex.C b/src/frontends/controllers/ControlBibtex.C index 085309becb..e9cc2e44ab 100644 --- a/src/frontends/controllers/ControlBibtex.C +++ b/src/frontends/controllers/ControlBibtex.C @@ -24,7 +24,7 @@ #include "ButtonControllerBase.h" #include "ControlBibtex.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "buffer.h" #include "BufferView.h" #include "lyxrc.h" diff --git a/src/frontends/controllers/ControlCharacter.C b/src/frontends/controllers/ControlCharacter.C index a00011273a..ddf3a08621 100644 --- a/src/frontends/controllers/ControlCharacter.C +++ b/src/frontends/controllers/ControlCharacter.C @@ -20,7 +20,7 @@ #include "buffer.h" #include "Dialogs.h" #include "Liason.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "bufferview_funcs.h" // ToggleAndShow #include "gettext.h" #include "language.h" diff --git a/src/frontends/controllers/ControlCitation.C b/src/frontends/controllers/ControlCitation.C index d7852e334d..3b22dd7c98 100644 --- a/src/frontends/controllers/ControlCitation.C +++ b/src/frontends/controllers/ControlCitation.C @@ -23,7 +23,7 @@ #include "ControlCitation.h" #include "buffer.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" // need to #include this in _one_ of the ControlCommand-derived classses in // order to instantiate diff --git a/src/frontends/controllers/ControlCommand.C b/src/frontends/controllers/ControlCommand.C index 35226c7c53..1eb3cab3cb 100644 --- a/src/frontends/controllers/ControlCommand.C +++ b/src/frontends/controllers/ControlCommand.C @@ -23,7 +23,7 @@ #include "ControlInset.tmpl" #include "buffer.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxfunc.h" #include "BufferView.h" diff --git a/src/frontends/controllers/ControlConnections.C b/src/frontends/controllers/ControlConnections.C index ca90b5ee77..f2d3eb3173 100644 --- a/src/frontends/controllers/ControlConnections.C +++ b/src/frontends/controllers/ControlConnections.C @@ -20,7 +20,7 @@ #include "ViewBase.h" #include "ControlConnections.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "buffer.h" using SigC::slot; diff --git a/src/frontends/controllers/ControlERT.C b/src/frontends/controllers/ControlERT.C index 6115604b9a..a237d2c0a2 100644 --- a/src/frontends/controllers/ControlERT.C +++ b/src/frontends/controllers/ControlERT.C @@ -22,7 +22,7 @@ #include "ControlERT.h" #include "ControlInset.tmpl" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "buffer.h" #include "BufferView.h" diff --git a/src/frontends/controllers/ControlError.C b/src/frontends/controllers/ControlError.C index d6c94ea769..4d7696f915 100644 --- a/src/frontends/controllers/ControlError.C +++ b/src/frontends/controllers/ControlError.C @@ -22,7 +22,7 @@ #include "ControlError.h" #include "ControlInset.tmpl" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "buffer.h" #include "insets/inseterror.h" diff --git a/src/frontends/controllers/ControlExternal.C b/src/frontends/controllers/ControlExternal.C index 7de496d5b1..403686f740 100644 --- a/src/frontends/controllers/ControlExternal.C +++ b/src/frontends/controllers/ControlExternal.C @@ -25,7 +25,7 @@ #include "ControlInset.tmpl" #include "Dialogs.h" #include "Liason.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "ViewBase.h" #include "buffer.h" #include "frontends/Alert.h" diff --git a/src/frontends/controllers/ControlFloat.C b/src/frontends/controllers/ControlFloat.C index 64f22fde39..73a0c01e61 100644 --- a/src/frontends/controllers/ControlFloat.C +++ b/src/frontends/controllers/ControlFloat.C @@ -20,7 +20,7 @@ #include "ControlFloat.h" #include "ControlInset.tmpl" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "buffer.h" #include "BufferView.h" #include "insets/insetfloat.h" diff --git a/src/frontends/controllers/ControlForks.C b/src/frontends/controllers/ControlForks.C index 4ffbfb82bc..95c806125b 100644 --- a/src/frontends/controllers/ControlForks.C +++ b/src/frontends/controllers/ControlForks.C @@ -17,7 +17,7 @@ #include "ViewBase.h" #include "BufferView.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxfunc.h" #include "frontends/Dialogs.h" diff --git a/src/frontends/controllers/ControlGraphics.C b/src/frontends/controllers/ControlGraphics.C index b7b8d86fa8..07690ba99d 100644 --- a/src/frontends/controllers/ControlGraphics.C +++ b/src/frontends/controllers/ControlGraphics.C @@ -30,7 +30,7 @@ #include "buffer.h" #include "BufferView.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "gettext.h" #include "lyxrc.h" diff --git a/src/frontends/controllers/ControlInclude.C b/src/frontends/controllers/ControlInclude.C index a9134e0fbf..c289b026a1 100644 --- a/src/frontends/controllers/ControlInclude.C +++ b/src/frontends/controllers/ControlInclude.C @@ -23,7 +23,7 @@ #include "Alert.h" #include "BufferView.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxfunc.h" #include "gettext.h" #include "helper_funcs.h" diff --git a/src/frontends/controllers/ControlIndex.C b/src/frontends/controllers/ControlIndex.C index 6b2cd0702c..b4ee8784f5 100644 --- a/src/frontends/controllers/ControlIndex.C +++ b/src/frontends/controllers/ControlIndex.C @@ -22,7 +22,7 @@ #include "ControlIndex.h" #include "buffer.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" using SigC::slot; diff --git a/src/frontends/controllers/ControlLog.C b/src/frontends/controllers/ControlLog.C index c878e05042..d9ac1d4789 100644 --- a/src/frontends/controllers/ControlLog.C +++ b/src/frontends/controllers/ControlLog.C @@ -21,7 +21,7 @@ #include "ViewBase.h" #include "ButtonControllerBase.h" #include "ControlLog.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "Dialogs.h" #include "lyxrc.h" #include "BufferView.h" diff --git a/src/frontends/controllers/ControlMinipage.C b/src/frontends/controllers/ControlMinipage.C index f8fe7fe521..3cbd8579f8 100644 --- a/src/frontends/controllers/ControlMinipage.C +++ b/src/frontends/controllers/ControlMinipage.C @@ -22,7 +22,7 @@ #include "ControlMinipage.h" #include "ControlInset.tmpl" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "buffer.h" #include "BufferView.h" #include "helper_funcs.h" diff --git a/src/frontends/controllers/ControlPreamble.C b/src/frontends/controllers/ControlPreamble.C index 814b518289..20bbcc9a47 100644 --- a/src/frontends/controllers/ControlPreamble.C +++ b/src/frontends/controllers/ControlPreamble.C @@ -15,7 +15,7 @@ #include "ViewBase.h" #include "ButtonControllerBase.h" #include "ControlPreamble.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "Dialogs.h" #include "buffer.h" #include "lyxrc.h" diff --git a/src/frontends/controllers/ControlPrint.C b/src/frontends/controllers/ControlPrint.C index 0526472a5f..37673096bc 100644 --- a/src/frontends/controllers/ControlPrint.C +++ b/src/frontends/controllers/ControlPrint.C @@ -23,7 +23,7 @@ #include "ControlPrint.h" #include "buffer.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "PrinterParams.h" #include "Liason.h" #include "helper_funcs.h" diff --git a/src/frontends/controllers/ControlRef.C b/src/frontends/controllers/ControlRef.C index 5aac880b9c..4f98837756 100644 --- a/src/frontends/controllers/ControlRef.C +++ b/src/frontends/controllers/ControlRef.C @@ -22,11 +22,12 @@ #include "ButtonControllerBase.h" #include "ControlRef.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "buffer.h" #include "lyxfunc.h" #include "bufferlist.h" #include "support/filetools.h" // MakeAbsPath, MakeDisplayPath +#include "debug.h" using SigC::slot; using std::vector; diff --git a/src/frontends/controllers/ControlSearch.C b/src/frontends/controllers/ControlSearch.C index 958238e2ac..46a971191a 100644 --- a/src/frontends/controllers/ControlSearch.C +++ b/src/frontends/controllers/ControlSearch.C @@ -22,7 +22,7 @@ #include "ControlSearch.h" #include "Dialogs.h" #include "Liason.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "buffer.h" #include "lyxfind.h" #include "debug.h" diff --git a/src/frontends/controllers/ControlSendto.C b/src/frontends/controllers/ControlSendto.C index 93e1467f0b..993536124c 100644 --- a/src/frontends/controllers/ControlSendto.C +++ b/src/frontends/controllers/ControlSendto.C @@ -17,7 +17,7 @@ #include "ButtonControllerBase.h" #include "ControlSendto.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "BufferView.h" #include "buffer.h" #include "converter.h" diff --git a/src/frontends/controllers/ControlShowFile.C b/src/frontends/controllers/ControlShowFile.C index f46100860b..90f8d2628a 100644 --- a/src/frontends/controllers/ControlShowFile.C +++ b/src/frontends/controllers/ControlShowFile.C @@ -17,7 +17,7 @@ #include "ButtonControllerBase.h" #include "ControlShowFile.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "BufferView.h" #include "gettext.h" #include "support/filetools.h" // FileSearch diff --git a/src/frontends/controllers/ControlSpellchecker.C b/src/frontends/controllers/ControlSpellchecker.C index c4e66b5443..01c24bf606 100644 --- a/src/frontends/controllers/ControlSpellchecker.C +++ b/src/frontends/controllers/ControlSpellchecker.C @@ -33,7 +33,7 @@ #include "buffer.h" #include "lyxrc.h" #include "BufferView.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxtext.h" #include "gettext.h" #include "support/lstrings.h" diff --git a/src/frontends/controllers/ControlTabularCreate.C b/src/frontends/controllers/ControlTabularCreate.C index ad7661e130..229732a6a9 100644 --- a/src/frontends/controllers/ControlTabularCreate.C +++ b/src/frontends/controllers/ControlTabularCreate.C @@ -21,7 +21,7 @@ #include "ControlTabularCreate.h" #include "BufferView.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxfunc.h" #include "support/lstrings.h" diff --git a/src/frontends/controllers/ControlTexinfo.C b/src/frontends/controllers/ControlTexinfo.C index 280be5d4a8..040192ce35 100644 --- a/src/frontends/controllers/ControlTexinfo.C +++ b/src/frontends/controllers/ControlTexinfo.C @@ -21,7 +21,7 @@ #include "ButtonControllerBase.h" #include "ControlTexinfo.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "BufferView.h" #include "gettext.h" #include "support/filetools.h" // FileSearch diff --git a/src/frontends/controllers/ControlThesaurus.C b/src/frontends/controllers/ControlThesaurus.C index 7486a4e4e9..44ac513931 100644 --- a/src/frontends/controllers/ControlThesaurus.C +++ b/src/frontends/controllers/ControlThesaurus.C @@ -17,7 +17,7 @@ #include "ControlThesaurus.h" #include "Dialogs.h" #include "Liason.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxfind.h" #include "buffer.h" #include "debug.h" diff --git a/src/frontends/controllers/ControlToc.C b/src/frontends/controllers/ControlToc.C index 20a9f596d1..65d509ad57 100644 --- a/src/frontends/controllers/ControlToc.C +++ b/src/frontends/controllers/ControlToc.C @@ -22,7 +22,7 @@ #include "ControlToc.h" #include "buffer.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxfunc.h" #include "support/lstrings.h" // tostr #include "gettext.h" diff --git a/src/frontends/controllers/ControlUrl.C b/src/frontends/controllers/ControlUrl.C index 174663f2be..96a8de5683 100644 --- a/src/frontends/controllers/ControlUrl.C +++ b/src/frontends/controllers/ControlUrl.C @@ -21,7 +21,7 @@ #include "ButtonControllerBase.h" #include "ControlUrl.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "buffer.h" using SigC::slot; diff --git a/src/frontends/controllers/ControlVCLog.C b/src/frontends/controllers/ControlVCLog.C index 4e79491e8c..e877b69f4b 100644 --- a/src/frontends/controllers/ControlVCLog.C +++ b/src/frontends/controllers/ControlVCLog.C @@ -25,7 +25,7 @@ #include "ControlVCLog.h" #include "buffer.h" #include "BufferView.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "Dialogs.h" #include "lyxrc.h" #include "support/lyxlib.h" diff --git a/src/frontends/gnome/ChangeLog b/src/frontends/gnome/ChangeLog index 9f6e784405..ffd4e43983 100644 --- a/src/frontends/gnome/ChangeLog +++ b/src/frontends/gnome/ChangeLog @@ -1,3 +1,7 @@ +2002-05-23 John Levon + + * FileDialog.C: LyXView moved into frontends/ + 2002-04-09 Michael A. Koziarski * dialoges/GERT.glade diff --git a/src/frontends/gnome/Dialogs.C b/src/frontends/gnome/Dialogs.C index 048129a267..94e9627886 100644 --- a/src/frontends/gnome/Dialogs.C +++ b/src/frontends/gnome/Dialogs.C @@ -17,7 +17,7 @@ #include "gettext.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "gnomeBC.h" #include "Tooltips.h" #include "GUI.h" diff --git a/src/frontends/gnome/FileDialog.C b/src/frontends/gnome/FileDialog.C index 3d57350753..8e950eb807 100644 --- a/src/frontends/gnome/FileDialog.C +++ b/src/frontends/gnome/FileDialog.C @@ -23,7 +23,7 @@ #include -#include "LyXView.h" // This is only needed while we have the xforms part! +#include "frontends/LyXView.h" // This is only needed while we have the xforms part! #include "bufferview_funcs.h" // FileDialog::Private diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index b8d24b4bd0..f753743bce 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2002-05-23 John Levon + + * QtLyXView.h: moved into frontends/ + 2002-05-22 Lars Gullik Bjønnes * QDocument.h: use more specific smart_ptr header. diff --git a/src/frontends/qt2/QtLyXView.h b/src/frontends/qt2/QtLyXView.h index 46288fe083..aca4b635a4 100644 --- a/src/frontends/qt2/QtLyXView.h +++ b/src/frontends/qt2/QtLyXView.h @@ -10,4 +10,4 @@ */ #undef emit -#include "LyXView.h" +#include "frontends/LyXView.h" diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index f198ce1c72..35834cf5b0 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,24 @@ +2002-05-23 John Levon + + * DropDown.h: + * FileDialog.C: + * FormBaseDeprecated.C: + * FormDocument.C: + * FormIndex.C: + * FormInset.C: + * FormMathsBitmap.C: + * FormMathsDelim.C: + * FormMathsMatrix.C: + * FormMathsPanel.C: + * FormParagraph.C: + * FormPreferences.C: + * FormPrint.C: + * FormTabular.C: + * Makefile.am: + * XFormsView.h: + * XFormsView.C: LyXView is now in frontends/, + XFormsView moved to here + 2002-05-23 John Levon * Makefile.am: diff --git a/src/frontends/xforms/DropDown.h b/src/frontends/xforms/DropDown.h index e5be63abc4..42eeac46cf 100644 --- a/src/frontends/xforms/DropDown.h +++ b/src/frontends/xforms/DropDown.h @@ -14,7 +14,7 @@ #pragma interface #endif -#include "LyXView.h" +#include "frontends/LyXView.h" #include #include "LString.h" #include FORMS_H_LOCATION diff --git a/src/frontends/xforms/FileDialog.C b/src/frontends/xforms/FileDialog.C index ade7afffbd..fc8b0e10e5 100644 --- a/src/frontends/xforms/FileDialog.C +++ b/src/frontends/xforms/FileDialog.C @@ -17,7 +17,7 @@ // temp. hack until Allow/prohibitInput is not // needed any more in src/ - for now it's simplest // to leave it there -#include "LyXView.h" +#include "frontends/LyXView.h" #include "bufferview_funcs.h" #include "gettext.h" #include "commandtags.h" diff --git a/src/frontends/xforms/FormBaseDeprecated.C b/src/frontends/xforms/FormBaseDeprecated.C index 41c808f0c4..8b5b2fe731 100644 --- a/src/frontends/xforms/FormBaseDeprecated.C +++ b/src/frontends/xforms/FormBaseDeprecated.C @@ -18,7 +18,7 @@ #include "xforms_resize.h" #include "GUIRunTime.h" #include "Tooltips.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxrc.h" #include "support/LAssert.h" @@ -98,7 +98,7 @@ void FormBaseDeprecated::show() } fl_freeze_form(form()); - update(); // make sure its up-to-date + update(); fl_unfreeze_form(form()); if (form()->visible) { diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index ec42fc7be1..40e553cc31 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -27,7 +27,7 @@ #include "bmtable.h" #include "language.h" #include "frnt_lang.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxfunc.h" #include "lyxrc.h" #include "BufferView.h" diff --git a/src/frontends/xforms/FormIndex.C b/src/frontends/xforms/FormIndex.C index 369fa138b2..98aa975cbe 100644 --- a/src/frontends/xforms/FormIndex.C +++ b/src/frontends/xforms/FormIndex.C @@ -15,7 +15,7 @@ #include "xformsBC.h" #include "ControlIndex.h" #include "FormIndex.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "form_index.h" typedef FormCB > base_class; diff --git a/src/frontends/xforms/FormInset.C b/src/frontends/xforms/FormInset.C index 5f6c102cc5..34a1cb7157 100644 --- a/src/frontends/xforms/FormInset.C +++ b/src/frontends/xforms/FormInset.C @@ -15,7 +15,7 @@ #endif #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "FormInset.h" #include "xformsBC.h" diff --git a/src/frontends/xforms/FormMathsBitmap.C b/src/frontends/xforms/FormMathsBitmap.C index 4a5423c8d7..39bec4ad14 100644 --- a/src/frontends/xforms/FormMathsBitmap.C +++ b/src/frontends/xforms/FormMathsBitmap.C @@ -21,7 +21,7 @@ #include "FormMathsBitmap.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "bmtable.h" #include "debug.h" #include "xforms_helpers.h" diff --git a/src/frontends/xforms/FormMathsDelim.C b/src/frontends/xforms/FormMathsDelim.C index a744c3524f..257dcd0735 100644 --- a/src/frontends/xforms/FormMathsDelim.C +++ b/src/frontends/xforms/FormMathsDelim.C @@ -18,7 +18,7 @@ #include "FormMathsDelim.h" #include "form_maths_delim.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "bmtable.h" #include "debug.h" #include "support/lstrings.h" diff --git a/src/frontends/xforms/FormMathsMatrix.C b/src/frontends/xforms/FormMathsMatrix.C index 3e4ae0e14e..b443c57b3d 100644 --- a/src/frontends/xforms/FormMathsMatrix.C +++ b/src/frontends/xforms/FormMathsMatrix.C @@ -20,7 +20,7 @@ #include "FormMathsMatrix.h" #include "form_maths_matrix.h" #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "Lsstream.h" #include "lyxfunc.h" #include "support/LAssert.h" diff --git a/src/frontends/xforms/FormMathsPanel.C b/src/frontends/xforms/FormMathsPanel.C index 00ccc44891..a9cc5b6dd9 100644 --- a/src/frontends/xforms/FormMathsPanel.C +++ b/src/frontends/xforms/FormMathsPanel.C @@ -16,7 +16,7 @@ #endif #include "Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "FormMathsPanel.h" #include "form_maths_panel.h" #include "MathsSymbols.h" diff --git a/src/frontends/xforms/FormParagraph.C b/src/frontends/xforms/FormParagraph.C index 610035ba28..67ca2674cf 100644 --- a/src/frontends/xforms/FormParagraph.C +++ b/src/frontends/xforms/FormParagraph.C @@ -18,7 +18,7 @@ #include "form_paragraph.h" #include "Dialogs.h" #include "Liason.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "buffer.h" #include "lyxtext.h" #include "xforms_helpers.h" diff --git a/src/frontends/xforms/FormPreferences.C b/src/frontends/xforms/FormPreferences.C index 34dee4f661..12b6aae30b 100644 --- a/src/frontends/xforms/FormPreferences.C +++ b/src/frontends/xforms/FormPreferences.C @@ -20,7 +20,7 @@ #include "buffer.h" #include "converter.h" #include "debug.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "language.h" #include "frnt_lang.h" #include "lyxfunc.h" diff --git a/src/frontends/xforms/FormPrint.C b/src/frontends/xforms/FormPrint.C index 340424dfbc..41924a46d2 100644 --- a/src/frontends/xforms/FormPrint.C +++ b/src/frontends/xforms/FormPrint.C @@ -18,7 +18,7 @@ #include "FormPrint.h" #include "form_print.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "PrinterParams.h" diff --git a/src/frontends/xforms/FormTabular.C b/src/frontends/xforms/FormTabular.C index 5b58392bb0..d9c1899ad7 100644 --- a/src/frontends/xforms/FormTabular.C +++ b/src/frontends/xforms/FormTabular.C @@ -16,7 +16,7 @@ #include "FormTabular.h" #include "form_tabular.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "Dialogs.h" #include "buffer.h" #include "xforms_helpers.h" diff --git a/src/frontends/xforms/Makefile.am b/src/frontends/xforms/Makefile.am index a774fa5098..f32f0f37af 100644 --- a/src/frontends/xforms/Makefile.am +++ b/src/frontends/xforms/Makefile.am @@ -208,8 +208,10 @@ libxforms_la_SOURCES = \ Toolbar_pimpl.h \ Tooltips.C \ Tooltips.h \ - XPainter.h \ + XFormsView.C \ + XFormsView.h \ XPainter.C \ + XPainter.h \ xforms_helpers.C \ xforms_helpers.h \ xforms_resize.C \ diff --git a/src/frontends/xforms/XFormsView.C b/src/frontends/xforms/XFormsView.C new file mode 100644 index 0000000000..bb73db762b --- /dev/null +++ b/src/frontends/xforms/XFormsView.C @@ -0,0 +1,258 @@ +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 1995 Matthias Ettrich + * Copyright 1995-2001 The LyX Team. + * + * ====================================================== */ + +#include + +#ifdef __GNUG__ +#pragma implementation +#endif + +#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 "frontends/Timeout.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" { + +static +int C_XFormsView_atCloseMainFormCB(FL_FORM * form, void * p) +{ + return XFormsView::atCloseMainFormCB(form, p); +} + +} + + +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; +} + + +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_set_form_minsize(form_, form_->w, form_->h); + 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(); + + minibuffer->dd_init(); +} + + +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, string const & icon_title) +{ + fl_set_form_title(form_, title.c_str()); + fl_winicontitle(form_->window, icon_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(); +} diff --git a/src/frontends/xforms/XFormsView.h b/src/frontends/xforms/XFormsView.h new file mode 100644 index 0000000000..762bb32c4b --- /dev/null +++ b/src/frontends/xforms/XFormsView.h @@ -0,0 +1,59 @@ +// -*- 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 FORMS_H_LOCATION + +#include "frontends/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: + /// pass the title, and the iconified title + virtual void setWindowTitle(string const &, string const &); + /// makes the main form. + void create_form_form_main(int width, int height); + /// A pointer to the form. + FL_FORM * form_; +}; +#endif diff --git a/src/importer.C b/src/importer.C index 563651d465..59b943a07d 100644 --- a/src/importer.C +++ b/src/importer.C @@ -18,7 +18,7 @@ #include "importer.h" #include "converter.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxfunc.h" #include "bufferlist.h" diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index e4ea1516f9..291df21dd5 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,23 @@ +2002-05-23 John Levon + + * insetbib.C: + * insetcite.C: + * inseterror.C: + * insetert.C: + * insetexternal.C: + * insetfloat.C: + * insetfloatlist.C: + * insetgraphics.C: + * insetinclude.C: + * insetindex.C: + * insetminipage.C: + * insetparent.C: + * insetref.C: + * insettabular.C: + * insettext.C: + * insettoc.C: + * inseturl.C: LyXView moved into frontends/ + 2002-05-23 John Levon * inset.C: diff --git a/src/insets/insetbib.C b/src/insets/insetbib.C index 8b4ca13d18..ec4547eba2 100644 --- a/src/insets/insetbib.C +++ b/src/insets/insetbib.C @@ -12,7 +12,7 @@ #include "lyxtext.h" #include "lyxrc.h" #include "font.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxtextclasslist.h" #include "frontends/Dialogs.h" diff --git a/src/insets/insetcite.C b/src/insets/insetcite.C index edcfeb1e7d..a0b7ccf03b 100644 --- a/src/insets/insetcite.C +++ b/src/insets/insetcite.C @@ -17,7 +17,7 @@ #include "buffer.h" #include "BufferView.h" #include "LaTeXFeatures.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "debug.h" #include "gettext.h" diff --git a/src/insets/inseterror.C b/src/insets/inseterror.C index 23924528ac..f48761c025 100644 --- a/src/insets/inseterror.C +++ b/src/insets/inseterror.C @@ -19,7 +19,7 @@ #include "lyxfont.h" #include "gettext.h" #include "inseterror.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "frontends/Painter.h" #include "frontends/Dialogs.h" diff --git a/src/insets/insetert.C b/src/insets/insetert.C index 8471c83579..67fa7d8c19 100644 --- a/src/insets/insetert.C +++ b/src/insets/insetert.C @@ -19,7 +19,7 @@ #include "language.h" #include "buffer.h" #include "BufferView.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxtext.h" #include "debug.h" #include "lyxtextclasslist.h" diff --git a/src/insets/insetexternal.C b/src/insets/insetexternal.C index 35b8ace1b9..3a43e5069d 100644 --- a/src/insets/insetexternal.C +++ b/src/insets/insetexternal.C @@ -18,7 +18,7 @@ #include "ExternalTemplate.h" #include "BufferView.h" #include "buffer.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyx_main.h" #include "LaTeXFeatures.h" #include "gettext.h" diff --git a/src/insets/insetfloat.C b/src/insets/insetfloat.C index c458a9560a..cc733c4226 100644 --- a/src/insets/insetfloat.C +++ b/src/insets/insetfloat.C @@ -26,7 +26,7 @@ #include "debug.h" #include "Floating.h" #include "buffer.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "frontends/Dialogs.h" using std::ostream; diff --git a/src/insets/insetfloatlist.C b/src/insets/insetfloatlist.C index 7c146848c2..579989b378 100644 --- a/src/insets/insetfloatlist.C +++ b/src/insets/insetfloatlist.C @@ -8,7 +8,7 @@ #include "FloatList.h" #include "LaTeXFeatures.h" #include "frontends/Dialogs.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "BufferView.h" #include "buffer.h" #include "gettext.h" diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index 3ba1248838..f440b26991 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -81,7 +81,7 @@ TODO Before initial production release: #include "graphics/GraphicsCache.h" #include "graphics/GraphicsImage.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxtext.h" #include "buffer.h" #include "BufferView.h" diff --git a/src/insets/insetinclude.C b/src/insets/insetinclude.C index 8d4370243f..3bda5bea60 100644 --- a/src/insets/insetinclude.C +++ b/src/insets/insetinclude.C @@ -10,7 +10,7 @@ #include "BufferView.h" #include "debug.h" #include "lyxrc.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "LaTeXFeatures.h" #include "gettext.h" #include "lyxtextclasslist.h" diff --git a/src/insets/insetindex.C b/src/insets/insetindex.C index 1e673e71ec..85f2d2f395 100644 --- a/src/insets/insetindex.C +++ b/src/insets/insetindex.C @@ -6,7 +6,7 @@ #include "insetindex.h" #include "BufferView.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "frontends/Dialogs.h" #include "LaTeXFeatures.h" #include "gettext.h" diff --git a/src/insets/insetminipage.C b/src/insets/insetminipage.C index 9440b3def1..91bef6d40c 100644 --- a/src/insets/insetminipage.C +++ b/src/insets/insetminipage.C @@ -17,7 +17,7 @@ #include "gettext.h" #include "lyxfont.h" #include "BufferView.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "frontends/Dialogs.h" #include "lyxtext.h" #include "insets/insettext.h" diff --git a/src/insets/insetparent.C b/src/insets/insetparent.C index f516755bd1..90f2d98fb4 100644 --- a/src/insets/insetparent.C +++ b/src/insets/insetparent.C @@ -20,7 +20,7 @@ #include "insetparent.h" #include "support/filetools.h" #include "BufferView.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "support/LOstream.h" #include "commandtags.h" #include "buffer.h" diff --git a/src/insets/insetref.C b/src/insets/insetref.C index 1ad1209070..c9ad260e20 100644 --- a/src/insets/insetref.C +++ b/src/insets/insetref.C @@ -10,7 +10,7 @@ #include "debug.h" #include "gettext.h" #include "LaTeXFeatures.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "frontends/Dialogs.h" #include "lyxfunc.h" #include "BufferView.h" diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index 6c65dca7ff..f486a217f7 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -25,7 +25,7 @@ #include "frontends/Painter.h" #include "font.h" #include "lyxtext.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "insets/insettext.h" #include "debug.h" #include "gettext.h" diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 23741c9ebe..268613f621 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -21,7 +21,7 @@ #include "lyxfont.h" #include "commandtags.h" #include "buffer.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "BufferView.h" #include "lyxtextclasslist.h" #include "LaTeXFeatures.h" diff --git a/src/insets/insettoc.C b/src/insets/insettoc.C index 843dad55e9..5ba5af0665 100644 --- a/src/insets/insettoc.C +++ b/src/insets/insettoc.C @@ -7,7 +7,7 @@ #include "gettext.h" #include "insettoc.h" #include "BufferView.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "frontends/Dialogs.h" #include "debug.h" #include "buffer.h" diff --git a/src/insets/inseturl.C b/src/insets/inseturl.C index d52b6afaaf..1fbad24d33 100644 --- a/src/insets/inseturl.C +++ b/src/insets/inseturl.C @@ -7,7 +7,7 @@ #include "inseturl.h" #include "BufferView.h" #include "LaTeXFeatures.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "debug.h" #include "frontends/Dialogs.h" #include "support/lstrings.h" diff --git a/src/lyx_cb.C b/src/lyx_cb.C index acd2dc171b..7d52cadc5d 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -17,7 +17,7 @@ #include "bufferview_funcs.h" #include "debug.h" #include "lastfiles.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxrc.h" #include "lyxtext.h" #include "gettext.h" diff --git a/src/lyx_gui.C b/src/lyx_gui.C index aff0e0fe87..6bfe005cfd 100644 --- a/src/lyx_gui.C +++ b/src/lyx_gui.C @@ -20,7 +20,7 @@ #include "lyx_main.h" #include "debug.h" #include "version.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "buffer.h" #include "BufferView.h" #include "lyxserver.h" @@ -90,7 +90,7 @@ int LyX_XErrHandler(Display * display, XErrorEvent * xeev) lyxerr << etxt << " id: " << xeev->resourceid << endl; // By doing an abort we get a nice backtrace. (hopefully) lyx::abort(); - return 0; // Solaris CC wants us to return something + return 0; } } diff --git a/src/lyx_main.C b/src/lyx_main.C index 7f8e5bb0ba..bc3da055e9 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -17,7 +17,7 @@ #include "lyx_main.h" #include "lyx_gui.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxfunc.h" #include "lyxrc.h" #include "buffer.h" diff --git a/src/lyxfind.C b/src/lyxfind.C index 7e42daca2d..72784eff1a 100644 --- a/src/lyxfind.C +++ b/src/lyxfind.C @@ -6,7 +6,7 @@ #include "lyxtext.h" #include "lyxfind.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "frontends/Alert.h" #include "support/textutils.h" #include "support/lstrings.h" diff --git a/src/lyxfunc.C b/src/lyxfunc.C index e71a977d1d..5035922300 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -36,7 +36,7 @@ #include "bufferview_funcs.h" #include "minibuffer.h" #include "vspace.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "FloatList.h" #include "converter.h" #include "exporter.h" diff --git a/src/lyxvc.C b/src/lyxvc.C index 4431b6d30f..98c8edd010 100644 --- a/src/lyxvc.C +++ b/src/lyxvc.C @@ -10,7 +10,7 @@ #include "buffer.h" #include "BufferView.h" #include "gettext.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxfunc.h" #include "frontends/Alert.h" diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 6b84e4adaf..245fbae75f 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,8 @@ +2002-05-23 John Levon + + * formula.C: + * formulabase.C: LyXView moved into frontends/ + 2002-05-23 John Levon * formula.C: diff --git a/src/mathed/formula.C b/src/mathed/formula.C index 415b0e0f42..a35e90862e 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -35,7 +35,7 @@ #include "support/LAssert.h" #include "support/systemcall.h" #include "support/filetools.h" // LibFileSearch -#include "LyXView.h" +#include "frontends/LyXView.h" #include "frontends/Painter.h" #include "lyxrc.h" #include "math_hullinset.h" diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index 865faf7026..e01e2c858b 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -33,7 +33,7 @@ #include "debug.h" #include "math_support.h" #include "support/lstrings.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "frontends/Painter.h" #include "font.h" #include "Lsstream.h" diff --git a/src/minibuffer.C b/src/minibuffer.C index 92a307dfc7..bbc4f92c09 100644 --- a/src/minibuffer.C +++ b/src/minibuffer.C @@ -20,14 +20,14 @@ // FIXME: temporary #include "frontends/xforms/DropDown.h" +#include "frontends/xforms/XFormsView.h" #include "minibuffer.h" #include "support/lyxalgo.h" #include "support/filetools.h" #include "support/lstrings.h" -#include "LyXView.h" -#include "XFormsView.h" +#include "frontends/LyXView.h" #include "gettext.h" #include "LyXAction.h" #include "BufferView.h" diff --git a/src/text.C b/src/text.C index 469e0e929f..1b28196ab0 100644 --- a/src/text.C +++ b/src/text.C @@ -19,7 +19,7 @@ #include "buffer.h" #include "debug.h" #include "lyxrc.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "frontends/Painter.h" #include "tracer.h" #include "font.h" diff --git a/src/text2.C b/src/text2.C index f45841a810..dd00754792 100644 --- a/src/text2.C +++ b/src/text2.C @@ -18,13 +18,12 @@ #include "LString.h" #include "paragraph.h" #include "lyxtextclasslist.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "undo_funcs.h" #include "buffer.h" #include "bufferparams.h" #include "gettext.h" #include "BufferView.h" -#include "LyXView.h" #include "CutAndPaste.h" #include "frontends/Painter.h" #include "font.h" diff --git a/src/trans.C b/src/trans.C index 57ba8d0421..7fee999c8f 100644 --- a/src/trans.C +++ b/src/trans.C @@ -4,7 +4,7 @@ #pragma implementation #endif -#include "LyXView.h" +#include "frontends/LyXView.h" #include "trans.h" #include "support/filetools.h" #include "support/lstrings.h" diff --git a/src/vc-backend.C b/src/vc-backend.C index c4336d48e7..a0efd43e0c 100644 --- a/src/vc-backend.C +++ b/src/vc-backend.C @@ -8,7 +8,7 @@ #include "debug.h" #include "buffer.h" #include "BufferView.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxfunc.h" #include "support/FileInfo.h"