okular/core/utils.h
Aleix Pol f42a3bad65 Drop libkscreen dependency
Drops the x11 fallback. We were falling back to QX11Extras that were in
fact using QScreen internally.
Also remove the QDesktopWidget fallbacks for the same reason.
Drops some API for fetching the dpi and unifies it with ::realDpi(QWidget).

Based on Sebas's patch.
Reviewed by Albert.

REVIEW: 126913
2016-01-30 18:15:07 +01:00

60 lines
1.7 KiB
C++

/***************************************************************************
* Copyright (C) 2006 by Luigi Toscano <luigi.toscano@tiscali.it> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef _OKULAR_UTILS_H_
#define _OKULAR_UTILS_H_
#include "okularcore_export.h"
#include "area.h"
class QRect;
class QImage;
class QWidget;
namespace Okular
{
/**
* @short General utility functions.
*
* This class contains some static functions of general utility.
*/
class OKULARCORE_EXPORT Utils
{
public:
/**
* Rotate the rect \p source in the area \p width x \p height with the
* specified \p orientation .
*/
static QRect rotateRect( const QRect & source, int width, int height, int orientation );
/**
* Return the real DPI of the display containing given widget
*
* On X11, it can indicate the real horizontal DPI value without any Xrdb
* setting. Otherwise, returns the same as realDpiX/Y(),
*
* @since 0.19 (KDE 4.13)
*/
static QSizeF realDpi(QWidget* widgetOnScreen);
/**
* Compute the smallest rectangle that contains all non-white pixels in image),
* in normalized [0,1] coordinates.
*
* @since 0.7 (KDE 4.1)
*/
static NormalizedRect imageBoundingBox( const QImage* image );
};
}
#endif
/* kate: replace-tabs on; indent-width 4; */