author | ar <ar> | 2004-05-21 20:54:44 (UTC) |
---|---|---|
committer | ar <ar> | 2004-05-21 20:54:44 (UTC) |
commit | 37294c41a902eab36427372bdda31b4462fd73ca (patch) (unidiff) | |
tree | e86f2a473ac0854b451577871603a2d4f94f8f45 /noncore | |
parent | d0a66ef7432056016ed637597ca24e85e7bc2503 (diff) | |
download | opie-37294c41a902eab36427372bdda31b4462fd73ca.zip opie-37294c41a902eab36427372bdda31b4462fd73ca.tar.gz opie-37294c41a902eab36427372bdda31b4462fd73ca.tar.bz2 |
- convert qDebug to odebug
-rw-r--r-- | noncore/styles/theme/ogfxeffect.cpp | 16 | ||||
-rw-r--r-- | noncore/styles/theme/othemebase.cpp | 31 |
2 files changed, 28 insertions, 19 deletions
diff --git a/noncore/styles/theme/ogfxeffect.cpp b/noncore/styles/theme/ogfxeffect.cpp index 90b45fe..ab63c98 100644 --- a/noncore/styles/theme/ogfxeffect.cpp +++ b/noncore/styles/theme/ogfxeffect.cpp | |||
@@ -1,28 +1,32 @@ | |||
1 | /* This file is part of the KDE libraries | 1 | /* This file is part of the KDE libraries |
2 | Copyright (C) 1998, 1999 Christian Tibirna <ctibirna@total.net> | 2 | Copyright (C) 1998, 1999 Christian Tibirna <ctibirna@total.net> |
3 | (C) 1998, 1999 Daniel M. Duley <mosfet@kde.org> | 3 | (C) 1998, 1999 Daniel M. Duley <mosfet@kde.org> |
4 | (C) 1998, 1999 Dirk A. Mueller <mueller@kde.org> | 4 | (C) 1998, 1999 Dirk A. Mueller <mueller@kde.org> |
5 | 5 | ||
6 | */ | 6 | */ |
7 | 7 | ||
8 | // $Id$ | 8 | // $Id$ |
9 | 9 | ||
10 | #include <qimage.h> | 10 | #include "ogfxeffect.h" |
11 | #include <qpainter.h> | ||
12 | 11 | ||
12 | /* OPIE */ | ||
13 | #include <opie2/odebug.h> | ||
13 | #include <qpe/qmath.h> | 14 | #include <qpe/qmath.h> |
14 | 15 | ||
15 | #include "ogfxeffect.h" | 16 | /* QT */ |
17 | #include <qimage.h> | ||
18 | #include <qpainter.h> | ||
16 | 19 | ||
20 | /* STD */ | ||
17 | #include <cstdlib> | 21 | #include <cstdlib> |
18 | #include <cmath> | 22 | #include <cmath> |
19 | 23 | ||
20 | //====================================================================== | 24 | //====================================================================== |
21 | // | 25 | // |
22 | // Gradient effects | 26 | // Gradient effects |
23 | // | 27 | // |
24 | //====================================================================== | 28 | //====================================================================== |
25 | 29 | ||
26 | 30 | ||
27 | QPixmap& OGfxEffect::gradient(QPixmap &pixmap, const QColor &ca, | 31 | QPixmap& OGfxEffect::gradient(QPixmap &pixmap, const QColor &ca, |
28 | const QColor &cb, GradientType eff, int ncols) | 32 | const QColor &cb, GradientType eff, int ncols) |
@@ -34,25 +38,25 @@ QPixmap& OGfxEffect::gradient(QPixmap &pixmap, const QColor &ca, | |||
34 | return pixmap; | 38 | return pixmap; |
35 | } | 39 | } |
36 | 40 | ||
37 | QImage OGfxEffect::gradient(const QSize &size, const QColor &ca, | 41 | QImage OGfxEffect::gradient(const QSize &size, const QColor &ca, |
38 | const QColor &cb, GradientType eff, int /*ncols*/) | 42 | const QColor &cb, GradientType eff, int /*ncols*/) |
39 | { | 43 | { |
40 | int rDiff, gDiff, bDiff; | 44 | int rDiff, gDiff, bDiff; |
41 | int rca, gca, bca, rcb, gcb, bcb; | 45 | int rca, gca, bca, rcb, gcb, bcb; |
42 | 46 | ||
43 | QImage image(size, 32); | 47 | QImage image(size, 32); |
44 | 48 | ||
45 | if (size.width() == 0 || size.height() == 0) { | 49 | if (size.width() == 0 || size.height() == 0) { |
46 | qDebug ( "WARNING: OGfxEffect::gradient: invalid image" ); | 50 | odebug << "WARNING: OGfxEffect::gradient: invalid image" << oendl; |
47 | return image; | 51 | return image; |
48 | } | 52 | } |
49 | 53 | ||
50 | register int x, y; | 54 | register int x, y; |
51 | 55 | ||
52 | rDiff = (rcb = cb.red()) - (rca = ca.red()); | 56 | rDiff = (rcb = cb.red()) - (rca = ca.red()); |
53 | gDiff = (gcb = cb.green()) - (gca = ca.green()); | 57 | gDiff = (gcb = cb.green()) - (gca = ca.green()); |
54 | bDiff = (bcb = cb.blue()) - (bca = ca.blue()); | 58 | bDiff = (bcb = cb.blue()) - (bca = ca.blue()); |
55 | 59 | ||
56 | if( eff == VerticalGradient || eff == HorizontalGradient ){ | 60 | if( eff == VerticalGradient || eff == HorizontalGradient ){ |
57 | 61 | ||
58 | uint *p; | 62 | uint *p; |
@@ -290,25 +294,25 @@ QPixmap& OGfxEffect::blend(QPixmap &pixmap, float initial_intensity, | |||
290 | 294 | ||
291 | pixmap.convertFromImage(image); | 295 | pixmap.convertFromImage(image); |
292 | } | 296 | } |
293 | return pixmap; | 297 | return pixmap; |
294 | } | 298 | } |
295 | 299 | ||
296 | 300 | ||
297 | QImage& OGfxEffect::blend(QImage &image, float initial_intensity, | 301 | QImage& OGfxEffect::blend(QImage &image, float initial_intensity, |
298 | const QColor &bgnd, GradientType eff, | 302 | const QColor &bgnd, GradientType eff, |
299 | bool anti_dir) | 303 | bool anti_dir) |
300 | { | 304 | { |
301 | if (image.width() == 0 || image.height() == 0) { | 305 | if (image.width() == 0 || image.height() == 0) { |
302 | qDebug ( "Invalid image\n" ); | 306 | odebug << "Invalid image" << oendl; |
303 | return image; | 307 | return image; |
304 | } | 308 | } |
305 | 309 | ||
306 | int r_bgnd = bgnd.red(), g_bgnd = bgnd.green(), b_bgnd = bgnd.blue(); | 310 | int r_bgnd = bgnd.red(), g_bgnd = bgnd.green(), b_bgnd = bgnd.blue(); |
307 | int r, g, b; | 311 | int r, g, b; |
308 | int ind; | 312 | int ind; |
309 | 313 | ||
310 | unsigned int xi, xf, yi, yf; | 314 | unsigned int xi, xf, yi, yf; |
311 | unsigned int a; | 315 | unsigned int a; |
312 | 316 | ||
313 | // check the boundaries of the initial intesity param | 317 | // check the boundaries of the initial intesity param |
314 | float unaffected = 1; | 318 | float unaffected = 1; |
@@ -476,25 +480,25 @@ QImage& OGfxEffect::blend(QImage &image, float initial_intensity, | |||
476 | b = qBlue (data[ind]) + (int)(intensity * | 480 | b = qBlue (data[ind]) + (int)(intensity * |
477 | (b_bgnd - qBlue (data[ind]))); | 481 | (b_bgnd - qBlue (data[ind]))); |
478 | if (r > 255) r = 255; if (r < 0 ) r = 0; | 482 | if (r > 255) r = 255; if (r < 0 ) r = 0; |
479 | if (g > 255) g = 255; if (g < 0 ) g = 0; | 483 | if (g > 255) g = 255; if (g < 0 ) g = 0; |
480 | if (b > 255) b = 255; if (b < 0 ) b = 0; | 484 | if (b > 255) b = 255; if (b < 0 ) b = 0; |
481 | a = qAlpha(data[ind]); | 485 | a = qAlpha(data[ind]); |
482 | data[ind] = qRgba(r, g, b, a); | 486 | data[ind] = qRgba(r, g, b, a); |
483 | } | 487 | } |
484 | } | 488 | } |
485 | } | 489 | } |
486 | 490 | ||
487 | else | 491 | else |
488 | qDebug ( "not implemented\n" ); | 492 | odebug << "not implemented" << oendl; |
489 | 493 | ||
490 | return image; | 494 | return image; |
491 | } | 495 | } |
492 | 496 | ||
493 | #if 0 | 497 | #if 0 |
494 | // Not very efficient as we create a third big image... | 498 | // Not very efficient as we create a third big image... |
495 | // | 499 | // |
496 | QImage& KQGfxEffect::blend(QImage &image1, QImage &image2, | 500 | QImage& KQGfxEffect::blend(QImage &image1, QImage &image2, |
497 | GradientType gt, int xf, int yf) | 501 | GradientType gt, int xf, int yf) |
498 | { | 502 | { |
499 | if (image1.width() == 0 || image1.height() == 0 || | 503 | if (image1.width() == 0 || image1.height() == 0 || |
500 | image2.width() == 0 || image2.height() == 0) | 504 | image2.width() == 0 || image2.height() == 0) |
diff --git a/noncore/styles/theme/othemebase.cpp b/noncore/styles/theme/othemebase.cpp index 7ce4e5a..d2226e6 100644 --- a/noncore/styles/theme/othemebase.cpp +++ b/noncore/styles/theme/othemebase.cpp | |||
@@ -169,25 +169,25 @@ void OThemeBase::generateBorderPix( int i ) | |||
169 | bitBlt( &tmp, 0, 0, pbPixmaps[ i ], pbPixmaps[ i ] ->width() - pbWidth[ i ], | 169 | bitBlt( &tmp, 0, 0, pbPixmaps[ i ], pbPixmaps[ i ] ->width() - pbWidth[ i ], |
170 | pbWidth[ i ], pbWidth[ i ], pbPixmaps[ i ] ->height() - pbWidth[ i ] * 2, | 170 | pbWidth[ i ], pbWidth[ i ], pbPixmaps[ i ] ->height() - pbWidth[ i ] * 2, |
171 | Qt::CopyROP, false ); | 171 | Qt::CopyROP, false ); |
172 | if ( srcMask ) { | 172 | if ( srcMask ) { |
173 | bitBlt( &destMask, 0, 0, srcMask, pbPixmaps[ i ] ->width() - pbWidth[ i ], | 173 | bitBlt( &destMask, 0, 0, srcMask, pbPixmaps[ i ] ->width() - pbWidth[ i ], |
174 | pbWidth[ i ], pbWidth[ i ], pbPixmaps[ i ] ->height() - pbWidth[ i ] * 2, | 174 | pbWidth[ i ], pbWidth[ i ], pbPixmaps[ i ] ->height() - pbWidth[ i ] * 2, |
175 | Qt::CopyROP, false ); | 175 | Qt::CopyROP, false ); |
176 | tmp.setMask( destMask ); | 176 | tmp.setMask( destMask ); |
177 | } | 177 | } |
178 | pbPixmaps[ i ] ->setBorder( OThemePixmap::Right, tmp ); | 178 | pbPixmaps[ i ] ->setBorder( OThemePixmap::Right, tmp ); |
179 | } | 179 | } |
180 | else | 180 | else |
181 | qDebug ( "OThemeBase: Tried making border from empty pixmap" ); | 181 | odebug << "OThemeBase: Tried making border from empty pixmap" << oendl; |
182 | } | 182 | } |
183 | 183 | ||
184 | 184 | ||
185 | void OThemeBase::copyWidgetConfig( int sourceID, int destID, QString *pixnames, | 185 | void OThemeBase::copyWidgetConfig( int sourceID, int destID, QString *pixnames, |
186 | QString *brdnames ) | 186 | QString *brdnames ) |
187 | { | 187 | { |
188 | scaleHints[ destID ] = scaleHints[ sourceID ]; | 188 | scaleHints[ destID ] = scaleHints[ sourceID ]; |
189 | gradients[ destID ] = gradients[ sourceID ]; | 189 | gradients[ destID ] = gradients[ sourceID ]; |
190 | blends[ destID ] = blends[ sourceID ]; | 190 | blends[ destID ] = blends[ sourceID ]; |
191 | bContrasts[ destID ] = bContrasts[ sourceID ]; | 191 | bContrasts[ destID ] = bContrasts[ sourceID ]; |
192 | borders[ destID ] = borders[ sourceID ]; | 192 | borders[ destID ] = borders[ sourceID ]; |
193 | highlights[ destID ] = highlights[ sourceID ]; | 193 | highlights[ destID ] = highlights[ sourceID ]; |
@@ -364,37 +364,37 @@ OThemeBase::~OThemeBase() | |||
364 | delete( grHighColors[ i ] ); | 364 | delete( grHighColors[ i ] ); |
365 | } | 365 | } |
366 | delete cache; | 366 | delete cache; |
367 | } | 367 | } |
368 | 368 | ||
369 | QImage* OThemeBase::loadImage( QString &name ) | 369 | QImage* OThemeBase::loadImage( QString &name ) |
370 | { | 370 | { |
371 | QImage * image = new QImage; | 371 | QImage * image = new QImage; |
372 | QString path = configFilePath + "/pixmaps/" + name; | 372 | QString path = configFilePath + "/pixmaps/" + name; |
373 | image->load( path ); | 373 | image->load( path ); |
374 | if ( !image->isNull() ) | 374 | if ( !image->isNull() ) |
375 | return ( image ); | 375 | return ( image ); |
376 | qDebug ( "OThemeBase: Unable to load image %s\n", name.ascii ( ) ); | 376 | odebug << "OThemeBase: Unable to load image " << name.ascii ( ) << oendl; |
377 | delete image; | 377 | delete image; |
378 | return ( NULL ); | 378 | return ( NULL ); |
379 | } | 379 | } |
380 | 380 | ||
381 | OThemePixmap* OThemeBase::loadPixmap( QString &name ) | 381 | OThemePixmap* OThemeBase::loadPixmap( QString &name ) |
382 | { | 382 | { |
383 | OThemePixmap * pixmap = new OThemePixmap( false ); | 383 | OThemePixmap * pixmap = new OThemePixmap( false ); |
384 | QString path = configFilePath + "/pixmaps/" + name; | 384 | QString path = configFilePath + "/pixmaps/" + name; |
385 | pixmap->load( path ); | 385 | pixmap->load( path ); |
386 | if ( !pixmap->isNull() ) | 386 | if ( !pixmap->isNull() ) |
387 | return pixmap; | 387 | return pixmap; |
388 | qDebug ( "OThemeBase: Unable to load pixmap %s\n", name.ascii() ); | 388 | odebug << "OThemeBase: Unable to load pixmap " << name.ascii() << oendl; |
389 | delete pixmap; | 389 | delete pixmap; |
390 | return ( NULL ); | 390 | return ( NULL ); |
391 | } | 391 | } |
392 | 392 | ||
393 | OThemePixmap* OThemeBase::scale( int w, int h, WidgetType widget ) | 393 | OThemePixmap* OThemeBase::scale( int w, int h, WidgetType widget ) |
394 | { | 394 | { |
395 | if ( scaleHints[ widget ] == FullScale ) { | 395 | if ( scaleHints[ widget ] == FullScale ) { |
396 | if ( !pixmaps[ widget ] || pixmaps[ widget ] ->width() != w || | 396 | if ( !pixmaps[ widget ] || pixmaps[ widget ] ->width() != w || |
397 | pixmaps[ widget ] ->height() != h ) { | 397 | pixmaps[ widget ] ->height() != h ) { |
398 | OThemePixmap * cachePix = cache->pixmap( w, h, widget ); | 398 | OThemePixmap * cachePix = cache->pixmap( w, h, widget ); |
399 | if ( cachePix ) { | 399 | if ( cachePix ) { |
400 | cachePix = new OThemePixmap( *cachePix ); | 400 | cachePix = new OThemePixmap( *cachePix ); |
@@ -414,47 +414,47 @@ OThemePixmap* OThemeBase::scale( int w, int h, WidgetType widget ) | |||
414 | blend( widget ); | 414 | blend( widget ); |
415 | } | 415 | } |
416 | } | 416 | } |
417 | } | 417 | } |
418 | else if ( scaleHints[ widget ] == HorizontalScale ) { | 418 | else if ( scaleHints[ widget ] == HorizontalScale ) { |
419 | if ( pixmaps[ widget ] ->width() != w ) { | 419 | if ( pixmaps[ widget ] ->width() != w ) { |
420 | OThemePixmap * cachePix = cache->horizontalPixmap( w, widget ); | 420 | OThemePixmap * cachePix = cache->horizontalPixmap( w, widget ); |
421 | if ( cachePix ) { | 421 | if ( cachePix ) { |
422 | cachePix = new OThemePixmap( *cachePix ); | 422 | cachePix = new OThemePixmap( *cachePix ); |
423 | if ( pixmaps[ widget ] ) | 423 | if ( pixmaps[ widget ] ) |
424 | cache->insert( pixmaps[ widget ], OThemeCache::HorizontalScale, widget ); | 424 | cache->insert( pixmaps[ widget ], OThemeCache::HorizontalScale, widget ); |
425 | else | 425 | else |
426 | qDebug ( "We would have inserted a null pixmap!\n" ); | 426 | odebug << "We would have inserted a null pixmap!" << oendl; |
427 | pixmaps[ widget ] = cachePix; | 427 | pixmaps[ widget ] = cachePix; |
428 | } | 428 | } |
429 | else { | 429 | else { |
430 | cache->insert( pixmaps[ widget ], OThemeCache::HorizontalScale, widget ); | 430 | cache->insert( pixmaps[ widget ], OThemeCache::HorizontalScale, widget ); |
431 | QImage tmpImg = images[ widget ] -> | 431 | QImage tmpImg = images[ widget ] -> |
432 | smoothScale( w, images[ widget ] ->height() ); | 432 | smoothScale( w, images[ widget ] ->height() ); |
433 | pixmaps[ widget ] = new OThemePixmap; | 433 | pixmaps[ widget ] = new OThemePixmap; |
434 | pixmaps[ widget ] ->convertFromImage( tmpImg ); | 434 | pixmaps[ widget ] ->convertFromImage( tmpImg ); |
435 | if ( blends[ widget ] != 0.0 ) | 435 | if ( blends[ widget ] != 0.0 ) |
436 | blend( widget ); | 436 | blend( widget ); |
437 | } | 437 | } |
438 | } | 438 | } |
439 | } | 439 | } |
440 | else if ( scaleHints[ widget ] == VerticalScale ) { | 440 | else if ( scaleHints[ widget ] == VerticalScale ) { |
441 | if ( pixmaps[ widget ] ->height() != h ) { | 441 | if ( pixmaps[ widget ] ->height() != h ) { |
442 | OThemePixmap * cachePix = cache->verticalPixmap( w, widget ); | 442 | OThemePixmap * cachePix = cache->verticalPixmap( w, widget ); |
443 | if ( cachePix ) { | 443 | if ( cachePix ) { |
444 | cachePix = new OThemePixmap( *cachePix ); | 444 | cachePix = new OThemePixmap( *cachePix ); |
445 | if ( pixmaps[ widget ] ) | 445 | if ( pixmaps[ widget ] ) |
446 | cache->insert( pixmaps[ widget ], OThemeCache::VerticalScale, widget ); | 446 | cache->insert( pixmaps[ widget ], OThemeCache::VerticalScale, widget ); |
447 | else | 447 | else |
448 | qDebug ( "We would have inserted a null pixmap!\n" ); | 448 | odebug << "We would have inserted a null pixmap!" << oendl; |
449 | pixmaps[ widget ] = cachePix; | 449 | pixmaps[ widget ] = cachePix; |
450 | } | 450 | } |
451 | else { | 451 | else { |
452 | cache->insert( pixmaps[ widget ], OThemeCache::VerticalScale, widget ); | 452 | cache->insert( pixmaps[ widget ], OThemeCache::VerticalScale, widget ); |
453 | QImage tmpImg = | 453 | QImage tmpImg = |
454 | images[ widget ] ->smoothScale( images[ widget ] ->width(), h ); | 454 | images[ widget ] ->smoothScale( images[ widget ] ->width(), h ); |
455 | pixmaps[ widget ] = new OThemePixmap; | 455 | pixmaps[ widget ] = new OThemePixmap; |
456 | pixmaps[ widget ] ->convertFromImage( tmpImg ); | 456 | pixmaps[ widget ] ->convertFromImage( tmpImg ); |
457 | if ( blends[ widget ] != 0.0 ) | 457 | if ( blends[ widget ] != 0.0 ) |
458 | blend( widget ); | 458 | blend( widget ); |
459 | } | 459 | } |
460 | } | 460 | } |
@@ -581,25 +581,25 @@ OThemePixmap* OThemeBase::scaleBorder( int w, int h, WidgetType widget ) | |||
581 | p.drawTiledPixmap( w - bdWidth, bdWidth, bdWidth, h - bdWidth * 2, | 581 | p.drawTiledPixmap( w - bdWidth, bdWidth, bdWidth, h - bdWidth * 2, |
582 | *tmp ); | 582 | *tmp ); |
583 | if ( srcMask ) | 583 | if ( srcMask ) |
584 | mPainter.drawTiledPixmap( w - bdWidth, bdWidth, bdWidth, h - bdWidth * 2, *srcMask ); | 584 | mPainter.drawTiledPixmap( w - bdWidth, bdWidth, bdWidth, h - bdWidth * 2, *srcMask ); |
585 | else | 585 | else |
586 | mPainter.fillRect( w - bdWidth, bdWidth, bdWidth, h - bdWidth * 2, color1 ); | 586 | mPainter.fillRect( w - bdWidth, bdWidth, bdWidth, h - bdWidth * 2, color1 ); |
587 | } | 587 | } |
588 | p.end(); | 588 | p.end(); |
589 | mPainter.end(); | 589 | mPainter.end(); |
590 | pixmap->setMask( mask ); | 590 | pixmap->setMask( mask ); |
591 | cache->insert( pixmap, OThemeCache::FullScale, widget, true ); | 591 | cache->insert( pixmap, OThemeCache::FullScale, widget, true ); |
592 | if ( !pixmap->mask() ) | 592 | if ( !pixmap->mask() ) |
593 | qDebug ( "No mask for border pixmap!\n" ); | 593 | odebug << "No mask for border pixmap!" << oendl; |
594 | } | 594 | } |
595 | return ( pixmap ); | 595 | return ( pixmap ); |
596 | } | 596 | } |
597 | 597 | ||
598 | 598 | ||
599 | OThemePixmap* OThemeBase::blend( WidgetType widget ) | 599 | OThemePixmap* OThemeBase::blend( WidgetType widget ) |
600 | { | 600 | { |
601 | OGfxEffect::GradientType g; | 601 | OGfxEffect::GradientType g; |
602 | switch ( gradients[ widget ] ) { | 602 | switch ( gradients[ widget ] ) { |
603 | case GrHorizontal: | 603 | case GrHorizontal: |
604 | g = OGfxEffect::HorizontalGradient; | 604 | g = OGfxEffect::HorizontalGradient; |
605 | break; | 605 | break; |
@@ -796,35 +796,37 @@ static QColor strToColor ( const QString &str ) | |||
796 | void OThemeBase::applyMiscResourceGroup( Config *config ) | 796 | void OThemeBase::applyMiscResourceGroup( Config *config ) |
797 | { | 797 | { |
798 | config-> setGroup ( "Misc" ); | 798 | config-> setGroup ( "Misc" ); |
799 | QString tmpStr; | 799 | QString tmpStr; |
800 | 800 | ||
801 | tmpStr = config->readEntry( "SButtonPosition" ); | 801 | tmpStr = config->readEntry( "SButtonPosition" ); |
802 | if ( tmpStr == "BottomLeft" ) | 802 | if ( tmpStr == "BottomLeft" ) |
803 | sbPlacement = SBBottomLeft; | 803 | sbPlacement = SBBottomLeft; |
804 | else if ( tmpStr == "BottomRight" ) | 804 | else if ( tmpStr == "BottomRight" ) |
805 | sbPlacement = SBBottomRight; | 805 | sbPlacement = SBBottomRight; |
806 | else { | 806 | else { |
807 | if ( tmpStr != "Opposite" && !tmpStr.isEmpty() ) | 807 | if ( tmpStr != "Opposite" && !tmpStr.isEmpty() ) |
808 | qDebug ( "OThemeBase: Unrecognized sb button option %s, using Opposite.\n", tmpStr.ascii() ); | 808 | odebug << "OThemeBase: Unrecognized sb button option " << tmpStr.ascii() |
809 | << ", using Opposite." << oendl; | ||
809 | sbPlacement = SBOpposite; | 810 | sbPlacement = SBOpposite; |
810 | } | 811 | } |
811 | tmpStr = config->readEntry( "ArrowType" ); | 812 | tmpStr = config->readEntry( "ArrowType" ); |
812 | if ( tmpStr == "Small" ) | 813 | if ( tmpStr == "Small" ) |
813 | arrowStyle = SmallArrow; | 814 | arrowStyle = SmallArrow; |
814 | else if ( tmpStr == "3D" ) | 815 | else if ( tmpStr == "3D" ) |
815 | arrowStyle = MotifArrow; | 816 | arrowStyle = MotifArrow; |
816 | else { | 817 | else { |
817 | if ( tmpStr != "Normal" && !tmpStr.isEmpty() ) | 818 | if ( tmpStr != "Normal" && !tmpStr.isEmpty() ) |
818 | qDebug ( "OThemeBase: Unrecognized arrow option %s, using Normal.\n", tmpStr.ascii() ); | 819 | odebug << "OThemeBase: Unrecognized arrow option " << tmpStr.ascii() |
820 | << ", using Normal." << oendl; | ||
819 | arrowStyle = LargeArrow; | 821 | arrowStyle = LargeArrow; |
820 | } | 822 | } |
821 | tmpStr = config->readEntry( "ShadeStyle" ); | 823 | tmpStr = config->readEntry( "ShadeStyle" ); |
822 | if ( tmpStr == "Motif" ) | 824 | if ( tmpStr == "Motif" ) |
823 | shading = Motif; | 825 | shading = Motif; |
824 | else if ( tmpStr == "Next" ) | 826 | else if ( tmpStr == "Next" ) |
825 | shading = Next; | 827 | shading = Next; |
826 | else if ( tmpStr == "KDE" ) | 828 | else if ( tmpStr == "KDE" ) |
827 | shading = KDE; | 829 | shading = KDE; |
828 | else | 830 | else |
829 | shading = Windows; | 831 | shading = Windows; |
830 | 832 | ||
@@ -857,48 +859,50 @@ void OThemeBase::applyResourceGroup( Config *config, int i, QString *copyfrom, Q | |||
857 | return ; | 859 | return ; |
858 | 860 | ||
859 | // Scale hint | 861 | // Scale hint |
860 | tmpStr = config->readEntry( "Scale" ); | 862 | tmpStr = config->readEntry( "Scale" ); |
861 | if ( tmpStr == "Full" ) | 863 | if ( tmpStr == "Full" ) |
862 | scaleHints [ i ] = FullScale; | 864 | scaleHints [ i ] = FullScale; |
863 | else if ( tmpStr == "Horizontal" ) | 865 | else if ( tmpStr == "Horizontal" ) |
864 | scaleHints [ i ] = HorizontalScale; | 866 | scaleHints [ i ] = HorizontalScale; |
865 | else if ( tmpStr == "Vertical" ) | 867 | else if ( tmpStr == "Vertical" ) |
866 | scaleHints [ i ] = VerticalScale; | 868 | scaleHints [ i ] = VerticalScale; |
867 | else { | 869 | else { |
868 | if ( tmpStr != "Tile" && !tmpStr.isEmpty() ) | 870 | if ( tmpStr != "Tile" && !tmpStr.isEmpty() ) |
869 | qDebug ( "OThemeBase: Unrecognized scale option %s, using Tile.\n", tmpStr.ascii() ); | 871 | odebug << "OThemeBase: Unrecognized scale option " << tmpStr.ascii() |
872 | << ", using Tile." << oendl; | ||
870 | scaleHints [ i ] = TileScale; | 873 | scaleHints [ i ] = TileScale; |
871 | } | 874 | } |
872 | 875 | ||
873 | 876 | ||
874 | // Gradient type | 877 | // Gradient type |
875 | tmpStr = config->readEntry( "Gradient" ); | 878 | tmpStr = config->readEntry( "Gradient" ); |
876 | if ( tmpStr == "Diagonal" ) | 879 | if ( tmpStr == "Diagonal" ) |
877 | gradients [ i ] = GrDiagonal; | 880 | gradients [ i ] = GrDiagonal; |
878 | else if ( tmpStr == "Horizontal" ) | 881 | else if ( tmpStr == "Horizontal" ) |
879 | gradients [ i ] = GrHorizontal; | 882 | gradients [ i ] = GrHorizontal; |
880 | else if ( tmpStr == "Vertical" ) | 883 | else if ( tmpStr == "Vertical" ) |
881 | gradients [ i ] = GrVertical; | 884 | gradients [ i ] = GrVertical; |
882 | else if ( tmpStr == "Pyramid" ) | 885 | else if ( tmpStr == "Pyramid" ) |
883 | gradients [ i ] = GrPyramid; | 886 | gradients [ i ] = GrPyramid; |
884 | else if ( tmpStr == "Rectangle" ) | 887 | else if ( tmpStr == "Rectangle" ) |
885 | gradients [ i ] = GrRectangle; | 888 | gradients [ i ] = GrRectangle; |
886 | else if ( tmpStr == "Elliptic" ) | 889 | else if ( tmpStr == "Elliptic" ) |
887 | gradients [ i ] = GrElliptic; | 890 | gradients [ i ] = GrElliptic; |
888 | else if ( tmpStr == "ReverseBevel" ) | 891 | else if ( tmpStr == "ReverseBevel" ) |
889 | gradients [ i ] = GrReverseBevel; | 892 | gradients [ i ] = GrReverseBevel; |
890 | else { | 893 | else { |
891 | if ( tmpStr != "None" && !tmpStr.isEmpty() ) | 894 | if ( tmpStr != "None" && !tmpStr.isEmpty() ) |
892 | qDebug ( "OThemeBase: Unrecognized gradient option %s, using None.\n", tmpStr.ascii() ); | 895 | odebug << "OThemeBase: Unrecognized gradient option " << tmpStr.ascii() |
896 | << ", using None." << oendl; | ||
893 | gradients [ i ] = GrNone; | 897 | gradients [ i ] = GrNone; |
894 | } | 898 | } |
895 | 899 | ||
896 | // Blend intensity | 900 | // Blend intensity |
897 | blends[ i ] = config->readEntry( "BlendIntensity", "0.0" ).toDouble(); | 901 | blends[ i ] = config->readEntry( "BlendIntensity", "0.0" ).toDouble(); |
898 | 902 | ||
899 | // Bevel contrast | 903 | // Bevel contrast |
900 | bContrasts[ i ] = config->readNumEntry( "BevelContrast", 0 ); | 904 | bContrasts[ i ] = config->readNumEntry( "BevelContrast", 0 ); |
901 | 905 | ||
902 | // Border width | 906 | // Border width |
903 | borders [ i ] = config->readNumEntry( "Border", 1 ); | 907 | borders [ i ] = config->readNumEntry( "Border", 1 ); |
904 | 908 | ||
@@ -936,26 +940,27 @@ void OThemeBase::applyResourceGroup( Config *config, int i, QString *copyfrom, Q | |||
936 | images[ i ] = NULL; | 940 | images[ i ] = NULL; |
937 | 941 | ||
938 | 942 | ||
939 | // Pixmap border | 943 | // Pixmap border |
940 | tmpStr = config->readEntry( "PixmapBorder", "" ); | 944 | tmpStr = config->readEntry( "PixmapBorder", "" ); |
941 | brdnames[ i ] = tmpStr; | 945 | brdnames[ i ] = tmpStr; |
942 | pbDuplicate[ i ] = false; | 946 | pbDuplicate[ i ] = false; |
943 | pbPixmaps[ i ] = NULL; | 947 | pbPixmaps[ i ] = NULL; |
944 | pbWidth[ i ] = 0; | 948 | pbWidth[ i ] = 0; |
945 | if ( !tmpStr.isEmpty() ) { | 949 | if ( !tmpStr.isEmpty() ) { |
946 | pbWidth[ i ] = config->readNumEntry( "PixmapBWidth", 0 ); | 950 | pbWidth[ i ] = config->readNumEntry( "PixmapBWidth", 0 ); |
947 | if ( pbWidth[ i ] == 0 ) { | 951 | if ( pbWidth[ i ] == 0 ) { |
948 | qDebug ( "OThemeBase: No border width specified for pixmapped border widget %s\n", widgetEntries[ i ] ); | 952 | odebug << "OThemeBase: No border width specified for pixmapped border widget " |
949 | qDebug ( "OThemeBase: Using default of 2.\n" ); | 953 | << widgetEntries[ i ] << oendl; |
954 | odebug << "OThemeBase: Using default of 2." << oendl; | ||
950 | pbWidth[ i ] = 2; | 955 | pbWidth[ i ] = 2; |
951 | } | 956 | } |
952 | } | 957 | } |
953 | 958 | ||
954 | 959 | ||
955 | // Various widget specific settings. This was more efficent when bunched | 960 | // Various widget specific settings. This was more efficent when bunched |
956 | // together in the misc group, but this makes an easier to read config. | 961 | // together in the misc group, but this makes an easier to read config. |
957 | if ( i == SliderGroove ) | 962 | if ( i == SliderGroove ) |
958 | roundedSlider = config->readBoolEntry( "SmallGroove", false ); | 963 | roundedSlider = config->readBoolEntry( "SmallGroove", false ); |
959 | else if ( i == ActiveTab ) { | 964 | else if ( i == ActiveTab ) { |
960 | aTabLine = config->readBoolEntry( "BottomLine", true ); | 965 | aTabLine = config->readBoolEntry( "BottomLine", true ); |
961 | } | 966 | } |
@@ -994,25 +999,25 @@ void OThemeBase::readResourceGroup( int i, QString *copyfrom, QString *pixnames, | |||
994 | for ( sIndex = 0; sIndex < WIDGETS; ++sIndex ) { | 999 | for ( sIndex = 0; sIndex < WIDGETS; ++sIndex ) { |
995 | if ( tmpStr == widgetEntries[ sIndex ] ) { | 1000 | if ( tmpStr == widgetEntries[ sIndex ] ) { |
996 | if ( !loadArray[ sIndex ] ) // hasn't been loaded yet | 1001 | if ( !loadArray[ sIndex ] ) // hasn't been loaded yet |
997 | readResourceGroup( sIndex, copyfrom, pixnames, brdnames, | 1002 | readResourceGroup( sIndex, copyfrom, pixnames, brdnames, |
998 | loadArray ); | 1003 | loadArray ); |
999 | break; | 1004 | break; |
1000 | } | 1005 | } |
1001 | } | 1006 | } |
1002 | if ( loadArray[ sIndex ] ) { | 1007 | if ( loadArray[ sIndex ] ) { |
1003 | copyWidgetConfig( sIndex, i, pixnames, brdnames ); | 1008 | copyWidgetConfig( sIndex, i, pixnames, brdnames ); |
1004 | } | 1009 | } |
1005 | else | 1010 | else |
1006 | qDebug ( "OThemeBase: Unable to identify source widget for %s\n", widgetEntries[ i ] ); | 1011 | odebug << "OThemeBase: Unable to identify source widget for " << widgetEntries[ i ] << oendl; |
1007 | return ; | 1012 | return ; |
1008 | } | 1013 | } |
1009 | // special inheritance for disabled arrows (these are tri-state unlike | 1014 | // special inheritance for disabled arrows (these are tri-state unlike |
1010 | // the rest of what we handle). | 1015 | // the rest of what we handle). |
1011 | for ( tmpVal = DisArrowUp; tmpVal <= DisArrowRight; ++tmpVal ) { | 1016 | for ( tmpVal = DisArrowUp; tmpVal <= DisArrowRight; ++tmpVal ) { |
1012 | if ( tmpVal == i ) { | 1017 | if ( tmpVal == i ) { |
1013 | tmpStr = pixnames [ i ]; | 1018 | tmpStr = pixnames [ i ]; |
1014 | if ( tmpStr.isEmpty() ) { | 1019 | if ( tmpStr.isEmpty() ) { |
1015 | copyWidgetConfig( ArrowUp + ( tmpVal - DisArrowUp ), i, pixnames, | 1020 | copyWidgetConfig( ArrowUp + ( tmpVal - DisArrowUp ), i, pixnames, |
1016 | brdnames ); | 1021 | brdnames ); |
1017 | return ; | 1022 | return ; |
1018 | } | 1023 | } |