-// Callback for close main form from window manager
-int LyXView::atCloseMainFormCB(FL_FORM *, void *)
-{
- QuitLyX();
- return FL_IGNORE;
-}
-
-
-// Wrapper for the above
-extern "C"
-int C_LyXView_atCloseMainFormCB(FL_FORM * form, void * p)
-{
- return LyXView::atCloseMainFormCB(form, p);
-}
-
-
-void LyXView::setPosition(int x, int y)
-{
- fl_set_form_position(form_, x, y);
-}
-
-
-void LyXView::show(int place, int border, string const & title)
-{
- fl_show_form(form_, place, border, title.c_str());
- minibuffer->Init();
-#if FL_REVISION < 89
- InitLyXLookup(fl_get_display(), form_->window);
-#endif
-}
-
-
-void LyXView::create_form_form_main(int width, int height)
- /* to make this work as it should, .lyxrc should have been
- * read first; OR maybe this one should be made dynamic.
- * Hmmmm. Lgb.
- * We will probably not have lyxrc before the main form is
- * initialized, because error messages from lyxrc parsing
- * are presented (and rightly so) in GUI popups. Asger.
- */
-{
- // the main form
- form_ = fl_bgn_form(FL_NO_BOX, width, height);
- form_->u_vdata = this;
- FL_OBJECT * obj = fl_add_box(FL_FLAT_BOX, 0, 0, width, height, "");
- fl_set_object_color(obj, FL_MCOL, FL_MCOL);
-
- // Parameters for the appearance of the main form
- int const air = 2;
- int const bw = abs(fl_get_border_width());
-
- //
- // THE MENUBAR
- //
- menubar = new Menubar(this, menubackend);
-
- //
- // TOOLBAR
- //
-
- toolbar = new Toolbar(this, air, 30 + air + bw, toolbardefaults);
-
- // Setup the toolbar
- toolbar->set(true);
-
- //
- // WORKAREA
- //
-
- int const ywork = 60 + 2 * air + bw;
- int const workheight = height - ywork - (25 + 2 * air);
-
- ::current_view = bufferview = new BufferView(this, air, ywork,
- width - 3 * air,
- workheight);
-
- //
- // MINIBUFFER
- //
-
- minibuffer = new MiniBuffer(this, air, height - (25 + air),
- width - (2 * air), 25);
-
- //
- // TIMERS
- //
-
- autosave_timeout.timeout.connect(slot(this, &LyXView::AutoSave));
-
- //
- // Misc
- //
-
- // assign an icon to main form
- string iconname = LibFileSearch("images", "lyx", "xpm");
- if (!iconname.empty()) {
- unsigned int w, h;
- Pixmap lyx_p, lyx_mask;
- lyx_p = fl_read_pixmapfile(fl_root,
- iconname.c_str(),
- &w,
- &h,
- &lyx_mask,
- 0,
- 0,
- 0); // this leaks
- fl_set_form_icon(form_, lyx_p, lyx_mask);
- }
-
- // set min size
- fl_set_form_minsize(form_, 50, 50);
-
- fl_end_form();
-}
-
-
-void LyXView::init()
-{
- // Set the textclass choice
- invalidateLayoutChoice();
- updateLayoutChoice();
- updateMenubar();
-
- // Start autosave timer
- if (lyxrc.autosave) {
- autosave_timeout.setTimeout(lyxrc.autosave * 1000);
- autosave_timeout.start();
- }
-
- intl->InitKeyMapper(lyxrc.use_kbmap);
-}
-
-