summaryrefslogtreecommitdiffstats
path: root/src/kernel/tqpainter_x11.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/tqpainter_x11.cpp')
-rw-r--r--src/kernel/tqpainter_x11.cpp132
1 files changed, 66 insertions, 66 deletions
diff --git a/src/kernel/tqpainter_x11.cpp b/src/kernel/tqpainter_x11.cpp
index e477f2aaa..a25614691 100644
--- a/src/kernel/tqpainter_x11.cpp
+++ b/src/kernel/tqpainter_x11.cpp
@@ -225,14 +225,14 @@ inline double qsin( double a )
return(r);
}
-double qsincos( double a, bool calcCos=FALSE )
+double qsincos( double a, bool calcCos=false )
{
return calcCos ? qcos(a) : qsin(a);
}
#else
-double qsincos( double a, bool calcCos=FALSE )
+double qsincos( double a, bool calcCos=false )
{
if ( calcCos ) // calculate cosine
a -= Q_PI2;
@@ -258,8 +258,8 @@ double qsincos( double a, bool calcCos=FALSE )
return (a-a3/6+a5/120-a7/5040+a9/362880-a11/39916800)*sign;
}
-inline double qsin( double a ) { return qsincos(a, FALSE); }
-inline double qcos( double a ) { return qsincos(a, TRUE); }
+inline double qsin( double a ) { return qsincos(a, false); }
+inline double qcos( double a ) { return qsincos(a, true); }
#endif
@@ -282,14 +282,14 @@ struct TQGC
const int gc_array_size = 256;
static TQGC gc_array[gc_array_size]; // array of GCs
-static bool gc_array_init = FALSE;
+static bool gc_array_init = false;
static void init_gc_array()
{
if ( !gc_array_init ) {
memset( gc_array, 0, gc_array_size*sizeof(TQGC) );
- gc_array_init = TRUE;
+ gc_array_init = true;
}
}
@@ -303,17 +303,17 @@ static void cleanup_gc_array( Display *dpy )
XFreeGC( dpy, p->gc );
p++;
}
- gc_array_init = FALSE;
+ gc_array_init = false;
}
}
// #define DONT_USE_GC_ARRAY
-static GC alloc_gc( Display *dpy, int scrn, Drawable hd, bool monochrome=FALSE,
- bool privateGC = FALSE )
+static GC alloc_gc( Display *dpy, int scrn, Drawable hd, bool monochrome=false,
+ bool privateGC = false )
{
#if defined(DONT_USE_GC_ARRAY)
- privateGC = TRUE; // will be slower
+ privateGC = true; // will be slower
#endif
if ( privateGC ) {
GC gc = XCreateGC( dpy, hd, 0, 0 );
@@ -329,11 +329,11 @@ static GC alloc_gc( Display *dpy, int scrn, Drawable hd, bool monochrome=FALSE,
p->gc = XCreateGC( dpy, hd, 0, 0 );
p->scrn = scrn;
XSetGraphicsExposures( dpy, p->gc, False );
- p->in_use = FALSE;
+ p->in_use = false;
p->mono = monochrome;
}
if ( !p->in_use && p->mono == monochrome && p->scrn == scrn ) {
- p->in_use = TRUE; // available/compatible GC
+ p->in_use = true; // available/compatible GC
return p->gc;
}
p++;
@@ -346,10 +346,10 @@ static GC alloc_gc( Display *dpy, int scrn, Drawable hd, bool monochrome=FALSE,
return gc;
}
-static void free_gc( Display *dpy, GC gc, bool privateGC = FALSE )
+static void free_gc( Display *dpy, GC gc, bool privateGC = false )
{
#if defined(DONT_USE_GC_ARRAY)
- privateGC = TRUE; // will be slower
+ privateGC = true; // will be slower
#endif
if ( privateGC ) {
Q_ASSERT( dpy != 0 );
@@ -361,7 +361,7 @@ static void free_gc( Display *dpy, GC gc, bool privateGC = FALSE )
if ( gc_array_init ) {
while ( i-- ) {
if ( p->gc == gc ) {
- p->in_use = FALSE; // set available
+ p->in_use = false; // set available
XSetClipMask( dpy, gc, None ); // make it reusable
XSetFunction( dpy, gc, GXcopy );
XSetFillStyle( dpy, gc, FillSolid );
@@ -408,14 +408,14 @@ struct TQGCC // cached GC
const int gc_cache_size = 29; // multiply by 4
static TQGCC *gc_cache_buf;
static TQGCC *gc_cache[4*gc_cache_size];
-static bool gc_cache_init = FALSE;
+static bool gc_cache_init = false;
static uint gc_cache_clip_serial = 0;
static void init_gc_cache()
{
if ( !gc_cache_init ) {
- gc_cache_init = TRUE;
+ gc_cache_init = true;
gc_cache_clip_serial = 0;
TQGCC *g = gc_cache_buf = new TQGCC[4*gc_cache_size];
memset( g, 0, 4*gc_cache_size*sizeof(TQGCC) );
@@ -461,7 +461,7 @@ static void cleanup_gc_cache()
}
#endif
delete [] gc_cache_buf;
- gc_cache_init = FALSE;
+ gc_cache_init = false;
}
@@ -499,13 +499,13 @@ static bool obtain_gc( void **ref, GC *gc, uint pix, Display *dpy, int scrn,
gc_cache[k-1] = g;
*ref = (void *)g;
*gc = g->gc;
- return TRUE;
+ return true;
} else { // all GCs in use
#if defined(GC_CACHE_STAT)
g_numfaults++;
#endif
*ref = 0;
- return FALSE;
+ return false;
}
}
}
@@ -527,19 +527,19 @@ static bool obtain_gc( void **ref, GC *gc, uint pix, Display *dpy, int scrn,
gc_cache[k] = prev;
gc_cache[k-1] = g;
}
- return TRUE;
+ return true;
} else { // create new GC
#if defined(GC_CACHE_STAT)
g_numcreates++;
#endif
- g->gc = alloc_gc( dpy, scrn, hd, FALSE );
+ g->gc = alloc_gc( dpy, scrn, hd, false );
g->scrn = scrn;
g->pix = pix;
g->count = 1;
g->hits = 1;
g->clip_serial = 0;
*gc = g->gc;
- return FALSE;
+ return false;
}
}
@@ -607,7 +607,7 @@ void TQPainter::init()
penRef = brushRef = 0;
clip_serial = 0;
pfont = 0;
- block_ext = FALSE;
+ block_ext = false;
}
@@ -681,7 +681,7 @@ void TQPainter::updatePen()
(ps == NoPen || ps == SolidLine) &&
cpen.width() == 0 && rop == CopyROP;
- bool obtained = FALSE;
+ bool obtained = false;
bool internclipok = hasClipping();
if ( cacheIt ) {
if ( gc ) {
@@ -693,7 +693,7 @@ void TQPainter::updatePen()
obtained = obtain_gc(&penRef, &gc, cpen.color().pixel(scrn), dpy, scrn,
hd, clip_serial);
if ( !obtained && !penRef )
- gc = alloc_gc( dpy, scrn, hd, FALSE );
+ gc = alloc_gc( dpy, scrn, hd, false );
} else {
if ( gc ) {
if ( penRef ) {
@@ -701,7 +701,7 @@ void TQPainter::updatePen()
penRef = 0;
gc = alloc_gc( dpy, scrn, hd, testf(MonoDev) );
} else {
- internclipok = TRUE;
+ internclipok = true;
}
} else {
gc = alloc_gc( dpy, scrn, hd, testf(MonoDev), testf(UsePrivateCx) );
@@ -738,7 +738,7 @@ void TQPainter::updatePen()
*/
int dot = cpen.width(); // width of a dot
int fudge = 1;
- bool allow_zero_lw = TRUE;
+ bool allow_zero_lw = true;
if ( dot <= 1 ) {
dot = 3;
fudge = 2;
@@ -753,13 +753,13 @@ void TQPainter::updatePen()
dashes[0] = fudge * 3 * dot;
dashes[1] = fudge * dot;
dash_len = 2;
- allow_zero_lw = FALSE;
+ allow_zero_lw = false;
break;
case DotLine:
dashes[0] = dot;
dashes[1] = dot;
dash_len = 2;
- allow_zero_lw = FALSE;
+ allow_zero_lw = false;
break;
case DashDotLine:
dashes[0] = 3 * dot;
@@ -767,7 +767,7 @@ void TQPainter::updatePen()
dashes[2] = dot;
dashes[3] = fudge * dot;
dash_len = 4;
- allow_zero_lw = FALSE;
+ allow_zero_lw = false;
break;
case DashDotDotLine:
dashes[0] = 3 * dot;
@@ -777,14 +777,14 @@ void TQPainter::updatePen()
dashes[4] = dot;
dashes[5] = dot;
dash_len = 6;
- allow_zero_lw = FALSE;
+ allow_zero_lw = false;
break;
case FineDotLine:
dot = 1;
dashes[0] = dot;
dashes[1] = dot;
dash_len = 2;
- allow_zero_lw = FALSE;
+ allow_zero_lw = false;
}
Q_ASSERT( dash_len <= (int) sizeof(dashes) );
@@ -888,7 +888,7 @@ void TQPainter::updateBrush()
(bs == NoBrush || bs == SolidPattern) &&
bro.x() == 0 && bro.y() == 0 && rop == CopyROP;
- bool obtained = FALSE;
+ bool obtained = false;
bool internclipok = hasClipping();
if ( cacheIt ) {
if ( gc_brush ) {
@@ -900,7 +900,7 @@ void TQPainter::updateBrush()
obtained = obtain_gc(&brushRef, &gc_brush, cbrush.color().pixel(scrn), dpy,
scrn, hd, clip_serial);
if ( !obtained && !brushRef )
- gc_brush = alloc_gc( dpy, scrn, hd, FALSE );
+ gc_brush = alloc_gc( dpy, scrn, hd, false );
} else {
if ( gc_brush ) {
if ( brushRef ) {
@@ -908,7 +908,7 @@ void TQPainter::updateBrush()
brushRef = 0;
gc_brush = alloc_gc( dpy, scrn, hd, testf(MonoDev) );
} else {
- internclipok = TRUE;
+ internclipok = true;
}
} else {
gc_brush = alloc_gc( dpy, scrn, hd, testf(MonoDev), testf(UsePrivateCx));
@@ -955,9 +955,9 @@ void TQPainter::updateBrush()
TQString key;
key.sprintf( "$qt-brush$%d", bs );
pm = TQPixmapCache::find( key );
- bool del = FALSE;
+ bool del = false;
if ( !pm ) { // not already in pm dict
- pm = new TQBitmap( d, d, pat, TRUE );
+ pm = new TQBitmap( d, d, pat, true );
TQ_CHECK_PTR( pm );
del = !TQPixmapCache::insert( key, pm );
}
@@ -981,8 +981,8 @@ void TQPainter::updateBrush()
/*!
- Begins painting the paint device \a pd and returns TRUE if
- successful; otherwise returns FALSE. If \a unclipped is TRUE, the
+ Begins painting the paint device \a pd and returns true if
+ successful; otherwise returns false. If \a unclipped is true, the
painting will not be clipped at the paint device's boundaries,
(although this is not supported by all platforms).
@@ -1015,13 +1015,13 @@ bool TQPainter::begin( const TQPaintDevice *pd, bool unclipped )
tqWarning( "TQPainter::begin: Painter is already active."
"\n\tYou must end() the painter before a second begin()" );
#endif
- return FALSE;
+ return false;
}
if ( pd == 0 ) {
#if defined(QT_CHECK_NULL)
tqWarning( "TQPainter::begin: Paint device cannot be null" );
#endif
- return FALSE;
+ return false;
}
TQPixmap::x11SetDefaultScreen( pd->x11Screen() );
@@ -1042,7 +1042,7 @@ bool TQPainter::begin( const TQPaintDevice *pd, bool unclipped )
"this device;\n\tAn extended paint device can only be "
"painted by one TQPainter at a time." );
#endif
- return FALSE;
+ return false;
}
bool reinit = flags != IsStartingUp; // 2nd or 3rd etc. time called
@@ -1067,7 +1067,7 @@ bool TQPainter::begin( const TQPaintDevice *pd, bool unclipped )
else
flags = IsStartingUp;
pdev = 0;
- return FALSE;
+ return false;
}
if ( tabstops ) // update tabstops for device
setTabStops( tabstops );
@@ -1131,7 +1131,7 @@ bool TQPainter::begin( const TQPaintDevice *pd, bool unclipped )
tqWarning( "TQPainter::begin: Cannot paint null pixmap" );
#endif
end();
- return FALSE;
+ return false;
}
bool mono = pm->depth() == 1; // monochrome bitmap
if ( mono ) {
@@ -1160,7 +1160,7 @@ bool TQPainter::begin( const TQPaintDevice *pd, bool unclipped )
clip_serial = gc_cache_clip_serial++;
updateBrush();
updatePen();
- return TRUE;
+ return true;
}
/*!
@@ -1190,7 +1190,7 @@ bool TQPainter::end() // end painting
#if defined(QT_CHECK_STATE)
tqWarning( "TQPainter::end: Missing begin() or begin() failed" );
#endif
- return FALSE;
+ return false;
}
killPStack();
@@ -1243,7 +1243,7 @@ bool TQPainter::end() // end painting
pdev->painters--;
pdev = 0;
dpy = 0;
- return TRUE;
+ return true;
}
/*!
@@ -1451,8 +1451,8 @@ void TQPainter::setBrushOrigin( int x, int y )
/*!
- Enables clipping if \a enable is TRUE, or disables clipping if \a
- enable is FALSE.
+ Enables clipping if \a enable is true, or disables clipping if \a
+ enable is false.
\sa hasClipping(), setClipRect(), setClipRegion()
*/
@@ -1543,7 +1543,7 @@ void TQPainter::setClipRegion( const TQRegion &rgn, CoordinateMode m )
return; // device cannot clip
}
clearf( ClipOn ); // be sure to update clip rgn
- setClipping( TRUE );
+ setClipping( true );
}
@@ -1803,7 +1803,7 @@ void TQPainter::drawRect( int x, int y, int w, int h )
void TQPainter::drawWinFocusRect( int x, int y, int w, int h )
{
- drawWinFocusRect( x, y, w, h, TRUE, color0 );
+ drawWinFocusRect( x, y, w, h, true, color0 );
}
/*!
@@ -1828,7 +1828,7 @@ void TQPainter::drawWinFocusRect( int x, int y, int w, int h )
void TQPainter::drawWinFocusRect( int x, int y, int w, int h,
const TQColor &bgColor )
{
- drawWinFocusRect( x, y, w, h, FALSE, bgColor );
+ drawWinFocusRect( x, y, w, h, false, bgColor );
}
@@ -2119,7 +2119,7 @@ void TQPainter::drawArc( int x, int y, int w, int h, int a, int alen )
if ( txop == TxRotShear ) { // rotate/shear
TQPointArray pa;
pa.makeArc( x, y, w, h, a, alen, xmat ); // arc polyline
- drawPolyInternal( pa, FALSE );
+ drawPolyInternal( pa, false );
return;
}
map( x, y, w, h, &x, &y, &w, &h );
@@ -2202,7 +2202,7 @@ void TQPainter::drawPie( int x, int y, int w, int h, int a, int alen )
XFillArc( dpy, hd, gc_brush, x, y, w, h, a*4, alen*4 );
if ( nopen ) {
g = gc_brush;
- nopen = FALSE;
+ nopen = false;
}
}
if ( !nopen ) { // draw pie outline
@@ -2278,7 +2278,7 @@ void TQPainter::drawChord( int x, int y, int w, int h, int a, int alen )
XFillArc( dpy, hd, gc_brush, x, y, w, h, a*4, alen*4 );
if ( nopen ) {
g = gc_brush;
- nopen = FALSE;
+ nopen = false;
}
}
if ( !nopen ) { // draw chord outline
@@ -2419,8 +2419,8 @@ static int global_polygon_shape = Complex;
The first point is always connected to the last point.
The polygon is filled with the current brush(). If \a winding is
- TRUE, the polygon is filled using the winding fill algorithm. If
- \a winding is FALSE, the polygon is filled using the even-odd
+ true, the polygon is filled using the winding fill algorithm. If
+ \a winding is false, the polygon is filled using the even-odd
(alternative) fill algorithm.
\warning On X11, coordinates that do not fit into 16-bit signed
@@ -2502,7 +2502,7 @@ void TQPainter::drawConvexPolygon( const TQPointArray &pa,
int index, int npoints )
{
global_polygon_shape = Convex;
- drawPolygon(pa, FALSE, index, npoints);
+ drawPolygon(pa, false, index, npoints);
global_polygon_shape = Complex;
}
@@ -2617,11 +2617,11 @@ void TQPainter::drawPixmap( int x, int y, const TQPixmap &pixmap,
if ( sx != 0 || sy != 0 ||
sw != pixmap.width() || sh != pixmap.height() ) {
TQPixmap tmp( sw, sh, pixmap.depth() );
- bitBlt( &tmp, 0, 0, &pixmap, sx, sy, sw, sh, CopyROP, TRUE );
+ bitBlt( &tmp, 0, 0, &pixmap, sx, sy, sw, sh, CopyROP, true );
if ( pixmap.mask() ) {
TQBitmap mask( sw, sh );
bitBlt( &mask, 0, 0, pixmap.mask(), sx, sy, sw, sh,
- CopyROP, TRUE );
+ CopyROP, true );
tmp.setMask( mask );
}
drawPixmap( x, y, tmp );
@@ -2706,7 +2706,7 @@ void TQPainter::drawPixmap( int x, int y, const TQPixmap &pixmap,
TQBitmap *comb = new TQBitmap( sw, sh );
comb->detach();
- GC cgc = tqt_xget_temp_gc( pixmap.x11Screen(), TRUE ); // get temporary mono GC
+ GC cgc = tqt_xget_temp_gc( pixmap.x11Screen(), true ); // get temporary mono GC
XSetForeground( dpy, cgc, 0 );
XFillRectangle( dpy, comb->handle(), cgc, 0, 0, sw, sh );
XSetBackground( dpy, cgc, 0 );
@@ -2792,15 +2792,15 @@ static void drawTile( TQPainter *p, int x, int y, int w, int h,
static void fillTile( TQPixmap *tile, const TQPixmap &pixmap )
{
- bitBlt( tile, 0, 0, &pixmap, 0, 0, -1, -1, TQt::CopyROP, TRUE );
+ bitBlt( tile, 0, 0, &pixmap, 0, 0, -1, -1, TQt::CopyROP, true );
int x = pixmap.width();
while ( x < tile->width() ) {
- bitBlt( tile, x,0, tile, 0,0, x,pixmap.height(), TQt::CopyROP, TRUE );
+ bitBlt( tile, x,0, tile, 0,0, x,pixmap.height(), TQt::CopyROP, true );
x *= 2;
}
int y = pixmap.height();
while ( y < tile->height() ) {
- bitBlt( tile, 0,y, tile, 0,0, tile->width(),y, TQt::CopyROP, TRUE );
+ bitBlt( tile, 0,y, tile, 0,0, tile->width(),y, TQt::CopyROP, true );
y *= 2;
}
}
@@ -3001,7 +3001,7 @@ void qt_draw_background( TQPainter *p, int x, int y, int w, int h )
return;
}
XSetForeground( p->dpy, p->gc, p->bg_col.pixel(p->scrn) );
- qt_draw_transformed_rect( p, x, y, w, h, TRUE);
+ qt_draw_transformed_rect( p, x, y, w, h, true);
XSetForeground( p->dpy, p->gc, p->cpen.color().pixel(p->scrn) );
}