author | zecke <zecke> | 2002-10-14 17:51:25 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-14 17:51:25 (UTC) |
commit | 3e92f4eba0510e7d3744f096a62eaa175b15c993 (patch) (side-by-side diff) | |
tree | b015584a3488434e75d4b7f1a55b548a88cf17c5 /noncore/apps/opie-console/emulation_handler.cpp | |
parent | 2c5e8939ba073a42c032f5a9660ed0dd4580bf88 (diff) | |
download | opie-3e92f4eba0510e7d3744f096a62eaa175b15c993.zip opie-3e92f4eba0510e7d3744f096a62eaa175b15c993.tar.gz opie-3e92f4eba0510e7d3744f096a62eaa175b15c993.tar.bz2 |
add the bridge
Diffstat (limited to 'noncore/apps/opie-console/emulation_handler.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/emulation_handler.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp new file mode 100644 index 0000000..787de67 --- a/dev/null +++ b/noncore/apps/opie-console/emulation_handler.cpp @@ -0,0 +1,41 @@ +#include <qwidget.h> + +#include "TEWidget.h" +#include "TEmuVt102.h" + +#include "emulation_handler.h" + + +EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent, const char* name ) + : QObject(0, name ) +{ + load(prof ); + m_teWid = new TEWidget( parent, "TerminalMain" ); + parent->resize( m_teWid->calcSize(80, 24 ) ); + m_teEmu = new TEmuVt102(m_teWid ); + + connect(m_teEmu,SIGNAL(ImageSizeChanged(int, int) ), + this, SIGNAL(changeSize(int, int) ) ); + connect(m_teEmu, SIGNAL(sndBlock(const char*, int) ), + this, SLOT(recvEmulation(const char*, int) ) ); + +} +EmulationHandler::~EmulationHandler() { + delete m_teEmu; + delete m_teWid; +} +void EmulationHandler::load( const Profile& ) { + +} +void EmulationHandler::recv( const QByteArray& ar) { + m_teEmu->onRcvBlock(ar.data(), ar.count() ); +} +void EmulationHandler::recvEmulation(const char* src, int len ) { + QByteArray ar(len); + memcpy(ar.data(), src, sizeof(char) * len ); + + emit send(ar); +} +QWidget* EmulationHandler::widget() { + return m_teWid; +} |