src/gui/kernel/qx11info_x11.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.
00004 **
00005 ** This file is part of the QtGui module of the Qt Toolkit.
00006 **
00007 ** This file may be used under the terms of the GNU General Public
00008 ** License version 2.0 as published by the Free Software Foundation
00009 ** and appearing in the file LICENSE.GPL included in the packaging of
00010 ** this file.  Please review the following information to ensure GNU
00011 ** General Public Licensing requirements will be met:
00012 ** http://www.trolltech.com/products/qt/opensource.html
00013 **
00014 ** If you are unsure which license is appropriate for your use, please
00015 ** review the following information:
00016 ** http://www.trolltech.com/products/qt/licensing.html or contact the
00017 ** sales department at sales@trolltech.com.
00018 **
00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00021 **
00022 ****************************************************************************/
00023 
00024 #ifndef QX11INFO_X11_H
00025 #define QX11INFO_X11_H
00026 
00027 #include <QtCore/qnamespace.h>
00028 
00029 QT_BEGIN_HEADER
00030 
00031 QT_MODULE(Gui)
00032 
00033 struct QX11InfoData;
00034 class QPaintDevice;
00035 class QApplicationPrivate;
00036 class QX11InfoPrivate;
00037 
00038 typedef struct _XDisplay Display;
00039 
00040 class Q_GUI_EXPORT QX11Info
00041 {
00042 public:
00043     QX11Info();
00044     ~QX11Info();
00045     QX11Info(const QX11Info &other);
00046     QX11Info &operator=(const QX11Info &other);
00047 
00048     static Display *display();
00049     static const char *appClass();
00050     int screen() const;
00051     int depth() const;
00052     int cells() const;
00053     Qt::HANDLE colormap() const;
00054     bool defaultColormap() const;
00055     void *visual() const;
00056     bool defaultVisual() const;
00057 
00058     static int appScreen();
00059     static int appDepth(int screen = -1);
00060     static int appCells(int screen = -1);
00061     static Qt::HANDLE appColormap(int screen = -1);
00062     static void *appVisual(int screen = -1);
00063     static Qt::HANDLE appRootWindow(int screen = -1);
00064     static bool appDefaultColormap(int screen = -1);
00065     static bool appDefaultVisual(int screen = -1);
00066     static int appDpiX(int screen = -1);
00067     static int appDpiY(int screen = -1);
00068     static void setAppDpiX(int screen, int dpi);
00069     static void setAppDpiY(int screen, int dpi);
00070     static unsigned long appTime();
00071     static unsigned long appUserTime();
00072     static void setAppTime(unsigned long time);
00073     static void setAppUserTime(unsigned long time);
00074 
00075 protected:
00076     void copyX11Data(const QPaintDevice *);
00077     void cloneX11Data(const QPaintDevice *);
00078     void setX11Data(const QX11InfoData *);
00079     QX11InfoData* getX11Data(bool def = false) const;
00080 
00081     QX11InfoData *x11data;
00082 
00083     friend class QX11PaintEngine;
00084     friend class QPixmap;
00085     friend class QWidget;
00086     friend class QWidgetPrivate;
00087     friend class QGLWidget;
00088     friend void qt_init(QApplicationPrivate *priv, int, Display *display, Qt::HANDLE visual,
00089                         Qt::HANDLE colormap);
00090     friend void qt_cleanup();
00091 };
00092 
00093 QT_END_HEADER
00094 
00095 #endif // QX11INFO_X11_H

Generated on Thu Mar 15 11:55:19 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1