summaryrefslogtreecommitdiff
path: root/noncore
authorar <ar>2004-05-21 20:54:44 (UTC)
committer ar <ar>2004-05-21 20:54:44 (UTC)
commit37294c41a902eab36427372bdda31b4462fd73ca (patch) (unidiff)
treee86f2a473ac0854b451577871603a2d4f94f8f45 /noncore
parentd0a66ef7432056016ed637597ca24e85e7bc2503 (diff)
downloadopie-37294c41a902eab36427372bdda31b4462fd73ca.zip
opie-37294c41a902eab36427372bdda31b4462fd73ca.tar.gz
opie-37294c41a902eab36427372bdda31b4462fd73ca.tar.bz2
- convert qDebug to odebug
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/styles/theme/ogfxeffect.cpp16
-rw-r--r--noncore/styles/theme/othemebase.cpp31
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
@@ -4,19 +4,23 @@
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
@@ -40,13 +44,13 @@ QImage OGfxEffect::gradient(const QSize &size, const QColor &ca,
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());
@@ -296,13 +300,13 @@ QPixmap& OGfxEffect::blend(QPixmap &pixmap, float initial_intensity,
296 300
297QImage& OGfxEffect::blend(QImage &image, float initial_intensity, 301QImage& 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;
@@ -482,13 +486,13 @@ QImage& OGfxEffect::blend(QImage &image, float initial_intensity,
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...
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
@@ -175,13 +175,13 @@ void OThemeBase::generateBorderPix( int i )
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
185void OThemeBase::copyWidgetConfig( int sourceID, int destID, QString *pixnames, 185void OThemeBase::copyWidgetConfig( int sourceID, int destID, QString *pixnames,
186 QString *brdnames ) 186 QString *brdnames )
187{ 187{
@@ -370,25 +370,25 @@ 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
381OThemePixmap* OThemeBase::loadPixmap( QString &name ) 381OThemePixmap* 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
393OThemePixmap* OThemeBase::scale( int w, int h, WidgetType widget ) 393OThemePixmap* OThemeBase::scale( int w, int h, WidgetType widget )
394{ 394{
@@ -420,13 +420,13 @@ OThemePixmap* OThemeBase::scale( int w, int h, WidgetType widget )
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() );
@@ -442,13 +442,13 @@ OThemePixmap* OThemeBase::scale( int w, int h, WidgetType widget )
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 );
@@ -587,13 +587,13 @@ OThemePixmap* OThemeBase::scaleBorder( int w, int h, WidgetType widget )
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
599OThemePixmap* OThemeBase::blend( WidgetType widget ) 599OThemePixmap* OThemeBase::blend( WidgetType widget )
@@ -802,23 +802,25 @@ void OThemeBase::applyMiscResourceGroup( Config *config )
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" )
@@ -863,13 +865,14 @@ void OThemeBase::applyResourceGroup( Config *config, int i, QString *copyfrom, Q
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" );
@@ -886,13 +889,14 @@ void OThemeBase::applyResourceGroup( Config *config, int i, QString *copyfrom, Q
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
@@ -942,14 +946,15 @@ void OThemeBase::applyResourceGroup( Config *config, int i, QString *copyfrom, Q
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
@@ -1000,13 +1005,13 @@ void OThemeBase::readResourceGroup( int i, QString *copyfrom, QString *pixnames,
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 ) {