--===============0253566037== Content-Type: multipart/alternative; boundary=0016e644ccb8d2b6f0046a2dd127 --0016e644ccb8d2b6f0046a2dd127 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, if you want to make a ARGB window using xlib/Qt here is the code i use /**files to include from xlib*/ #include #include /**getting display*/ Display *dpy =3D XOpenDisplay ( 0 ); // open default display if ( !dpy ) { qWarning ( "Cannot connect to the X server" ); exit ( 1 ); } /**code for argb visual*/ bool argbVisual=3Dfalse; int screen =3D DefaultScreen ( dpy ); Colormap colormap =3D 0; Visual *visual =3D 0; int eventBase, errorBase; if ( XRenderQueryExtension ( dpy, &eventBase, &errorBase ) ) { qWarning ("You have ARGB support"); int nvi; XVisualInfo templ; templ.screen =3D screen; templ.depth =3D 32; templ.c_class =3D TrueColor; XVisualInfo *xvi =3D XGetVisualInfo ( dpy, VisualScreenMask | VisualDepthMask | VisualClassMask, &templ, &nvi )= ; for ( int i =3D 0; i < nvi; ++i ) { XRenderPictFormat *format =3D XRenderFindVisualFormat ( dpy, xvi[i].visual ); if ( format->type =3D=3D PictTypeDirect && format->direct.alpha= Mask ) { visual =3D xvi[i].visual; colormap =3D XCreateColormap ( dpy, RootWindow ( dpy, scree= n ), visual, AllocNone ); argbVisual=3Dtrue; break; } } } /**end of code for argb visual*/ then QApplication app (dpy, argc, argv,Qt::HANDLE ( visual ), Qt::HANDLE ( colormap ) ); On Thu, May 14, 2009 at 6:24 PM, Thomas L=FCbking w= rote: > Am Thursday 14 May 2009 schrieb Harald Hvaal: > > > > Do I need to write graphics routines through kwin plugin framework? Is > if you want an effect on desktops/windows (like the cube switch etc.) > that's likely the best location > > > > there a flag in Qt that I can use to get an alpha blended backgroudn fo= r > a > > qmainwindow? > Qt 4.5 (only on window type widgets QWidget::isWindow()) > QWidget::setAttribute(Qt::WA_TranslucentBackground) > this will however (obviously) only work on composited desktops > > > > Maybe plasma has something for this? Is it even possible? > if you want whatever you want on the desktop layer (i.e. below all normal > windows), you can make a plasmoid (QGraphicsViewItem) and just use alpha > blending > > > Thomas > > > > > > >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to > unsubscribe << > > --=20 Regards: Shashank Singh Associate - Software | New Technologies team Geodesic Limited | Tel: +91 22 2831 2872 Blog:http://techfreaks4u.com/blog Marble contributor : http://edu.kde.org/marble/ KDE-in Volunteer : http://www.kde.in/ --0016e644ccb8d2b6f0046a2dd127 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,
if you want to make a ARGB window using xlib/Qt here is the code i u= se
/**files to include from xlib*/
#include <X11/extensions/Xrende= r.h>
#include <X11/Xlib.h>
=A0=A0=A0
/**getting display*= /
Display *dpy =3D XOpenDisplay ( 0 ); // open default display
=A0=A0=A0 i= f ( !dpy ) {
=A0=A0=A0=A0=A0=A0=A0 qWarning ( "Cannot connect to th= e X server" );
=A0=A0=A0=A0=A0=A0=A0 exit ( 1 );
=A0=A0=A0 }
=
/**code for argb visual*/
=A0=A0=A0 bool=A0 argbVisual=3Dfalse;
=A0=A0=A0 int screen =3D DefaultScreen ( dpy );
=A0=A0=A0 Colormap color= map =3D 0;
=A0=A0=A0 Visual *visual =3D 0;
=A0=A0=A0 int eventBase, e= rrorBase;

=A0=A0=A0 if ( XRenderQueryExtension ( dpy, &eventBase= , &errorBase ) ) {
=A0=A0=A0=A0=A0=A0=A0 qWarning ("You have AR= GB support");
=A0=A0=A0=A0=A0=A0=A0 int nvi;
=A0=A0=A0=A0=A0=A0=A0 XVisualInfo templ;<= br>=A0=A0=A0=A0=A0=A0=A0 templ.screen=A0 =3D screen;
=A0=A0=A0=A0=A0=A0= =A0 templ.depth=A0=A0 =3D 32;
=A0=A0=A0=A0=A0=A0=A0 templ.c_class =3D Tr= ueColor;
=A0=A0=A0=A0=A0=A0=A0 XVisualInfo *xvi =3D XGetVisualInfo ( dpy= , VisualScreenMask |
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 VisualDepthMask |=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 VisualClassMask, = &templ, &nvi );

=A0=A0=A0=A0=A0=A0=A0 for ( int i =3D 0; i &= lt; nvi; ++i ) {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 XRenderPictFormat *fo= rmat =3D XRenderFindVisualFormat ( dpy,
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 xvi[i].visual );
=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 if ( format->type =3D=3D PictTypeDirect &&= format->direct.alphaMask ) {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 visual =3D xvi[i].visual;
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 colormap =3D XCreateColormap ( dpy, RootWindow ( dpy, screen ),
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 visual, AllocNone= );
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 argbVisual=3Dtrue;
= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 break;
=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 }
=A0=A0=A0=A0=A0=A0=A0 }
=A0=A0=A0 }
=A0=A0=A0 /*= *end of code for argb visual*/

then QApplication app (dpy, argc, arg= v,Qt::HANDLE ( visual ), Qt::HANDLE ( colormap ) );



On Thu, May 14, 2009 at 6:24 PM, Tho= mas L=FCbking <thomas.luebking@web.de> wrote:
Am Thursday 14 May 2009 schrieb Harald Hvaal:


> Do I need to write= graphics routines through kwin plugin framework? Is
if you want an effect on desktops/windows (like the cube switch etc.) that&= #39;s likely the best location


> there a flag in Qt= that I can use to get an alpha blended backgroudn for a
> qmainwindow?
Qt 4.5 (only on window type widgets QWidget::isWindow())
QWidget::setAttribute(Qt::WA_TranslucentBackground)
this will however (obviously) only work on composited desktops


> Maybe plasma has s= omething for this? Is it even possible?
if you want whatever you want on the desktop layer (i.e. below all normal w= indows), you can make a plasmoid (QGraphicsViewItem) and just use alpha ble= nding


Thomas





>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub= to unsubscribe <<




--
Regards:
Shashan= k Singh
Associate - Software | New Technologies team
Geodesic Limited= | =A0<http://www.geodesic.com&g= t;
Tel: +91 22 2831 2872

Blog:http://techfreaks4u.com/blog
Marble contributor : http://edu.kde.org/marble/
KDE-in Volunteer : = http://www.kde.in/
--0016e644ccb8d2b6f0046a2dd127-- --===============0253566037== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --===============0253566037==--