summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/emulation_widget.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/emulation_widget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/emulation_widget.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/emulation_widget.cpp b/noncore/apps/opie-console/emulation_widget.cpp
index e11c5e4..40199fa 100644
--- a/noncore/apps/opie-console/emulation_widget.cpp
+++ b/noncore/apps/opie-console/emulation_widget.cpp
@@ -81,24 +81,31 @@ static QChar vt100extended(QChar c)
81 case 0x2502 : return 25; 81 case 0x2502 : return 25;
82 case 0x2264 : return 26; 82 case 0x2264 : return 26;
83 case 0x2265 : return 27; 83 case 0x2265 : return 27;
84 case 0x03c0 : return 28; 84 case 0x03c0 : return 28;
85 case 0x2260 : return 29; 85 case 0x2260 : return 29;
86 case 0x00a3 : return 30; 86 case 0x00a3 : return 30;
87 case 0x00b7 : return 31; 87 case 0x00b7 : return 31;
88 } 88 }
89 return c; 89 return c;
90} 90}
91 91
92 92
93QSize EmulationWidget::calcSize( int cols, int lins ) const
94{
95 int frw = width() - contentsRect().width();
96 int frh = height() - contentsRect().height();
97 int scw = (scrollLoc == SCRNONE? 0 : m_scrollbar->width() );
98 return QSize( f_width * cols + 2 * rimX + frw + scw, f_height * lins + 2 * rimY + frh );
99}
93 100
94void EmulationWidget::setImage( QArray<Character> const newimg, int lines, int columns ) 101void EmulationWidget::setImage( QArray<Character> const newimg, int lines, int columns )
95{ 102{
96 const QPixmap* pm = backgroundPixmap(); 103 const QPixmap* pm = backgroundPixmap();
97 QPainter paint; 104 QPainter paint;
98 105
99 // dont allow updates, while drawing 106 // dont allow updates, while drawing
100 setUpdatesEnabled( false ); 107 setUpdatesEnabled( false );
101 108
102 paint.begin( this ); 109 paint.begin( this );
103 110
104 QPoint tL = contentsRect().topLeft(); 111 QPoint tL = contentsRect().topLeft();
@@ -108,25 +115,25 @@ void EmulationWidget::setImage( QArray<Character> const newimg, int lines, int c
108 115
109 int cf = -1; 116 int cf = -1;
110 int cb = -1; 117 int cb = -1;
111 int cr = -1; 118 int cr = -1;
112 119
113 int lins = QMIN( m_lines, QMAX( 0, lines ) ); 120 int lins = QMIN( m_lines, QMAX( 0, lines ) );
114 int cols = QMIN( m_columns, QMAX( 0, columns ) ); 121 int cols = QMIN( m_columns, QMAX( 0, columns ) );
115 QArray<QChar> disstrU = QArray<QChar>( cols ); 122 QArray<QChar> disstrU = QArray<QChar>( cols );
116 123
117 for ( int y = 0; y < lins; ++y ) 124 for ( int y = 0; y < lins; ++y )
118 {int len; 125 {int len;
119 const Character* lcl = &m_image[y * m_columns]; 126 const Character* lcl = &m_image[y * m_columns];
120 const Character* ext = &newimg[y * columns]; 127 const Character* ext = &newimg[y * m_columns];
121 if ( ! m_resizing ) 128 if ( ! m_resizing )
122 for ( int x = 0; x < cols; ++x ) 129 for ( int x = 0; x < cols; ++x )
123 { 130 {
124 // disable, till widget works, WITHOUT blinking 131 // disable, till widget works, WITHOUT blinking
125 //hasBlinker |= ( ext[x].r & RE_BLINK ); 132 //hasBlinker |= ( ext[x].r & RE_BLINK );
126 133
127 if ( ext[x] != lcl[x] ) 134 if ( ext[x] != lcl[x] )
128 { 135 {
129 cr = ext[x].r; 136 cr = ext[x].r;
130 cb = ext[x].b; 137 cb = ext[x].b;
131 if ( ext[x].f != cf ) cf = ext[x].f; 138 if ( ext[x].f != cf ) cf = ext[x].f;
132 int lln = cols - x; 139 int lln = cols - x;