comparison gui-main.h @ 7:04867eba6428

function objects and signals/slots for errors and results
author John W. Eaton <jwe@octave.org>
date Thu, 23 May 2019 09:27:09 -0400
parents 54edd85237ab
children 7c4b04a6346d
comparison
equal deleted inserted replaced
6:1b575145197e 7:04867eba6428
30 30
31 void accept_line (const std::string& line); 31 void accept_line (const std::string& line);
32 32
33 // Redisplay current command line. 33 // Redisplay current command line.
34 34
35 void redisplay (void);
36
37 void insert_at_end (const std::string& text); 35 void insert_at_end (const std::string& text);
38 36
39 void emit_error (const std::string& msg); 37 void emit_error (const std::string& msg);
40 38
41 void emit_result (double value); 39 void emit_result (double value);
42 40
43 signals: 41 signals:
44 42
45 void input_char_available (int key); 43 void input_char_available (int key);
46 44
47 void result_available (double value); 45 void accept_line_signal (const QString& line);
48 46
49 void accept_line_signal (const QString& line); 47 void redisplay_signal (void);
50 48
51 public slots: 49 public slots:
52 50
53 void handle_input_char (int key); 51 void handle_input_char (int key);
54 52
53 void handle_error (const QString& msg);
54
55 void handle_result (double value); 55 void handle_result (double value);
56
57 void redisplay (void);
56 58
57 protected: 59 protected:
58 60
59 void keyPressEvent (QKeyEvent *event); 61 void keyPressEvent (QKeyEvent *event);
60 62
86 int beg_mark; 88 int beg_mark;
87 int prompt_mark; 89 int prompt_mark;
88 }; 90 };
89 91
90 extern int main (int argc, char **argv); 92 extern int main (int argc, char **argv);
91
92 extern void emit_error (const std::string& msg);
93
94 extern void emit_result (double value);
95 } 93 }
96 94
97 #endif 95 #endif