annotate libgui/src/octave-adapter/octave-link.cc @ 15204:359098ad343e

update copyright notices in libgui directory * documentation-dockwidget.cc, documentation-dockwidget.h, files-dockwidget.cc, files-dockwidget.h, history-dockwidget.cc, history-dockwidget.h, m-editor/file-editor-interface.h, m-editor/file-editor-tab.cc, m-editor/file-editor-tab.h, m-editor/file-editor.cc, m-editor/file-editor.h, m-editor/lexer-octave-gui.cc, m-editor/lexer-octave-gui.h, main-window.cc, main-window.h, octave-adapter/octave-event-listener.h, octave-adapter/octave-event-observer.h, octave-adapter/octave-event.cc, octave-adapter/octave-event.h, octave-adapter/octave-link.cc, octave-adapter/octave-link.h, octave-adapter/octave-main-thread.cc, octave-adapter/octave-main-thread.h, octave-gui.cc, octave-qt-event-listener.cc, octave-qt-event-listener.h, resource-manager.cc, resource-manager.h, settings-dialog.cc, settings-dialog.h, symbol-information.cc, symbol-information.h, terminal-dockwidget.cc, terminal-dockwidget.h, welcome-wizard.cc, welcome-wizard.h, workspace-model.cc, workspace-model.h, workspace-view.cc, workspace-view.h: Use copyright notice format that is consistent with other files in Octave.
author John W. Eaton <jwe@octave.org>
date Mon, 20 Aug 2012 14:02:08 -0400
parents 017f0b2e6933
children eec0d1fcba4f
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 Copyright (C) 2011-2012 John P. Swensen
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
5
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
6 This file is part of Octave.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
7
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
8 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
9 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
10 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
11 option) any later version.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
12
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
13 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
14 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
15 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
16 for more details.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
17
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
18 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
19 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
20 <http://www.gnu.org/licenses/>.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
21
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
22 */
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
23
15155
9e62d5a3a45e partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents: 15041
diff changeset
24 #ifdef HAVE_CONFIG_H
9e62d5a3a45e partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents: 15041
diff changeset
25 #include <config.h>
9e62d5a3a45e partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents: 15041
diff changeset
26 #endif
9e62d5a3a45e partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents: 15041
diff changeset
27
9e62d5a3a45e partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents: 15041
diff changeset
28 #include "cmd-edit.h"
9e62d5a3a45e partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents: 15041
diff changeset
29 #include "oct-env.h"
9e62d5a3a45e partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents: 15041
diff changeset
30 #include "oct-mutex.h"
9e62d5a3a45e partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents: 15041
diff changeset
31 #include "symtab.h"
9e62d5a3a45e partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents: 15041
diff changeset
32 #include "toplev.h"
9e62d5a3a45e partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents: 15041
diff changeset
33
14707
674740c44c09 Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14703
diff changeset
34 #include "octave-link.h"
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
35
14689
dd19de736ee4 Fixed crash on exit. Typing exit in the terminal works, too.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
36 int octave_readline_hook ()
14668
6a6733a55982 Removed unused classes and added octave loop hook.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14664
diff changeset
37 {
14754
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14751
diff changeset
38 octave_link::instance ()->entered_readline_hook ();
14719
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
39 octave_link::instance ()->generate_events ();
14718
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
40 octave_link::instance ()->process_events ();
14754
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14751
diff changeset
41 octave_link::instance ()->finished_readline_hook ();
14671
f346343654a4 Settings readline event hook and fixed race condition.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14670
diff changeset
42 return 0;
14668
6a6733a55982 Removed unused classes and added octave loop hook.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14664
diff changeset
43 }
6a6733a55982 Removed unused classes and added octave loop hook.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14664
diff changeset
44
14689
dd19de736ee4 Fixed crash on exit. Typing exit in the terminal works, too.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
45 void octave_exit_hook (int status)
dd19de736ee4 Fixed crash on exit. Typing exit in the terminal works, too.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
46 {
14721
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14720
diff changeset
47 (void) status;
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14720
diff changeset
48 octave_link::instance ()->about_to_exit ();
14689
dd19de736ee4 Fixed crash on exit. Typing exit in the terminal works, too.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
49 }
dd19de736ee4 Fixed crash on exit. Typing exit in the terminal works, too.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
50
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
51 octave_link octave_link::_singleton;
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
52
14719
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
53 octave_link::octave_link ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
54 {
14721
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14720
diff changeset
55 _event_queue_mutex = new octave_mutex ();
14719
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
56 _last_working_directory = "";
14727
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
57 _debugging_mode_active = false;
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
58 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
59
14709
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14707
diff changeset
60 octave_link::~octave_link ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
61 {
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
62 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
63
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
64 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
65 octave_link::launch_octave ()
13541
b48ac9ad8de0 Highly improved separation of model and view classes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13528
diff changeset
66 {
13677
f27573828e92 Properly implemented shutdown of callback thread.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13674
diff changeset
67 // Create both threads.
14719
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
68 _octave_main_thread = new octave_main_thread ();
14689
dd19de736ee4 Fixed crash on exit. Typing exit in the terminal works, too.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
69 command_editor::add_event_hook (octave_readline_hook);
dd19de736ee4 Fixed crash on exit. Typing exit in the terminal works, too.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
70 octave_exit = octave_exit_hook;
dd19de736ee4 Fixed crash on exit. Typing exit in the terminal works, too.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
71
13677
f27573828e92 Properly implemented shutdown of callback thread.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13674
diff changeset
72 // Start the first one.
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
73 _octave_main_thread->start ();
13541
b48ac9ad8de0 Highly improved separation of model and view classes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13528
diff changeset
74 }
b48ac9ad8de0 Highly improved separation of model and view classes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13528
diff changeset
75
13518
bace956a3724 Put history model part into OctaveLink.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13517
diff changeset
76 void
14719
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
77 octave_link::register_event_listener (octave_event_listener *oel)
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
78 { _octave_event_listener = oel; }
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
79
14718
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
80 void
14719
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
81 octave_link::generate_events ()
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
82 {
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
83 std::string current_working_directory = octave_env::get_current_directory ();
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
84 if (current_working_directory != _last_working_directory)
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
85 {
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
86 _last_working_directory = current_working_directory;
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
87 if (_octave_event_listener)
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
88 _octave_event_listener
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
89 ->current_directory_has_changed (_last_working_directory);
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
90 }
14726
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
91
14751
c6135951bc18 Fixed detecting debugging mode.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14750
diff changeset
92 if (_debugging_mode_active != Vdebugging)
14726
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
93 {
14751
c6135951bc18 Fixed detecting debugging mode.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14750
diff changeset
94 _debugging_mode_active = Vdebugging;
14726
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
95 if (_octave_event_listener)
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
96 {
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
97 if (_debugging_mode_active)
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
98 _octave_event_listener->entered_debug_mode ();
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
99 else
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
100 _octave_event_listener->quit_debug_mode ();
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
101 }
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
102 }
14719
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
103 }
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
104
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
105 void
14718
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
106 octave_link::process_events ()
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
107 {
14721
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14720
diff changeset
108 _event_queue_mutex->lock ();
14875
3fd857c284fe Editor now gets focussed when opening a file.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14804
diff changeset
109
14718
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
110 while (_event_queue.size () > 0)
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
111 {
14719
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
112 octave_event * e = _event_queue.front ();
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
113 _event_queue.pop ();
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
114 if (e->perform ())
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
115 e->accept ();
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
116 else
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
117 e->reject ();
14718
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
118 }
14721
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14720
diff changeset
119 _event_queue_mutex->unlock ();
14718
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
120 }
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
121
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
122 void
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
123 octave_link::post_event (octave_event *e)
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
124 {
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
125 if (e)
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
126 {
14721
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14720
diff changeset
127 _event_queue_mutex->lock ();
14719
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
128 _event_queue.push (e);
14721
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14720
diff changeset
129 _event_queue_mutex->unlock ();
14718
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
130 }
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
131 }
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
132
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
133 void
14720
cecc7da96e2a Added update events for the command history model and workspace model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
134 octave_link::event_accepted (octave_event *e)
14718
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
135 { delete e; }
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
136
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
137 void
14720
cecc7da96e2a Added update events for the command history model and workspace model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
138 octave_link::event_reject (octave_event *e)
14718
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
139 { delete e; }
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
140
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
141 void
14721
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14720
diff changeset
142 octave_link::about_to_exit ()
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14720
diff changeset
143 {
14750
4812bcd524a1 Fixed flooding the event queue by only an event after the last one has been processed.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
144 _event_queue_mutex->lock ();
4812bcd524a1 Fixed flooding the event queue by only an event after the last one has been processed.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
145 while (!_event_queue.empty ())
4812bcd524a1 Fixed flooding the event queue by only an event after the last one has been processed.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
146 _event_queue.pop ();
4812bcd524a1 Fixed flooding the event queue by only an event after the last one has been processed.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
147
4812bcd524a1 Fixed flooding the event queue by only an event after the last one has been processed.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
148 _event_queue_mutex->unlock ();
4812bcd524a1 Fixed flooding the event queue by only an event after the last one has been processed.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
149
14721
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14720
diff changeset
150 if (_octave_event_listener)
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14720
diff changeset
151 _octave_event_listener->about_to_exit ();
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14720
diff changeset
152 }
14754
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14751
diff changeset
153
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14751
diff changeset
154 void
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14751
diff changeset
155 octave_link::entered_readline_hook ()
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14751
diff changeset
156 { }
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14751
diff changeset
157
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14751
diff changeset
158 void
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14751
diff changeset
159 octave_link::finished_readline_hook ()
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14751
diff changeset
160 {
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14751
diff changeset
161 }
14804
a565c560e654 Replaced a lot of terminal interaction with events: Clearing, loading and saving workspace, running a file. Default location for saving a new file is now the current working directory. Fixed bad settings with a fresh installation of the GUI by providing a file with default settings and installing it when appropriate.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14754
diff changeset
162
a565c560e654 Replaced a lot of terminal interaction with events: Clearing, loading and saving workspace, running a file. Default location for saving a new file is now the current working directory. Fixed bad settings with a fresh installation of the GUI by providing a file with default settings and installing it when appropriate.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14754
diff changeset
163 std::string
a565c560e654 Replaced a lot of terminal interaction with events: Clearing, loading and saving workspace, running a file. Default location for saving a new file is now the current working directory. Fixed bad settings with a fresh installation of the GUI by providing a file with default settings and installing it when appropriate.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14754
diff changeset
164 octave_link::get_last_working_directory ()
a565c560e654 Replaced a lot of terminal interaction with events: Clearing, loading and saving workspace, running a file. Default location for saving a new file is now the current working directory. Fixed bad settings with a fresh installation of the GUI by providing a file with default settings and installing it when appropriate.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14754
diff changeset
165 {
a565c560e654 Replaced a lot of terminal interaction with events: Clearing, loading and saving workspace, running a file. Default location for saving a new file is now the current working directory. Fixed bad settings with a fresh installation of the GUI by providing a file with default settings and installing it when appropriate.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14754
diff changeset
166 return _last_working_directory;
a565c560e654 Replaced a lot of terminal interaction with events: Clearing, loading and saving workspace, running a file. Default location for saving a new file is now the current working directory. Fixed bad settings with a fresh installation of the GUI by providing a file with default settings and installing it when appropriate.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14754
diff changeset
167 }