All pastes #1225017 Raw Copy code Copy link Edit

Stuff

public unlisted text v1 · immutable
#1225017 ·published 2008-10-10 23:32 UTC
rendered paste body
Index: playground/base/plasma/applets/CMakeLists.txt
===================================================================
--- playground/base/plasma/applets/CMakeLists.txt	(revision 869357)
+++ playground/base/plasma/applets/CMakeLists.txt	(working copy)
@@ -53,7 +53,7 @@
    add_subdirectory(systemcommand)
    add_subdirectory(embed-win)
 endif ( Q_WS_X11 )
-add_subdirectory(tasks-refactor)
+#add_subdirectory(tasks-refactor)
 ###uncomment this section when FindDecibel.cmake exists
 #macro_optional_find_package(Decibel)
 
Index: playground/base/plasma/screenmanagement/kephal/kephal/screens.h
===================================================================
--- playground/base/plasma/screenmanagement/kephal/kephal/screens.h	(revision 869357)
+++ playground/base/plasma/screenmanagement/kephal/kephal/screens.h	(working copy)
@@ -21,12 +21,14 @@
 #ifndef KEPHAL_SCREENS_H
 #define KEPHAL_SCREENS_H
 
+#include <QApplication>
+#include <QDesktopWidget>
 #include <QPoint>
 #include <QSize>
 #include <QObject>
 #include <QRect>
 
-#include <kephal_export.h>
+#include "kephal_export.h"
 
 namespace kephal {
 
@@ -180,6 +182,27 @@
             static Screens * m_instance;
     };
     
+    class KEPHAL_EXPORT ScreenUtils {
+        public:
+            static int numScreens() {
+                return Screens::instance()->screens().size();
+            }
+            
+            static QRect screenGeometry(int id) {
+                if (id == -1) 
+                    return QApplication::desktop()->screenGeometry();
+                else
+                    return Screens::instance()->screen(id)->geom();
+            }
+            
+            static QSize screenSize(int id) {
+                if (id == -1) 
+                    return QApplication::desktop()->screenGeometry().size();
+                else
+                    return Screens::instance()->screen(id)->size();
+            }            
+    };
+    
 }