Exemple #1
0
Emulation::Emulation(TEWidget* gui)
{
  this->gui = gui;

  this->scr = new TEScreen(gui->Lines(),gui->Columns());

  bulk_nlcnt = 0; // reset bulk newline counter
  bulk_incnt = 0; // reset bulk counter
  connected  = FALSE;

  QObject::connect(&bulk_timer, SIGNAL(timeout()), this, SLOT(showBulk()) );
  QObject::connect(gui,SIGNAL(changedImageSizeSignal(int,int)),
                   this,SLOT(onImageSizeChange(int,int)));
  QObject::connect(gui,SIGNAL(changedHistoryCursor(int)), 
                   this,SLOT(onHistoryCursorChange(int)));
  QObject::connect(gui,SIGNAL(keyPressedSignal(QKeyEvent*)), 
                   this,SLOT(onKeyPress(QKeyEvent*)));
  QObject::connect(gui,SIGNAL(beginSelectionSignal(const int,const int)),
		   this,SLOT(onSelectionBegin(const int,const int)) );
  QObject::connect(gui,SIGNAL(extendSelectionSignal(const int,const int)),
		   this,SLOT(onSelectionExtend(const int,const int)) );
  QObject::connect(gui,SIGNAL(endSelectionSignal(const BOOL)),
		   this,SLOT(setSelection(const BOOL)) );
  QObject::connect(gui,SIGNAL(clearSelectionSignal()),
		   this,SLOT(clearSelection()) );
}
Exemple #2
0
void Emulation::onImageSizeChange(int lines, int columns)
{
  if (!connected) return;
  scr->resizeImage(lines,columns);
  showBulk();
  emit ImageSizeChanged(lines,columns);   // propagate event to serial line
}
Exemple #3
0
void Emulation::bulkEnd()
{
  if ( bulk_nlcnt > gui->Lines() || bulk_incnt > 20 )
    showBulk();                         // resets bulk_??cnt to 0, too.
  else
    bulk_timer.start(BULK_TIMEOUT,TRUE);
}
Exemple #4
0
Emulation::Emulation() :
  _currentScreen(0),
  _codec(0),
  _decoder(0),
  _keyTranslator(0),
  _usesMouse(false)
{

  // create screens with a default size
  _screen[0] = new Screen(40,80);
  _screen[1] = new Screen(40,80);
  _currentScreen = _screen[0];

  QObject::connect(&_bulkTimer1, SIGNAL(timeout()), this, SLOT(showBulk()) );
  QObject::connect(&_bulkTimer2, SIGNAL(timeout()), this, SLOT(showBulk()) );
   
  // listen for mouse status changes
  connect( this , SIGNAL(programUsesMouseChanged(bool)) , 
           SLOT(usesMouseChanged(bool)) );
}
Exemple #5
0
void Emulation::clearSelection() {
  if (!connected) return;
  _currentScreen->clearSelection();
  showBulk();
}
Exemple #6
0
void Emulation::onSelectionExtend(const int x, const int y) {
  if (!connected) return;
  _currentScreen->setSelectionEnd(x,y);
  showBulk();
}
Exemple #7
0
void Emulation::onSelectionBegin(const int x, const int y, const bool columnmode) {
  if (!connected) return;
  _currentScreen->setSelectionStart( x,y,columnmode);
  showBulk();
}
Exemple #8
0
void Emulation::setHistory(const HistoryType& t)
{
  _screen[0]->setScroll(t);

  showBulk();
}
Exemple #9
0
void Emulation::onHistoryCursorChange(int cursor)
{
  if (!connected) return;
  scr->setHistCursor(cursor);
  showBulk();
}
Exemple #10
0
void Emulation::setConnect(bool c)
{
  connected = c;
  if ( connected) showBulk();
  if (!connected) scr->clearSelection();
}
Exemple #11
0
void Emulation::clearSelection() {
  if (!connected) return;
  scr->clearSelection(); 
  showBulk();
}
Exemple #12
0
void Emulation::onSelectionExtend(const int x, const int y) {
  if (!connected) return;
  scr->setSelExtentXY(x,y);
  showBulk();
}
Exemple #13
0
// Selection ---------------------------
void Emulation::onSelectionBegin(const int x, const int y) {
  if (!connected) return;
  scr->setSelBeginXY(x,y);
  showBulk();
}