You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
386 lines
12 KiB
386 lines
12 KiB
13 years ago
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||
5 months ago
|
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/include/tqpixmap.h:1 -->
|
||
13 years ago
|
<html>
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||
5 months ago
|
<title>tqpixmap.h Include File</title>
|
||
13 years ago
|
<style type="text/css"><!--
|
||
|
fn { margin-left: 1cm; text-indent: -1cm; }
|
||
|
a:link { color: #004faf; text-decoration: none }
|
||
|
a:visited { color: #672967; text-decoration: none }
|
||
|
body { background: #ffffff; color: black; }
|
||
|
--></style>
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
|
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||
|
<tr bgcolor="#E5E5E5">
|
||
|
<td valign=center>
|
||
|
<a href="index.html">
|
||
|
<font color="#004faf">Home</font></a>
|
||
|
| <a href="classes.html">
|
||
|
<font color="#004faf">All Classes</font></a>
|
||
|
| <a href="mainclasses.html">
|
||
|
<font color="#004faf">Main Classes</font></a>
|
||
|
| <a href="annotated.html">
|
||
|
<font color="#004faf">Annotated</font></a>
|
||
|
| <a href="groups.html">
|
||
|
<font color="#004faf">Grouped Classes</font></a>
|
||
|
| <a href="functions.html">
|
||
|
<font color="#004faf">Functions</font></a>
|
||
|
</td>
|
||
5 months ago
|
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>tqpixmap.h</h1>
|
||
13 years ago
|
|
||
5 months ago
|
<p>This is the verbatim text of the tqpixmap.h include file. It is provided only for illustration; the copyright remains with Trolltech.
|
||
13 years ago
|
<hr>
|
||
|
<pre>
|
||
|
/****************************************************************************
|
||
5 months ago
|
** $Id: qt/tqpixmap.h 3.3.8 edited Jan 11 14:38 $
|
||
13 years ago
|
**
|
||
|
** Definition of TQPixmap class
|
||
|
**
|
||
|
** Created : 940501
|
||
|
**
|
||
|
** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
|
||
|
**
|
||
|
** This file is part of the kernel module of the TQt GUI Toolkit.
|
||
|
**
|
||
|
** This file may be used under the terms of the GNU General Public
|
||
|
** License versions 2.0 or 3.0 as published by the Free Software
|
||
|
** Foundation and appearing in the file LICENSE.GPL included in the
|
||
|
** packaging of this file. Alternatively you may (at your option) use any
|
||
|
** later version of the GNU General Public License if such license has
|
||
|
** been publicly approved by Trolltech ASA (or its successors, if any)
|
||
|
** and the KDE Free TQt Foundation.
|
||
|
**
|
||
|
** Please review the following information to ensure GNU General
|
||
13 years ago
|
** Public Licensing requirements will be met:
|
||
13 years ago
|
** http://trolltech.com/products/qt/licenses/licensing/opensource/.
|
||
|
** If you are unsure which license is appropriate for your use, please
|
||
|
** review the following information:
|
||
|
** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
|
||
|
** or contact the sales department at sales@trolltech.com.
|
||
|
**
|
||
|
** This file may be used under the terms of the Q Public License as
|
||
|
** defined by Trolltech ASA and appearing in the file LICENSE.TQPL
|
||
|
** included in the packaging of this file. Licensees holding valid TQt
|
||
|
** Commercial licenses may use this file in accordance with the TQt
|
||
|
** Commercial License Agreement provided with the Software.
|
||
|
**
|
||
|
** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
|
||
|
** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
|
||
|
** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
|
||
|
** herein.
|
||
|
**
|
||
|
**********************************************************************/
|
||
|
|
||
|
#ifndef TQPIXMAP_H
|
||
|
#define TQPIXMAP_H
|
||
|
|
||
|
#ifndef QT_H
|
||
5 months ago
|
#include "tqpaintdevice.h"
|
||
|
#include "tqcolor.h" // char*->TQColor conversion
|
||
6 months ago
|
#include "tqstring.h" // char*->TQString conversion
|
||
13 years ago
|
#include "ntqnamespace.h"
|
||
13 years ago
|
#endif // QT_H
|
||
|
|
||
|
class TQPixmapPrivate;
|
||
|
|
||
10 months ago
|
#if defined(TQ_WS_WIN)
|
||
13 years ago
|
// Internal pixmap memory optimization class for Windows 9x
|
||
|
class TQMultiCellPixmap;
|
||
|
#endif
|
||
|
|
||
|
|
||
1 year ago
|
class TQ_EXPORT TQPixmap : public TQPaintDevice, public TQt
|
||
13 years ago
|
{
|
||
|
public:
|
||
|
enum ColorMode { Auto, Color, Mono };
|
||
|
enum Optimization { DefaultOptim, NoOptim, MemoryOptim=NoOptim,
|
||
|
NormalOptim, BestOptim };
|
||
|
|
||
|
TQPixmap();
|
||
|
TQPixmap( const TQImage& image );
|
||
|
TQPixmap( int w, int h, int depth = -1, Optimization = DefaultOptim );
|
||
|
TQPixmap( const TQSize &, int depth = -1, Optimization = DefaultOptim );
|
||
6 years ago
|
#ifndef TQT_NO_IMAGEIO
|
||
13 years ago
|
TQPixmap( const TQString& fileName, const char *format=0,
|
||
|
ColorMode mode=Auto );
|
||
|
TQPixmap( const TQString& fileName, const char *format,
|
||
|
int conversion_flags );
|
||
|
TQPixmap( const char *xpm[] ); // ### in 4.0, 'const char * const xpm[]'?
|
||
|
TQPixmap( const TQByteArray &data );
|
||
|
#endif
|
||
|
TQPixmap( const TQPixmap & );
|
||
|
~TQPixmap();
|
||
|
|
||
|
TQPixmap &operator=( const TQPixmap & );
|
||
|
TQPixmap &operator=( const TQImage & );
|
||
|
|
||
|
bool isNull() const;
|
||
|
|
||
|
int width() const { return data->w; }
|
||
|
int height() const { return data->h; }
|
||
|
TQSize size() const { return TQSize(data->w,data->h); }
|
||
|
TQRect rect() const { return TQRect(0,0,data->w,data->h); }
|
||
|
int depth() const { return data->d; }
|
||
|
static int defaultDepth();
|
||
|
|
||
|
void fill( const TQColor &fillColor = TQt::white );
|
||
|
void fill( const TQWidget *, int xofs, int yofs );
|
||
|
void fill( const TQWidget *, const TQPoint &ofs );
|
||
|
void resize( int width, int height );
|
||
|
void resize( const TQSize & );
|
||
|
|
||
|
const TQBitmap *mask() const;
|
||
|
void setMask( const TQBitmap & );
|
||
|
bool selfMask() const;
|
||
|
bool hasAlpha() const;
|
||
|
bool hasAlphaChannel() const;
|
||
6 years ago
|
#ifndef TQT_NO_IMAGE_HEURISTIC_MASK
|
||
13 years ago
|
TQBitmap createHeuristicMask( bool clipTight = TRUE ) const;
|
||
|
#endif
|
||
6 years ago
|
#ifndef TQT_NO_MIME
|
||
13 years ago
|
static TQPixmap fromMimeSource( const TQString& abs_name );
|
||
|
#endif
|
||
|
static TQPixmap grabWindow( WId, int x=0, int y=0, int w=-1, int h=-1 );
|
||
|
static TQPixmap grabWidget( TQWidget * widget,
|
||
|
int x=0, int y=0, int w=-1, int h=-1 );
|
||
|
|
||
6 years ago
|
#ifndef TQT_NO_PIXMAP_TRANSFORMATION
|
||
13 years ago
|
TQPixmap xForm( const TQWMatrix & ) const;
|
||
|
static TQWMatrix trueMatrix( const TQWMatrix &, int w, int h );
|
||
|
#endif
|
||
|
|
||
|
TQImage convertToImage() const;
|
||
|
bool convertFromImage( const TQImage &, ColorMode mode=Auto );
|
||
|
bool convertFromImage( const TQImage &, int conversion_flags );
|
||
6 years ago
|
#ifndef TQT_NO_IMAGEIO
|
||
13 years ago
|
static const char* imageFormat( const TQString &fileName );
|
||
|
bool load( const TQString& fileName, const char *format=0,
|
||
|
ColorMode mode=Auto );
|
||
|
bool load( const TQString& fileName, const char *format,
|
||
|
int conversion_flags );
|
||
|
bool loadFromData( const uchar *buf, uint len,
|
||
|
const char* format=0,
|
||
|
ColorMode mode=Auto );
|
||
|
bool loadFromData( const uchar *buf, uint len,
|
||
|
const char* format,
|
||
|
int conversion_flags );
|
||
|
bool loadFromData( const TQByteArray &data,
|
||
|
const char* format=0,
|
||
|
int conversion_flags=0 );
|
||
|
bool save( const TQString& fileName, const char* format, int quality = -1 ) const;
|
||
|
bool save( TQIODevice* device, const char* format, int quality = -1 ) const;
|
||
|
#endif
|
||
|
|
||
10 months ago
|
#if defined(TQ_WS_WIN)
|
||
13 years ago
|
HBITMAP hbm() const;
|
||
|
#endif
|
||
|
|
||
|
int serialNumber() const;
|
||
|
|
||
|
Optimization optimization() const;
|
||
|
void setOptimization( Optimization );
|
||
|
static Optimization defaultOptimization();
|
||
|
static void setDefaultOptimization( Optimization );
|
||
|
|
||
|
virtual void detach();
|
||
|
|
||
|
bool isTQBitmap() const;
|
||
|
|
||
10 months ago
|
#if defined(TQ_WS_WIN)
|
||
13 years ago
|
// These functions are internal and used by Windows 9x only
|
||
|
bool isMultiCellPixmap() const;
|
||
|
HDC multiCellHandle() const;
|
||
|
HBITMAP multiCellBitmap() const;
|
||
|
int multiCellOffset() const;
|
||
|
int allocCell();
|
||
|
void freeCell( bool = FALSE );
|
||
|
#endif
|
||
|
|
||
6 months ago
|
#if defined(TQ_WS_X11)
|
||
13 years ago
|
static int x11SetDefaultScreen( int screen );
|
||
|
void x11SetScreen( int screen );
|
||
|
#endif
|
||
|
|
||
|
#ifndef Q_QDOC
|
||
1 year ago
|
TQ_DUMMY_COMPARISON_OPERATOR(TQPixmap)
|
||
13 years ago
|
#endif
|
||
|
|
||
|
protected:
|
||
|
TQPixmap( int w, int h, const uchar *data, bool isXbitmap );
|
||
|
int metric( int ) const;
|
||
|
|
||
10 months ago
|
#if defined(TQ_WS_WIN)
|
||
13 years ago
|
struct TQMCPI { // mem optim for win9x
|
||
|
TQMultiCellPixmap *mcp;
|
||
|
int offset;
|
||
|
};
|
||
|
#endif
|
||
|
|
||
|
struct TQPixmapData : public TQShared { // internal pixmap data
|
||
|
TQCOORD w, h;
|
||
|
short d;
|
||
|
uint uninit : 1;
|
||
|
uint bitmap : 1;
|
||
|
uint selfmask : 1;
|
||
10 months ago
|
#if defined(TQ_WS_WIN)
|
||
13 years ago
|
uint mcp : 1;
|
||
|
#endif
|
||
|
int ser_no;
|
||
|
TQBitmap *mask;
|
||
10 months ago
|
#if defined(TQ_WS_WIN)
|
||
13 years ago
|
TQPixmap *maskpm;
|
||
|
union {
|
||
|
HBITMAP hbm; // if mcp == FALSE
|
||
|
TQMCPI *mcpi; // if mcp == TRUE
|
||
|
} hbm_or_mcpi;
|
||
|
uchar *realAlphaBits;
|
||
|
#ifdef Q_OS_TEMP
|
||
|
uchar* ppvBits; // Pointer to DIBSection bits
|
||
|
#endif
|
||
10 months ago
|
#elif defined(TQ_WS_X11)
|
||
13 years ago
|
void *ximage;
|
||
|
void *maskgc;
|
||
|
TQPixmap *alphapm;
|
||
10 months ago
|
#elif defined(TQ_WS_MAC)
|
||
13 years ago
|
ColorTable *clut;
|
||
|
TQPixmap *alphapm;
|
||
|
#endif
|
||
|
Optimization optim;
|
||
10 months ago
|
#if defined(TQ_WS_WIN)
|
||
13 years ago
|
HBITMAP old_hbm;
|
||
|
#endif
|
||
|
} *data;
|
||
|
private:
|
||
6 years ago
|
#ifndef TQT_NO_IMAGEIO
|
||
13 years ago
|
bool doImageIO( TQImageIO* io, int quality ) const;
|
||
|
#endif
|
||
|
TQPixmap( int w, int h, int depth, bool, Optimization );
|
||
|
void init( int, int, int, bool, Optimization );
|
||
|
void deref();
|
||
|
TQPixmap copy( bool ignoreMask = FALSE ) const;
|
||
10 months ago
|
#if defined(TQ_WS_WIN)
|
||
13 years ago
|
void initAlphaPixmap( uchar *bytes, int length, struct tagBITMAPINFO *bmi );
|
||
|
void convertToAlphaPixmap( bool initAlpha=TRUE );
|
||
|
static void bitBltAlphaPixmap( TQPixmap *dst, int dx, int dy,
|
||
|
const TQPixmap *src, int sx, int sy,
|
||
|
int sw, int sh, bool useDstAlpha );
|
||
|
#endif
|
||
|
static Optimization defOptim;
|
||
1 year ago
|
friend TQ_EXPORT void bitBlt( TQPaintDevice *, int, int,
|
||
13 years ago
|
const TQPaintDevice *,
|
||
|
int, int, int, int, RasterOp, bool );
|
||
1 year ago
|
friend TQ_EXPORT void bitBlt( TQPaintDevice *, int, int,
|
||
13 years ago
|
const TQImage* src,
|
||
|
int, int, int, int, int conversion_flags );
|
||
1 year ago
|
friend TQ_EXPORT void copyBlt( TQPixmap *dst, int dx, int dy,
|
||
13 years ago
|
const TQPixmap *src, int sx, int sy,
|
||
|
int sw, int sh );
|
||
|
|
||
10 months ago
|
#if defined(TQ_WS_MAC)
|
||
13 years ago
|
friend void unclippedScaledBitBlt(TQPaintDevice *, int, int, int, int,
|
||
|
const TQPaintDevice *, int, int, int, int,
|
||
|
TQt::RasterOp, bool, bool);
|
||
|
#endif
|
||
|
|
||
|
friend class TQBitmap;
|
||
|
friend class TQPaintDevice;
|
||
|
friend class TQPainter;
|
||
|
friend class TQGLWidget;
|
||
|
};
|
||
|
|
||
|
|
||
|
inline bool TQPixmap::isNull() const
|
||
|
{
|
||
|
return data->w == 0;
|
||
|
}
|
||
|
|
||
|
inline void TQPixmap::fill( const TQWidget *w, const TQPoint &ofs )
|
||
|
{
|
||
|
fill( w, ofs.x(), ofs.y() );
|
||
|
}
|
||
|
|
||
|
inline void TQPixmap::resize( const TQSize &s )
|
||
|
{
|
||
|
resize( s.width(), s.height() );
|
||
|
}
|
||
|
|
||
|
inline const TQBitmap *TQPixmap::mask() const
|
||
|
{
|
||
|
return data->mask;
|
||
|
}
|
||
|
|
||
|
inline bool TQPixmap::selfMask() const
|
||
|
{
|
||
|
return data->selfmask;
|
||
|
}
|
||
|
|
||
10 months ago
|
#if defined(TQ_WS_WIN)
|
||
13 years ago
|
inline HBITMAP TQPixmap::hbm() const
|
||
|
{
|
||
|
return data->mcp ? 0 : data->hbm_or_mcpi.hbm;
|
||
|
}
|
||
|
#endif
|
||
|
|
||
|
inline int TQPixmap::serialNumber() const
|
||
|
{
|
||
|
return data->ser_no;
|
||
|
}
|
||
|
|
||
|
inline TQPixmap::Optimization TQPixmap::optimization() const
|
||
|
{
|
||
|
return data->optim;
|
||
|
}
|
||
|
|
||
|
inline bool TQPixmap::isTQBitmap() const
|
||
|
{
|
||
|
return data->bitmap;
|
||
|
}
|
||
|
|
||
10 months ago
|
#if defined(TQ_WS_WIN)
|
||
13 years ago
|
inline bool TQPixmap::isMultiCellPixmap() const
|
||
|
{
|
||
|
return data->mcp;
|
||
|
}
|
||
|
#endif
|
||
|
|
||
|
|
||
|
/*****************************************************************************
|
||
|
TQPixmap stream functions
|
||
|
*****************************************************************************/
|
||
|
|
||
6 years ago
|
#if !defined(TQT_NO_DATASTREAM) && !defined(TQT_NO_IMAGEIO)
|
||
1 year ago
|
TQ_EXPORT TQDataStream &operator<<( TQDataStream &, const TQPixmap & );
|
||
|
TQ_EXPORT TQDataStream &operator>>( TQDataStream &, TQPixmap & );
|
||
13 years ago
|
#endif
|
||
|
|
||
|
/*****************************************************************************
|
||
|
TQPixmap (and TQImage) helper functions
|
||
|
*****************************************************************************/
|
||
|
|
||
6 years ago
|
#ifndef TQT_NO_PIXMAP_TRANSFORMATION
|
||
13 years ago
|
# define QT_XFORM_TYPE_MSBFIRST 0
|
||
|
# define QT_XFORM_TYPE_LSBFIRST 1
|
||
10 months ago
|
# if defined(TQ_WS_WIN)
|
||
13 years ago
|
# define QT_XFORM_TYPE_WINDOWSPIXMAP 2
|
||
|
# endif
|
||
|
bool qt_xForm_helper( const TQWMatrix&, int, int, int, uchar*, int, int, int, uchar*, int, int, int );
|
||
|
#endif
|
||
|
|
||
1 year ago
|
TQ_EXPORT void copyBlt( TQPixmap *dst, int dx, int dy,
|
||
13 years ago
|
const TQPixmap *src, int sx = 0, int sy = 0,
|
||
|
int sw = -1, int sh = -1 );
|
||
|
|
||
|
#endif // TQPIXMAP_H
|
||
|
</pre>
|
||
|
<!-- eof -->
|
||
|
<p><address><hr><div align=center>
|
||
|
<table width=100% cellspacing=0 border=0><tr>
|
||
|
<td>Copyright © 2007
|
||
|
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
||
|
<td align=right><div align=right>TQt 3.3.8</div>
|
||
|
</table></div></address></body>
|
||
|
</html>
|