#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"
#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"
2002-05-23 John Levon <moz@compsoc.man.ac.uk>
- * 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 <moz@compsoc.man.ac.uk>
+
+ * 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 <larsbj@birdstep.com>
#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;
+++ /dev/null
-/* 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 "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 <sys/time.h>
-#include <unistd.h>
-
-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()));
-}
+++ /dev/null
-// -*- C++ -*-
-
-#ifndef LYXVIEW_BASE_H
-#define LYXVIEW_BASE_H
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include <boost/utility.hpp>
-#include <sigc++/signal_system.h>
-
-#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
Lsstream.h \
LyXAction.C \
LyXAction.h \
- LyXView.C \
- LyXView.h \
MenuBackend.C \
MenuBackend.h \
ParagraphParameters.C \
ToolbarDefaults.h \
WorkArea.C \
WorkArea.h \
- XFormsView.C \
- XFormsView.h \
box.h \
box.C \
broken_headers.h \
undo.h \
undo_funcs.C \
undo_funcs.h \
- undostack.C \
- undostack.h \
vc-backend.C \
vc-backend.h \
version.C \
#include "WorkArea.h"
#include "debug.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "lyxrc.h" // lyxrc.show_banner
#include "version.h" // lyx_version
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;
+++ /dev/null
-/* 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 "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();
-}
+++ /dev/null
-// -*- 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
#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"
LyXLex nylex(0, 0);
nylex.setStream(istr);
inset->read(this, nylex);
-
par->insertInset(pos, inset, font);
++pos;
insertErtContents(par, pos);
*/
// 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.
}
-// 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()
#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"
#endif
#include "bufferview_funcs.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "BufferView.h"
#include "paragraph.h"
#include "lyxfont.h"
}
-/* -------> 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)
#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"
+2002-05-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * Liason.C:
+ * LyXView.h:
+ * LyXView.C:
+ * Makefile.am: move LyXView here
+
2002-05-23 John Levon <moz@compsoc.man.ac.uk>
* Makefile.am:
#include "lyxrc.h"
#include "PrinterParams.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "BufferView.h"
#include "buffer.h"
#include "exporter.h"
--- /dev/null
+/* 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 "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 <sys/time.h>
+#include <unistd.h>
+
+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()));
+}
--- /dev/null
+// -*- C++ -*-
+
+#ifndef LYXVIEW_BASE_H
+#define LYXVIEW_BASE_H
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#include <boost/utility.hpp>
+#include <sigc++/signal_system.h>
+
+#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
Timeout.C \
Timeout.h \
Toolbar.C \
- Toolbar.h
+ Toolbar.h \
+ LyXView.C \
+ LyXView.h
+2002-05-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * 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 <larsbj@birdstep.com>
* ControlExternal.C: add scoped_ptr.hpp
#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"
#include "ButtonControllerBase.h"
#include "ControlBibitem.h"
#include "Dialogs.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "buffer.h"
#include "BufferView.h"
#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"
#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"
#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
#include "ControlInset.tmpl"
#include "buffer.h"
#include "Dialogs.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "lyxfunc.h"
#include "BufferView.h"
#include "ViewBase.h"
#include "ControlConnections.h"
#include "Dialogs.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "buffer.h"
using SigC::slot;
#include "ControlERT.h"
#include "ControlInset.tmpl"
#include "Dialogs.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "buffer.h"
#include "BufferView.h"
#include "ControlError.h"
#include "ControlInset.tmpl"
#include "Dialogs.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "buffer.h"
#include "insets/inseterror.h"
#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"
#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"
#include "ViewBase.h"
#include "BufferView.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "lyxfunc.h"
#include "frontends/Dialogs.h"
#include "buffer.h"
#include "BufferView.h"
#include "Dialogs.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "gettext.h"
#include "lyxrc.h"
#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"
#include "ControlIndex.h"
#include "buffer.h"
#include "Dialogs.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
using SigC::slot;
#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"
#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"
#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"
#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"
#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;
#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"
#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"
#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
#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"
#include "ControlTabularCreate.h"
#include "BufferView.h"
#include "Dialogs.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "lyxfunc.h"
#include "support/lstrings.h"
#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
#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"
#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"
#include "ButtonControllerBase.h"
#include "ControlUrl.h"
#include "Dialogs.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "buffer.h"
using SigC::slot;
#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"
+2002-05-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * FileDialog.C: LyXView moved into frontends/
+
2002-04-09 Michael A. Koziarski <michael@koziarski.com>
* dialoges/GERT.glade
#include "gettext.h"
#include "Dialogs.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "gnomeBC.h"
#include "Tooltips.h"
#include "GUI.h"
#include <sigc++/signal_system.h>
-#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
+2002-05-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * QtLyXView.h: moved into frontends/
+
2002-05-22 Lars Gullik Bjønnes <larsbj@birdstep.com>
* QDocument.h: use more specific smart_ptr header.
*/
#undef emit
-#include "LyXView.h"
+#include "frontends/LyXView.h"
+2002-05-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * 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 <moz@compsoc.man.ac.uk>
* Makefile.am:
#pragma interface
#endif
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include <sigc++/signal_system.h>
#include "LString.h"
#include FORMS_H_LOCATION
// 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"
#include "xforms_resize.h"
#include "GUIRunTime.h"
#include "Tooltips.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "lyxrc.h"
#include "support/LAssert.h"
}
fl_freeze_form(form());
- update(); // make sure its up-to-date
+ update();
fl_unfreeze_form(form());
if (form()->visible) {
#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"
#include "xformsBC.h"
#include "ControlIndex.h"
#include "FormIndex.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "form_index.h"
typedef FormCB<ControlIndex, FormDB<FD_form_index> > base_class;
#endif
#include "Dialogs.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "FormInset.h"
#include "xformsBC.h"
#include "FormMathsBitmap.h"
#include "Dialogs.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "bmtable.h"
#include "debug.h"
#include "xforms_helpers.h"
#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"
#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"
#endif
#include "Dialogs.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "FormMathsPanel.h"
#include "form_maths_panel.h"
#include "MathsSymbols.h"
#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"
#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"
#include "FormPrint.h"
#include "form_print.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "PrinterParams.h"
#include "FormTabular.h"
#include "form_tabular.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "Dialogs.h"
#include "buffer.h"
#include "xforms_helpers.h"
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 \
--- /dev/null
+/* 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 "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();
+}
--- /dev/null
+// -*- 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
#include "importer.h"
#include "converter.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "lyxfunc.h"
#include "bufferlist.h"
+2002-05-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * 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 <moz@compsoc.man.ac.uk>
* inset.C:
#include "lyxtext.h"
#include "lyxrc.h"
#include "font.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "lyxtextclasslist.h"
#include "frontends/Dialogs.h"
#include "buffer.h"
#include "BufferView.h"
#include "LaTeXFeatures.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "debug.h"
#include "gettext.h"
#include "lyxfont.h"
#include "gettext.h"
#include "inseterror.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "frontends/Painter.h"
#include "frontends/Dialogs.h"
#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"
#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"
#include "debug.h"
#include "Floating.h"
#include "buffer.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "frontends/Dialogs.h"
using std::ostream;
#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"
#include "graphics/GraphicsCache.h"
#include "graphics/GraphicsImage.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "lyxtext.h"
#include "buffer.h"
#include "BufferView.h"
#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"
#include "insetindex.h"
#include "BufferView.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "frontends/Dialogs.h"
#include "LaTeXFeatures.h"
#include "gettext.h"
#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"
#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"
#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"
#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"
#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"
#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"
#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"
#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"
#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"
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;
}
}
#include "lyx_main.h"
#include "lyx_gui.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "lyxfunc.h"
#include "lyxrc.h"
#include "buffer.h"
#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"
#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"
#include "buffer.h"
#include "BufferView.h"
#include "gettext.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "lyxfunc.h"
#include "frontends/Alert.h"
+2002-05-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * formula.C:
+ * formulabase.C: LyXView moved into frontends/
+
2002-05-23 John Levon <moz@compsoc.man.ac.uk>
* formula.C:
#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"
#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"
// 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"
#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"
#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"
#pragma implementation
#endif
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "trans.h"
#include "support/filetools.h"
#include "support/lstrings.h"
#include "debug.h"
#include "buffer.h"
#include "BufferView.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "lyxfunc.h"
#include "support/FileInfo.h"