30 #if defined (HAVE_CONFIG_H)
34 #if defined (HAVE_QSCINTILLA)
36 #include <QApplication>
39 #include <QDesktopServices>
40 #include <QDialogButtonBox>
41 #include <QFileDialog>
42 #include <QInputDialog>
44 #include <QMessageBox>
45 #include <QPrintDialog>
46 #include <QPushButton>
52 #include <QTextStream>
53 #include <QVBoxLayout>
54 #if defined (HAVE_QSCI_QSCILEXEROCTAVE_H)
55 # define HAVE_LEXER_OCTAVE 1
56 # include <Qsci/qscilexeroctave.h>
57 #elif defined (HAVE_QSCI_QSCILEXERMATLAB_H)
58 # define HAVE_LEXER_MATLAB 1
59 # include <Qsci/qscilexermatlab.h>
61 #include <Qsci/qscilexerbash.h>
62 #include <Qsci/qscilexerbatch.h>
63 #include <Qsci/qscilexercpp.h>
64 #include <Qsci/qscilexerjava.h>
65 #include <Qsci/qscilexerdiff.h>
66 #include <Qsci/qscilexerperl.h>
67 #include <Qsci/qsciprinter.h>
86 #include "builtin-defun-decls.h"
108 const QString& directory_arg)
109 : m_octave_qobj (oct_qobj)
111 m_lexer_apis =
nullptr;
112 m_is_octave_file =
true;
113 m_lines_changed =
false;
114 m_autoc_active =
false;
116 m_ced = directory_arg;
119 m_file_system_watcher.setObjectName (
"_qt_autotest_force_engine_poller");
126 m_bp_conditions.clear ();
127 m_bp_restore_count = 0;
129 m_breakpoint_info.remove_next =
false;
130 m_breakpoint_info.remove_line = -1;
133 m_last_modified = QDateTime::currentDateTimeUtc();
135 connect (m_edit_area, SIGNAL (cursorPositionChanged (
int,
int)),
136 this, SLOT (handle_cursor_moved (
int,
int)));
138 connect (m_edit_area, SIGNAL (SCN_CHARADDED (
int)),
139 this, SLOT (handle_char_added (
int)));
141 connect (m_edit_area, SIGNAL (SCN_DOUBLECLICK (
int,
int,
int)),
142 this, SLOT (handle_double_click (
int,
int,
int)));
144 connect (m_edit_area, SIGNAL (linesChanged ()),
145 this, SLOT (handle_lines_changed ()));
154 m_status_bar =
new QStatusBar (
this);
157 m_row_indicator =
new QLabel (
"",
this);
158 QFontMetrics fm = m_row_indicator->fontMetrics ();
159 m_row_indicator->setMinimumSize (4.5*fm.averageCharWidth (), 0);
161 m_col_indicator =
new QLabel (
"",
this);
162 m_col_indicator->setMinimumSize (4*fm.averageCharWidth (), 0);
164 m_status_bar->addWidget (row_label, 0);
165 m_status_bar->addWidget (m_row_indicator, 0);
166 m_status_bar->addWidget (col_label, 0);
167 m_status_bar->addWidget (m_col_indicator, 0);
170 QLabel *enc_label =
new QLabel (tr (
"encoding:"),
this);
171 m_enc_indicator =
new QLabel (
"",
this);
172 m_status_bar->addWidget (enc_label, 0);
173 m_status_bar->addWidget (m_enc_indicator, 0);
174 m_status_bar->addWidget (
new QLabel (
" ",
this), 0);
178 m_eol_indicator =
new QLabel (
"",
this);
179 m_status_bar->addWidget (eol_label, 0);
180 m_status_bar->addWidget (m_eol_indicator, 0);
181 m_status_bar->addWidget (
new QLabel (
" ",
this), 0);
184 m_edit_area->setMarginType (1, QsciScintilla::SymbolMargin);
185 m_edit_area->setMarginSensitivity (1,
true);
187 m_edit_area->setMarkerBackgroundColor (QColor (0, 0, 232),
marker::bookmark);
192 m_edit_area->markerDefine (QsciScintilla::RightArrow,
194 m_edit_area->setMarkerBackgroundColor (QColor (255, 255, 0),
196 m_edit_area->markerDefine (QsciScintilla::RightArrow,
198 m_edit_area->setMarkerBackgroundColor (QColor (192, 192, 192),
201 connect (m_edit_area, SIGNAL (marginClicked (
int,
int,
202 Qt::KeyboardModifiers)),
203 this, SLOT (handle_margin_clicked (
int,
int,
204 Qt::KeyboardModifiers)));
210 m_edit_area->setMarginsForegroundColor (QColor (96, 96, 96));
211 m_edit_area->setMarginsBackgroundColor (QColor (232, 232, 220));
212 m_edit_area->setMarginType (2, QsciScintilla::TextMargin);
215 m_edit_area->setBraceMatching (QsciScintilla::StrictBraceMatch);
216 m_edit_area->setAutoIndent (
true);
217 m_edit_area->setIndentationWidth (2);
218 m_edit_area->setIndentationsUseTabs (
false);
220 m_edit_area->setUtf8 (
true);
223 m_edit_area->SendScintilla (QsciScintillaBase::SCI_AUTOCSETCANCELATSTART,
false);
225 QVBoxLayout *edit_area_layout =
new QVBoxLayout ();
226 edit_area_layout->addWidget (m_edit_area);
227 edit_area_layout->addWidget (m_status_bar);
228 edit_area_layout->setMargin (0);
229 edit_area_layout->setSpacing (0);
230 setLayout (edit_area_layout);
242 connect (m_edit_area, SIGNAL (modificationChanged (
bool)),
243 this, SLOT (update_window_title (
bool)));
245 connect (m_edit_area, SIGNAL (copyAvailable (
bool)),
246 this, SLOT (handle_copy_available (
bool)));
248 connect (&m_file_system_watcher, &QFileSystemWatcher::fileChanged,
249 this, [=] (
const QString& path) { file_has_changed (path); });
276 m_enc_indicator->setText (m_encoding);
278 m_new_encoding = m_encoding;
299 if (new_encoding.isEmpty ())
311 if ((save_dialog == QMessageBox::Cancel) ||
312 (save_dialog == QMessageBox::Save))
336 QRegExp rxfun1 (
"^[\t ]*function[^=]+=[\t ]*"
337 + word_at_cursor +
"[\t ]*\\([^\\)]*\\)[\t ]*$");
338 QRegExp rxfun2 (
"^[\t ]*function[\t ]+"
339 + word_at_cursor +
"[\t ]*\\([^\\)]*\\)[\t ]*$");
340 QRegExp rxfun3 (
"^[\t ]*function[\t ]+"
341 + word_at_cursor +
"[\t ]*$");
342 QRegExp rxfun4 (
"^[\t ]*function[^=]+=[\t ]*"
343 + word_at_cursor +
"[\t ]*$");
346 QStringList lines =
m_edit_area->text ().split (
"\n");
349 for (line = 0; line < lines.count (); line++)
351 if ((pos_fct = rxfun1.indexIn (lines.at (line))) != -1)
353 if ((pos_fct = rxfun2.indexIn (lines.at (line))) != -1)
355 if ((pos_fct = rxfun3.indexIn (lines.at (line))) != -1)
357 if ((pos_fct = rxfun4.indexIn (lines.at (line))) != -1)
367 int vis_line =
m_edit_area->SendScintilla (2220, line);
391 for (
int i = 0; i <
m_bp_lines.length (); i++)
410 cond =
'(' + cond +
") || (" +
m_edit_area->selectedText () +
')';
413 emit
dbstop_if (
"dbstop if", linenr+1, cond);
427 = QInputDialog::getText (
this, tr (
"Breakpoint condition"),
428 prompt, QLineEdit::Normal, cond, &ok);
432 if (ok && ! new_cond.isEmpty ())
439 QPointer<file_editor_tab> this_fetab (
this);
450 if (this_fetab.isNull ())
460 es.interpreter_try (frame);
467 tree_evaluator& tw = interp.get_evaluator ();
468 bp_table& bptab = tw.get_bp_table ();
470 bptab.condition_valid (new_cond.toStdString ());
475 emit request_add_breakpoint (line, new_cond);
484 catch (
const interrupt_exception&)
488 msg =
"evaluation interrupted";
497 QString new_prompt = (tr (
"ERROR: ")
511 if (! trackedFiles.isEmpty ())
513 if (! fileName.isEmpty () && QFile::exists (fileName))
570 int ans = QMessageBox::question (
nullptr, tr (
"Octave Editor"),
571 tr (
"Cannot add breakpoint to modified or unnamed file.\n"
572 "Save and add breakpoint, or cancel?"),
573 QMessageBox::Save | QMessageBox::Cancel, QMessageBox::Save);
575 if (ans == QMessageBox::Save)
587 Qt::KeyboardModifiers
state)
591 unsigned int markers_mask =
m_edit_area->markersAtLine (editor_linenr);
593 if (
state & Qt::ControlModifier)
626 #if defined (HAVE_LEXER_OCTAVE)
627 lexer =
new QsciLexerOctave ();
628 #elif defined (HAVE_LEXER_MATLAB)
629 lexer =
new QsciLexerMatlab ();
648 lexer =
new QsciLexerCPP ();
652 lexer =
new QsciLexerJava ();
656 lexer =
new QsciLexerPerl ();
660 lexer =
new QsciLexerBatch ();
664 lexer =
new QsciLexerDiff ();
668 lexer =
new QsciLexerBash ();
673 #if defined (HAVE_LEXER_OCTAVE)
674 lexer =
new QsciLexerOctave ();
676 #elif defined (HAVE_LEXER_MATLAB)
677 lexer =
new QsciLexerMatlab ();
696 || QString(old_lexer->lexer ()) != QString(
lexer->
lexer ()))
736 bool update_apis =
false;
741 QString tmp_app_name = QCoreApplication::applicationName ();
742 QCoreApplication::setApplicationName (
"octave");
744 #if defined (HAVE_QSTANDARDPATHS)
745 QString local_data_path
746 = QStandardPaths::writableLocation (QStandardPaths::CacheLocation);
748 QString local_data_path
749 = QDesktopServices::storageLocation (QDesktopServices::CacheLocation);
752 QCoreApplication::setApplicationName (
"octave");
760 bool octave_functions
763 QCoreApplication::setApplicationName (tmp_app_name);
779 if (octave_functions)
788 update_apis = ! apis_file.exists ();
790 if (octave_functions)
795 QDateTime apis_time = apis_file.lastModified ();
797 || QDateTime::currentDateTime () > apis_time.addSecs (180))
812 bool apis_usable =
f.open (QIODevice::ReadOnly);
815 QDir ().mkpath (QFileInfo (
f).absolutePath ());
816 apis_usable =
f.open (QIODevice::WriteOnly);
838 QPointer<file_editor_tab> this_fetab (
this);
849 if (this_fetab.isNull ())
852 QStringList api_entries;
855 const Cell ctmp = tmp(0).cell_value ();
858 std::string kw = ctmp(i).string_value ();
872 if (octave_functions)
891 for (
int i = 1; i <= 3; i++)
895 QString keyword = QString (
lexer->keywords (i));
897 QStringList keyword_list
898 = keyword.split (QRegExp (R
"(\s+)"));
900 for (
int j = 0; j < keyword_list.size (); j++)
909 if (update_apis_only)
919 QColor bg =
lexer->paper (0);
920 QColor fg =
lexer->color (0);
936 QColor current_line_bg
941 bgm = current_line_bg;
947 QColor hg = QApplication::palette ().color (QPalette::Highlight);
958 QFont line_numbers_font =
lexer->defaultFont ();
959 int font_size = line_numbers_font.pointSize ();
960 font_size = font_size
964 line_numbers_font.setPointSize (font_size);
975 for (
int idx = 0; idx < api_entries.size (); idx++)
984 disconnect (
m_lexer_apis, &QsciAPIs::apiPreparationFinished,
991 connect (
m_lexer_apis, &QsciAPIs::apiPreparationFinished,
1037 bool remove_on_success)
1042 save_file (fileName, remove_on_success);
1058 QsciPrinter *printer =
new QsciPrinter (QPrinter::HighResolution);
1060 QPrintDialog printDlg (printer,
this);
1062 if (printDlg.exec () == QDialog::Accepted)
1179 if (! bmlist.isEmpty ())
1181 bmlist += QString::number (line);
1199 const QString& condition)
1226 int editor_linenr, cur;
1227 m_edit_area->getCursorPosition (&editor_linenr, &cur);
1254 if (nextcond != -1 && (nextcond < nextline || nextline == -1))
1255 nextline = nextcond;
1267 int line, cur, prevline, prevcond;
1276 if (prevcond != -1 && prevcond > prevline)
1277 prevline = prevcond;
1301 unsigned int sci_msg)
1351 QsciScintilla::EolMode eol_mode)
1394 QPointer<file_editor_tab> this_fetab (
this);
1412 line, cond.toStdString ());
1413 if (this_fetab.isNull ())
1449 line = QInputDialog::getInt (
m_edit_area, tr (
"Goto line"),
1450 tr (
"Line number"), line+1, 1,
1479 QsciScintilla::AutoCompletionSource s =
m_edit_area->autoCompletionSource ();
1482 case QsciScintilla::AcsAll:
1486 case QsciScintilla::AcsAPIs:
1490 case QsciScintilla::AcsDocument:
1494 case QsciScintilla::AcsNone:
1506 int lineFrom, lineTo, colFrom, colTo;
1507 m_edit_area->getSelection (&lineFrom, &colFrom, &lineTo, &colTo);
1512 for (
int i = lineFrom; i <= lineTo; i++)
1540 int lineFrom, lineTo;
1545 m_edit_area->getSelection (&lineFrom, &colFrom, &lineTo, &colTo);
1566 QString ws =
"^(?:[ \\t]*)";
1568 QString used_comment_str = comment_str.at (0);
1579 = QInputDialog::getText (
this, tr (
"Comment selected text"),
1580 tr (
"Comment string to use:\n"),
1585 if ((! ok) || used_comment_str.isEmpty ())
1596 QStringList comment_str_sorted (comment_str.at (0));
1599 for (
int i = 1; i < comment_str.length (); i++)
1602 for (
int j = 0; j < comment_str_sorted.length (); j++)
1604 if (comment_str.at (i).length () > comment_str_sorted.at (j).length ())
1606 comment_str_sorted.insert (j, comment_str.at (i));
1612 comment_str_sorted << comment_str.at (i);
1617 for (
int i = 0; i < comment_str_sorted.length (); i++)
1623 rxc = QRegExp (ws +
"(" +
regexp +
")");
1627 int len = 0, lenc = 0;
1632 int lineFrom, lineTo, colFrom, colTo;
1633 int change_col_from = 1;
1634 int change_col_to = 1;
1637 m_edit_area->getSelection (&lineFrom, &colFrom, &lineTo, &colTo);
1642 for (
int i = lineFrom; i <= lineTo; i++)
1651 if ((removed = line.contains (rxc)))
1653 len = rxc.matchedLength ();
1654 QString matched_text = rxc.capturedTexts ().at (0);
1655 lenc = matched_text.remove (QRegExp (ws)).length ();
1661 if (i == lineFrom && (colFrom <
len-lenc || ! removed))
1662 change_col_from = 0;
1663 if (i == lineTo && (colTo <
len-lenc || ! removed))
1671 colFrom = colFrom + lenc;
1673 colTo = colTo + lenc;
1681 colFrom = colFrom - change_col_from*lenc;
1682 colTo = colTo - change_col_to*lenc;
1686 m_edit_area->setSelection (lineFrom, colFrom, lineTo, colTo);
1693 m_edit_area->insertAt (used_comment_str, cpline, 0);
1697 if (line.contains (rxc))
1699 len = rxc.matchedLength ();
1700 QString matched_text = rxc.capturedTexts ().at (0);
1701 lenc = matched_text.remove (QRegExp (ws)).length ();
1713 QString tooltip (
"");
1716 title = tr (
"<unnamed>");
1720 title = file.fileName ();
1737 dlg->setAttribute (Qt::WA_DeleteOnClose);
1742 dlg->setWindowModality (Qt::NonModal);
1749 int decision = QMessageBox::Yes;
1755 QMessageBox::StandardButtons buttons = QMessageBox::Save |
1756 QMessageBox::Discard |
1757 QMessageBox::Cancel;
1762 QString available_actions =
1763 tr (
"Do you want to cancel closing, save or discard the changes?");
1769 file = tr (
"<unnamed>");
1772 =
new QMessageBox (QMessageBox::Warning, tr (
"Octave Editor"),
1775 "is about to be closed but has been modified. "
1777 arg (file). arg (available_actions),
1778 buttons, qobject_cast<QWidget *> (parent ()));
1780 msgBox->setDefaultButton (QMessageBox::Save);
1783 decision = msgBox->exec ();
1785 if (decision == QMessageBox::Cancel)
1787 else if (decision == QMessageBox::Save)
1827 for (
int i = 0; i <
m_bp_lines.length (); i++)
1840 QFileInfo
file_info = QFileInfo (fileName);
1841 QString file_to_load;
1843 file_to_load =
file_info.canonicalFilePath ();
1845 file_to_load = fileName;
1846 QFile file (file_to_load);
1847 if (!file.open(QIODevice::ReadOnly))
1848 return file.errorString ();
1850 int col = 0, line = 0;
1858 QApplication::setOverrideCursor (Qt::WaitCursor);
1861 QByteArray text_data = file.readAll ();
1869 const QByteArray eol_lf = QByteArray (1, 0x0a);
1870 const QByteArray eol_cr = QByteArray (1, 0x0d);
1872 if (text_data.endsWith (eol_lf))
1875 if (text_data.endsWith (eol_cr))
1880 QTextCodec::ConverterState st;
1881 QTextCodec *codec = QTextCodec::codecForName (
m_encoding.toLatin1 ());
1882 if (codec ==
nullptr)
1883 codec = QTextCodec::codecForLocale ();
1885 const QString text = codec->toUnicode(text_data.constData(),
1886 text_data.size(), &st);
1889 if (st.invalidChars > 0)
1895 QString msg = tr (
"There were problems reading the file\n"
1897 "with the selected encoding %2.\n\n"
1898 "Modifying and saving the file might "
1902 msg_box->setIcon (QMessageBox::Warning);
1903 msg_box->setText (msg);
1904 msg_box->setWindowTitle (tr (
"Octave Editor"));
1905 msg_box->addButton (tr (
"&Edit anyway"), QMessageBox::YesRole);
1906 msg_box->addButton (tr (
"Chan&ge encoding"), QMessageBox::AcceptRole);
1907 msg_box->addButton (tr (
"&Close"), QMessageBox::RejectRole);
1909 connect (msg_box, &QMessageBox::buttonClicked,
1912 msg_box->setWindowModality (Qt::WindowModal);
1913 msg_box->setAttribute (Qt::WA_DeleteOnClose);
1920 QApplication::restoreOverrideCursor ();
1935 QString txt = btn->text ();
1937 if (txt == tr (
"&Close"))
1944 if (txt == tr (
"Chan&ge encoding"))
1948 dlg.setWindowTitle (tr (
"Select new default encoding"));
1951 =
new QLabel (tr (
"Please select a new encoding\n"
1952 "for reloading the current file.\n\n"
1953 "This does not change the default encoding.\n"));
1955 QComboBox *enc_combo =
new QComboBox ();
1959 connect (enc_combo, &QComboBox::currentTextChanged,
1962 QDialogButtonBox *buttons
1963 =
new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
1965 connect (buttons, &QDialogButtonBox::accepted, &dlg, &QDialog::accept);
1966 connect (buttons, &QDialogButtonBox::rejected, &dlg, &QDialog::reject);
1968 QGridLayout *main_layout =
new QGridLayout;
1969 main_layout->setSizeConstraint (QLayout::SetFixedSize);
1970 main_layout->addWidget (text, 0, 0);
1971 main_layout->addWidget (enc_combo, 1, 0);
1972 main_layout->addWidget (buttons, 2, 0);
1973 dlg.setLayout (main_layout);
1975 int answer = dlg.exec ();
1977 if (answer == QDialog::Accepted)
1997 QByteArray text =
m_edit_area->text ().toLatin1 ();
1999 QByteArray eol_lf = QByteArray (1, 0x0a);
2000 QByteArray eol_cr = QByteArray (1, 0x0d);
2001 QByteArray eol_crlf = eol_cr;
2002 eol_crlf.append (eol_lf);
2004 int count_crlf = text.count (eol_crlf);
2005 int count_lf = text.count (eol_lf) - count_crlf;
2006 int count_cr = text.count (eol_cr) - count_crlf;
2010 QsciScintilla::EolMode eol_mode
2015 if (count_crlf > count_max)
2017 eol_mode = QsciScintilla::EolWindows;
2018 count_max = count_crlf;
2020 if (count_lf > count_max)
2022 eol_mode = QsciScintilla::EolUnix;
2023 count_max = count_lf;
2025 if (count_cr > count_max)
2027 eol_mode = QsciScintilla::EolMac;
2037 case QsciScintilla::EolWindows:
2040 case QsciScintilla::EolMac:
2043 case QsciScintilla::EolUnix:
2060 QPointer<file_editor_tab> this_fetab (
this);
2070 if (this_fetab.isNull ())
2077 Qt::QueuedConnection);
2094 if (file (i).string_value () ==
m_file_name.toStdString ())
2120 const QString& base_name,
2121 bool remove_on_success,
2122 bool restore_breakpoints)
2124 int ans = QMessageBox::question (
nullptr, tr (
"Debug or Save"),
2125 tr (
"This file is currently being executed.\n"
2126 "Quit debugging and save?"),
2127 QMessageBox::Save | QMessageBox::Cancel);
2129 if (ans == QMessageBox::Save)
2136 QPointer<file_editor_tab> this_fetab (
this);
2153 std::string std_base_name = base_name.toStdString ();
2159 if (this_fetab.isNull ())
2163 restore_breakpoints);
2169 bool remove_on_success,
2170 bool restore_breakpoints)
2193 QFileInfo
file_info = QFileInfo (saveFileName);
2194 QString file_to_save;
2197 file_to_save =
file_info.canonicalFilePath ();
2198 QString base_name =
file_info.baseName ();
2205 QPointer<file_editor_tab> this_fetab (
this);
2218 if (this_fetab.isNull ())
2229 std::string std_base_name = base_name.toStdString ();
2231 if (tw.in_debug_repl ())
2236 sym = symtab.find_user_function (std_base_name);
2247 if (! sym.is_defined () || ! sym.is_user_code ())
2249 emit do_save_file_signal (file_to_save, remove_on_success,
2250 restore_breakpoints);
2256 std::string full_name = file_to_save.toStdString ();
2261 emit do_save_file_signal (file_to_save, remove_on_success,
2262 restore_breakpoints);
2272 octave_map stk = tw.backtrace (curr_frame,
false);
2274 Cell names = stk.contents (
"name");
2278 if (names(i).string_value () == std_base_name)
2280 emit confirm_dbquit_and_save_signal
2281 (file_to_save, base_name, remove_on_success,
2282 restore_breakpoints);
2288 symtab.clear_user_function (std_base_name);
2291 restore_breakpoints);
2295 emit do_save_file_signal (saveFileName, remove_on_success,
2296 restore_breakpoints);
2300 bool remove_on_success,
2301 bool restore_breakpoints)
2303 QSaveFile file (file_to_save);
2307 if (trackedFiles.contains (file_to_save))
2327 if (! file.open (QIODevice::WriteOnly))
2331 if (trackedFiles.contains (file_to_save))
2337 tr (
"Octave Editor"),
2338 tr (
"Could not open file %1 for write:\n%2.").
2339 arg (file_to_save).arg (file.errorString ()),
2340 QMessageBox::Ok,
nullptr);
2349 QTextStream out (&file);
2357 out.setCodec (codec);
2359 QApplication::setOverrideCursor (Qt::WaitCursor);
2367 QApplication::restoreOverrideCursor ();
2371 bool writing_ok = file.commit ();
2376 QFileInfo
file_info = QFileInfo (file.fileName ());
2377 QString full_file_to_save =
file_info.canonicalFilePath ();
2388 if (remove_on_success)
2397 if (restore_breakpoints)
2402 QMessageBox::critical (
nullptr,
2403 tr (
"Octave Editor"),
2404 tr (
"The changes could not be saved to the file\n"
2406 .arg (file.fileName ())
2422 if (remove_on_success)
2433 QStringList filters;
2434 filters << tr (
"Octave Files (*.m)")
2435 << tr (
"All Files (*)");
2436 fileDialog->setNameFilters (filters);
2437 fileDialog->setDefaultSuffix (
"m");
2446 fileDialog->selectNameFilter (filters.at (1));
2447 fileDialog->setDefaultSuffix (
"");
2452 fileDialog->selectFile (
"");
2453 fileDialog->setDirectory (
m_ced);
2458 if (! fname.isEmpty ())
2459 fileDialog->selectFile (fname +
".m");
2462 fileDialog->setAcceptMode (QFileDialog::AcceptSave);
2463 fileDialog->setViewMode (QFileDialog::Detail);
2464 fileDialog->setOption (QFileDialog::HideNameFilterDetails,
false);
2472 fileDialog->setOption(QFileDialog::DontUseNativeDialog);
2479 fileDialog->setOption(QFileDialog::DontConfirmOverwrite);
2482 connect (fileDialog, &QFileDialog::filterSelected,
2485 if (remove_on_success)
2487 connect (fileDialog, &QFileDialog::fileSelected,
2490 connect (fileDialog, &QFileDialog::rejected,
2495 connect (fileDialog, &QFileDialog::fileSelected,
2510 QFileDialog *file_dialog = qobject_cast<QFileDialog *> (sender ());
2512 QRegExp rx (
"\\*\\.([^ ^\\)]*)[ \\)]");
2513 int index = rx.indexIn (
filter, 0);
2516 file_dialog->setDefaultSuffix (rx.cap (1));
2518 file_dialog->setDefaultSuffix (
"");
2524 QString base_name = file.baseName ();
2526 if ((file.suffix () ==
"m")
2529 int ans = QMessageBox::question (
nullptr, tr (
"Octave Editor"),
2531 "is not a valid identifier.\n\n"
2532 "If you keep this filename, you will not be able to\n"
2533 "call your script using its name as an Octave command.\n\n"
2534 "Do you want to choose another name?").arg (base_name),
2535 QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
2537 if (ans == QMessageBox::Yes)
2546 QTextCodec *codec = QTextCodec::codecForName (
m_encoding.toLatin1 ());
2549 if ((! codec) &&
m_encoding.startsWith(
"SYSTEM"))
2550 codec = QTextCodec::codecForLocale ();
2554 QMessageBox::critical (
nullptr,
2555 tr (
"Octave Editor"),
2556 tr (
"The current encoding %1\n"
2557 "can not be applied.\n\n"
2558 "Please select another one!").arg (
m_encoding));
2564 bool can_encode = codec->canEncode (editor_text);
2571 QVector<uint> u32_str = editor_text.toUcs4 ();
2572 const uint32_t *src =
reinterpret_cast<const uint32_t *
>
2579 u32_str.size (), &length);
2582 if (errno == EILSEQ)
2586 ::free (
static_cast<void *
> (res_str));
2591 QMessageBox::StandardButton pressed_button
2592 = QMessageBox::critical (
nullptr,
2593 tr (
"Octave Editor"),
2594 tr (
"The current editor contents can not be encoded\n"
2595 "with the selected encoding %1.\n"
2596 "Using it would result in data loss!\n\n"
2597 "Please select another one!").arg (
m_encoding),
2598 QMessageBox::Cancel | QMessageBox::Ignore,
2599 QMessageBox::Cancel);
2601 if (pressed_button == QMessageBox::Ignore)
2612 QString saveFileName = save_file_name;
2613 QFileInfo file (saveFileName);
2614 QFileDialog *file_dialog = qobject_cast<QFileDialog *> (sender ());
2619 if ((! file_dialog->defaultSuffix ().isEmpty ()) && file.suffix ().isEmpty ())
2621 saveFileName = saveFileName +
"." + file_dialog->defaultSuffix ();
2624 file.setFile (saveFileName);
2628 if (file_dialog->testOption (QFileDialog::DontConfirmOverwrite) && file.exists ())
2630 int ans = QMessageBox::question (file_dialog,
2631 tr (
"Octave Editor"),
2632 tr (
"%1\n already exists\n"
2633 "Do you want to overwrite it?").arg (saveFileName),
2634 QMessageBox::Yes | QMessageBox::No);
2635 if (ans != QMessageBox::Yes)
2679 if (file_exists && ! do_close)
2683 QDateTime modified = QFileInfo (
m_file_name).lastModified ().toUTC ();
2695 if (! trackedFiles.isEmpty ())
2698 if (file_exists && ! do_close)
2716 tr (
"Octave Editor"),
2717 tr (
"It seems that \'%1\' has been modified by another application. Do you want to reload it?").
2719 QMessageBox::Yes | QMessageBox::No,
this);
2721 connect (msgBox, &QMessageBox::finished,
2724 msgBox->setWindowModality (Qt::WindowModal);
2725 msgBox->setAttribute (Qt::WA_DeleteOnClose);
2744 QString modified =
"";
2746 modified = tr (
"\n\nWarning: The contents in the editor is modified!");
2752 =
new QMessageBox (QMessageBox::Warning, tr (
"Octave Editor"),
2753 tr (
"It seems that the file\n"
2755 "has been deleted or renamed. Do you want to save it now?%2").
2757 QMessageBox::Save | QMessageBox::Close,
nullptr);
2761 connect (msgBox, &QMessageBox::finished,
2764 msgBox->setWindowModality (Qt::WindowModal);
2765 msgBox->setAttribute (Qt::WA_DeleteOnClose);
2781 m_edit_area->setMarginType (3, QsciScintilla::SymbolMargin);
2782 m_edit_area->setFolding (QsciScintilla::BoxedTreeFoldStyle, 3);
2786 m_edit_area->setFolding (QsciScintilla::NoFoldStyle, 3);
2800 bool match_keywords =
settings->value
2802 bool match_document =
settings->value
2805 QsciScintilla::AutoCompletionSource source = QsciScintilla::AcsNone;
2808 source = QsciScintilla::AcsAll;
2810 source = QsciScintilla::AcsAPIs;
2811 else if (match_document)
2812 source = QsciScintilla::AcsDocument;
2828 m_edit_area->setWhitespaceVisibility (QsciScintilla::WsVisibleAfterIndent);
2830 m_edit_area->setWhitespaceVisibility (QsciScintilla::WsVisible);
2832 m_edit_area->setWhitespaceVisibility (QsciScintilla::WsInvisible);
2849 disconnect (
m_edit_area, SIGNAL (linesChanged ()),
nullptr,
nullptr);
2872 m_edit_area->SendScintilla (QsciScintillaBase::SCI_SETHSCROLLBAR,
2874 m_edit_area->SendScintilla (QsciScintillaBase::SCI_SETSCROLLWIDTH,-1);
2875 m_edit_area->SendScintilla (QsciScintillaBase::SCI_SETSCROLLWIDTHTRACKING,
true);
2888 m_edit_area->setEdgeMode (QsciScintilla::EdgeLine);
2893 m_edit_area->setEdgeMode (QsciScintilla::EdgeBackground);
2895 m_edit_area->setEdgeMode (QsciScintilla::EdgeLine);
2899 m_edit_area->setEdgeMode (QsciScintilla::EdgeNone);
2902 m_edit_area->setWrapVisualFlags (QsciScintilla::WrapFlagByBorder);
2903 m_edit_area->setWrapIndentMode (QsciScintilla::WrapIndentSame);
2906 m_edit_area->setWrapMode (QsciScintilla::WrapWord);
2908 m_edit_area->setWrapMode (QsciScintilla::WrapNone);
2929 bool cursor_blinking;
2936 if (cursor_blinking)
2937 m_edit_area->SendScintilla (QsciScintillaBase::SCI_SETCARETPERIOD, 500);
2939 m_edit_area->SendScintilla (QsciScintillaBase::SCI_SETCARETPERIOD, 0);
2969 if (decision == QMessageBox::Yes)
2984 if (decision == QMessageBox::Save)
3002 if (ID !=
this || ID ==
nullptr)
3019 int editor_linenr = -1;
3022 if (editor_linenr != -1)
3030 int original_linenr = -1;
3033 if (original_linenr >= 0)
3036 int linenr_guess = editor_linenr + line - original_linenr;
3076 if (ID !=
this || ID ==
nullptr)
3085 const QString& cond)
3087 if (ID !=
this || ID ==
nullptr)
3094 int editor_linenr = -1;
3102 if ((cond ==
"") != (bp->
get_cond () ==
""))
3141 long int visible_lines
3142 =
m_edit_area->SendScintilla (QsciScintillaBase::SCI_LINESONSCREEN);
3144 if (visible_lines > 2)
3153 int vis_line =
m_edit_area->SendScintilla (2220, line);
3155 int first_line =
m_edit_area->firstVisibleLine ();
3157 if (always || vis_line == first_line
3158 || vis_line > first_line + visible_lines - 2)
3160 first_line += (vis_line - first_line - (visible_lines - 1) / 2);
3178 if (
m_edit_area->SendScintilla (QsciScintillaBase::SCI_AUTOCACTIVE))
3198 if (do_smart_indent)
3235 if (! style_comment)
3246 int col_space = col;
3247 int indentation =
m_edit_area->indentation (line);
3251 while (c !=
' ' && c !=
'\t' && col_space > indentation)
3253 pos =
m_edit_area->positionFromLineIndex (line, col_space--);
3254 c =
m_edit_area->SendScintilla (QsciScintillaBase::SCI_GETCHARAT, pos);
3259 int col_newline = col - 1;
3260 if (c ==
' ' || c ==
'\t')
3261 col_newline = col_space + 1;
3265 QString newline = QString (
"\n");
3269 m_edit_area->insertAt (newline, line, col_newline);
3273 m_edit_area->setIndentation (line + 1, indentation);
3274 m_edit_area->SendScintilla (QsciScintillaBase::SCI_LINEEND);
3300 QString word =
m_edit_area->wordAtLineIndex (line, col);
3301 word = word.trimmed ();
3303 if (! word.isEmpty ())
3308 int first_line =
m_edit_area->firstVisibleLine ();
3309 int x_offset =
m_edit_area->SendScintilla (QsciScintillaBase::SCI_GETXOFFSET);
3312 bool find_result_available
3321 #
if defined (HAVE_QSCI_VERSION_2_6_0)
3328 int wlen = word.length ();
3330 while (find_result_available)
3344 m_edit_area->SendScintilla (QsciScintillaBase::SCI_SETXOFFSET, x_offset);
3346 m_edit_area->setSelection (line, col - wlen, line, col);
3355 QRegExp rxfun1 (
"^[\t ]*function[^=]+=([^\\(]+)\\([^\\)]*\\)[\t ]*$");
3356 QRegExp rxfun2 (
"^[\t ]*function[\t ]+([^\\(]+)\\([^\\)]*\\)[\t ]*$");
3357 QRegExp rxfun3 (
"^[\t ]*function[^=]+=[\t ]*([^\\s]+)[\t ]*$");
3358 QRegExp rxfun4 (
"^[\t ]*function[\t ]+([^\\s]+)[\t ]*$");
3359 QRegExp rxfun5 (
"^[\t ]*classdef[\t ]+([^\\s]+)[\t ]*$");
3361 QStringList lines =
m_edit_area->text ().split (
"\n");
3363 for (
int i = 0; i < lines.count (); i++)
3365 if (rxfun1.indexIn (lines.at (i)) != -1)
3366 return rxfun1.cap (1).remove (QRegExp (
"[ \t]*"));
3367 else if (rxfun2.indexIn (lines.at (i)) != -1)
3368 return rxfun2.cap (1).remove (QRegExp (
"[ \t]*"));
3369 else if (rxfun3.indexIn (lines.at (i)) != -1)
3370 return rxfun3.cap (1).remove (QRegExp (
"[ \t]*"));
3371 else if (rxfun4.indexIn (lines.at (i)) != -1)
3372 return rxfun4.cap (1).remove (QRegExp (
"[ \t]*"));
3373 else if (rxfun5.indexIn (lines.at (i)) != -1)
3374 return rxfun5.cap (1).remove (QRegExp (
"[ \t]*"));
OCTARRAY_OVERRIDABLE_FUNC_API octave_idx_type numel(void) const
Number of elements in the array.
Base class for Octave interfaces that use Qt.
resource_manager & get_resource_manager(void)
int remove_breakpoint_from_file(const std::string &file="", int line=1)
int add_breakpoint_in_file(const std::string &file="", int line=1, const std::string &condition="")
bp_lines remove_all_breakpoints_from_file(const std::string &file, bool silent=false)
static bool interrupt(bool=true)
void notice_settings(const gui_settings *settings, bool init=false)
void next_breakpoint(const QWidget *ID)
void handle_decode_warning_answer(QAbstractButton *btn)
void handle_add_octave_apis(const QStringList &api_entries)
void smart_indent_line_or_selected_text(const QWidget *ID)
void remove_all_breakpoints_signal(void)
void handle_lines_changed(void)
void handle_dbstop_if(const QString &prompt, int line, const QString &cond)
void report_marker_linenr(QIntList &lines, QStringList &conditions)
bool check_valid_identifier(QString file_name)
void do_comment_selected_text(bool comment, bool input_str=false)
base_qobject & m_octave_qobj
void run_file_signal(const QFileInfo &info)
void move_match_brace(const QWidget *ID, bool select)
void previous_breakpoint(const QWidget *ID)
void save_file_as(const QWidget *ID)
void do_indent_selected_text(bool indent)
void set_modified(bool modified=true)
void set_focus(const QWidget *ID)
bool valid_file_name(const QString &file=QString())
void set_focus_editor_signal(QWidget *)
void run_file(const QWidget *ID, bool step_into=false)
void add_breakpoint_event(int line, const QString &cond)
void update_breakpoints()
void unindent_selected_text(const QWidget *ID)
void remove_position_via_debugger_linenr(int debugger_linenr)
void save_apis_info(void)
void comment_selected_text(const QWidget *ID, bool input_str)
void handle_save_file_as_answer(const QString &fileName)
void confirm_dbquit_and_save(const QString &file_to_save, const QString &base_name, bool remove_on_success, bool restore_breakpoints)
void do_breakpoint_marker(bool insert, const QWidget *ID, int line=-1, const QString &cond="")
int check_file_modified(bool remove=false)
void request_remove_breakpoint_via_editor_linenr(int editor_linenr)
QString load_file(const QString &fileName)
QStringList m_bp_conditions
void update_rowcol_indicator(int line, int col)
void handle_current_enc_changed(const QString &enc)
QFileSystemWatcher m_file_system_watcher
void handle_request_remove_breakpoint(int line)
void confirm_dbquit_and_save_signal(const QString &file_to_save, const QString &base_name, bool remove_on_success, bool restore_breakpoints)
void indent_selected_text(const QWidget *ID)
void handle_save_file_as_answer_close(const QString &fileName)
void context_run(const QWidget *ID)
void next_bookmark(const QWidget *ID)
void check_restore_breakpoints(void)
void remove_all_positions(void)
void convert_eol(const QWidget *ID, QsciScintilla::EolMode)
void center_current_line(bool always=true)
void set_file_name(const QString &fileName)
void interpreter_event(const fcn_callback &fcn)
void handle_remove_next(int remove_line)
QString get_all_bookmarks(void)
void recover_from_exit(void)
void new_file(const QString &commands=QString())
void tab_remove_request(void)
void file_has_changed(const QString &path, bool do_close=false)
void handle_file_reload_answer(int decision)
void previous_bookmark(const QWidget *ID)
void remove_bookmark(const QWidget *ID)
void enable_file_watcher(bool do_enable)
void editor_check_conflict_save(const QString &saveFileName, bool remove_on_success)
void update_eol_indicator(void)
void do_save_file(const QString &file_to_save, bool remove_on_success, bool restore_breakpoints)
void request_add_breakpoint(int line, const QString &cond)
bool conditional_close(void)
void handle_margin_clicked(int line, int margin, Qt::KeyboardModifiers state)
void mru_add_file(const QString &file_name, const QString &encoding)
void remove_all_breakpoints(const QWidget *ID)
void save_file(const QWidget *ID)
QString get_function_name(void)
void handle_char_added(int character)
void context_help(const QWidget *ID, bool)
void find_translated_line_number(int original_linenr, int &translated_linenr, marker *&)
void update_breakpoints_handler(const octave_value_list &argout)
void delete_debugger_pointer(const QWidget *ID, int line=-1)
void update_lexer_settings(bool update_apis_only=false)
QStatusBar * m_status_bar
octave_qscintilla * m_edit_area
QTextCodec * check_valid_codec(void)
void handle_cursor_moved(int line, int col)
void auto_margin_width(void)
void editor_state_changed(bool copy_available, bool is_octave_file, bool is_modified)
bool m_always_reload_changed_files
void handle_context_menu_break_condition(int linenr)
void set_current_directory(const QString &dir)
QString encoding(void) const
void handle_api_entries_added(void)
void handle_request_add_breakpoint(int line, const QString &cond)
void set_encoding(const QString &new_encoding)
void zoom_in(const QWidget *ID)
void scintilla_command(const QWidget *, unsigned int)
void toggle_bookmark(const QWidget *ID)
void find_linenr_just_before(int linenr, int &original_linenr, int &editor_linenr)
void change_editor_state(const QWidget *ID)
void edit_mfile_request(const QString &, const QString &, const QString &, int)
QString file_name(void) const
void show_auto_completion(const QWidget *ID)
void insert_debugger_pointer(const QWidget *ID, int line=-1)
void request_open_file(const QString &, const QString &=QString())
void show_dialog(QDialog *dlg, bool modal)
void zoom_normal(const QWidget *ID)
void tab_ready_to_close(void)
QDateTime m_last_modified
void handle_save_as_filter_selected(const QString &filter)
void do_save_file_signal(const QString &file_to_save, bool remove_on_success, bool restore_breakpoints)
void uncomment_selected_text(const QWidget *ID)
QsciScintilla::EolMode m_save_as_desired_eol
void handle_context_menu_edit(const QString &)
void print_file(const QWidget *ID)
void dbstop_if(const QString &prompt, int line, const QString &cond)
void maybe_remove_next(int remove_line)
void file_name_changed(const QString &fileName, const QString &toolTip, bool modified)
bool m_highlight_all_occurrences
void update_breakpoints_signal(const octave_value_list &args)
bool unchanged_or_saved(void)
void context_edit(const QWidget *ID)
void goto_line(const QWidget *ID, int line=-1)
void handle_file_resave_answer(int decision)
breakpoint_info m_breakpoint_info
void handle_copy_available(bool enableCopy)
void handle_double_click(int p, int l, int modifier)
void toggle_breakpoint(const QWidget *ID)
void update_window_title(bool modified)
QsciScintilla::EolMode detect_eol_mode(void)
void remove_breakpoint_via_debugger_linenr(int debugger_linenr)
void edit_area_changed(octave_qscintilla *edit_area)
void request_add_octave_apis(const QStringList &)
void closeEvent(QCloseEvent *event)
void zoom_out(const QWidget *ID)
void api_entries_added(void)
void handle_save_file_as_answer_cancel(void)
void do_smart_indent_line_or_selected_text(void)
bool m_line_break_comments
error_system & get_error_system(void)
tree_evaluator & get_evaluator(void)
symbol_table & get_symbol_table(void)
void recover_from_exception(void)
load_path & get_load_path(void)
std::list< std::string > autoloaded_functions(void) const
lexer(interpreter &interp)
string_vector fcn_names(void) const
void handle_find_translation(int original_linenr, int &editor_linenr, marker *&bp)
void handle_remove_via_original_linenr(int original_linenr)
void handle_find_just_before(int linenr, int &original_linenr, int &editor_linenr)
void handle_request_remove_via_editor_linenr(int editor_linenr)
void request_remove(int original_linenr)
@ unsure_debugger_position
void handle_report_editor_linenr(QIntList &lines, QStringList &conditions)
const QString & get_cond(void) const
void set_cond(const QString &cond)
virtual octave_user_code * user_code_value(bool silent=false)
octave_idx_type numel(void) const
const Cell & contents(const_iterator p) const
void get_current_position(int *pos, int *line, int *col)
void smart_indent(bool do_smart_indent, int do_auto_close, int line, int ind_char_width)
void context_help_doc(bool)
void set_word_selection(const QString &word=QString())
void show_selection_markers(int l1, int c1, int l2, int c2)
void context_menu_break_condition_signal(int)
void smart_indent_line_or_selected_text(int lineFrom, int lineTo)
virtual void setCursorPosition(int line, int col)
void context_menu_edit_signal(const QString &)
void set_selection_marker_color(const QColor &c)
void interpreter_event(const fcn_callback &fcn)
void clear_selection_markers(void)
QStringList comment_string(bool comment=true)
int is_style_comment(int pos=-1)
void replace_all(const QString &o_str, const QString &n_str, bool re, bool cs, bool wo)
void update_rowcol_indicator_signal(int line, int col)
gui_settings * get_settings(void) const
void read_lexer_settings(QsciLexer *lexer, gui_settings *settings, int mode=0, int def=0)
void combo_encoding(QComboBox *combo, const QString ¤t=QString())
octave_idx_type numel(void) const
void clear_user_function(const std::string &name)
std::list< std::string > built_in_function_names(void)
void dbquit(bool all=false)
bp_table & get_bp_table(void)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
OCTAVE_EXPORT octave_value_list Fdbstatus(octave::interpreter &interp, const octave_value_list &args, int nargout)
std::string canonicalize_file_name(const std::string &name)
MArray< T > filter(MArray< T > &b, MArray< T > &a, MArray< T > &x, MArray< T > &si, int dim=0)
const gui_pref cs_cursor_blinking("terminal/cursorBlinking", QVariant(true))
const gui_pref ed_always_reload_changed_files("editor/always_reload_changed_files", QVariant(false))
const gui_pref ed_indent_uses_tabs("editor/indent_uses_tabs", QVariant(false))
const gui_pref ed_code_completion("editor/codeCompletion", QVariant(true))
const gui_pref ed_show_hscroll_bar("editor/show_hscroll_bar", QVariant(true))
const gui_pref ed_code_completion_octave_functions("editor/codeCompletion_octave_functions", QVariant(true))
const gui_pref ed_auto_endif("editor/auto_endif", QVariant(1))
const gui_pref ed_show_white_space("editor/show_white_space", QVariant(false))
const gui_pref ed_color_mode("editor/color_mode", QVariant(0))
const gui_pref ed_line_numbers_size("editor/line_numbers_size", QVariant(0))
const gui_pref ed_wrap_lines("editor/wrap_lines", QVariant(false))
const gui_pref ed_highlight_current_line("editor/highlightCurrentLine", QVariant(true))
const gui_pref ed_break_lines("editor/break_lines", QVariant(false))
const gui_pref ed_break_lines_comments("editor/break_lines_comments", QVariant(false))
const QString ed_last_comment_str("editor/oct_last_comment_str")
const gui_pref ed_highlight_current_line_color("editor/highlightCurrentLineColor", QVariant(settings_color_no_change))
const gui_pref ed_long_line_marker("editor/long_line_marker", QVariant(true))
const gui_pref ed_tab_indents_line("editor/tab_indents_line", QVariant(false))
const gui_pref ed_code_completion_octave_builtins("editor/codeCompletion_octave_builtins", QVariant(true))
const gui_pref ed_show_edit_status_bar("editor/show_edit_status_bar", QVariant(true))
const gui_pref ed_code_completion_threshold("editor/codeCompletion_threshold", QVariant(3))
const gui_pref ed_code_completion_document("editor/codeCompletion_document", QVariant(true))
const gui_pref ed_backspace_unindents_line("editor/backspace_unindents_line", QVariant(false))
const gui_pref ed_code_completion_case("editor/codeCompletion_case", QVariant(true))
const gui_pref ed_rm_trailing_spaces("editor/rm_trailing_spaces", QVariant(true))
const gui_pref ed_default_enc("editor/default_encoding", QVariant("UTF-8"))
const gui_pref ed_long_line_marker_background("editor/long_line_marker_background", QVariant(false))
const gui_pref ed_show_white_space_indent("editor/show_white_space_indent", QVariant(false))
const gui_pref ed_show_line_numbers("editor/showLineNumbers", QVariant(true))
const gui_pref ed_highlight_all_occurrences("editor/highlight_all_occurrences", QVariant(true))
const gui_pref ed_show_eol_chars("editor/show_eol_chars", QVariant(false))
const gui_pref ed_show_indent_guides("editor/show_indent_guides", QVariant(false))
const gui_pref ed_code_folding("editor/code_folding", QVariant(true))
const gui_pref ed_force_newline("editor/force_newline", QVariant(true))
const gui_pref ed_indent_width("editor/indent_width", QVariant(2))
const gui_pref ed_tab_width("editor/tab_width", QVariant(2))
const gui_pref ed_long_line_column("editor/long_line_column", QVariant(80))
const gui_pref ed_default_eol_mode("editor/default_eol_mode", QVariant(os_eol_mode))
const gui_pref ed_code_completion_replace("editor/codeCompletion_replace", QVariant(false))
const gui_pref ed_code_completion_keywords("editor/codeCompletion_keywords", QVariant(true))
const gui_pref ed_auto_indent("editor/auto_indent", QVariant(true))
const gui_pref ed_long_line_marker_line("editor/long_line_marker_line", QVariant(true))
const gui_pref global_use_native_dialogs("use_native_file_dialogs", QVariant(true))
const gui_pref global_cursor_blinking("cursor_blinking", QVariant(true))
const QColor settings_color_no_change(255, 0, 255)
OCTGUI_API QColor interpolate_color(const QColor &col1, const QColor &col2, double fs, double fv)
OCTAVE_EXPORT octave_value_list Fiskeyword(const octave_value_list &args, int)
F77_RET_T const F77_DBLE const F77_DBLE * f
for(octave_idx_type i=0;i< n;i++) ac+
QString fromStdString(const std::string &s)
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
static OCTAVE_NORETURN void eval_error(const char *msg, const dim_vector &x, const dim_vector &y)
static uint32_t state[624]
char * octave_u32_conv_to_encoding_strict(const char *tocode, const uint32_t *src, size_t srclen, size_t *lengthp)
bool valid_identifier(const char *s)