*
* \author unknown
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*/
#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
#include "XFormsView.h"
-#include FORMS_H_LOCATION
+#include "XFormsMenubar.h"
+#include "XFormsToolbar.h"
#include "XMiniBuffer.h"
+
+#include "BufferView.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 "frontends/Dialogs.h"
-#include "MenuBackend.h"
-#include "ToolbarDefaults.h"
#include "lyxfunc.h"
-#include "bufferview_funcs.h"
-#include "BufferView.h"
+#include "MenuBackend.h"
+
+#include "frontends/Dialogs.h"
+
+#include "support/filetools.h" // OnlyFilename()
#include <boost/bind.hpp>
-#include <boost/signals/connection.hpp>
+
+using lyx::support::LibFileSearch;
+
using std::abs;
using std::endl;
+using std::string;
+
//extern void AutoSave(BufferView *);
extern void QuitLyX();
-// This is very temporary
-BufferView * current_view;
-
extern "C" {
static
int const air = 2;
int const bw = abs(fl_get_border_width());
- menubar_.reset(new Menubar(this, menubackend));
+ menubar_.reset(new XFormsMenubar(this, menubackend));
- toolbar_.reset(new Toolbar(this, air, 30 + air + bw, toolbardefaults));
+ toolbar_.reset(new XFormsToolbar(this, air, 30 + air + bw));
+ toolbar_->init();
int const ywork = 60 + 2 * air + bw;
int const workheight = height - ywork - (25 + 2 * air);
bufferview_.reset(new BufferView(this, air, ywork,
width - 3 * air, workheight));
- ::current_view = bufferview_.get();
- minibuffer_.reset(new XMiniBuffer(this, *controlcommand_,
+ minibuffer_.reset(new XMiniBuffer(*controlcommand_,
air, height - (25 + air), width - (2 * air), 25));
// assign an icon to main form
fl_set_form_minsize(getForm(), 50, 50);
fl_end_form();
-
- minibuffer_->dd_init();
}
}
-void XFormsView::show_view_state()
+void XFormsView::clearMessage()
{
message(getLyXFunc().view_status_message());
}
-// 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
+void XFormsView::show_view_state()
{
- view()->hideCursor();
+ message(getLyXFunc().view_status_message());
+}
- 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;
- }
+void XFormsView::busy(bool yes) const
+{
+ if (yes) {
+ view()->hideCursor();
- /* set the cursor to the watch for all forms and the canvas */
- XDefineCursor(fl_get_display(), getForm()->window, cursor);
+ static Cursor cursor;
+ static bool cursor_undefined = true;
- XFlush(fl_get_display());
- fl_deactivate_all_forms();
-}
+ 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);
-void XFormsView::allowInput() const
-{
- /* reset the cursor from the watch for all forms and the canvas */
+ XFlush(fl_get_display());
- XUndefineCursor(fl_get_display(), getForm()->window);
+ /// we only need to deactivate to prevent resetting the cursor
+ /// to I-beam over the workarea
+ fl_deactivate_all_forms();
+ } else {
+ /// reset the cursor from the watch for all forms and the canvas
- XFlush(fl_get_display());
- fl_activate_all_forms();
+ XUndefineCursor(fl_get_display(), getForm()->window);
+
+ XFlush(fl_get_display());
+ fl_activate_all_forms();
+ }
}