summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/TEmulation.cpp
Unidiff
Diffstat (limited to 'core/apps/embeddedkonsole/TEmulation.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/TEmulation.cpp43
1 files changed, 29 insertions, 14 deletions
diff --git a/core/apps/embeddedkonsole/TEmulation.cpp b/core/apps/embeddedkonsole/TEmulation.cpp
index 6f3ad32..c19f2a1 100644
--- a/core/apps/embeddedkonsole/TEmulation.cpp
+++ b/core/apps/embeddedkonsole/TEmulation.cpp
@@ -6,17 +6,17 @@
6/* */ 6/* */
7/* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ 7/* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */
8/* */ 8/* */
9/* This file is part of Konsole - an X terminal for KDE */ 9/* This file is part of Konsole - an X terminal for KDE */
10/* */ 10/* */
11/* -------------------------------------------------------------------------- */ 11/* -------------------------------------------------------------------------- */
12 /* */ 12/* */
13/* Ported Konsole to Qt/Embedded */ 13/* Ported Konsole to Qt/Embedded */
14 /* */ 14/* */
15/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ 15/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */
16 /* */ 16/* */
17/* -------------------------------------------------------------------------- */ 17/* -------------------------------------------------------------------------- */
18 18
19/*! \class TEmulation 19/*! \class TEmulation
20 20
21 \brief Mediator between TEWidget and TEScreen. 21 \brief Mediator between TEWidget and TEScreen.
22 22
@@ -100,26 +100,36 @@ TEmulation::TEmulation(TEWidget* gui)
100 100
101 bulk_nlcnt = 0; // reset bulk newline counter 101 bulk_nlcnt = 0; // reset bulk newline counter
102 bulk_incnt = 0; // reset bulk counter 102 bulk_incnt = 0; // reset bulk counter
103 connected = FALSE; 103 connected = FALSE;
104 104
105 QObject::connect(&bulk_timer, SIGNAL(timeout()), this, SLOT(showBulk()) ); 105 QObject::connect(&bulk_timer, SIGNAL(timeout()), this, SLOT(showBulk()) );
106
106 QObject::connect(gui,SIGNAL(changedImageSizeSignal(int,int)), 107 QObject::connect(gui,SIGNAL(changedImageSizeSignal(int,int)),
107 this,SLOT(onImageSizeChange(int,int))); 108 this,SLOT(onImageSizeChange(int,int)));
109
108 QObject::connect(gui,SIGNAL(changedHistoryCursor(int)), 110 QObject::connect(gui,SIGNAL(changedHistoryCursor(int)),
109 this,SLOT(onHistoryCursorChange(int))); 111 this,SLOT(onHistoryCursorChange(int)));
112
113 QObject::connect(gui,SIGNAL(changedHorzCursor(int)),
114 this,SLOT(onHorzCursorChange(int)));
115
110 QObject::connect(gui,SIGNAL(keyPressedSignal(QKeyEvent*)), 116 QObject::connect(gui,SIGNAL(keyPressedSignal(QKeyEvent*)),
111 this,SLOT(onKeyPress(QKeyEvent*))); 117 this,SLOT(onKeyPress(QKeyEvent*)));
118
112 QObject::connect(gui,SIGNAL(beginSelectionSignal(const int,const int)), 119 QObject::connect(gui,SIGNAL(beginSelectionSignal(const int,const int)),
113 this,SLOT(onSelectionBegin(const int,const int)) ); 120 this,SLOT(onSelectionBegin(const int,const int)) );
121
114 QObject::connect(gui,SIGNAL(extendSelectionSignal(const int,const int)), 122 QObject::connect(gui,SIGNAL(extendSelectionSignal(const int,const int)),
115 this,SLOT(onSelectionExtend(const int,const int)) ); 123 this,SLOT(onSelectionExtend(const int,const int)) );
124
116 QObject::connect(gui,SIGNAL(endSelectionSignal(const BOOL)), 125 QObject::connect(gui,SIGNAL(endSelectionSignal(const BOOL)),
117 this,SLOT(setSelection(const BOOL)) ); 126 this,SLOT(setSelection(const BOOL)) );
127
118 QObject::connect(gui,SIGNAL(clearSelectionSignal()), 128 QObject::connect(gui,SIGNAL(clearSelectionSignal()),
119 this,SLOT(clearSelection()) ); 129 this,SLOT(clearSelection()) );
120} 130}
121 131
122/*! 132/*!
123*/ 133*/
124 134
125TEmulation::~TEmulation() 135TEmulation::~TEmulation()
@@ -296,14 +306,16 @@ void TEmulation::showBulk()
296 { 306 {
297 ca* image = scr->getCookedImage(); // get the image 307 ca* image = scr->getCookedImage(); // get the image
298 gui->setImage(image, 308 gui->setImage(image,
299 scr->getLines(), 309 scr->getLines(),
300 scr->getColumns()); // actual refresh 310 scr->getColumns()); // actual refresh
301 free(image); 311 free(image);
302 //FIXME: check that we do not trigger other draw event here. 312
313 //FIXME: check that we do not trigger other draw event here.
303 gui->setScroll(scr->getHistCursor(),scr->getHistLines()); 314 gui->setScroll(scr->getHistCursor(),scr->getHistLines());
315
304 } 316 }
305} 317}
306 318
307void TEmulation::bulkStart() 319void TEmulation::bulkStart()
308{ 320{
309 if (bulk_timer.isActive()) bulk_timer.stop(); 321 if (bulk_timer.isActive()) bulk_timer.stop();
@@ -336,28 +348,31 @@ void TEmulation::setConnect(bool c)
336/*! triggered by image size change of the TEWidget `gui'. 348/*! triggered by image size change of the TEWidget `gui'.
337 349
338 This event is simply propagated to the attached screens 350 This event is simply propagated to the attached screens
339 and to the related serial line. 351 and to the related serial line.
340*/ 352*/
341 353
342void TEmulation::onImageSizeChange(int lines, int columns) 354void TEmulation::onImageSizeChange(int lines, int columns) {
343{
344 if (!connected) return; 355 if (!connected) return;
345 screen[0]->resizeImage(lines,columns); 356 screen[0]->resizeImage(lines,columns);
346 screen[1]->resizeImage(lines,columns); 357 screen[1]->resizeImage(lines,columns);
347 showBulk(); 358 showBulk();
348 emit ImageSizeChanged(lines,columns); // propagate event to serial line 359 emit ImageSizeChanged(lines,columns); // propagate event to serial line
349} 360}
350 361
351void TEmulation::onHistoryCursorChange(int cursor) 362void TEmulation::onHistoryCursorChange(int cursor) {
352{
353 if (!connected) return; 363 if (!connected) return;
354 scr->setHistCursor(cursor); 364 scr->setHistCursor(cursor);
355 showBulk(); 365 showBulk();
356} 366}
357 367
358void TEmulation::setColumns(int columns) 368void TEmulation::onHorzCursorChange(int cursor) {
359{ 369 if (!connected) return;
370 scr->setHorzCursor(cursor);
371 showBulk();
372}
373
374void TEmulation::setColumns(int columns) {
360 //FIXME: this goes strange ways. 375 //FIXME: this goes strange ways.
361 // Can we put this straight or explain it at least? 376 // Can we put this straight or explain it at least?
362 emit changeColumns(columns); 377 emit changeColumns(columns);
363} 378}