From 593b2f111fce68f8a33016ed5dc5fa6e141ccb18 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Thu, 2 Apr 2009 05:42:52 +0000 Subject: [PATCH] pull render thread into the library so it can be share svn path=/trunk/KDE/kdelibs/; revision=948058 --- private/wallpaperrenderthread_p.h | 56 +++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 private/wallpaperrenderthread_p.h diff --git a/private/wallpaperrenderthread_p.h b/private/wallpaperrenderthread_p.h new file mode 100644 index 000000000..607761450 --- /dev/null +++ b/private/wallpaperrenderthread_p.h @@ -0,0 +1,56 @@ +/* + Copyright (c) 2007 Paolo Capriotti + + 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 RENDERTHREAD_H +#define RENDERTHREAD_H + +#include "backgroundpackage.h" +#include +#include +#include +#include +#include + +class RenderThread : public QThread +{ +Q_OBJECT +public: + RenderThread(); + virtual ~RenderThread(); + + int render(const QString &file, + const QColor &color, + Background::ResizeMethod method); + + void setSize(const QSize &size); + void setRatio(float ratio); + +protected: + virtual void run(); + +private: + QMutex m_mutex; // to protect parameters + QWaitCondition m_condition; + + // protected by mutex + int m_current_token; + QString m_file; + QColor m_color; + QSize m_size; + float m_ratio; + Background::ResizeMethod m_method; + + bool m_abort; + bool m_restart; + +signals: + void done(int token, const QImage &pixmap); +}; + +#endif // RENDERTHREAD_H