~ubuntu-branches/debian/squeeze/smplayer/squeeze

« back to all changes in this revision

Viewing changes to src/desktopinfo.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Breuil Cyril
  • Date: 2007-06-24 16:35:29 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070624163529-hhckbmd24uicada7
Tags: 0.5.20-0ubuntu1
* New upstream release
* Change Maintainer Email

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include <qapplication.h>
21
21
#include <qdesktopwidget.h>
22
22
 
23
 
QSize desktop_size() {
 
23
QSize DesktopInfo::desktop_size(QWidget *w) {
24
24
        QDesktopWidget * dw = QApplication::desktop();
25
 
        qDebug("desktop_size: primary screen: %d", dw->primaryScreen());
26
 
    return dw->screen( dw->primaryScreen() )->size();
 
25
        qDebug("DesktopInfo::desktop_size: primary screen: %d", dw->primaryScreen());
 
26
        QSize s = dw->screen( dw->primaryScreen() )->size();
 
27
        qDebug("DesktopInfo::desktop_size: size of primary screen: %d x %d", s.width(), s.height() );
 
28
        //return dw->screen( dw->primaryScreen() )->size();
 
29
 
 
30
        QRect r = dw->screenGeometry(w);
 
31
        qDebug("DesktopInfo::desktop_size: size of screen: %d x %d", r.width(), r.height() );
 
32
        return QSize(r.width(), r.height() );
27
33
}
28
34
 
29
 
double desktop_aspectRatio() {
30
 
    QSize s = desktop_size();
 
35
double DesktopInfo::desktop_aspectRatio(QWidget *w) {
 
36
    QSize s = DesktopInfo::desktop_size(w);
31
37
    return  (double) s.width() / s.height() ;
32
38
}
33
39