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.cpp | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/noncore/apps/opie-console/emulation_widget.cpp b/noncore/apps/opie-console/emulation_widget.cpp index 4688551..f0708d0 100644 --- a/noncore/apps/opie-console/emulation_widget.cpp +++ b/noncore/apps/opie-console/emulation_widget.cpp | |||
@@ -203,97 +203,91 @@ void EmulationWidget::paintEvent( QPaintEvent* pe ) | |||
203 | int cb = m_image[loc(x,y)].b; | 203 | int cb = m_image[loc(x,y)].b; |
204 | int cr = m_image[loc(x,y)].r; | 204 | int cr = m_image[loc(x,y)].r; |
205 | while (x+len <= rlx && | 205 | while (x+len <= rlx && |
206 | m_image[loc(x+len,y)].f == cf && | 206 | m_image[loc(x+len,y)].f == cf && |
207 | m_image[loc(x+len,y)].b == cb && | 207 | m_image[loc(x+len,y)].b == cb && |
208 | m_image[loc(x+len,y)].r == cr ) | 208 | m_image[loc(x+len,y)].r == cr ) |
209 | { | 209 | { |
210 | disstrU[len] = vt100extended(m_image[loc(x+len,y)].c); | 210 | disstrU[len] = vt100extended(m_image[loc(x+len,y)].c); |
211 | len += 1; | 211 | len += 1; |
212 | } | 212 | } |
213 | QString unistr(disstrU,len); | 213 | QString unistr(disstrU,len); |
214 | 214 | ||
215 | drawAttrString( unistr, painter, QRect( m_blX+tLx+f_width*x,m_bY+tLy+f_height*y,f_width*len,f_height ), m_image[loc(x ,y )], pm != 0l, false ); | 215 | drawAttrString( unistr, painter, QRect( m_blX+tLx+f_width*x,m_bY+tLy+f_height*y,f_width*len,f_height ), m_image[loc(x ,y )], pm != 0l, false ); |
216 | x +=len -1; | 216 | x +=len -1; |
217 | } | 217 | } |
218 | delete [] disstrU; | 218 | delete [] disstrU; |
219 | drawFrame( &painter ); | 219 | drawFrame( &painter ); |
220 | painter.end(); | 220 | painter.end(); |
221 | } | 221 | } |
222 | 222 | ||
223 | void EmulationWidget::calcGeometry() | 223 | void EmulationWidget::calcGeometry() |
224 | { | 224 | { |
225 | m_scrollbar->resize(QApplication::style().scrollBarExtent().width(), contentsRect().height() ); | 225 | m_scrollbar->resize(QApplication::style().scrollBarExtent().width(), contentsRect().height() ); |
226 | 226 | ||
227 | odebug << QString(" TEST").arg( contentsRect().width() ) << oendl; | ||
228 | odebug << QString(" TEST").arg( contentsRect().height() ) << oendl; | ||
229 | odebug << "NEUER TESTT!!!!!!!!" << oendl; | ||
230 | |||
231 | switch( scrollLoc ) | 227 | switch( scrollLoc ) |
232 | { | 228 | { |
233 | case SCRNONE : | 229 | case SCRNONE : |
234 | m_columns = ( contentsRect().width() -2 * rimX ) / f_width; | 230 | m_columns = ( contentsRect().width() -2 * rimX ) / f_width; |
235 | m_blX = ( contentsRect().width() - ( m_columns*f_width ) ) / 2; | 231 | m_blX = ( contentsRect().width() - ( m_columns*f_width ) ) / 2; |
236 | m_brX = m_blX; | 232 | m_brX = m_blX; |
237 | m_scrollbar->hide(); | 233 | m_scrollbar->hide(); |
238 | break; | 234 | break; |
239 | case SCRLEFT : | 235 | case SCRLEFT : |
240 | m_columns = ( contentsRect().width() - 2 * rimX - m_scrollbar->width() ) / f_width; | 236 | m_columns = ( contentsRect().width() - 2 * rimX - m_scrollbar->width() ) / f_width; |
241 | m_brX = ( contentsRect().width() - ( m_columns*f_width ) - m_scrollbar->width() ) / 2; | 237 | m_brX = ( contentsRect().width() - ( m_columns*f_width ) - m_scrollbar->width() ) / 2; |
242 | m_blX = m_brX + m_scrollbar->width(); | 238 | m_blX = m_brX + m_scrollbar->width(); |
243 | m_scrollbar->move( contentsRect().topLeft() ); | 239 | m_scrollbar->move( contentsRect().topLeft() ); |
244 | m_scrollbar->show(); | 240 | m_scrollbar->show(); |
245 | break; | 241 | break; |
246 | case SCRIGHT: | 242 | case SCRIGHT: |
247 | m_columns = ( contentsRect().width() - 2 * rimX - m_scrollbar->width() ) / f_width; | 243 | m_columns = ( contentsRect().width() - 2 * rimX - m_scrollbar->width() ) / f_width; |
248 | m_blX = ( contentsRect().width() - ( m_columns*f_width ) - m_scrollbar->width() ) / 2; | 244 | m_blX = ( contentsRect().width() - ( m_columns*f_width ) - m_scrollbar->width() ) / 2; |
249 | m_brX = m_blX; | 245 | m_brX = m_blX; |
250 | m_scrollbar->move( contentsRect().topRight() - QPoint (m_scrollbar->width()-1,0 ) ); | 246 | m_scrollbar->move( contentsRect().topRight() - QPoint (m_scrollbar->width()-1,0 ) ); |
251 | m_scrollbar->show(); | 247 | m_scrollbar->show(); |
252 | break; | 248 | break; |
253 | } | 249 | } |
254 | 250 | ||
255 | m_lines = ( contentsRect().height() - 2 * rimY ) / f_height; | 251 | m_lines = ( contentsRect().height() - 2 * rimY ) / f_height; |
256 | m_bY = ( contentsRect().height() - (m_lines * f_height ) ) / 2; | 252 | m_bY = ( contentsRect().height() - (m_lines * f_height ) ) / 2; |
257 | } | 253 | } |
258 | 254 | ||
259 | void EmulationWidget::drawAttrString( QString& string, QPainter &painter, QRect rect, Character attr, bool usePixmap, bool clear ) | 255 | void EmulationWidget::drawAttrString( QString& string, QPainter &painter, QRect rect, Character attr, bool usePixmap, bool clear ) |
260 | { | 256 | { |
261 | owarn << "Color1 " << color_table[attr.b].color.name().latin1() << "" << oendl; | ||
262 | if ( usePixmap && color_table[attr.b].transparent ) | 257 | if ( usePixmap && color_table[attr.b].transparent ) |
263 | { | 258 | { |
264 | painter.setBackgroundMode( TransparentMode ); | 259 | painter.setBackgroundMode( TransparentMode ); |
265 | if ( clear ) | 260 | if ( clear ) |
266 | erase( rect ); | 261 | erase( rect ); |
267 | } | 262 | } |
268 | else | 263 | else |
269 | { | 264 | { |
270 | if ( blinking ) | 265 | if ( blinking ) |
271 | painter.fillRect( rect, color_table[attr.b].color ); | 266 | painter.fillRect( rect, color_table[attr.b].color ); |
272 | else | 267 | else |
273 | { | 268 | { |
274 | painter.setBackgroundMode( OpaqueMode ); | 269 | painter.setBackgroundMode( OpaqueMode ); |
275 | owarn << "Color " << color_table[attr.b].color.name().latin1() << "" << oendl; | ||
276 | painter.setBackgroundColor( color_table[attr.b].color ); | 270 | painter.setBackgroundColor( color_table[attr.b].color ); |
277 | } | 271 | } |
278 | } | 272 | } |
279 | if ( color_table[attr.f].bold ) | 273 | if ( color_table[attr.f].bold ) |
280 | painter.setPen( QColor( 0x8F, 0x00, 0x00 ) ); | 274 | painter.setPen( QColor( 0x8F, 0x00, 0x00 ) ); |
281 | else | 275 | else |
282 | painter.setPen( color_table[attr.f].color ); | 276 | painter.setPen( color_table[attr.f].color ); |
283 | painter.drawText( rect.x(), rect.y() + f_ascent, string ); | 277 | painter.drawText( rect.x(), rect.y() + f_ascent, string ); |
284 | 278 | ||
285 | } | 279 | } |
286 | 280 | ||
287 | 281 | ||
288 | /////////////////////// | 282 | /////////////////////// |
289 | // scrollbar | 283 | // scrollbar |
290 | // //////////////////// | 284 | // //////////////////// |
291 | 285 | ||
292 | void EmulationWidget::scroll( int value ) | 286 | void EmulationWidget::scroll( int value ) |
293 | { | 287 | { |
294 | } | 288 | } |
295 | 289 | ||
296 | void EmulationWidget::setScroll( int cursor, int slines ) | 290 | void EmulationWidget::setScroll( int cursor, int slines ) |
297 | { | 291 | { |
298 | } | 292 | } |
299 | 293 | ||