diff options
Diffstat (limited to 'src/kernel/qpixmap_x11.cpp')
| -rw-r--r-- | src/kernel/qpixmap_x11.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/src/kernel/qpixmap_x11.cpp b/src/kernel/qpixmap_x11.cpp index 184cc4f16..c431070d3 100644 --- a/src/kernel/qpixmap_x11.cpp +++ b/src/kernel/qpixmap_x11.cpp @@ -107,7 +107,7 @@ inline static void qSafeXDestroyImage( XImage *x ) #if defined(QT_MITSHM_XFORM) -static bool xshminit = FALSE; +static bool xshminit = false; static XShmSegmentInfo xshminfo; static XImage *xshmimg = 0; static Pixmap xshmpm = 0; @@ -140,14 +140,14 @@ static bool qt_create_mitshm_buffer( const TQPaintDevice* dev, int w, int h ) tqt_cleanup_mitshm(); } else { if ( !XShmQueryVersion(dpy, &major, &minor, &pixmaps_ok) ) - return FALSE; // MIT Shm not supported + return false; // MIT Shm not supported tqAddPostRoutine( tqt_cleanup_mitshm ); - xshminit = TRUE; + xshminit = true; } xshmimg = XShmCreateImage( dpy, vis, dd, ZPixmap, 0, &xshminfo, w, h ); if ( !xshmimg ) - return FALSE; + return false; bool ok; xshminfo.shmid = shmget( IPC_PRIVATE, @@ -159,7 +159,7 @@ static bool qt_create_mitshm_buffer( const TQPaintDevice* dev, int w, int h ) xshminfo.shmaddr = xshmimg->data; ok = ( xshminfo.shmaddr != (char*)-1 ); } - xshminfo.readOnly = FALSE; + xshminfo.readOnly = false; if ( ok ) ok = XShmAttach( dpy, &xshminfo ); if ( !ok ) { @@ -169,13 +169,13 @@ static bool qt_create_mitshm_buffer( const TQPaintDevice* dev, int w, int h ) shmdt( xshminfo.shmaddr ); if ( xshminfo.shmid != -1 ) shmctl( xshminfo.shmid, IPC_RMID, 0 ); - return FALSE; + return false; } if ( pixmaps_ok ) xshmpm = XShmCreatePixmap( dpy, DefaultRootWindow(dpy), xshmimg->data, &xshminfo, w, h, dd ); - return TRUE; + return true; } #else @@ -184,7 +184,7 @@ static bool qt_create_mitshm_buffer( const TQPaintDevice* dev, int w, int h ) // // static bool qt_create_mitshm_buffer( TQPaintDevice*, int, int ) // { -// return FALSE; +// return false; // } #endif // QT_MITSHM_XFORM @@ -355,10 +355,10 @@ static void build_scale_table( uint **table, uint nBits ) return; } if (!*table) { - static bool firstTable = TRUE; + static bool firstTable = true; if ( firstTable ) { tqAddPostRoutine( cleanup_scale_tables ); - firstTable = FALSE; + firstTable = false; } *table = new uint[256]; } @@ -395,7 +395,7 @@ void TQPixmap::init( int w, int h, int d, bool bitmap, Optimization optim ) static int serial = 0; if ( defaultScreen >= 0 && defaultScreen != x11Screen() ) { - TQPaintDeviceX11Data* xd = getX11Data( TRUE ); + TQPaintDeviceX11Data* xd = getX11Data( true ); xd->x_screen = defaultScreen; xd->x_depth = TQPaintDevice::x11AppDepth( xd->x_screen ); xd->x_cells = TQPaintDevice::x11AppCells( xd->x_screen ); @@ -419,7 +419,7 @@ void TQPixmap::init( int w, int h, int d, bool bitmap, Optimization optim ) memset( data, 0, sizeof(TQPixmapData) ); data->count = 1; - data->uninit = TRUE; + data->uninit = true; data->bitmap = bitmap; data->ser_no = ++serial; data->optim = optim; @@ -487,18 +487,18 @@ void TQPixmap::deref() /*! Constructs a monochrome pixmap, with width \a w and height \a h, that is initialized with the data in \a bits. The \a isXbitmap - indicates whether the data is an X bitmap and defaults to FALSE. + indicates whether the data is an X bitmap and defaults to false. This constructor is protected and used by the TQBitmap class. */ TQPixmap::TQPixmap( int w, int h, const uchar *bits, bool isXbitmap) : TQPaintDevice( TQInternal::Pixmap ) { // for bitmaps only - init( 0, 0, 0, FALSE, defOptim ); + init( 0, 0, 0, false, defOptim ); if ( w <= 0 || h <= 0 ) // create null pixmap return; - data->uninit = FALSE; + data->uninit = false; data->w = w; data->h = h; data->d = 1; @@ -548,7 +548,7 @@ void TQPixmap::detach() { if ( data->count != 1 ) *this = copy(); - data->uninit = FALSE; + data->uninit = false; // reset cached data if ( data->ximage ) { @@ -778,7 +778,7 @@ TQImage TQPixmap::convertToImage() const axi = XGetImage(x11Display(), alf->hd, 0, 0, w, h, AllPlanes, ZPixmap); if (axi) { - image.setAlphaBuffer( TRUE ); + image.setAlphaBuffer( true ); alpha.create(w, h, 8); // copy each scanline @@ -797,7 +797,7 @@ TQImage TQPixmap::convertToImage() const qSafeXDestroyImage( axi ); } } else if (msk) { - image.setAlphaBuffer( TRUE ); + image.setAlphaBuffer( true ); alpha = msk->convertToImage(); } bool ale = alpha.bitOrder() == TQImage::LittleEndian; @@ -1070,15 +1070,15 @@ TQImage TQPixmap::convertToImage() const /*! - Converts image \a img and sets this pixmap. Returns TRUE if - successful; otherwise returns FALSE. + Converts image \a img and sets this pixmap. Returns true if + successful; otherwise returns false. The \a conversion_flags argument is a bitwise-OR of the \l{TQt::ImageConversionFlags}. Passing 0 for \a conversion_flags sets all the default options. Note that even though a TQPixmap with depth 1 behaves much like a - TQBitmap, isTQBitmap() returns FALSE. + TQBitmap, isTQBitmap() returns false. If a pixmap with depth 1 is painted with color0 and color1 and converted to an image, the pixels painted with color0 will produce @@ -1095,7 +1095,7 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags ) #if defined(QT_CHECK_NULL) tqWarning( "TQPixmap::convertFromImage: Cannot convert a null image" ); #endif - return FALSE; + return false; } detach(); // detach other references TQImage image = img; @@ -1107,7 +1107,7 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags ) (conversion_flags & ColorMode_Mask)==MonoOnly ); if ( w >= 32768 || h >= 32768 ) - return FALSE; + return false; // get rid of the mask delete data->mask; @@ -1125,12 +1125,12 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags ) d = 1; } } else { // can be both - bool conv8 = FALSE; + bool conv8 = false; if ( d > 8 && dd <= 8 ) { // convert to 8 bit if ( (conversion_flags & DitherMode_Mask) == AutoDither ) conversion_flags = (conversion_flags & ~DitherMode_Mask) | PreferDither; - conv8 = TRUE; + conv8 = true; } else if ( (conversion_flags & ColorMode_Mask) == ColorOnly ) { conv8 = d == 1; // native depth wanted } else if ( d == 1 ) { @@ -1140,7 +1140,7 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags ) conv8 = TQMIN(c0,c1) != tqRgb(0,0,0) || TQMAX(c0,c1) != tqRgb(255,255,255); } else { // eg. 1-color monochrome images (they do exist). - conv8 = TRUE; + conv8 = true; } } if ( conv8 ) { @@ -1227,7 +1227,7 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags ) m = image.createAlphaMask( conversion_flags ); setMask( m ); } - return TRUE; + return true; } Display *dpy = x11Display(); @@ -1284,7 +1284,7 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags ) newbits = (uchar *)malloc( xi->bytes_per_line*h ); TQ_CHECK_PTR( newbits ); if ( !newbits ) // no memory - return FALSE; + return false; int bppc = xi->bits_per_pixel; bool contig_bits = n_bits(red_mask) == rbits && @@ -1299,7 +1299,7 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags ) // Can do it? (Contiguous bits?) contig_bits; - static bool init=FALSE; + static bool init=false; static int D[16][16]; if ( dither_tc && !init ) { // I also contributed this code to XV - WWA. @@ -1333,7 +1333,7 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags ) } } } - init=TRUE; + init=true; } enum { BPP8, @@ -1613,7 +1613,7 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags ) #endif TQ_CHECK_PTR( newbits ); if ( !newbits ) // no memory - return FALSE; + return false; uchar* p = newbits; memcpy( p, image.bits(), nbytes ); // copy image data into newbits @@ -1744,7 +1744,7 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags ) #endif TQ_CHECK_PTR( newerbits ); if ( !newerbits ) // no memory - return FALSE; + return false; uchar* p = newbits; for ( uint y=0; y<h; y++ ) { // OOPS: Do right byte order!! p2 = newerbits + p2inc*y; @@ -1802,11 +1802,11 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags ) #ifdef QT_MITSHM_CONVERSIONS if( mitshm_ximage ) - XShmPutImage( dpy, hd, tqt_xget_readonly_gc( x11Screen(), FALSE ), + XShmPutImage( dpy, hd, tqt_xget_readonly_gc( x11Screen(), false ), xi, 0, 0, 0, 0, w, h, False ); else #endif - XPutImage( dpy, hd, tqt_xget_readonly_gc( x11Screen(), FALSE ), + XPutImage( dpy, hd, tqt_xget_readonly_gc( x11Screen(), false ), xi, 0, 0, 0, 0, w, h ); data->w = w; @@ -1831,7 +1831,7 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags ) for (int i = 0, count = image.numColors(); i < count; ++i) { const int alpha = tqAlpha(rgb[i]); if (alpha != 0 && alpha != 0xff) { - alphamap = TRUE; + alphamap = true; break; } } @@ -1937,7 +1937,7 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags ) #endif qSafeXDestroyImage(axi); } - return TRUE; + return true; } @@ -2019,10 +2019,10 @@ TQPixmap TQPixmap::grabWindow( WId window, int x, int y, int w, int h ) } TQPixmap pm( w, h ); - pm.data->uninit = FALSE; + pm.data->uninit = false; pm.x11SetScreen( scr ); - GC gc = tqt_xget_temp_gc( scr, FALSE ); + GC gc = tqt_xget_temp_gc( scr, false ); XSetSubwindowMode( dpy, gc, IncludeInferiors ); XCopyArea( dpy, window, pm.handle(), gc, x, y, w, h, 0, 0 ); XSetSubwindowMode( dpy, gc, ClipByChildren ); @@ -2100,9 +2100,9 @@ TQPixmap TQPixmap::xForm( const TQWMatrix &matrix ) const } #if defined(QT_MITSHM_XFORM) - static bool try_once = TRUE; + static bool try_once = true; if (try_once) { - try_once = FALSE; + try_once = false; if ( !xshminit ) qt_create_mitshm_buffer( this, 800, 600 ); } @@ -2212,9 +2212,9 @@ TQPixmap TQPixmap::xForm( const TQWMatrix &matrix ) const } return pm; } else { // color pixmap - GC gc = tqt_xget_readonly_gc( x11Screen(), FALSE ); + GC gc = tqt_xget_readonly_gc( x11Screen(), false ); TQPixmap pm( w, h ); - pm.data->uninit = FALSE; + pm.data->uninit = false; pm.x11SetScreen( x11Screen() ); #if defined(QT_MITSHM_XFORM) if ( use_mitshm ) { @@ -2312,7 +2312,7 @@ void TQPixmap::x11SetScreen( int screen ) return; // nothing to do if ( isNull() ) { - TQPaintDeviceX11Data* xd = getX11Data( TRUE ); + TQPaintDeviceX11Data* xd = getX11Data( true ); xd->x_screen = screen; xd->x_depth = TQPaintDevice::x11AppDepth( screen ); xd->x_cells = TQPaintDevice::x11AppCells( screen ); @@ -2329,7 +2329,7 @@ void TQPixmap::x11SetScreen( int screen ) TQImage img = convertToImage(); resize(0,0); - TQPaintDeviceX11Data* xd = getX11Data( TRUE ); + TQPaintDeviceX11Data* xd = getX11Data( true ); xd->x_screen = screen; xd->x_depth = TQPaintDevice::x11AppDepth( screen ); xd->x_cells = TQPaintDevice::x11AppCells( screen ); @@ -2342,7 +2342,7 @@ void TQPixmap::x11SetScreen( int screen ) } /*! - Returns TRUE this pixmap has an alpha channel or a mask. + Returns true this pixmap has an alpha channel or a mask. \sa hasAlphaChannel() mask() */ @@ -2352,11 +2352,11 @@ bool TQPixmap::hasAlpha() const } /*! - Returns TRUE if the pixmap has an alpha channel; otherwise it - returns FALSE. + Returns true if the pixmap has an alpha channel; otherwise it + returns false. NOTE: If the pixmap has a mask but not alpha channel, this - function returns FALSE. + function returns false. \sa hasAlpha() mask() */ @@ -2397,7 +2397,7 @@ TQ_EXPORT void copyBlt( TQPixmap *dst, int dx, int dy, } // copy pixel data - bitBlt( dst, dx, dy, src, sx, sy, sw, sh, TQt::CopyROP, TRUE ); + bitBlt( dst, dx, dy, src, sx, sy, sw, sh, TQt::CopyROP, true ); // copy mask data if ( src->data->mask ) { @@ -2409,7 +2409,7 @@ TQ_EXPORT void copyBlt( TQPixmap *dst, int dx, int dy, } bitBlt( dst->data->mask, dx, dy, - src->data->mask, sx, sy, sw, sh, TQt::CopyROP, TRUE ); + src->data->mask, sx, sy, sw, sh, TQt::CopyROP, true ); } #ifndef TQT_NO_XFTFREETYPE @@ -2434,7 +2434,7 @@ TQ_EXPORT void copyBlt( TQPixmap *dst, int dx, int dy, return; // create an alpha pixmap for dst if it doesn't exist - bool do_init = FALSE; + bool do_init = false; if ( ! dst->data->alphapm ) { dst->data->alphapm = new TQPixmap; @@ -2450,7 +2450,7 @@ TQ_EXPORT void copyBlt( TQPixmap *dst, int dx, int dy, dst->width(), dst->height(), 8); // new alpha pixmaps should be fully opaque by default - do_init = TRUE; + do_init = true; dst->data->alphapm->rendhd = (TQt::HANDLE) XftDrawCreateAlpha( dst->x11Display(), |
