GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
marker.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2016-2018 Daniel J. Sebald
3 
4 This file is part of Octave.
5 
6 Octave is free software: you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10 
11 Octave is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with Octave; see the file COPYING. If not, see
18 <https://www.gnu.org/licenses/>.
19 
20 */
21 
22 #if ! defined (octave_marker_h)
23 #define octave_marker_h 1
24 
25 #include <Qsci/qsciscintilla.h>
26 #include <QObject>
27 
28 // Defined for purposes of sending QList<int> as part of signal.
29 #include <QList>
31 
32 // The breakpoint class keeps track of the debug line number that Octave core
33 // uses and the handle of the marker inside the editor file. If the editor
34 // contents is modified, the debug line number and editor line number can be
35 // out of alignment. The marker handle can be used to retrieve the editor
36 // line.
37 
38 namespace octave
39 {
40  class marker : public QObject
41  {
42  Q_OBJECT
43 
44  public:
45 
46  // List of all marker types
47  // If multiple markers are on the same line, the first one listed
48  // is drawn at the back, so big ones should be first.
50  {
58  };
59 
60  marker (QsciScintilla *edit_area, int original_linenr,
61  editor_markers marker_type, const QString& condition = "");
62 
63  marker (QsciScintilla *edit_area, int original_linenr,
64  editor_markers marker_type, int editor_linenr,
65  const QString& condition = "");
66 
67  ~marker (void) = default;
68 
69  const QString& get_cond (void) const { return m_condition; }
70 
71  void set_cond (const QString& cond) { m_condition = cond; }
72 
73  public slots:
74 
75  void handle_remove_via_original_linenr (int original_linenr);
76  void handle_request_remove_via_editor_linenr (int editor_linenr);
77  void handle_remove (void);
78  void handle_find_translation (int original_linenr, int& editor_linenr,
79  marker*& bp);
80  void handle_find_just_before (int linenr, int& original_linenr,
81  int& editor_linenr);
82  void handle_find_just_after (int linenr, int& original_linenr,
83  int& editor_linenr);
84  /* void handle_lines_changed (void);*/
85  void handle_marker_line_deleted (int mhandle);
86  void handle_marker_line_undeleted (int mhandle);
87  void handle_report_editor_linenr (QIntList& lines, QStringList& conditions);
88 
89  signals:
90 
91  void request_remove (int original_linenr);
92 
93  private:
94 
95  void construct (QsciScintilla *edit_area, int original_linenr,
96  editor_markers marker_type, int editor_linenr,
97  const QString& condition);
98 
103  QString m_condition;
104  };
105 }
106 
107 #endif
~marker(void)=default
void request_remove(int original_linenr)
void handle_marker_line_undeleted(int mhandle)
Definition: marker.cc:144
void construct(QsciScintilla *edit_area, int original_linenr, editor_markers marker_type, int editor_linenr, const QString &condition)
Definition: marker.cc:48
void handle_report_editor_linenr(QIntList &lines, QStringList &conditions)
Definition: marker.cc:117
void handle_remove_via_original_linenr(int original_linenr)
Definition: marker.cc:59
int m_original_linenr
Definition: marker.h:100
QList< int > QIntList
Definition: marker.h:30
void handle_find_just_before(int linenr, int &original_linenr, int &editor_linenr)
Definition: marker.cc:97
marker(QsciScintilla *edit_area, int original_linenr, editor_markers marker_type, const QString &condition="")
Definition: marker.cc:41
editor_markers m_marker_type
Definition: marker.h:101
QString m_condition
Definition: marker.h:103
const QString & get_cond(void) const
Definition: marker.h:69
void handle_marker_line_deleted(int mhandle)
Definition: marker.cc:124
void handle_find_translation(int original_linenr, int &editor_linenr, marker *&bp)
Definition: marker.cc:87
void handle_remove(void)
Definition: marker.cc:81
QsciScintilla * m_edit_area
Definition: marker.h:99
int m_mhandle
Definition: marker.h:102
QList< int > QIntList
Definition: dialog.h:38
void handle_find_just_after(int linenr, int &original_linenr, int &editor_linenr)
Definition: marker.cc:107
void set_cond(const QString &cond)
Definition: marker.h:71
void handle_request_remove_via_editor_linenr(int editor_linenr)
Definition: marker.cc:68