summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/emulation_layer.cpp
authoribotty <ibotty>2002-10-09 17:40:35 (UTC)
committer ibotty <ibotty>2002-10-09 17:40:35 (UTC)
commitc80818d8388c07c1606a70306aea0c9a1e17ea3c (patch) (side-by-side diff)
treec010af190b398b698299a42ce06217c950d6525d /noncore/apps/opie-console/emulation_layer.cpp
parente0b4cca74ec611583c38901a83c448592e8ebec6 (diff)
downloadopie-c80818d8388c07c1606a70306aea0c9a1e17ea3c.zip
opie-c80818d8388c07c1606a70306aea0c9a1e17ea3c.tar.gz
opie-c80818d8388c07c1606a70306aea0c9a1e17ea3c.tar.bz2
updated emulationLayer to use WidgetLayer (not Widget, which is b0rked)
default.cpp is broken, because there is still no new widget (coming soon...)
Diffstat (limited to 'noncore/apps/opie-console/emulation_layer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/emulation_layer.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/noncore/apps/opie-console/emulation_layer.cpp b/noncore/apps/opie-console/emulation_layer.cpp
index 6c420e0..5baf05c 100644
--- a/noncore/apps/opie-console/emulation_layer.cpp
+++ b/noncore/apps/opie-console/emulation_layer.cpp
@@ -76,7 +76,7 @@
*/
#include "emulation_layer.h"
-#include "widget.h"
+#include "widget_layer.h"
#include "screen.h"
#include <stdio.h>
#include <stdlib.h>
@@ -95,34 +95,34 @@
/*!
*/
-EmulationLayer::EmulationLayer(Widget* gui)
+EmulationLayer::EmulationLayer( WidgetLayer* gui )
: decoder((QTextDecoder*)NULL)
{
this->gui = gui;
- screen[0] = new Screen(gui->Lines(),gui->Columns());
- screen[1] = new Screen(gui->Lines(),gui->Columns());
+ screen[0] = new Screen(gui->lines(),gui->columns());
+ screen[1] = new Screen(gui->lines(),gui->columns());
scr = screen[0];
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()) );
+ QObject::connect(&bulk_timer, SIGNAL( timeout() ), this, SLOT( showBulk() ) );
+ QObject::connect(gui,SIGNAL( imageSizeChanged( int, int ) ),
+ this,SLOT( onImageSizeChange( int, int ) ) );
+ QObject::connect(gui,SIGNAL( changedHistoryCursor( int ) ),
+ this,SLOT( historyCursorChange( int ) ) );
+ QObject::connect(gui,SIGNAL( keyPressed( QKeyEvent* ) ),
+ this,SLOT( onKeyPress( QKeyEvent* ) ) );
+ QObject::connect(gui,SIGNAL( selectionBegin( const int, const int) ),
+ this,SLOT( onSelectionBegin( const int, const int ) ) );
+ QObject::connect(gui,SIGNAL( selectionExtended( const int, const int ) ),
+ this,SLOT( onSelectionExtend( const int,const int ) ) );
+ QObject::connect(gui,SIGNAL( selectionEnd( const bool ) ),
+ this,SLOT( setSelection( const bool ) ) );
+ QObject::connect(gui,SIGNAL( selectionCleared() ),
+ this,SLOT( clearSelection() ) );
}
/*!
@@ -197,7 +197,7 @@ void EmulationLayer::onRcvChar(int c)
case '\t' : scr->Tabulate(); break;
case '\n' : scr->NewLine(); break;
case '\r' : scr->Return(); break;
- case 0x07 : gui->Bell(); break;
+ case 0x07 : gui->bell(); break;
default : scr->ShowCharacter(c); break;
};
}
@@ -303,11 +303,11 @@ void EmulationLayer::showBulk()
bulk_incnt = 0; // reset bulk counter
if (connected)
{
- Character* image = scr->getCookedImage(); // get the image
+ QArray<Character> image = scr->getCookedImage(); // get the image
gui->setImage(image,
scr->getLines(),
scr->getColumns()); // actual refresh
- free(image);
+ delete image;
//FIXME: check that we do not trigger other draw event here.
gui->setScroll(scr->getHistCursor(),scr->getHistLines());
}
@@ -320,7 +320,7 @@ void EmulationLayer::bulkStart()
void EmulationLayer::bulkEnd()
{
- if ( bulk_nlcnt > gui->Lines() || bulk_incnt > 20 )
+ if ( bulk_nlcnt > gui->lines() || bulk_incnt > 20 )
showBulk(); // resets bulk_??cnt to 0, too.
else
bulk_timer.start(BULK_TIMEOUT,TRUE);
@@ -331,7 +331,7 @@ void EmulationLayer::setConnect(bool c)
connected = c;
if ( connected)
{
- onImageSizeChange(gui->Lines(), gui->Columns());
+ onImageSizeChange(gui->lines(), gui->columns());
showBulk();
}
else