[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/unity/WebKit/WebCore/platform/qt
From: Nikolas Zimmermann <wildfox () kde ! org>
Date: 2006-08-05 15:07:14
Message-ID: 1154790434.958568.13874.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 570038 by wildfox:
Implement ScreenQt, all classes are basically implemented.
Most still contain a few stubs (mostly noticeable: FrameQt)
Looking forward to a KPart :-)
M +31 -7 ScreenQt.cpp
--- branches/work/unity/WebKit/WebCore/platform/qt/ScreenQt.cpp #570037:570038
@@ -1,5 +1,7 @@
/*
* Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
+ * (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ *
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -27,28 +29,50 @@
#include "config.h"
#include "Screen.h"
+#include "Widget.h"
+#include "HelperQt.h"
#include "FloatRect.h"
-#include "Widget.h"
-#include <stdio.h>
+#include <QApplication>
+#include <QDesktopWidget>
-#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", \
__FILE__, __LINE__); } while(0)
-
namespace WebCore {
FloatRect screenRect(Widget* widget)
{
- notImplemented();
+ QWidget *qw = widget->qwidget();
+ if (!qw)
+ return FloatRect();
+
+ // Taken from KGlobalSettings::desktopGeometry
+ QDesktopWidget *dw = QApplication::desktop();
+ if (!dw)
+ return FloatRect();
+
+ return (QRectF) dw->screenGeometry(qw);
}
int screenDepth(Widget* widget)
{
- notImplemented();
+ QWidget *qw = widget->qwidget();
+ if (!qw)
+ return 32;
+
+ return qw->depth();
}
FloatRect usableScreenRect(Widget* widget)
{
- notImplemented();
+ QWidget *qw = widget->qwidget();
+ if (!qw)
+ return FloatRect();
+
+ // Taken from KGlobalSettings::desktopGeometry
+ QDesktopWidget *dw = QApplication::desktop();
+ if (!dw)
+ return FloatRect();
+
+ return (QRectF) dw->availableGeometry(qw);
}
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic