|
|
|
@ -131,7 +131,7 @@ KScienceSaver::KScienceSaver( WId id, bool s, bool gP )
|
|
|
|
|
: KScreenSaver( id )
|
|
|
|
|
{
|
|
|
|
|
d = new KScienceData;
|
|
|
|
|
d->gc = XCreateGC(qt_xdisplay(), id, 0, 0);
|
|
|
|
|
d->gc = XCreateGC(tqt_xdisplay(), id, 0, 0);
|
|
|
|
|
d->xRootWin = 0;
|
|
|
|
|
d->buffer = 0;
|
|
|
|
|
|
|
|
|
@ -159,7 +159,7 @@ KScienceSaver::~KScienceSaver()
|
|
|
|
|
releaseLens();
|
|
|
|
|
if ( d->xRootWin )
|
|
|
|
|
XDestroyImage( d->xRootWin );
|
|
|
|
|
XFreeGC(qt_xdisplay(), d->gc );
|
|
|
|
|
XFreeGC(tqt_xdisplay(), d->gc );
|
|
|
|
|
delete d;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -592,14 +592,14 @@ void KScienceSaver::do_refresh( const TQRect & rect )
|
|
|
|
|
|
|
|
|
|
if( hideBG[mode] )
|
|
|
|
|
{
|
|
|
|
|
XSetWindowBackground( qt_xdisplay(), winId(), black.pixel() );
|
|
|
|
|
XClearArea( qt_xdisplay(), winId(), rect.left(), rect.top(),
|
|
|
|
|
XSetWindowBackground( tqt_xdisplay(), winId(), black.pixel() );
|
|
|
|
|
XClearArea( tqt_xdisplay(), winId(), rect.left(), rect.top(),
|
|
|
|
|
rect.width(), rect.height(), false );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
myAssert( d->xRootWin != 0, "root window not grabbed" );
|
|
|
|
|
XPutImage( qt_xdisplay(), winId(), d->gc, d->xRootWin,
|
|
|
|
|
XPutImage( tqt_xdisplay(), winId(), d->gc, d->xRootWin,
|
|
|
|
|
rect.left(), rect.top(),
|
|
|
|
|
rect.left(), rect.top(),
|
|
|
|
|
rect.width(), rect.height() );
|
|
|
|
@ -700,15 +700,15 @@ void KScienceSaver::slotTimeout()
|
|
|
|
|
if( hideBG[mode] )
|
|
|
|
|
blackPixel( xcoord, ycoord );
|
|
|
|
|
(this->*applyLens)(xs, ys, xd, yd, w, h);
|
|
|
|
|
XPutImage( qt_xdisplay(), winId(), d->gc, d->buffer, 0, 0, xd, yd, w, h );
|
|
|
|
|
XPutImage( tqt_xdisplay(), winId(), d->gc, d->buffer, 0, 0, xd, yd, w, h );
|
|
|
|
|
if( hideBG[mode] )
|
|
|
|
|
blackPixelUndo( xcoord, ycoord );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KScienceSaver::grabRootWindow()
|
|
|
|
|
{
|
|
|
|
|
Display *dsp = qt_xdisplay();
|
|
|
|
|
Window rootwin = RootWindow( dsp, qt_xscreen() );
|
|
|
|
|
Display *dsp = tqt_xdisplay();
|
|
|
|
|
Window rootwin = RootWindow( dsp, tqt_xscreen() );
|
|
|
|
|
|
|
|
|
|
// grab contents of root window
|
|
|
|
|
if( d->xRootWin )
|
|
|
|
@ -729,7 +729,7 @@ void KScienceSaver::grabPreviewWidget()
|
|
|
|
|
if( d->xRootWin )
|
|
|
|
|
XDestroyImage( d->xRootWin );
|
|
|
|
|
|
|
|
|
|
Display *dsp = qt_xdisplay();
|
|
|
|
|
Display *dsp = tqt_xdisplay();
|
|
|
|
|
d->xRootWin = XGetImage( dsp, winId(), 0, 0, width(), height(), AllPlanes, ZPixmap);
|
|
|
|
|
myAssert( d->xRootWin, "unable to grab preview window\n" );
|
|
|
|
|
|
|
|
|
@ -739,7 +739,7 @@ void KScienceSaver::grabPreviewWidget()
|
|
|
|
|
|
|
|
|
|
void KScienceSaver::blackPixel( int x, int y )
|
|
|
|
|
{
|
|
|
|
|
unsigned char black = (char) BlackPixel( qt_xdisplay(), qt_xscreen() );
|
|
|
|
|
unsigned char black = (char) BlackPixel( tqt_xdisplay(), tqt_xscreen() );
|
|
|
|
|
unsigned int adr = x*bpp + y*imgnext;
|
|
|
|
|
|
|
|
|
|
for(int i=0; i<bpp; i++) {
|
|
|
|
|