2
* Copyright (C) 2005,2006,2007 by Siraj Razick <siraj@kde.org>
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2,
6
* or (at your option) any later version, as published by the Free
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details
14
* You should have received a copy of the GNU General Public
15
* License along with this program; if not, write to the
16
* Free Software Foundation, Inc.,
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
#include "QtDisplay.h"
22
#include <config-lancelot.h>
24
#ifdef LANCELOT_HAVE_COMPOSITING
26
QtDisplay::QtDisplay(char * display, int screen)
28
_displayPtr = display;
34
_dpyPtr = XOpenDisplay(_displayPtr);
36
_screen = DefaultScreen(_dpyPtr);
40
void QtDisplay::testDisplay()
48
QtDisplay::~QtDisplay()
53
/*Manpage : function Proto types
54
1.) XVisualInfo *XGetVisualInfo ( Display *display , long vinfo_mask , XVisualInfo *vinfo_template , int *nitems_return );
59
void QtDisplay::setupXRender()
62
if (!XRenderQueryExtension(_dpyPtr, &tmp, &tmp2))
65
XRenderPictFormat * m_xrender_pict_formatPtr;
69
XVisualInfo * m_xvinfoAddr = &m_xvinfo;
72
m_xvinfo.c_class = TrueColor;
73
m_xvinfo.screen = _screen;
75
long m_vinfo_mask = VisualScreenMask | VisualDepthMask | VisualClassMask;
77
XVisualInfo * m_xvinfoPtr;
78
m_xvinfoPtr = XGetVisualInfo(_dpyPtr, m_vinfo_mask, m_xvinfoAddr, &m_xv_count);
80
for (int index = 0; index < m_xv_count ; index++) {
81
m_xrender_pict_formatPtr = XRenderFindVisualFormat(_dpyPtr,
82
m_xvinfoPtr[index].visual);
84
if (m_xrender_pict_formatPtr->type == PictTypeDirect) {
85
if (m_xrender_pict_formatPtr->direct.alphaMask) {
86
_visualPtr = m_xvinfoPtr[index].visual;
87
_colormap = XCreateColormap(_dpyPtr, RootWindow(_dpyPtr,_screen), _visualPtr, AllocNone);
94
#endif // LANCELOT_HAVE_COMPOSITING