]> git.lyx.org Git - lyx.git/blob - src/lyx_gui.C
f432f5363d47a8aa4debcec0bc24297f4e6a5d45
[lyx.git] / src / lyx_gui.C
1 /* This file is part of
2  * ======================================================
3  * 
4  *           LyX, The Document Processor
5  *       
6  *          Copyright 1995 Matthias Ettrich
7  *          Copyright 1995-2000 The LyX Team.
8  *
9  * ====================================================== */
10
11 #include <config.h>
12 #include <cstdlib>
13
14 #ifdef __GNUG__
15 #pragma implementation
16 #endif
17
18 #include <fcntl.h>
19 #include "lyx_gui.h"
20 #include FORMS_H_LOCATION
21 #include "support/filetools.h"
22 #include "combox.h"
23 #include "lyx.h"
24 #include "form1.h"
25 #include "layout_forms.h"
26 #include "print_form.h"
27 #include "tex-strings.h"
28 #include "lyx_main.h"
29 #include "log_form.h"
30 #include "debug.h"
31 #include "version.h"
32 #include "LyXView.h"
33 #include "buffer.h"
34 #include "lyxserver.h"
35 #include "lyxrc.h"
36 #include "gettext.h"
37 #include "lyx_gui_misc.h"
38 #include "lyxlookup.h"
39 #include "bufferlist.h"
40 #include "language.h"
41 #include "ColorHandler.h"
42 #include "frontends/GUIRunTime.h"
43
44 using std::endl;
45
46 FD_form_title * fd_form_title;
47 FD_form_paragraph * fd_form_paragraph;
48 FD_form_paragraph_extra * fd_form_paragraph_extra;
49 FD_form_character * fd_form_character;
50 FD_form_document * fd_form_document;
51 FD_form_paper * fd_form_paper;
52 FD_form_table_options * fd_form_table_options;
53 FD_form_table_extra * fd_form_table_extra;
54 FD_form_quotes * fd_form_quotes;
55 FD_form_preamble * fd_form_preamble;
56 FD_form_table * fd_form_table;
57 FD_form_sendto * fd_form_sendto;
58 FD_form_figure * fd_form_figure;
59 FD_LaTeXLog * fd_latex_log; // from log_form.h
60 Combox * combo_language;
61 Combox * combo_language2;
62
63 extern LyXServer * lyxserver;
64 extern bool finished;   // flag, that we are quitting the program
65 extern BufferList bufferlist;
66
67 FL_CMD_OPT cmdopt[] =
68 {
69         {"-geometry", "*.geometry", XrmoptionSepArg, "690x510"}
70 };
71
72 static int width  = 690;
73 static int height = 510;
74 static int xpos   = -1;
75 static int ypos   = -1;
76 static char geometry[40];
77 bool       cursor_follows_scrollbar;
78
79
80 FL_resource res[] =
81 {
82         {"geometry", "geometryClass", FL_STRING, geometry, "", 40}
83 };
84
85
86 extern "C"
87 int LyX_XErrHandler(Display * display, XErrorEvent * xeev)
88 {
89 //#warning Please see if you can trigger this!
90         // emergency save
91         if (!bufferlist.empty())
92                 bufferlist.emergencyWriteAll();
93
94         // Get the reason for the crash.
95         char etxt[513];
96         XGetErrorText(display, xeev->error_code, etxt, 512);
97         lyxerr << etxt << endl;
98         // By doing an abort we get a nice backtrace. (hopefully)
99         lyx::abort();
100         return 0; // Solaris CC wants us to return something
101 }
102
103
104 LyXGUI::LyXGUI(LyX * owner, int * argc, char * argv[], bool GUI)
105   : _owner(owner), lyxViews(0)
106 {
107         gui = GUI;
108         if (!gui)
109                 return;
110
111         setDefaults();
112         
113         static const int num_res = sizeof(res)/sizeof(FL_resource);
114         fl_initialize(argc, argv, "LyX", cmdopt, num_res);
115         fl_get_app_resources(res, num_res);
116
117         static const int geometryBitmask = XParseGeometry( geometry,
118                                                            &xpos,
119                                                            &ypos,
120                                                            (unsigned int *) &width,
121                                                            (unsigned int *) &height
122                                                          );
123
124         Display * display = fl_get_display();
125         if (!display) {
126                 lyxerr << "LyX: unable to access X display, exiting" << endl;
127                 exit(1);
128         }
129         fcntl(ConnectionNumber(display), F_SETFD, FD_CLOEXEC);
130         // X Error handler install goes here
131         XSetErrorHandler(LyX_XErrHandler);
132
133         // A width less than 590 pops up an awkward main window
134         // The minimal values of width/height (590/400) are defined in
135         // src/lyx.C  
136         if (width < 590) width = 590;
137         if (height < 400) height = 400;
138         
139         // If width is not set by geometry, check it against monitor width
140         if ( !(geometryBitmask & 4) ) {
141                 Screen * scr = DefaultScreenOfDisplay(fl_get_display());
142                 if (WidthOfScreen(scr) - 8 < width)
143                         width = WidthOfScreen(scr) - 8;
144         }
145
146         // If height is not set by geometry, check it against monitor height
147         if ( !(geometryBitmask & 8) ) {
148                 Screen * scr = DefaultScreenOfDisplay(fl_get_display());
149                 if (HeightOfScreen(scr) - 24 < height)
150                         height = HeightOfScreen(scr) - 24;
151         }
152
153         // Recalculate xpos if it's negative
154         if (geometryBitmask & 16)
155                 xpos += WidthOfScreen(DefaultScreenOfDisplay(fl_get_display())) - width;
156
157         // Recalculate ypos if it's negative
158         if (geometryBitmask & 32)
159                 ypos += HeightOfScreen(DefaultScreenOfDisplay(fl_get_display())) - height;
160
161         // Initialize the LyXColorHandler
162         lyxColorHandler = new LyXColorHandler;
163 }
164
165
166 // A destructor is always necessary  (asierra-970604)
167 LyXGUI::~LyXGUI()
168 {
169         // Lyxserver was created in this class so should be destroyed
170         // here.  asierra-970604
171         delete lyxserver;
172         lyxserver = 0;
173         delete lyxViews;
174         lyxViews = 0;
175
176         CloseLyXLookup();
177 }
178
179
180 void LyXGUI::setDefaults()
181 {
182         FL_IOPT cntl;
183         cntl.buttonFontSize = FL_NORMAL_SIZE;
184         cntl.browserFontSize = FL_NORMAL_SIZE;
185         cntl.labelFontSize = FL_NORMAL_SIZE;
186         cntl.choiceFontSize = FL_NORMAL_SIZE;
187         cntl.inputFontSize = FL_NORMAL_SIZE;
188         cntl.menuFontSize  = FL_NORMAL_SIZE;
189         cntl.borderWidth = -1;
190         cntl.vclass = FL_DefaultVisual;
191         fl_set_defaults(FL_PDVisual
192                         | FL_PDButtonFontSize
193                         | FL_PDBrowserFontSize
194                         | FL_PDLabelFontSize
195                         | FL_PDChoiceFontSize
196                         | FL_PDInputFontSize
197                         | FL_PDMenuFontSize
198                         | FL_PDBorderWidth, &cntl);
199 }
200
201
202 // This is called after we have parsed lyxrc
203 void LyXGUI::init()
204 {
205         if (!gui)
206                 return;
207
208         create_forms();
209
210         if (lyxrc.font_norm_menu.empty())
211                 lyxrc.font_norm_menu = lyxrc.font_norm;
212         // Set the font name for popups and menus
213         string menufontname = lyxrc.menu_font_name 
214                                + "-*-*-*-?-*-*-*-*-"  
215                                + lyxrc.font_norm_menu;
216                 // "?" means "scale that font"
217         string popupfontname = lyxrc.popup_font_name 
218                                + "-*-*-*-?-*-*-*-*-"  
219                                + lyxrc.font_norm_menu;
220
221         int bold = fl_set_font_name(FL_BOLD_STYLE, menufontname.c_str());
222         int normal = fl_set_font_name(FL_NORMAL_STYLE, popupfontname.c_str());
223         if (bold < 0)
224                 lyxerr << "Could not set menu font to "
225                        << menufontname << endl;
226
227         if (normal < 0)
228                 lyxerr << "Could not set popup font to "
229                        << popupfontname << endl;
230
231         if (bold < 0 && normal < 0) {
232                 lyxerr << "Using 'helvetica' font for menus" << endl;
233                 bold = fl_set_font_name(FL_BOLD_STYLE,
234                                         "-*-helvetica-bold-r-*-*-*-?-*-*-*-*-iso8859-1");
235                 normal = fl_set_font_name(FL_NORMAL_STYLE,
236                                           "-*-helvetica-medium-r-*-*-*-?-*-*-*-*-iso8859-1");
237                 if (bold < 0 && normal < 0) {
238                         lyxerr << "Could not find helvetica font. Using 'fixed'." << endl;
239                         normal = fl_set_font_name(FL_NORMAL_STYLE, "fixed");
240                 }
241         }
242
243         // put here (after fl_initialize) to avoid segfault. Cannot be done
244         // in setDefaults() (Matthias 140496)
245         // Moved from ::LyXGUI to ::init to allow popup font customization 
246         // (petr 120997).
247         fl_setpup_fontstyle(FL_NORMAL_STYLE);
248         fl_setpup_fontsize(FL_NORMAL_SIZE);
249         fl_setpup_color(FL_MCOL, FL_BLACK);
250         fl_set_goodies_font(FL_NORMAL_STYLE, FL_NORMAL_SIZE);
251
252         // all lyxrc settings has to be done here as lyxrc has not yet
253         // been read when the GUI is created (Jug)
254
255         // the sendto form
256         if (!lyxrc.custom_export_command.empty())
257                 fl_set_input(fd_form_sendto->input_cmd,
258                              lyxrc.custom_export_command.c_str());
259         if (lyxrc.custom_export_format == "lyx")
260                 fl_set_button(fd_form_sendto->radio_ftype_lyx, 1);
261         else if (lyxrc.custom_export_format == "tex")
262                 fl_set_button(fd_form_sendto->radio_ftype_latex, 1);
263         else if (lyxrc.custom_export_format == "dvi")
264                 fl_set_button(fd_form_sendto->radio_ftype_dvi, 1);
265         else if (lyxrc.custom_export_format == "ps")
266                 fl_set_button(fd_form_sendto->radio_ftype_ps, 1);
267         else if (lyxrc.custom_export_format == "ascii")
268                 fl_set_button(fd_form_sendto->radio_ftype_ascii, 1);
269
270         // Update parameters.
271         lyxViews->redraw();
272
273         // Initialize the views.
274         lyxViews->init();
275
276         // in 0.12 the initialisation of the LyXServer must be done here
277         // 0.13 it should be moved again...
278         lyxserver = new LyXServer(lyxViews->getLyXFunc(), lyxrc.lyxpipes);
279 }
280
281
282 void LyXGUI::create_forms()
283 {
284         lyxerr[Debug::INIT] << "Initializing LyXView..." << endl;
285         lyxViews = new LyXView(width, height);
286         lyxerr[Debug::INIT] << "Initializing LyXView...done" << endl;
287
288         // From here down should be done by somebody else. (Lgb)
289
290         //
291         // Create forms
292         //
293
294         // the title form
295         string banner_file = LibFileSearch("images", "banner", "xpm");
296         if (lyxrc.show_banner && !banner_file.empty()) {
297                 fd_form_title = create_form_form_title();
298                 fl_set_form_dblbuffer(fd_form_title->form_title, 1); // use dbl buffer
299                 fl_set_form_atclose(fd_form_title->form_title, CancelCloseBoxCB, 0);
300                 fl_addto_form(fd_form_title->form_title);
301                 FL_OBJECT *obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 0, 0, 425, 290, "");
302                 fl_set_pixmapbutton_file(obj, banner_file.c_str());
303                 
304                 fl_set_pixmapbutton_focus_outline(obj, 3);
305                 fl_set_button_shortcut(obj, "^M ^[", 1);
306                 fl_set_object_boxtype(obj, FL_NO_BOX);
307                 fl_set_object_callback(obj, TimerCB, 0);
308                 
309                 obj = fl_add_text(FL_NORMAL_TEXT, 248, 265, 170, 16, LYX_VERSION);
310                 fl_set_object_lsize(obj, FL_NORMAL_SIZE);
311                 fl_mapcolor(FL_FREE_COL2, 0x05, 0x2e, 0x4c);
312                 fl_mapcolor(FL_FREE_COL3, 0xe1, 0xd2, 0x9b);
313                 fl_set_object_color(obj, FL_FREE_COL2, FL_FREE_COL2);
314                 fl_set_object_lcol(obj, FL_FREE_COL3);
315                 fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
316                 fl_set_object_lstyle(obj, FL_BOLD_STYLE);
317                 fl_end_form();
318         }
319         
320         // the paragraph form
321         fd_form_paragraph = create_form_form_paragraph();
322         fl_set_form_atclose(fd_form_paragraph->form_paragraph,
323                             CancelCloseBoxCB, 0);
324         fl_addto_choice(fd_form_paragraph->choice_space_above,
325                         _(" None | Defskip | Smallskip "
326                         "| Medskip | Bigskip | VFill | Length "));
327         fl_addto_choice(fd_form_paragraph->choice_space_below,
328                         _(" None | Defskip | Smallskip "
329                         "| Medskip | Bigskip | VFill | Length ")); 
330         fl_set_input_return(fd_form_paragraph->input_space_above,
331                             FL_RETURN_ALWAYS);
332         fl_set_input_return(fd_form_paragraph->input_space_below,
333                             FL_RETURN_ALWAYS);
334
335         // the paragraph extra form
336         fd_form_paragraph_extra = create_form_form_paragraph_extra();
337         fl_set_form_atclose(fd_form_paragraph_extra->form_paragraph_extra,
338                             CancelCloseBoxCB, 0);
339         fl_set_input_return(fd_form_paragraph_extra->input_pextra_width,
340                             FL_RETURN_ALWAYS);
341         fl_set_input_return(fd_form_paragraph_extra->input_pextra_widthp,
342                             FL_RETURN_ALWAYS);
343         lyxerr[Debug::INIT] << "Initializing form_paragraph...done" << endl;
344
345         // the character form
346         fd_form_character = create_form_form_character();
347         fl_set_form_atclose(fd_form_character->form_character,
348                             CancelCloseBoxCB, 0);
349         fl_addto_choice(fd_form_character->choice_family, 
350                         _(" No change %l| Roman | Sans Serif | Typewriter %l| Reset "));
351         fl_addto_choice(fd_form_character->choice_series, 
352                         _(" No change %l| Medium | Bold %l| Reset "));
353         fl_addto_choice(fd_form_character->choice_shape,
354                         _(" No change %l| Upright | Italic | Slanted | Small Caps "
355                         "%l| Reset "));
356         fl_addto_choice(fd_form_character->choice_size, 
357                         _(" No change %l| Tiny | Smallest | Smaller | Small "
358                         "| Normal | Large | Larger | Largest | Huge | Huger "
359                         "%l| Increase | Decrease | Reset "));
360         fl_addto_choice(fd_form_character->choice_bar, 
361                         _(" No change %l| Emph | Underbar | Noun | LaTeX mode %l| Reset "));
362         fl_addto_choice(fd_form_character->choice_color, 
363                         _(" No change %l| No color | Black | White | Red | Green "
364                         "| Blue | Cyan | Magenta | Yellow %l| Reset "));
365         fl_set_form_minsize(fd_form_character->form_character,
366                             fd_form_character->form_character->w,
367                             fd_form_character->form_character->h);
368         lyxerr[Debug::INIT] << "Initializing form_character::combox..." << endl;
369         fl_addto_form(fd_form_character->form_character);
370         combo_language2 = new Combox(FL_COMBOX_DROPLIST);
371         FL_OBJECT * ob = fd_form_character->choice_language;
372         combo_language2->add(ob->x, ob->y, ob->w, ob->h, 250);
373         combo_language2->shortcut("#L", 1);
374         fl_end_form();
375         lyxerr[Debug::INIT] << "Initializing form_character...done" << endl;
376
377 #ifdef USE_OLD_DOCUMENT_LAYOUT
378         // the document form
379         fd_form_document = create_form_form_document();
380         fl_set_form_atclose(fd_form_document->form_document,
381                             CancelCloseBoxCB, 0);
382         fl_addto_choice(fd_form_document->choice_spacing,
383                         _(" Single | OneHalf | Double | Other "));
384
385         fl_set_counter_bounds(fd_form_document->slider_secnumdepth,-2, 5);
386         fl_set_counter_bounds(fd_form_document->slider_tocdepth,-1, 5);
387         fl_set_counter_step(fd_form_document->slider_secnumdepth, 1, 1);
388         fl_set_counter_step(fd_form_document->slider_tocdepth, 1, 1);
389         fl_set_counter_precision(fd_form_document->slider_secnumdepth, 0);
390         fl_set_counter_precision(fd_form_document->slider_tocdepth, 0);
391         fl_addto_form(fd_form_document->form_document);
392         combo_language = new Combox(FL_COMBOX_DROPLIST);
393         ob = fd_form_document->choice_language;
394         combo_language->add(ob->x, ob->y, ob->w, ob->h, 250);
395         combo_language->shortcut("#G", 1);
396         fl_end_form();
397
398         // "default" is not part of the languages array any more.
399         combo_language->addto("default");
400         combo_language2->addto(_("No change"));
401         combo_language2->addto(_("Reset"));
402         for(Languages::const_iterator cit = languages.begin();
403             cit != languages.end(); ++cit) {
404                 combo_language->addto((*cit).second.lang().c_str());
405                 combo_language2->addto((*cit).second.lang().c_str());
406         }
407         combo_language2->select_text(_("No change"));
408
409         // not really necessary, but we can do it anyway.
410         fl_addto_choice(fd_form_document->choice_fontsize, "default|10|11|12");
411         int n;
412         for (n = 0; tex_fonts[n][0]; ++n) {
413             fl_addto_choice(fd_form_document->choice_fonts, tex_fonts[n]);
414         }
415
416         fl_addto_choice(fd_form_document->choice_inputenc,
417                         "default|auto|latin1|latin2|latin5"
418                         "|koi8-r|koi8-u|cp866|cp1251|iso88595");
419
420         for (n = 0; tex_graphics[n][0]; ++n) {
421             fl_addto_choice(fd_form_document->choice_postscript_driver,
422                                         tex_graphics[n]);
423         }
424         // not really necessary, but we can do it anyway.
425         fl_addto_choice(fd_form_document->choice_pagestyle,
426                         "default|empty|plain|headings|fancy");
427         fl_addto_choice(fd_form_document->choice_default_skip,
428                         _(" Smallskip | Medskip | Bigskip | Length "));
429         fl_set_input_return(fd_form_document->input_default_skip,
430                             FL_RETURN_ALWAYS);
431         fl_set_form_minsize(fd_form_document->form_document,
432                             fd_form_document->form_document->w,
433                             fd_form_document->form_document->h);
434         lyxerr[Debug::INIT] << "Initializing form_document...done" << endl;
435
436         // the paper form
437         fd_form_paper = create_form_form_paper();
438         fl_set_form_atclose(fd_form_paper->form_paper,
439                             CancelCloseBoxCB, 0);
440         fl_addto_choice(fd_form_paper->choice_papersize2,
441                         _(" Default | Custom | USletter | USlegal "
442                         "| USexecutive | A3 | A4 | A5 | B3 | B4 | B5 "));
443         fl_addto_choice(fd_form_paper->choice_paperpackage,
444                         _(" None "
445                         "| A4 small Margins (only portrait) "
446                         "| A4 very small Margins (only portrait) "
447                         "| A4 very wide margins (only portrait) "));
448         fl_set_input_return(fd_form_paper->input_custom_width,
449                             FL_RETURN_ALWAYS);
450         fl_set_input_return(fd_form_paper->input_custom_height,
451                             FL_RETURN_ALWAYS);
452         fl_set_input_return(fd_form_paper->input_top_margin,
453                             FL_RETURN_ALWAYS);
454         fl_set_input_return(fd_form_paper->input_bottom_margin,
455                             FL_RETURN_ALWAYS);
456         fl_set_input_return(fd_form_paper->input_left_margin,
457                             FL_RETURN_ALWAYS);
458         fl_set_input_return(fd_form_paper->input_right_margin,
459                             FL_RETURN_ALWAYS);
460         fl_set_input_return(fd_form_paper->input_head_height,
461                             FL_RETURN_ALWAYS);
462         fl_set_input_return(fd_form_paper->input_head_sep,
463                             FL_RETURN_ALWAYS);
464         fl_set_input_return(fd_form_paper->input_foot_skip,
465                             FL_RETURN_ALWAYS);
466         lyxerr[Debug::INIT] << "Initializing form_paper...done" << endl;
467 #endif
468
469 #ifndef NEW_TABULAR
470         // the table_options form
471         fd_form_table_options = create_form_form_table_options();
472         fl_set_form_atclose(fd_form_table_options->form_table_options,
473                             CancelCloseBoxCB, 0);
474         fl_set_input_return(fd_form_table_options->input_column_width,
475                             FL_RETURN_ALWAYS);
476
477         // the table_extra form
478         fd_form_table_extra = create_form_form_table_extra();
479         fl_set_form_atclose(fd_form_table_extra->form_table_extra,
480                             CancelCloseBoxCB, 0);
481         fl_set_input_return(fd_form_table_extra->input_special_alignment,
482                             FL_RETURN_ALWAYS);
483         fl_set_input_return(fd_form_table_extra->input_special_multialign,
484                             FL_RETURN_ALWAYS);
485         lyxerr[Debug::INIT] << "Initializing form_table_extra...done" << endl;
486 #endif
487
488 #ifdef USE_OLD_DOCUMENT_LAYOUT
489         // the quotes form
490         fd_form_quotes = create_form_form_quotes();
491         fl_set_form_atclose(fd_form_quotes->form_quotes,
492                             CancelCloseBoxCB, 0);
493         // Is it wrong of me to use « » instead of << >> ? (Lgb)
494         // Maybe if people use a font other than latin1... (JMarc)
495         fl_addto_choice(fd_form_quotes->choice_quotes_language,
496                         _(" ``text'' | ''text'' | ,,text`` | ,,text'' | «text» | »text« "));
497 #endif
498
499         // the preamble form
500         fd_form_preamble = create_form_form_preamble();
501         fl_set_form_atclose(fd_form_preamble->form_preamble,
502                             CancelCloseBoxCB, 0);
503
504 #ifndef NEW_TABULAR
505         // the table form
506         fd_form_table = create_form_form_table();
507         fl_set_form_atclose(fd_form_table->form_table, CancelCloseBoxCB, 0);
508         fl_set_slider_bounds(fd_form_table->slider_rows, 1, 50);
509         fl_set_slider_bounds(fd_form_table->slider_columns, 1, 50);
510         fl_set_slider_value(fd_form_table->slider_rows, 5);
511         fl_set_slider_value(fd_form_table->slider_columns, 5);
512         fl_set_slider_precision(fd_form_table->slider_rows, 0);
513         fl_set_slider_precision(fd_form_table->slider_columns, 0);
514         lyxerr[Debug::INIT] << "Initializing form_table...done" << endl;
515 #endif
516
517         // the sendto form
518         fd_form_sendto = create_form_form_sendto();
519         fl_set_form_atclose(fd_form_sendto->form_sendto, CancelCloseBoxCB, 0);
520
521         // the figure form
522         fd_form_figure = create_form_form_figure();
523         fl_set_form_atclose(fd_form_figure->form_figure,
524                             CancelCloseBoxCB, 0);
525         fl_set_button(fd_form_figure->radio_postscript, 1);
526
527         // the latex log form
528         fd_latex_log = create_form_LaTeXLog();
529         fl_set_form_atclose(fd_latex_log->LaTeXLog,
530                             CancelCloseBoxCB, 0);
531
532         // Show the main & title form
533         int main_placement = FL_PLACE_CENTER | FL_FREE_SIZE;
534         int title_placement = FL_PLACE_CENTER;
535         // Did we get a valid position?
536         if (xpos >= 0 && ypos >= 0) {
537                 lyxViews->setPosition(xpos, ypos);
538                 if (lyxrc.show_banner) {
539                         // show the title form in the middle of the main form
540                         fl_set_form_position(fd_form_title->form_title,
541                                              abs(xpos + (width/2) - (370 / 2)),
542                                              abs(ypos + (height/2) - (290 / 2)));
543                         title_placement = FL_PLACE_GEOMETRY;
544                         // The use of abs() above is a trick to ensure
545                         // valid positions
546                 }
547                         main_placement = FL_PLACE_POSITION;
548         }
549         lyxViews->show(main_placement, FL_FULLBORDER, "LyX");
550         if (lyxrc.show_banner) {
551                 fl_show_form(fd_form_title->form_title, 
552                              title_placement, FL_NOBORDER, 
553                              _("LyX Banner"));
554                 fl_redraw_form(fd_form_title->form_title);
555                 fl_raise_form(fd_form_title->form_title);
556
557                 // Show the title form at most 7 secs (lowered from 10 secs)
558                 fl_set_timer(fd_form_title->timer_title, 7);
559         }
560 }
561
562
563 void LyXGUI::runTime()
564 {
565         if (!gui) return;
566
567         GUIRunTime grt;
568         grt.runTime();
569 }
570
571
572 void LyXGUI::regBuf(Buffer * b)
573 {
574         lyxViews->view()->buffer(b);
575 }
576
577
578 LyXView * LyXGUI::getLyXView() const
579 {
580         return lyxViews;
581 }