2017-11-23 20:33:49 +01:00
|
|
|
#ifndef UTILS_HPP
|
|
|
|
#define UTILS_HPP
|
2017-04-23 15:05:48 +02:00
|
|
|
|
2017-07-01 17:24:03 +02:00
|
|
|
#include <QApplication>
|
2017-11-23 20:33:49 +01:00
|
|
|
#include <QPixmap>
|
2017-12-06 14:08:49 +01:00
|
|
|
#include <QScreen>
|
2017-12-17 19:59:16 +01:00
|
|
|
#include <QWidget>
|
|
|
|
#include <functional>
|
2017-04-23 15:05:48 +02:00
|
|
|
|
2017-11-23 20:33:49 +01:00
|
|
|
namespace utils {
|
|
|
|
QColor invertColor(QColor color);
|
|
|
|
QPixmap extend(QPixmap pixmap, int extraSize = 25, QColor hl = Qt::transparent);
|
2017-10-05 19:21:52 +02:00
|
|
|
QPixmap fullscreen(bool cursor = true);
|
|
|
|
QPixmap fullscreenArea(bool cursor = true, qreal x = 0, qreal y = 0, qreal w = -1, qreal h = -1);
|
|
|
|
QPixmap window(WId wid, QScreen *w = QApplication::primaryScreen());
|
|
|
|
void toClipboard(QString value);
|
|
|
|
QPoint smallestScreenCoordinate();
|
|
|
|
QPixmap
|
|
|
|
renderText(QString toRender, int padding = 5, QColor background = Qt::transparent, QColor pen = Qt::white, QFont font = QFont());
|
2017-12-17 19:59:16 +01:00
|
|
|
void externalScreenshot(std::function<void(QPixmap)> callback);
|
|
|
|
void externalScreenshotActive(std::function<void(QPixmap)> callback);
|
|
|
|
QString randomString(int length);
|
2018-02-18 02:35:29 +01:00
|
|
|
} // namespace utils
|
2017-04-23 15:05:48 +02:00
|
|
|
|
2017-11-23 20:33:49 +01:00
|
|
|
#endif // UTILS_HPP
|