Mercurial > octave-nkf
annotate gui/src/octave-adapter/octave-link.cc @ 15041:7c14e3e6fc6b gui
Update qterminal thanks to Jen. Removed performance information on events.
* main-window.cc: Removed timer updating performance information.
* main-window.h: Removed timer.
* octave-link.cc: Removed code that collects performance information.
* octave-link.h: Removed performance information struct.
author | Jacob Dawid <jacob.dawid@gmail.com> |
---|---|
date | Sat, 28 Jul 2012 15:17:57 +0200 |
parents | 3fd857c284fe |
children | 9e62d5a3a45e |
rev | line source |
---|---|
13674
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13601
diff
changeset
|
1 /* OctaveGUI - A graphical user interface for Octave |
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13601
diff
changeset
|
2 * Copyright (C) 2011 John P. Swensen, Jacob Dawid (jacob.dawid@googlemail.com) |
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13601
diff
changeset
|
3 * |
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13601
diff
changeset
|
4 * This program is free software: you can redistribute it and/or modify |
14290
faece6b2ab90
Corrected license headers in all files to GPL.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13683
diff
changeset
|
5 * it under the terms of the GNU General Public License as |
13674
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13601
diff
changeset
|
6 * published by the Free Software Foundation, either version 3 of the |
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13601
diff
changeset
|
7 * License, or (at your option) any later version. |
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13601
diff
changeset
|
8 * |
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13601
diff
changeset
|
9 * This program is distributed in the hope that it will be useful, |
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13601
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13601
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14290
faece6b2ab90
Corrected license headers in all files to GPL.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13683
diff
changeset
|
12 * GNU General Public License for more details. |
13674
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13601
diff
changeset
|
13 * |
14290
faece6b2ab90
Corrected license headers in all files to GPL.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13683
diff
changeset
|
14 * You should have received a copy of the GNU General Public License |
13674
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13601
diff
changeset
|
15 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13601
diff
changeset
|
16 */ |
13501 | 17 |
14707
674740c44c09
Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14703
diff
changeset
|
18 #include "octave-link.h" |
14673
adad007cd018
Fixed bug with querying wrong matrix dimensions (bug #36421).
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14671
diff
changeset
|
19 #include "load-path.h" |
13501 | 20 |
14689
dd19de736ee4
Fixed crash on exit. Typing exit in the terminal works, too.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14673
diff
changeset
|
21 int octave_readline_hook () |
14668
6a6733a55982
Removed unused classes and added octave loop hook.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14664
diff
changeset
|
22 { |
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
|
23 octave_link::instance ()->entered_readline_hook (); |
14719
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
24 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
|
25 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
|
26 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
|
27 return 0; |
14668
6a6733a55982
Removed unused classes and added octave loop hook.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14664
diff
changeset
|
28 } |
6a6733a55982
Removed unused classes and added octave loop hook.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14664
diff
changeset
|
29 |
14689
dd19de736ee4
Fixed crash on exit. Typing exit in the terminal works, too.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14673
diff
changeset
|
30 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
|
31 { |
14721
ec76264adca9
Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14720
diff
changeset
|
32 (void) status; |
ec76264adca9
Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14720
diff
changeset
|
33 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
|
34 } |
dd19de736ee4
Fixed crash on exit. Typing exit in the terminal works, too.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14673
diff
changeset
|
35 |
14712
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
36 octave_link octave_link::_singleton; |
13501 | 37 |
14719
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
38 octave_link::octave_link () |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
39 { |
14721
ec76264adca9
Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14720
diff
changeset
|
40 _event_queue_mutex = new octave_mutex (); |
14719
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
41 _last_working_directory = ""; |
14727
f34984656658
Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14726
diff
changeset
|
42 _debugging_mode_active = false; |
13501 | 43 } |
44 | |
14709
f50591409306
Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14707
diff
changeset
|
45 octave_link::~octave_link () |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
46 { |
13501 | 47 } |
48 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
49 void |
14712
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
50 octave_link::launch_octave () |
13541
b48ac9ad8de0
Highly improved separation of model and view classes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13528
diff
changeset
|
51 { |
13677
f27573828e92
Properly implemented shutdown of callback thread.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13674
diff
changeset
|
52 // Create both threads. |
14719
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
53 _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
|
54 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
|
55 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
|
56 |
13677
f27573828e92
Properly implemented shutdown of callback thread.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13674
diff
changeset
|
57 // Start the first one. |
14712
5cb54cca8a06
Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14709
diff
changeset
|
58 _octave_main_thread->start (); |
13541
b48ac9ad8de0
Highly improved separation of model and view classes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13528
diff
changeset
|
59 } |
b48ac9ad8de0
Highly improved separation of model and view classes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13528
diff
changeset
|
60 |
13518
bace956a3724
Put history model part into OctaveLink.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13517
diff
changeset
|
61 void |
14719
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
62 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
|
63 { _octave_event_listener = oel; } |
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
64 |
14718
3df7ef0080c7
Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
65 void |
14719
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
66 octave_link::generate_events () |
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
67 { |
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
68 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
|
69 if (current_working_directory != _last_working_directory) |
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
70 { |
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
71 _last_working_directory = current_working_directory; |
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
72 if (_octave_event_listener) |
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
73 _octave_event_listener |
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
74 ->current_directory_has_changed (_last_working_directory); |
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
75 } |
14726
e94a54ee0f46
Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14721
diff
changeset
|
76 |
14751
c6135951bc18
Fixed detecting debugging mode.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14750
diff
changeset
|
77 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
|
78 { |
14751
c6135951bc18
Fixed detecting debugging mode.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14750
diff
changeset
|
79 _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
|
80 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
|
81 { |
e94a54ee0f46
Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14721
diff
changeset
|
82 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
|
83 _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
|
84 else |
e94a54ee0f46
Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14721
diff
changeset
|
85 _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
|
86 } |
e94a54ee0f46
Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14721
diff
changeset
|
87 } |
14719
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
88 } |
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
89 |
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
90 void |
14718
3df7ef0080c7
Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
91 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
|
92 { |
14721
ec76264adca9
Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14720
diff
changeset
|
93 _event_queue_mutex->lock (); |
14875
3fd857c284fe
Editor now gets focussed when opening a file.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14804
diff
changeset
|
94 |
14718
3df7ef0080c7
Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
95 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
|
96 { |
14719
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
97 octave_event * e = _event_queue.front (); |
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
98 _event_queue.pop (); |
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
99 if (e->perform ()) |
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
100 e->accept (); |
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
101 else |
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
102 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
|
103 } |
14721
ec76264adca9
Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14720
diff
changeset
|
104 _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
|
105 } |
3df7ef0080c7
Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
106 |
3df7ef0080c7
Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
107 void |
3df7ef0080c7
Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
108 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
|
109 { |
3df7ef0080c7
Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
110 if (e) |
3df7ef0080c7
Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
111 { |
14721
ec76264adca9
Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14720
diff
changeset
|
112 _event_queue_mutex->lock (); |
14719
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
113 _event_queue.push (e); |
14721
ec76264adca9
Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14720
diff
changeset
|
114 _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
|
115 } |
3df7ef0080c7
Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
116 } |
3df7ef0080c7
Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
117 |
3df7ef0080c7
Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
118 void |
14720
cecc7da96e2a
Added update events for the command history model and workspace model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14719
diff
changeset
|
119 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
|
120 { delete e; } |
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 |
14720
cecc7da96e2a
Added update events for the command history model and workspace model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14719
diff
changeset
|
123 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
|
124 { delete e; } |
3df7ef0080c7
Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
125 |
3df7ef0080c7
Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
126 void |
14721
ec76264adca9
Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14720
diff
changeset
|
127 octave_link::about_to_exit () |
ec76264adca9
Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14720
diff
changeset
|
128 { |
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
|
129 _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
|
130 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
|
131 _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
|
132 |
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
|
133 _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
|
134 |
14721
ec76264adca9
Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14720
diff
changeset
|
135 if (_octave_event_listener) |
ec76264adca9
Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14720
diff
changeset
|
136 _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
|
137 } |
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
|
138 |
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
|
139 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
|
140 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
|
141 { } |
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
|
142 |
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
|
143 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
|
144 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
|
145 { |
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
|
146 } |
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
|
147 |
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
|
148 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
|
149 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
|
150 { |
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
|
151 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
|
152 } |