]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiListings.cpp
fix memory leaks
[lyx.git] / src / frontends / qt4 / GuiListings.cpp
1 /**
2  * \file GuiListings.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Bo Peng
7  * \author Jürgen Spitzmüller
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14 #include "GuiListings.h"
15
16 #include "qt_helpers.h"
17 #include "FuncRequest.h"
18 #include "insets/InsetListings.h"
19 #include "insets/InsetListingsParams.h"
20 #include "support/debug.h"
21
22 #include "support/lstrings.h"
23
24 #include <QLineEdit>
25 #include <QCloseEvent>
26 #include <QPushButton>
27 #include <QValidator>
28 #include <QRegExpValidator>
29
30
31 using std::string;
32 using std::vector;
33 using lyx::support::findToken;
34 using lyx::support::getVectorFromString;
35 using lyx::support::getStringFromVector;
36 using lyx::support::prefixIs;
37 using lyx::support::suffixIs;
38 using lyx::support::contains;
39
40
41 namespace lyx {
42 namespace frontend {
43
44
45 /////////////////////////////////////////////////////////////////////
46 //
47 // GuiListings
48 //
49 /////////////////////////////////////////////////////////////////////
50
51
52 char const * languages[] =
53 { "no language", "ABAP", "ACSL", "Ada", "ALGOL", "Assembler", "Awk", "bash", "Basic", "C",
54   "C++", "Caml", "Clean", "Cobol", "Comal 80", "command.com", "Comsol", "csh", "Delphi",
55   "Eiffel", "Elan", "erlang", "Euphoria", "Fortran", "Gnuplot", "Haskell", "HTML", "IDL", "inform",
56   "Java", "JVMIS", "ksh", "Lingo", "Lisp", "Logo", "make", "Mathematica", "Matlab", "Mercury",
57   "MetaPost", "Miranda", "ML", "Modula-2", "MuPAD", "NASTRAN", "Oberon-2", "OCL", "Octave",
58   "Oz", "Pascal", "Perl", "PHP", "PL/I", "Plasm", "PostScript", "POV", "Prolog", "Promela",
59   "PSTricks", "Python", "R", "Reduce", "Rexx", "RSL", "Ruby", "S", "SAS", "Scilab", "sh",
60   "SHELXL", "Simula", "tcl", "SPARQL", "SQL", "tcl", "TeX", "VBScript", "Verilog", "VHDL",
61   "VRML", "XML", "XSLT", "" };
62
63
64 char const * languages_gui[] =
65 { N_("No language"), "ABAP", "ACSL", "Ada", "ALGOL", "Assembler", "Awk", "bash", "Basic",
66   "C", "C++", "Caml", "Clean", "Cobol", "Comal 80", "command.com", "Comsol", "csh", "Delphi",
67   "Eiffel", "Elan", "Erlang", "Euphoria", "Fortran", "Gnuplot", "Haskell", "HTML", "IDL", "inform",
68   "Java", "JVMIS", "ksh", "Lingo", "Lisp", "Logo", "make", "Mathematica", "Matlab", "Mercury",
69   "MetaPost", "Miranda", "ML", "Modula-2", "MuPAD", "NASTRAN", "Oberon-2", "OCL", "Octave",
70   "Oz", "Pascal", "Perl", "PHP", "PL/I", "Plasm", "PostScript", "POV", "Prolog", "Promela",
71   "PSTricks", "Python", "R", "Reduce", "Rexx", "RSL", "Ruby", "S", "SAS", "Scilab", "sh",
72   "SHELXL", "Simula", "tcl", "SPARQL", "SQL", "tcl", "TeX", "VBScript", "Verilog", "VHDL",
73   "VRML", "XML", "XSLT", "" };
74
75
76 struct dialect_info {
77         /// the dialect
78         char const * dialect;
79         /// the associated language
80         char const * language;
81         /// representation of the dialect in the gui
82         char const * gui;
83         /// is this the default dialect?
84         bool is_default;
85 };
86
87
88 dialect_info const dialects[] = {
89         { "R/2 4.3", "ABAP", "R/2 4.3", false },
90         { "R/2 5.0", "ABAP", "R/2 5.0", false },
91         { "R/3 3.1", "ABAP", "R/3 3.1", false },
92         { "R/3 4.6C", "ABAP", "R/3 4.6C", false },
93         { "R/3 6.10", "ABAP", "R/3 6.10", true },
94         { "2005", "Ada", "2005", true },
95         { "83", "Ada", "83", false },
96         { "95", "Ada", "95", false },
97         { "60", "Algol", "60", false },
98         { "68", "Algol", "68", true },
99         { "Motorola68k", "Assembler", "Motorola 68xxx", false },
100         { "x86masm", "Assembler", "x86 (MASM)", false },
101         { "gnu", "Awk", "gnu", true },
102         { "POSIX", "Awk", "POSIX", false },
103         { "Visual", "Basic", "Visual", false },
104         { "ANSI", "C", "ANSI", true },
105         { "Handel", "C", "Handel", false },
106         { "Objective", "C", "Objective", false },
107         { "Sharp", "C", "Sharp", false },
108         { "ANSI", "C++", "ANSI", false },
109         { "GNU", "C++", "GNU", false },
110         { "ISO", "C++", "ISO", true },
111         { "Visual", "C++", "Visual", false },
112         { "light", "Caml", "light", true },
113         { "Objective", "Caml", "Objective", false },
114         { "1974", "Cobol", "1974", false },
115         { "1985", "Cobol", "1985", true },
116         { "ibm", "Cobol", "IBM", false },
117         { "WinXP", "command.com", "Windows XP", true },
118         { "77", "Fortran", "77", false },
119         { "90", "Fortran", "90", false },
120         { "95", "Fortran", "95", true },
121         { "CORBA", "IDL", "CORBA", false },
122         { "AspectJ", "Java", "Aspect J", false },
123         { "Auto", "Lisp", "Auto", false },
124         { "gnu", "make", "gnu", false },
125         { "1.0", "Mathematica", "1.0", false },
126         { "3.0", "Mathematica", "3.0", false },
127         { "5.2", "Mathematica", "5.2", true },
128         { "decorative", "OCL", "decorative", false },
129         { "OMG", "OCL", "OMG", true },
130         { "Borland6", "Pascal", "Borland 6", false },
131         { "Standard", "Pascal", "Standard", true },
132         { "XSC", "Pascal", "XSC", false },
133         { "PLUS", "S", "PLUS", false },
134         { "67", "Simula", "67", true },
135         { "CII", "Simula", "CII", false },
136         { "DEC", "Simula", "DEC", false },
137         { "IBM", "Simula", "IBM", false },
138         { "tk", "tcl", "tk", false },
139         { "AlLaTeX", "TeX", "AlLaTeX", false },
140         { "common", "TeX", "common", false },
141         { "LaTeX", "TeX", "LaTeX", false },
142         { "plain", "TeX", "plain", true },
143         { "primitive", "TeX", "primitive", false },
144         { "AMS", "VHDL", "AMS", false },
145         { "97", "VRML", "97", true }
146 };
147
148
149 size_t const nr_dialects = sizeof(dialects) / sizeof(dialect_info);
150
151
152 char const * font_sizes[] =
153 { "default", "tiny", "scriptsize", "footnotesize", "small", "normalsize", "large",
154   "Large", "" };
155
156 char const * font_sizes_gui[] =
157 { N_("Default"), N_("Tiny"), N_("Smallest"), N_("Smaller"), N_("Small"), N_("Normal"),
158   N_("Large"), N_("Larger"), "" };
159
160 char const * font_styles[] =
161 { "default", "rmfamily", "ttfamily", "sffamily", "" };
162
163 char const * font_styles_gui[] =
164 { N_("Default"), N_("Roman"), N_("Typewriter"), N_("Sans Serif"), "" };
165
166
167
168 GuiListings::GuiListings(GuiView & lv)
169         : GuiDialog(lv, "listings")
170 {
171         setupUi(this);
172         setViewTitle(_("Program Listing Settings"));
173
174         connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
175         connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
176         connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
177
178         connect(languageCO, SIGNAL(currentIndexChanged(int)),
179                 this, SLOT(change_adaptor()));
180         connect(dialectCO, SIGNAL(currentIndexChanged(int)),
181                 this, SLOT(change_adaptor()));
182         connect(inlineCB, SIGNAL(clicked()),
183                 this, SLOT(change_adaptor()));
184         connect(floatCB, SIGNAL(clicked()),
185                 this, SLOT(change_adaptor()));
186         connect(placementLE, SIGNAL(textChanged(QString)),
187                 this, SLOT(change_adaptor()));
188         connect(numberSideCO, SIGNAL(currentIndexChanged(int)),
189                 this, SLOT(change_adaptor()));
190         connect(numberStepLE, SIGNAL(textChanged(QString)),
191                 this, SLOT(change_adaptor()));
192         connect(numberFontSizeCO, SIGNAL(currentIndexChanged(int)),
193                 this, SLOT(change_adaptor()));
194         connect(firstlineLE, SIGNAL(textChanged(QString)),
195                 this, SLOT(change_adaptor()));
196         connect(lastlineLE, SIGNAL(textChanged(QString)),
197                 this, SLOT(change_adaptor()));
198         connect(fontsizeCO, SIGNAL(currentIndexChanged(int)),
199                 this, SLOT(change_adaptor()));
200         connect(fontstyleCO, SIGNAL(currentIndexChanged(int)),
201                 this, SLOT(change_adaptor()));
202         connect(breaklinesCB, SIGNAL(clicked()),
203                 this, SLOT(change_adaptor()));
204         connect(spaceCB, SIGNAL(clicked()),
205                 this, SLOT(change_adaptor()));
206         connect(spaceInStringCB, SIGNAL(clicked()),
207                 this, SLOT(change_adaptor()));
208         connect(extendedcharsCB, SIGNAL(clicked()),
209                 this, SLOT(change_adaptor()));
210
211         connect(listingsED,  SIGNAL(textChanged()),
212                 this, SLOT(change_adaptor()));
213         connect(listingsED,  SIGNAL(textChanged()),
214                 this, SLOT(set_listings_msg()));
215         connect(bypassCB, SIGNAL(clicked()),
216                 this, SLOT(change_adaptor()));
217         connect(bypassCB, SIGNAL(clicked()),
218                 this, SLOT(set_listings_msg()));
219
220         for (int n = 0; languages[n][0]; ++n)
221                 languageCO->addItem(qt_(languages_gui[n]));
222
223         for (int n = 0; font_styles[n][0]; ++n)
224                 fontstyleCO->addItem(qt_(font_styles_gui[n]));
225
226         for (int n = 0; font_sizes[n][0]; ++n) {
227                 QString font = qt_(font_sizes_gui[n]);
228                 fontsizeCO->addItem(font);
229                 numberFontSizeCO->addItem(font);
230         }
231
232         // set validators
233         numberStepLE->setValidator(new QIntValidator(0, 1000000, this));
234         firstlineLE->setValidator(new QIntValidator(0, 1000000, this));
235         lastlineLE->setValidator(new QIntValidator(0, 1000000, this));
236         placementLE->setValidator(new QRegExpValidator(QRegExp("[\\*tbph]*"), this));
237
238         bc().setOK(okPB);
239         bc().setApply(applyPB);
240         bc().setCancel(closePB);
241         listingsTB->setPlainText(
242                 qt_("Input listing parameters on the right. Enter ? for a list of parameters."));
243
244         updateContents();
245
246 }
247
248
249 void GuiListings::closeEvent(QCloseEvent * e)
250 {
251         slotClose();
252         e->accept();
253 }
254
255
256 void GuiListings::change_adaptor()
257 {
258         changed();
259 }
260
261
262 string GuiListings::construct_params()
263 {
264         string language = languages[languageCO->currentIndex()];
265         string dialect;
266         string const dialect_gui = fromqstr(dialectCO->currentText());
267         if (dialectCO->currentIndex() > 0) {
268                 for (size_t i = 0; i != nr_dialects; ++i) {
269                         if (dialect_gui == dialects[i].gui
270                         && dialects[i].language == language
271                         && !dialects[i].is_default) {
272                                 dialect = dialects[i].dialect;
273                                 break;
274                         }
275                 }
276         }
277
278         bool float_ = floatCB->isChecked();
279         string placement;
280         if (placementLE->isEnabled())
281                 placement = fromqstr(placementLE->text());
282
283         string numberSide;
284         switch (numberSideCO->currentIndex()) {
285         case 0:
286                 numberSide = "none";
287                 break;
288         case 1:
289                 numberSide = "left";
290                 break;
291         case 2:
292                 numberSide = "right";
293                 break;
294         default:
295                 numberSide = "none";
296                 break;
297         }
298         string stepnumber = fromqstr(numberStepLE->text());
299         string numberfontsize = font_sizes[numberFontSizeCO->currentIndex()];
300         string firstline = fromqstr(firstlineLE->text());
301         string lastline = fromqstr(lastlineLE->text());
302
303         string fontsize = font_sizes[fontsizeCO->currentIndex()];
304         string fontstyle = font_styles[fontstyleCO->currentIndex()];
305         string basicstyle;
306         if (fontsize != "default")
307                 basicstyle = "\\" + fontsize;
308         if (fontstyle != "default")
309                 basicstyle += "\\" + fontstyle;
310         bool breakline = breaklinesCB->isChecked();
311         bool space = spaceCB->isChecked();
312         bool spaceInString = spaceInStringCB->isChecked();
313         bool extendedchars = extendedcharsCB->isChecked();
314         string extra = fromqstr(listingsED->toPlainText());
315
316         // compose a string
317         InsetListingsParams par;
318         if (language != "no language" && !contains(extra, "language=")) {
319                 if (dialect.empty())
320                         par.addParam("language", language);
321                 else
322                         par.addParam("language", "{[" + dialect + "]" + language + "}");
323         }
324         // this dialog uses float=placement instead of float,floatplacement=placement
325         // because float accepts *tbph and floatplacement accepts bph.
326         // our placement textedit is actually for the float parameter
327         if (float_)
328                 par.addParam("float", placement);
329         if (numberSide != "none")
330                 par.addParam("numbers", numberSide);
331         if (numberfontsize != "default" && numberSide != "none")
332                 par.addParam("numberstyle", "\\" + numberfontsize);
333         if (!stepnumber.empty() && numberSide != "none")
334                 par.addParam("stepnumber", stepnumber);
335         if (!firstline.empty())
336                 par.addParam("firstline", firstline);
337         if (!lastline.empty())
338                 par.addParam("lastline", lastline);
339         if (!basicstyle.empty())
340                 par.addParam("basicstyle", basicstyle);
341         if (breakline)
342                 par.addParam("breaklines", "true");
343         if (space)
344                 par.addParam("showspaces", "true");
345         if (!spaceInString)
346                 par.addParam("showstringspaces", "false");
347         if (extendedchars)
348                 par.addParam("extendedchars", "true");
349         par.addParams(extra);
350         return par.params();
351 }
352
353
354 docstring GuiListings::validate_listings_params()
355 {
356         // use a cache here to avoid repeated validation
357         // of the same parameters
358         static string param_cache;
359         static docstring msg_cache;
360         
361         if (bypassCB->isChecked())
362                 return docstring();
363
364         string params = construct_params();
365         if (params != param_cache) {
366                 param_cache = params;
367                 msg_cache = InsetListingsParams(params).validate();
368         }
369         return msg_cache;
370 }
371
372
373 void GuiListings::set_listings_msg()
374 {
375         static bool isOK = true;
376         docstring msg = validate_listings_params();
377         if (msg.empty()) {
378                 if (isOK)
379                         return;
380                 isOK = true;
381                 listingsTB->setPlainText(
382                         qt_("Input listing parameters on the right. Enter ? for a list of parameters."));
383         } else {
384                 isOK = false;
385                 listingsTB->setPlainText(toqstr(msg));
386         }
387 }
388
389
390 void GuiListings::on_floatCB_stateChanged(int state)
391 {
392         if (state == Qt::Checked) {
393                 inlineCB->setChecked(false);
394                 placementLE->setEnabled(true);
395         } else
396                 placementLE->setEnabled(false);
397 }
398
399
400 void GuiListings::on_inlineCB_stateChanged(int state)
401 {
402         if (state == Qt::Checked) {
403                 floatCB->setChecked(false);
404                 placementLE->setEnabled(false);
405         }
406 }
407
408
409 void GuiListings::on_numberSideCO_currentIndexChanged(int index)
410 {
411         numberStepLE->setEnabled(index > 0);
412         numberFontSizeCO->setEnabled(index > 0);
413 }
414
415
416 void GuiListings::on_languageCO_currentIndexChanged(int index)
417 {
418         dialectCO->clear();
419         // 0 is "no dialect"
420         int default_dialect = 0;
421         dialectCO->addItem(qt_("No dialect"));
422         string const language = languages[index];
423
424         for (size_t i = 0; i != nr_dialects; ++i) {
425                 if (language == dialects[i].language) {
426                         dialectCO->addItem(qt_(dialects[i].gui));
427                         if (dialects[i].is_default)
428                                 default_dialect =
429                                         dialectCO->findText(qt_(dialects[i].gui));
430                 }
431         }
432         dialectCO->setCurrentIndex(default_dialect);
433         dialectCO->setEnabled(dialectCO->count() > 1);
434 }
435
436
437 void GuiListings::applyView()
438 {
439         params_.setInline(inlineCB->isChecked());
440         params_.setParams(construct_params());
441 }
442
443
444 static string plainParam(std::string const & par)
445 {
446         // remove enclosing braces
447         if (prefixIs(par, "{") && suffixIs(par, "}"))
448                 return par.substr(1, par.size() - 2);
449         return par;
450 }
451
452
453 void GuiListings::updateContents()
454 {
455         // set default values
456         listingsTB->setPlainText(
457                 qt_("Input listing parameters on the right. Enter ? for a list of parameters."));
458         languageCO->setCurrentIndex(findToken(languages, "no language"));
459         dialectCO->setCurrentIndex(0);
460         floatCB->setChecked(false);
461         placementLE->clear();
462         numberSideCO->setCurrentIndex(0);
463         numberStepLE->clear();
464         numberFontSizeCO->setCurrentIndex(findToken(font_sizes, "default"));
465         firstlineLE->clear();
466         lastlineLE->clear();
467         fontstyleCO->setCurrentIndex(findToken(font_styles, "default"));
468         fontsizeCO->setCurrentIndex(findToken(font_sizes, "default"));
469         breaklinesCB->setChecked(false);
470         spaceCB->setChecked(false);
471         spaceInStringCB->setChecked(true);
472         extendedcharsCB->setChecked(false);
473
474         // set values from param string
475         inlineCB->setChecked(params_.isInline());
476         if (params_.isInline()) {
477                 floatCB->setChecked(false);
478                 placementLE->setEnabled(false);
479         }
480         // break other parameters and set values
481         vector<string> pars = getVectorFromString(params_.separatedParams(), "\n");
482         // process each of them
483         for (vector<string>::iterator it = pars.begin();
484             it != pars.end(); ++it) {
485                 if (prefixIs(*it, "language=")) {
486                         string arg = plainParam(it->substr(9));
487                         // has dialect?
488                         string language;
489                         string dialect;
490                         bool in_gui = false;
491                         if (prefixIs(arg, "[") && contains(arg, "]")) {
492                                 size_t end_dialect = arg.find("]");
493                                 dialect = arg.substr(1, end_dialect - 1);
494                                 language = arg.substr(end_dialect + 1);
495                         } else {
496                                 language = arg;
497                         }
498                         int n = findToken(languages, language);
499                         if (n >= 0) {
500                                 languageCO->setCurrentIndex(n);
501                                 in_gui = true;
502                         }
503                         // on_languageCO_currentIndexChanged should have set dialects
504                         if (!dialect.empty()) {
505                                 string dialect_gui;
506                                 for (size_t i = 0; i != nr_dialects; ++i) {
507                                         if (dialect == dialects[i].dialect
508                                             && dialects[i].language == language) {
509                                                 dialect_gui = dialects[i].gui;
510                                                 break;
511                                         }
512                                 }
513                                 n = dialectCO->findText(qt_(dialect_gui));
514                                 if (n >= 0)
515                                         dialectCO->setCurrentIndex(n);
516                                 else
517                                         in_gui = false;
518                         }
519                         if (in_gui)
520                                 *it = "";
521                         languageCO->setEnabled(in_gui);
522                         dialectCO->setEnabled(
523                                 in_gui && dialectCO->count() > 1);
524                 } else if (prefixIs(*it, "float")) {
525                         floatCB->setChecked(true);
526                         inlineCB->setChecked(false);
527                         placementLE->setEnabled(true);
528                         if (prefixIs(*it, "float="))
529                                 placementLE->setText(
530                                         toqstr(plainParam(it->substr(6))));
531                         *it = "";
532                 } else if (prefixIs(*it, "numbers=")) {
533                         string s = plainParam(it->substr(8));
534                         int n = 0;
535                         if (s == "left")
536                                 n = 1;
537                         else if (s == "right")
538                                 n = 2;
539                         numberSideCO->setCurrentIndex(n);
540                         *it = "";
541                 } else if (prefixIs(*it, "stepnumber=")) {
542                         numberStepLE->setText(
543                                 toqstr(plainParam(it->substr(11))));
544                         *it = "";
545                 } else if (prefixIs(*it, "numberstyle=")) {
546                         string par = plainParam(it->substr(12));
547                         int n = findToken(font_sizes, par.substr(1));
548                         if (n >= 0)
549                                 numberFontSizeCO->setCurrentIndex(n);
550                         *it = "";
551                 } else if (prefixIs(*it, "firstline=")) {
552                         firstlineLE->setText(
553                                 toqstr(plainParam(it->substr(10))));
554                         *it = "";
555                 } else if (prefixIs(*it, "lastline=")) {
556                         lastlineLE->setText(
557                                 toqstr(plainParam(it->substr(9))));
558                         *it = "";
559                 } else if (prefixIs(*it, "basicstyle=")) {
560                         string style;
561                         string size;
562                         for (int n = 0; font_styles[n][0]; ++n) {
563                                 string const s = font_styles[n];
564                                 if (contains(*it, "\\" + s)) {
565                                         style = "\\" + s;
566                                         break;
567                                 }
568                         }
569                         for (int n = 0; font_sizes[n][0]; ++n) {
570                                 string const s = font_sizes[n];
571                                 if (contains(*it, "\\" + s)) {
572                                         size = "\\" + s;
573                                         break;
574                                 }
575                         }
576                         if (plainParam(it->substr(11)) == style + size
577                             || plainParam(it->substr(11)) == size + style) {
578                                 if (!style.empty()) {
579                                         int n = findToken(font_styles, style.substr(1));
580                                         if (n >= 0)
581                                                 fontstyleCO->setCurrentIndex(n);
582                                 }
583                                 if (!size.empty()) {
584                                         int n = findToken(font_sizes, size.substr(1));
585                                         if (n >= 0)
586                                                 fontsizeCO->setCurrentIndex(n);
587                                 }
588                                 *it = "";
589                         }
590                 } else if (prefixIs(*it, "breaklines=")) {
591                         breaklinesCB->setChecked(contains(*it, "true"));
592                         *it = "";
593                 } else if (prefixIs(*it, "showspaces=")) {
594                         spaceCB->setChecked(contains(*it, "true"));
595                         *it = "";
596                 } else if (prefixIs(*it, "showstringspaces=")) {
597                         spaceInStringCB->setChecked(contains(*it, "true"));
598                         *it = "";
599                 } else if (prefixIs(*it, "extendedchars=")) {
600                         extendedcharsCB->setChecked(contains(*it, "true"));
601                         *it = "";
602                 }
603         }
604
605         numberStepLE->setEnabled(numberSideCO->currentIndex() > 0);
606         numberFontSizeCO->setEnabled(numberSideCO->currentIndex() > 0);
607         // parameters that can be handled by widgets are cleared
608         // the rest is put to the extra edit box.
609         string extra = getStringFromVector(pars);
610         listingsED->setPlainText(toqstr(InsetListingsParams(extra).separatedParams()));
611 }
612
613
614 bool GuiListings::isValid()
615 {
616         return validate_listings_params().empty();
617 }
618
619
620 bool GuiListings::initialiseParams(string const & data)
621 {
622         InsetListingsMailer::string2params(data, params_);
623         return true;
624 }
625
626
627 void GuiListings::clearParams()
628 {
629         params_.clear();
630 }
631
632
633 void GuiListings::dispatchParams()
634 {
635         string const lfun = InsetListingsMailer::params2string(params_);
636         dispatch(FuncRequest(getLfun(), lfun));
637 }
638
639
640 void GuiListings::setParams(InsetListingsParams const & params)
641 {
642         params_ = params;
643 }
644
645
646 Dialog * createGuiListings(GuiView & lv) { return new GuiListings(lv); }
647
648
649 } // namespace frontend
650 } // namespace lyx
651
652
653 #include "GuiListings_moc.cpp"