~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to ksplash/ksplashx/defs.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** This file is based on sources of the Qt GUI Toolkit, used under the terms
 
4
** of the GNU General Public License version 2 (see the original copyright
 
5
** notice below).
 
6
** All further contributions to this file are (and are required to be)
 
7
** licensed under the terms of the GNU General Public License as published by
 
8
** the Free Software Foundation; either version 2 of the License, or
 
9
** (at your option) any later version.
 
10
**
 
11
** The original Qt license header follows:
 
12
**
 
13
**
 
14
** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
 
15
**
 
16
** This file is part of the kernel module of the Qt GUI Toolkit.
 
17
**
 
18
** This file may be distributed under the terms of the Q Public License
 
19
** as defined by Trolltech AS of Norway and appearing in the file
 
20
** LICENSE.QPL included in the packaging of this file.
 
21
**
 
22
** This file may be distributed and/or modified under the terms of the
 
23
** GNU General Public License version 2 as published by the Free Software
 
24
** Foundation and appearing in the file LICENSE.GPL included in the
 
25
** packaging of this file.
 
26
**
 
27
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
 
28
** licenses may use this file in accordance with the Qt Commercial License
 
29
** Agreement provided with the Software.
 
30
**
 
31
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 
32
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
33
**
 
34
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
 
35
**   information about Qt Commercial License Agreements.
 
36
** See http://www.trolltech.com/qpl/ for QPL licensing information.
 
37
** See http://www.trolltech.com/gpl/ for GPL licensing information.
 
38
**
 
39
** Contact info@trolltech.com if any conditions of this licensing are
 
40
** not clear to you.
 
41
**
 
42
**********************************************************************/
 
43
 
 
44
#ifndef QWINDOWDEFS_H
 
45
#define QWINDOWDEFS_H
 
46
 
 
47
#include <stdlib.h>
 
48
 
 
49
#define Q_WS_X11
 
50
 
 
51
#define Q_EXPORT
 
52
#define QT_NO_DATASTREAM
 
53
#define QT_NO_IMAGE_TEXT
 
54
#define QT_NO_IMAGE_TRANSFORMATION
 
55
#define QT_NO_IMAGE_MIRROR
 
56
#define QT_NO_COMPONENT
 
57
#define QT_NO_IMAGEIO
 
58
#define QT_NO_MIME
 
59
#define QT_NO_QIMAGEIO
 
60
#define QT_NO_STRINGLIST
 
61
#define QT_NO_XFTFREETYPE
 
62
#ifndef QT_NO_STL
 
63
#define QT_NO_STL
 
64
#endif
 
65
#ifndef QT_NO_ASCII_CAST
 
66
#define QT_NO_ASCII_CAST
 
67
#endif
 
68
#ifndef QT_NO_CAST_ASCII
 
69
#define QT_NO_CAST_ASCII
 
70
#endif
 
71
 
 
72
#define QT_NO_IMAGEIO_BMP
 
73
#define QT_NO_IMAGEIO_PPM
 
74
#define QT_NO_IMAGEIO_XBM
 
75
#define QT_NO_IMAGEIO_XPM
 
76
#define QT_NO_IMAGEIO_MNG
 
77
#define QT_NO_ASYNC_IMAGE_IO
 
78
 
 
79
#define QT_STATIC_CONST static const
 
80
#define QT_STATIC_CONST_IMPL const
 
81
 
 
82
typedef int QCOORD;                             // coordinate type
 
83
const QCOORD QCOORD_MAX =  2147483647;
 
84
const QCOORD QCOORD_MIN = -QCOORD_MAX - 1;
 
85
 
 
86
typedef unsigned int QRgb;                      // RGB triplet
 
87
 
 
88
#define qMax(a, b)      ((b) < (a) ? (a) : (b))
 
89
#define qMin(a, b)      ((a) < (b) ? (a) : (b))
 
90
#define qAbs(a) ((a) >= 0  ? (a) : -(a))
 
91
 
 
92
#define Q_UNUSED(x) (void)x;
 
93
 
 
94
#define Q_CHECK_PTR(p)
 
95
 
 
96
#define Q_ASSERT(x)
 
97
 
 
98
typedef unsigned char   uchar;
 
99
typedef unsigned        uint;
 
100
 
 
101
typedef signed char             Q_INT8;         // 8 bit signed
 
102
typedef unsigned char           Q_UINT8;        // 8 bit unsigned
 
103
typedef short                   Q_INT16;        // 16 bit signed
 
104
typedef unsigned short          Q_UINT16;       // 16 bit unsigned
 
105
typedef int                     Q_INT32;        // 32 bit signed
 
106
typedef unsigned int            quint32;        // 32 bit unsigned
 
107
#if defined(Q_OS_WIN64)
 
108
typedef __int64                 Q_LONG;         // word up to 64 bit signed
 
109
typedef unsigned __int64        Q_ULONG;        // word up to 64 bit unsigned
 
110
#else
 
111
typedef long                    Q_LONG;         // word up to 64 bit signed
 
112
typedef unsigned long           Q_ULONG;        // word up to 64 bit unsigned
 
113
#endif
 
114
 
 
115
 
 
116
#if 0
 
117
const QRgb  RGB_MASK    = 0x00ffffff;           // masks RGB values
 
118
 
 
119
Q_EXPORT inline int qRed( QRgb rgb )            // get red part of RGB
 
120
{ return (int)((rgb >> 16) & 0xff); }
 
121
 
 
122
Q_EXPORT inline int qGreen( QRgb rgb )          // get green part of RGB
 
123
{ return (int)((rgb >> 8) & 0xff); }
 
124
 
 
125
Q_EXPORT inline int qBlue( QRgb rgb )           // get blue part of RGB
 
126
{ return (int)(rgb & 0xff); }
 
127
 
 
128
Q_EXPORT inline int qAlpha( QRgb rgb )          // get alpha part of RGBA
 
129
{ return (int)((rgb >> 24) & 0xff); }
 
130
 
 
131
Q_EXPORT inline QRgb qRgb( int r, int g, int b )// set RGB value
 
132
{ return (0xff << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }
 
133
 
 
134
Q_EXPORT inline QRgb qRgba( int r, int g, int b, int a )// set RGBA value
 
135
{ return ((a & 0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }
 
136
 
 
137
Q_EXPORT inline int qGray( int r, int g, int b )// convert R,G,B to gray 0..255
 
138
{ return (r*11+g*16+b*5)/32; }
 
139
 
 
140
Q_EXPORT inline int qGray( QRgb rgb )           // convert RGB to gray 0..255
 
141
{ return qGray( qRed(rgb), qGreen(rgb), qBlue(rgb) ); }
 
142
#endif
 
143
 
 
144
inline
 
145
Q_EXPORT void qWarning( const char *, ... )     // print warning message
 
146
#if defined(Q_CC_GNU) && !defined(__INSURE__)
 
147
    __attribute__ ((format (printf, 1, 2)))
 
148
#endif
 
149
    {}
 
150
 
 
151
inline
 
152
Q_EXPORT void qFatal( const char *, ... )       // print fatal message and exit
 
153
#if defined(Q_CC_GNU)
 
154
    __attribute__ ((format (printf, 1, 2)))
 
155
#endif
 
156
    {
 
157
    abort();
 
158
    }
 
159
 
 
160
#include <stdio.h>
 
161
 
 
162
bool freadline( char* buf, int bufsize, FILE* datafile );
 
163
void strip_whitespace( char* line );
 
164
bool begins_with( const char* line, const char* str );
 
165
 
 
166
#endif