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.
48 lines
1.2 KiB
48 lines
1.2 KiB
9 years ago
|
#include "clip.h"
|
||
|
|
||
|
#include <qwidget.h>
|
||
|
#include <qbitmap.h>
|
||
|
#include <qpainter.h>
|
||
|
#include <netwm.h>
|
||
|
#include <netwm_def.h>
|
||
|
#include <kwin.h>
|
||
|
|
||
|
#include <kdebug.h>
|
||
|
|
||
|
clip::clip(QWidget *parent, const char *name) : QWidget(parent, name, WStyle_Customize | WStyle_NoBorder | WNoAutoErase | WDestructiveClose | WMouseNoMask | WStyle_StaysOnTop)
|
||
|
{
|
||
|
info = new NETWinInfo( qt_xdisplay(), winId(), qt_xrootwin(), NET::WMState);
|
||
|
info->setDesktop( NETWinInfo::OnAllDesktops );
|
||
|
|
||
|
info->setState(NETWinInfo::SkipTaskbar | NETWinInfo::SkipPager, NETWinInfo::SkipTaskbar | NETWinInfo::SkipPager);
|
||
|
hide();
|
||
|
setBackgroundMode(NoBackground);
|
||
|
|
||
|
KWin::setOnAllDesktops(winId(), true);
|
||
|
KWin::setState(winId(), NET::SkipTaskbar | NET::SkipPager);
|
||
|
KWin::setType(winId(), NET::Dock);
|
||
|
|
||
|
setCaption("kooldock clipping window");
|
||
|
}
|
||
|
|
||
|
clip::~clip()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
void clip::clipDesktop(int p1,int p2,int p3,int p4,int p5,int p6,int p7,int p8,int p9,int p10,int p11,int p12)
|
||
|
{
|
||
|
KWin::setExtendedStrut(winId(), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
|
||
|
}
|
||
|
|
||
|
void clip::paintEvent(QPaintEvent *)
|
||
|
{
|
||
|
QBitmap bm(size());
|
||
|
QPainter mp;
|
||
|
|
||
|
mp.begin(&bm, this);
|
||
|
mp.fillRect(rect(), Qt::black);
|
||
|
mp.end();
|
||
|
|
||
|
setMask(bm);
|
||
|
}
|