2 Skelton for retropc emulator
4 Author : K.Ohta <whatisthis.sowhat _at_ gmail.com>
6 History: 09 Apr, 2015 : Initial from Takeda.Toshiya's w32_debugger.cpp.
16 #include <QMetaObject>
18 //#include "res/resource.h"
19 #include "../../emu.h"
20 #include "../../vm/device.h"
21 #include "../../vm/debugger.h"
22 #include "../../vm/vm.h"
23 #include "../../fileio.h"
24 #include "qt_debugger.h"
30 void CSP_Debugger::put_string(QString s)
32 text->insertPlainText(s);
33 text->moveCursor(QTextCursor::End);
36 void CSP_Debugger::cmd_clear()
38 text_command->clear();
39 text->moveCursor(QTextCursor::End);
42 void CSP_Debugger::doExit(void)
44 //p_emu->close_debugger();
48 void CSP_Debugger::stop_polling()
53 void CSP_Debugger::call_debugger(void)
55 emit sig_call_debugger(text_command->text());
58 void CSP_Debugger::run(void)
60 connect(text_command, SIGNAL(editingFinished()), this, SLOT(call_debugger()));
61 connect(this, SIGNAL(sig_call_debugger(QString)), p_osd, SLOT(do_write_inputdata(QString)), Qt::DirectConnection);
63 connect(p_osd, SIGNAL(sig_debugger_finished()), this, SLOT(doExit()));
64 connect(this, SIGNAL(sig_finished()), p_osd, SLOT(do_close_debugger_thread()));
65 connect(this, SIGNAL(destroyed()), this, SLOT(doExit()));
66 connect(parent_object, SIGNAL(quit_debugger_thread()), this, SLOT(close()));
67 connect(this, SIGNAL(sig_finished()), this, SLOT(close()));
69 //emit sig_start_debugger();
72 void CSP_Debugger::closeEvent(QCloseEvent *event)
77 CSP_Debugger::CSP_Debugger(QWidget *parent, OSD *osd) : QWidget(parent, Qt::Window)
82 parent_object = parent;
83 text = new QTextEdit(this);
84 text->setReadOnly(true);
85 text->setLineWrapMode(QTextEdit::WidgetWidth);
86 //text->setCenterOnScroll(true);
88 text_command = new QLineEdit(this);
89 text_command->setEchoMode(QLineEdit::Normal);
90 text_command->setMaxLength(1024);
91 text_command->setReadOnly(false);
92 text_command->setEnabled(true);
93 text_command->clear();
95 VBoxWindow = new QVBoxLayout;
97 VBoxWindow->addWidget(text);
98 VBoxWindow->addWidget(text_command);
99 this->setLayout(VBoxWindow);
100 this->resize(640, 500);
104 CSP_Debugger::~CSP_Debugger()