//if possible we reuse the current QVariant private
const int type = qMetaTypeId<T>(reinterpret_cast<T *>(0));
QVariant::Private &d = v.data_ptr();
- if (v.isDetached() && (type == d.type || (type <= int(QVariant::Char) && d.type <= int(QVariant::Char)))) {
+ if (v.isDetached() && (type == d.type || (type <= QVariant::Char && d.type <= QVariant::Char))) {
d.type = type;
d.is_null = false;
T *old = reinterpret_cast<T*>(d.is_shared ? d.data.shared->ptr : &d.data.ptr);
// ### it because "storage class specifiers invalid in friend function
// ### declarations" :-) Ideas anyone?
void qt_init(QApplicationPrivate *priv, int,
- Display *display, Qt::HANDLE visual, Qt::HANDLE colormap)
+ Display *display, Qt::HANDLE visual, Qt::HANDLE colormap)
{
qt_x11Data = new QX11Data;
qt_x11Data->display = display;
return returnValue;
}
+void qt_x11_getX11InfoForWindow(QX11Info *xinfo, const void *att)
+{
+ QX11InfoData* xd = xinfo->getX11Data(true);
+ const XWindowAttributes *a = static_cast<const XWindowAttributes*>(att);
+ // find which screen the window is on...
+ xd->screen = QX11Info::appScreen(); // by default, use the default :)
+ int i;
+ for (i = 0; i < ScreenCount(qt_x11Data->display); i++) {
+ if (RootWindow(qt_x11Data->display, i) == a->root) {
+ xd->screen = i;
+ break;
+ }
+ }
+
+ xd->depth = a->depth;
+ xd->cells = DisplayCells(qt_x11Data->display, xd->screen);
+ xd->visual = a->visual;
+ xd->defaultVisual = (XVisualIDFromVisual((Visual *) a->visual) ==
+ XVisualIDFromVisual((Visual *) QX11Info::appVisual(xinfo->screen())));
+ xd->colormap = a->colormap;
+ xd->defaultColormap = (a->colormap == QX11Info::appColormap(xinfo->screen()));
+ xinfo->setX11Data(xd);
+}
+
void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyOldWindow)
{
Q_Q(QWidget);
}
#endif
-void qt_x11_getX11InfoForWindow(QX11Info *xinfo, const void *att)
-{
- QX11InfoData* xd = xinfo->getX11Data(true);
- const XWindowAttributes *a = static_cast<const XWindowAttributes*>(att);
- // find which screen the window is on...
- xd->screen = QX11Info::appScreen(); // by default, use the default :)
- int i;
- for (i = 0; i < ScreenCount(qt_x11Data->display); i++) {
- if (RootWindow(qt_x11Data->display, i) == a->root) {
- xd->screen = i;
- break;
- }
- }
-
- xd->depth = a->depth;
- xd->cells = DisplayCells(qt_x11Data->display, xd->screen);
- xd->visual = a->visual;
- xd->defaultVisual = (XVisualIDFromVisual((Visual *) a->visual) ==
- XVisualIDFromVisual((Visual *) QX11Info::appVisual(xinfo->screen())));
- xd->colormap = a->colormap;
- xd->defaultColormap = (a->colormap == QX11Info::appColormap(xinfo->screen()));
- xinfo->setX11Data(xd);
-}
-
void QWidgetPrivate::updateX11AcceptFocus()
{
Q_Q(QWidget);
QT_BEGIN_NAMESPACE
-
struct QX11InfoData;
class QX11Info;
class QPaintDevice;
static void setAppUserTime(unsigned long time);
static bool isCompositingManagerRunning();
-protected:
+private:
void copyX11Data(const QPaintDevice *);
void cloneX11Data(const QPaintDevice *);
void setX11Data(const QX11InfoData *);
QX11InfoData *x11data;
- friend class QX11PaintEngine;
friend class QPixmap;
+ friend class QX11PaintEngine;
friend class QX11PixmapData;
- friend class QWidget;
friend class QWidgetPrivate;
- friend void qt_init(QApplicationPrivate *priv, int, Display *display, Qt::HANDLE visual,
- Qt::HANDLE colormap);
- friend void qt_cleanup();
friend void qt_x11_getX11InfoForWindow(QX11Info *xinfo, const void *att);
};