summaryrefslogtreecommitdiff
path: root/noncore/net/mailit/resource.h
authorkergoth <kergoth>2003-08-09 17:00:23 (UTC)
committer kergoth <kergoth>2003-08-09 17:00:23 (UTC)
commitc33d5ec60361238e50a4a9d6e0eec03e396dce60 (patch) (unidiff)
tree31c0c85dc4262044db90c7918014bc45265ef420 /noncore/net/mailit/resource.h
parent78c296d534589835801fb6374ac9d43d44b2b1c9 (diff)
downloadopie-c33d5ec60361238e50a4a9d6e0eec03e396dce60.zip
opie-c33d5ec60361238e50a4a9d6e0eec03e396dce60.tar.gz
opie-c33d5ec60361238e50a4a9d6e0eec03e396dce60.tar.bz2
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/net/mailit/resource.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mailit/resource.h80
1 files changed, 0 insertions, 80 deletions
diff --git a/noncore/net/mailit/resource.h b/noncore/net/mailit/resource.h
deleted file mode 100644
index 982c58a..0000000
--- a/noncore/net/mailit/resource.h
+++ b/dev/null
@@ -1,80 +0,0 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#ifndef PIXMAPLOADER_H
21#define PIXMAPLOADER_H
22
23#include <qimage.h>
24#include <qbitmap.h>
25#include <qiconset.h>
26#include <qstringlist.h>
27
28class Resource
29{
30public:
31 Resource() {}
32
33 static QImage loadImage( const QString &name);
34
35 static QPixmap loadPixmap( const QString &name );
36 static QBitmap loadBitmap( const QString &name );
37 static QString findPixmap( const QString &name );
38
39 static QIconSet loadIconSet( const QString &name );
40
41 static QString findSound( const QString &name );
42 static QStringList allSounds();
43};
44
45// Inline for compatibility with SHARP ROMs
46inline QIconSet Resource::loadIconSet( const QString &pix )
47{
48 QImage img = loadImage( pix );
49 QPixmap pm;
50 pm.convertFromImage( img );
51 QIconSet is( pm );
52 QIconSet::Size size = pm.width() <= 22 ? QIconSet::Small : QIconSet::Large;
53
54 QPixmap dpm = loadPixmap( pix + "_disabled" );
55
56 #ifndef QT_NO_DEPTH_32// have alpha-blended pixmaps
57 if ( dpm.isNull() ) {
58 QImage dimg( img.width(), img.height(), 32 );
59 for ( int y = 0; y < img.height(); y++ ) {
60 for ( int x = 0; x < img.width(); x++ ) {
61 QRgb p = img.pixel( x, y );
62 uint a = (p & 0xff000000) / 3;
63 p = (p & 0x00ffffff) | (a & 0xff000000);
64 dimg.setPixel( x, y, p );
65 }
66 }
67
68 dimg.setAlphaBuffer( TRUE );
69 dpm.convertFromImage( dimg );
70 }
71#endif
72
73 if ( !dpm.isNull() )
74 is.setPixmap( dpm, size, QIconSet::Disabled );
75
76 return is;
77}
78
79
80#endif