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