annotate libgui/src/m-editor/file-editor-interface.h @ 16438:a971d8bdaadc

use signals instead of event queue for entering/leaving debug mode * file-editor-interface.h (file_editor_interface::handle_enter_debug_mode): Rename from file_editor_interface::handle_entered_debug_mode. Change all uses. (file_editor_interface::handle_exit_debug_mode): Rename from file_editor_interface::handle_quit_debug_mode. Change all uses. * file_editor.h, file_editor.cc (file_editor::handle_enter_debug_mode): Rename from file_editor::handle_entered_debug_mode. Change all uses. (file_editor::handle_exit_debug_mode): Rename from file_editor::handle_quit_debug_mode. Change all uses. * main-window.h, main-window.cc (main_window::handle_enter_debugger): Rename from main_window::handle_entered_debug_mode. Change all uses. (main_window::handle_exit_debugger): Rename from main_window::handle_quit_debug_mode. Change all uses. (main_window::construct): Delete signal connection from _octave_qt_event_listener::entered_debug_mode_signal to main_window::handle_entered_debug_mode. Delete signal connection from _octave_qt_event_listener::quit_debug_mode_signal to main_window::handle_quit_debug_mode. Connect _octave_qt_link::enter_debugger_signal signal to main_window::handle_enter_debugger. Connect _octave_qt_link::exit_debugger_signal signal to main_window::handle_exit_debugger. * octave-qt-event-listener.h, octave-qt-event-listener.cc (octave_qt_event_listener::entered_debug_mode, octave_qt_event_listener::quit_debug_mode): Delete. (octave_qt_event_listener::entered_debug_mode_signal, octave_qt_event_listener::quit_debug_mode_signal): Delete signals. * octave-qt-link.h, octave-qt-link.cc (octave_qt_link::do_enter_debugger_event): Emit enter_debugger_signal. (octave_qt_link::do_execute_in_debugger_event): New function. (octave_qt_link::do_exit_debugger_event): Emit exit_debugger_signal. (octave_qt_link::enter_debugger_signal, octave_qt_link::exit_debugger_signal): New signals. * octave-event-listener.h (octave_event_listener::entered_debug_mode, octave_event_listener::quit_debug_mode): Delete. * input.cc (octave_base_reader::octave_gets): Call octave_link::exit_debugger_event if not debugging. (execute_in_debugger_handler): Rename from exit_debugger_handler. Change all uses. Call octave_link::execute_in_debugger_event instead of octave_link::exit_debugger_event. * octave-link.h, octave-link.cc (octave_link::do_generate_events): Don't call debugging mode functions here. (octave_link::enter_debugger_event): Set instance->debugging to true. (octave_link::execute_in_debugger_event): New function. (octave_link::exit_debugger_event): Don't do anything unless instance->debugging is true. Toggle instance->debugging.
author John W. Eaton <jwe@octave.org>
date Fri, 05 Apr 2013 03:04:56 -0400
parents f9a737fd8829
children 7a2ee6ea7800
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
1 /*
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
2
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
3 Copyright (C) 2011-2012 Jacob Dawid
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
4
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
5 This file is part of Octave.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
6
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
8 under the terms of the GNU General Public License as published by the
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
10 option) any later version.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
11
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
15 for more details.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
16
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
17 You should have received a copy of the GNU General Public License
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
18 along with Octave; see the file COPYING. If not, see
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
19 <http://www.gnu.org/licenses/>.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
20
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
21 */
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
22
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
23 #ifndef FILEEDITORINTERFACE_H
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
24 #define FILEEDITORINTERFACE_H
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
25
14795
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14778
diff changeset
26 #include <QMenu>
15106
59175df7dcf6 Created and added debug action icons.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 15045
diff changeset
27 #include <QToolBar>
16057
c3057d80cf91 Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents: 15993
diff changeset
28 #include "octave-dock-widget.h"
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
29
16057
c3057d80cf91 Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents: 15993
diff changeset
30 class file_editor_interface : public octave_dock_widget
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
31 {
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
32 Q_OBJECT
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
33
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
34 public:
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15584
diff changeset
35 file_editor_interface (QWidget *p)
16057
c3057d80cf91 Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents: 15993
diff changeset
36 : octave_dock_widget (p)
15367
501a9cc2c68f maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15356
diff changeset
37 {
501a9cc2c68f maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15356
diff changeset
38 setObjectName ("FileEditor");
501a9cc2c68f maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15356
diff changeset
39 }
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
40
15367
501a9cc2c68f maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15356
diff changeset
41 virtual ~file_editor_interface () { }
14795
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14778
diff changeset
42
15993
41471c02d51c gui: show menu with recently used editor files also in file menu of main window
Torsten <ttl@justmail.de>
parents: 15980
diff changeset
43 virtual QMenu *get_mru_menu ( ) = 0;
15367
501a9cc2c68f maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15356
diff changeset
44 virtual QMenu *debug_menu () = 0;
501a9cc2c68f maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15356
diff changeset
45 virtual QToolBar *toolbar () = 0;
14795
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14778
diff changeset
46
16438
a971d8bdaadc use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents: 16399
diff changeset
47 virtual void handle_enter_debug_mode (void) = 0;
a971d8bdaadc use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents: 16399
diff changeset
48 virtual void handle_exit_debug_mode (void) = 0;
16395
fc491da603f6 also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents: 16386
diff changeset
49
fc491da603f6 also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents: 16386
diff changeset
50 virtual void
fc491da603f6 also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents: 16386
diff changeset
51 handle_insert_debugger_pointer_request (const QString& file, int line) = 0;
fc491da603f6 also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents: 16386
diff changeset
52
fc491da603f6 also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents: 16386
diff changeset
53 virtual void
fc491da603f6 also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents: 16386
diff changeset
54 handle_delete_debugger_pointer_request (const QString& file, int line) = 0;
16386
4902484f9181 callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents: 16383
diff changeset
55
4902484f9181 callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents: 16383
diff changeset
56 virtual void handle_update_dbstop_marker_request (bool insert,
4902484f9181 callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents: 16383
diff changeset
57 const QString& file,
4902484f9181 callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents: 16383
diff changeset
58 int line) = 0;
16399
f9a737fd8829 allow command-line edit function to use GUI editor
John W. Eaton <jwe@octave.org>
parents: 16395
diff changeset
59
f9a737fd8829 allow command-line edit function to use GUI editor
John W. Eaton <jwe@octave.org>
parents: 16395
diff changeset
60 virtual void handle_edit_file_request (const QString& file) = 0;
f9a737fd8829 allow command-line edit function to use GUI editor
John W. Eaton <jwe@octave.org>
parents: 16395
diff changeset
61
15980
6c0fce0632a4 gui: set keyboard focus when switching between dock widgets (bug #36957)
Torsten <ttl@justmail.de>
parents: 15848
diff changeset
62 virtual void set_focus () = 0;
14830
41b86dc61306 Removed run command, instead cding into the script directory and executing script directly.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14795
diff changeset
63
15367
501a9cc2c68f maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15356
diff changeset
64 public slots:
501a9cc2c68f maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15356
diff changeset
65 virtual void request_new_file () = 0;
501a9cc2c68f maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15356
diff changeset
66 virtual void request_open_file () = 0;
16386
4902484f9181 callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents: 16383
diff changeset
67 virtual void request_open_file (const QString& openFileName, int line = -1,
4902484f9181 callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents: 16383
diff changeset
68 bool debug_pointer = false,
4902484f9181 callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents: 16383
diff changeset
69 bool dbstop_marker = false,
4902484f9181 callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents: 16383
diff changeset
70 bool insert = true) = 0;
16057
c3057d80cf91 Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents: 15993
diff changeset
71 //signals:
14681
66ff321cb62e Integrated the editor to be docked with the other widgets.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14676
diff changeset
72
16057
c3057d80cf91 Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents: 15993
diff changeset
73 //protected:
14681
66ff321cb62e Integrated the editor to be docked with the other widgets.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14676
diff changeset
74
16057
c3057d80cf91 Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents: 15993
diff changeset
75 //protected slots:
c3057d80cf91 Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents: 15993
diff changeset
76
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
77 };
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
78
16291
c22a6cecaedd build: Use AMCOND to build GUI editor if Qscintilla available.
Rik <rik@octave.org>
parents: 16290
diff changeset
79 #endif // FILEEDITORINTERFACE_H