summaryrefslogtreecommitdiffstats
path: root/krita/plugins/viewplugins/histogram_docker
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /krita/plugins/viewplugins/histogram_docker
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krita/plugins/viewplugins/histogram_docker')
-rw-r--r--krita/plugins/viewplugins/histogram_docker/histogramdocker.cc38
-rw-r--r--krita/plugins/viewplugins/histogram_docker/histogramdocker.h16
-rw-r--r--krita/plugins/viewplugins/histogram_docker/kis_accumulating_producer.cc16
-rw-r--r--krita/plugins/viewplugins/histogram_docker/kis_accumulating_producer.h15
-rw-r--r--krita/plugins/viewplugins/histogram_docker/kis_cachedhistogram.h4
-rw-r--r--krita/plugins/viewplugins/histogram_docker/kis_imagerasteredcache.cc22
-rw-r--r--krita/plugins/viewplugins/histogram_docker/kis_imagerasteredcache.h21
7 files changed, 68 insertions, 64 deletions
diff --git a/krita/plugins/viewplugins/histogram_docker/histogramdocker.cc b/krita/plugins/viewplugins/histogram_docker/histogramdocker.cc
index 93d77bfb..2b458de4 100644
--- a/krita/plugins/viewplugins/histogram_docker/histogramdocker.cc
+++ b/krita/plugins/viewplugins/histogram_docker/histogramdocker.cc
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <qtooltip.h>
+#include <tqtooltip.h>
#include <klocale.h>
#include <kiconloader.h>
@@ -46,12 +46,12 @@
typedef KGenericFactory<KritaHistogramDocker> KritaHistogramDockerFactory;
K_EXPORT_COMPONENT_FACTORY( kritahistogramdocker, KritaHistogramDockerFactory( "krita" ) )
-KritaHistogramDocker::KritaHistogramDocker(QObject *parent, const char *name, const QStringList&)
- : KParts::Plugin(parent, name)
+KritaHistogramDocker::KritaHistogramDocker(TQObject *tqparent, const char *name, const TQStringList&)
+ : KParts::Plugin(tqparent, name)
{
- if ( parent->inherits("KisView") ) {
- m_view = dynamic_cast<KisView*>(parent);
+ if ( tqparent->inherits("KisView") ) {
+ m_view = dynamic_cast<KisView*>(tqparent);
setInstance(KritaHistogramDockerFactory::instance());
setXMLFile(locate("data","kritaplugins/kritahistogramdocker.rc"), true);
@@ -68,7 +68,7 @@ KritaHistogramDocker::KritaHistogramDocker(QObject *parent, const char *name, co
m_hview = new KisHistogramView(m_view);
- QToolTip::add(m_hview, i18n("Right-click to select histogram type"));
+ TQToolTip::add(m_hview, i18n("Right-click to select histogram type"));
m_hview->setHistogram(m_histogram);
m_hview->setColor(true);
m_hview->setCurrentChannels(m_producer, m_producer->channels());
@@ -76,14 +76,14 @@ KritaHistogramDocker::KritaHistogramDocker(QObject *parent, const char *name, co
m_hview->setCaption(i18n("Histogram"));
- connect(m_hview, SIGNAL(rightClicked(const QPoint&)),
- this, SLOT(popupMenu(const QPoint&)));
- connect(m_cache, SIGNAL(cacheUpdated()),
- new HistogramDockerUpdater(this, m_histogram, m_hview, m_producer), SLOT(updated()));
- connect(&m_popup, SIGNAL(activated(int)),
- this, SLOT(producerChanged(int)));
- connect(img, SIGNAL(sigColorSpaceChanged(KisColorSpace*)),
- this, SLOT(colorSpaceChanged(KisColorSpace*))); // No need to force updates here
+ connect(m_hview, TQT_SIGNAL(rightClicked(const TQPoint&)),
+ this, TQT_SLOT(popupMenu(const TQPoint&)));
+ connect(m_cache, TQT_SIGNAL(cacheUpdated()),
+ new HistogramDockerUpdater(this, m_histogram, m_hview, m_producer), TQT_SLOT(updated()));
+ connect(&m_popup, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(producerChanged(int)));
+ connect(img, TQT_SIGNAL(sigColorSpaceChanged(KisColorSpace*)),
+ this, TQT_SLOT(colorSpaceChanged(KisColorSpace*))); // No need to force updates here
// Add it to the control palette
m_view->canvasSubject()->paletteManager()->addWidget(
@@ -143,12 +143,12 @@ void KritaHistogramDocker::producerChanged(int pos)
m_hview->setColor(true);
m_hview->setCurrentChannels(m_producer, m_producer->channels());
- connect(m_cache, SIGNAL(cacheUpdated()),
- new HistogramDockerUpdater(this, m_histogram, m_hview, m_producer), SLOT(updated()));
+ connect(m_cache, TQT_SIGNAL(cacheUpdated()),
+ new HistogramDockerUpdater(this, m_histogram, m_hview, m_producer), TQT_SLOT(updated()));
}
}
-void KritaHistogramDocker::popupMenu(const QPoint& pos)
+void KritaHistogramDocker::popupMenu(const TQPoint& pos)
{
m_popup.popup(pos, m_currentProducerPos);
}
@@ -171,11 +171,11 @@ void KritaHistogramDocker::colorSpaceChanged(KisColorSpace* cs)
producerChanged(0);
}
-HistogramDockerUpdater::HistogramDockerUpdater(QObject* /*parent*/, KisHistogramSP h, KisHistogramView* v,
+HistogramDockerUpdater::HistogramDockerUpdater(TQObject* /*tqparent*/, KisHistogramSP h, KisHistogramView* v,
KisAccumulatingHistogramProducer* p)
: m_histogram(h), m_view(v), m_producer(p)
{
- connect(p, SIGNAL(completed()), this, SLOT(completed()));
+ connect(p, TQT_SIGNAL(completed()), this, TQT_SLOT(completed()));
}
void HistogramDockerUpdater::updated() {
diff --git a/krita/plugins/viewplugins/histogram_docker/histogramdocker.h b/krita/plugins/viewplugins/histogram_docker/histogramdocker.h
index 5cc57e18..bc023a89 100644
--- a/krita/plugins/viewplugins/histogram_docker/histogramdocker.h
+++ b/krita/plugins/viewplugins/histogram_docker/histogramdocker.h
@@ -21,8 +21,8 @@
#ifndef _HISTOGRAMDOCKER_H_
#define _HISTOGRAMDOCKER_H_
-#include <qobject.h>
-#include <qpopupmenu.h>
+#include <tqobject.h>
+#include <tqpopupmenu.h>
#include <kparts/plugin.h>
#include <kis_histogram_view.h>
@@ -39,12 +39,13 @@ class KisColorSpace;
class KritaHistogramDocker : public KParts::Plugin
{
Q_OBJECT
+ TQ_OBJECT
public:
- KritaHistogramDocker(QObject *parent, const char *name, const QStringList &);
+ KritaHistogramDocker(TQObject *tqparent, const char *name, const TQStringList &);
virtual ~KritaHistogramDocker();
private slots:
void producerChanged(int pos);
- void popupMenu(const QPoint & pos);
+ void popupMenu(const TQPoint & pos);
void colorSpaceChanged(KisColorSpace* cs);
private:
KisHistogramProducerFactory* m_factory;
@@ -54,17 +55,18 @@ private:
KisView* m_view;
KisHistogramView* m_hview;
KisImageRasteredCache* m_cache;
- QPopupMenu m_popup;
+ TQPopupMenu m_popup;
KisHistogramSP m_histogram;
uint m_currentProducerPos;
};
class KisGenericRGBHistogramProducerFactory;
-class HistogramDockerUpdater : public QObject {
+class HistogramDockerUpdater : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
- HistogramDockerUpdater(QObject* parent, KisHistogramSP h, KisHistogramView* v,
+ HistogramDockerUpdater(TQObject* tqparent, KisHistogramSP h, KisHistogramView* v,
KisAccumulatingHistogramProducer* p);
public slots:
void updated();
diff --git a/krita/plugins/viewplugins/histogram_docker/kis_accumulating_producer.cc b/krita/plugins/viewplugins/histogram_docker/kis_accumulating_producer.cc
index f899f2af..dd315549 100644
--- a/krita/plugins/viewplugins/histogram_docker/kis_accumulating_producer.cc
+++ b/krita/plugins/viewplugins/histogram_docker/kis_accumulating_producer.cc
@@ -18,20 +18,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <qthread.h>
-#include <qapplication.h>
-#include <qevent.h>
+#include <tqthread.h>
+#include <tqapplication.h>
+#include <tqevent.h>
#include "kis_accumulating_producer.h"
-static const int EmitCompletedType = QEvent::User + 1;
+static const int EmitCompletedType = TQEvent::User + 1;
/**
* The threaded producer definition in c++ file because this is really an internal affair.
* Note that since we _know_ that we'll only have a single instance of it running, at most,
* we don't care too much about locking and synchronization
**/
-class KisAccumulatingHistogramProducer::ThreadedProducer : public QThread {
+class KisAccumulatingHistogramProducer::ThreadedProducer : public TQThread {
KisAccumulatingHistogramProducer* m_source;
bool m_stop;
protected:
@@ -71,7 +71,7 @@ void KisAccumulatingHistogramProducer::ThreadedProducer::run() {
uint count = m_source->m_source->count(); // Talk about bad naming schemes...
KisCachedHistogramObserver::Producers* source = m_source->m_source;
- QValueVector<vBins>& bins = m_source->m_bins;
+ TQValueVector<vBins>& bins = m_source->m_bins;
int channels = m_source->m_channels;
int nrOfBins = m_source->m_nrOfBins;
@@ -88,11 +88,11 @@ void KisAccumulatingHistogramProducer::ThreadedProducer::run() {
if (!m_stop) {
// This function is thread-safe; and it takes ownership of the event
- QApplication::postEvent(m_source, new QCustomEvent(EmitCompletedType));
+ TQApplication::postEvent(m_source, new TQCustomEvent(EmitCompletedType));
}
}
-void KisAccumulatingHistogramProducer::customEvent(QCustomEvent* e) {
+void KisAccumulatingHistogramProducer::customEvent(TQCustomEvent* e) {
if (e->type() == EmitCompletedType) {
emit completed();
}
diff --git a/krita/plugins/viewplugins/histogram_docker/kis_accumulating_producer.h b/krita/plugins/viewplugins/histogram_docker/kis_accumulating_producer.h
index 4ef9f02a..46a0717d 100644
--- a/krita/plugins/viewplugins/histogram_docker/kis_accumulating_producer.h
+++ b/krita/plugins/viewplugins/histogram_docker/kis_accumulating_producer.h
@@ -21,7 +21,7 @@
#ifndef _KIS_ACCUMULATING_PRODUCER_H_
#define _KIS_ACCUMULATING_PRODUCER_H_
-#include <qobject.h>
+#include <tqobject.h>
#include <kis_basic_histogram_producers.h>
#include "kis_cachedhistogram.h"
@@ -34,23 +34,24 @@
* of HistogramProducers if you'd take addRegionsToBinAsync = addRegionToBin, but since that is
* already violated with the asynchronousity of it that is not really an issue anymore, I think)
**/
-class KisAccumulatingHistogramProducer : public QObject, public KisBasicHistogramProducer {
+class KisAccumulatingHistogramProducer : public TQObject, public KisBasicHistogramProducer {
Q_OBJECT
+ TQ_OBJECT
public:
KisAccumulatingHistogramProducer(KisCachedHistogramObserver::Producers* source);
~KisAccumulatingHistogramProducer();
/// Does _nothing_, use addRegionsToBinAsync
- virtual void addRegionToBin(Q_UINT8 *, Q_UINT8*, Q_UINT32, KisColorSpace *) {}
+ virtual void addRegionToBin(TQ_UINT8 *, TQ_UINT8*, TQ_UINT32, KisColorSpace *) {}
virtual void addRegionsToBinAsync();
- virtual QString positionToString(double pos) const
+ virtual TQString positionToString(double pos) const
{ return m_source->at(0)->positionToString(pos); }
virtual void setView(double, double) {} // No view support
virtual double maximalZoom() const { return 1.0; }
- virtual Q_INT32 numberOfBins() { return m_source->at(0)->numberOfBins(); }
+ virtual TQ_INT32 numberOfBins() { return m_source->at(0)->numberOfBins(); }
- virtual QValueVector<KisChannelInfo *> channels() { return m_source->at(0)->channels(); }
+ virtual TQValueVector<KisChannelInfo *> channels() { return m_source->at(0)->channels(); }
/// Call this when the 'source' list has changed colorspace
virtual void changedSourceProducer() {
@@ -63,7 +64,7 @@ signals:
void completed();
protected:
- virtual void customEvent(QCustomEvent* e);
+ virtual void customEvent(TQCustomEvent* e);
/// source already converts external to internal
virtual int externalToInternal(int ext) { return ext; }
KisCachedHistogramObserver::Producers* m_source;
diff --git a/krita/plugins/viewplugins/histogram_docker/kis_cachedhistogram.h b/krita/plugins/viewplugins/histogram_docker/kis_cachedhistogram.h
index dfe7a05e..a9b38a4a 100644
--- a/krita/plugins/viewplugins/histogram_docker/kis_cachedhistogram.h
+++ b/krita/plugins/viewplugins/histogram_docker/kis_cachedhistogram.h
@@ -21,14 +21,14 @@
#ifndef _CACHED_HISTOGRAM_H_
#define _CACHED_HISTOGRAM_H_
-#include <qvaluevector.h>
+#include <tqvaluevector.h>
#include <kis_histogram_producer.h>
#include "kis_imagerasteredcache.h"
class KisCachedHistogramObserver : public KisImageRasteredCache::Observer {
public:
- typedef QValueVector<KisHistogramProducer*> Producers;
+ typedef TQValueVector<KisHistogramProducer*> Producers;
KisCachedHistogramObserver(Producers* p, KisHistogramProducerFactory* f,
int x, int y, int w, int h, bool add = true)
: m_producers(p), m_factory(f), m_x(x), m_y(y), m_w(w), m_h(h)
diff --git a/krita/plugins/viewplugins/histogram_docker/kis_imagerasteredcache.cc b/krita/plugins/viewplugins/histogram_docker/kis_imagerasteredcache.cc
index 2c6562df..19599cd9 100644
--- a/krita/plugins/viewplugins/histogram_docker/kis_imagerasteredcache.cc
+++ b/krita/plugins/viewplugins/histogram_docker/kis_imagerasteredcache.cc
@@ -20,7 +20,7 @@
#include <cmath>
-#include <qapplication.h>
+#include <tqapplication.h>
#include <kdebug.h>
@@ -47,21 +47,21 @@ KisImageRasteredCache::KisImageRasteredCache(KisView* view, Observer* o)
imageSizeChanged(img->width(), img->height());
- connect(img, SIGNAL(sigImageUpdated(QRect)),
- this, SLOT(imageUpdated(QRect)));
- connect(img, SIGNAL(sigSizeChanged(Q_INT32, Q_INT32)),
- this, SLOT(imageSizeChanged(Q_INT32, Q_INT32)));
- connect(&m_timer, SIGNAL(timeout()), this, SLOT(timeOut()));
+ connect(img, TQT_SIGNAL(sigImageUpdated(TQRect)),
+ this, TQT_SLOT(imageUpdated(TQRect)));
+ connect(img, TQT_SIGNAL(sigSizeChanged(TQ_INT32, TQ_INT32)),
+ this, TQT_SLOT(imageSizeChanged(TQ_INT32, TQ_INT32)));
+ connect(&m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timeOut()));
}
KisImageRasteredCache::~KisImageRasteredCache() {
cleanUpElements();
}
-void KisImageRasteredCache::imageUpdated(QRect rc) {
+void KisImageRasteredCache::imageUpdated(TQRect rc) {
if (rc.isValid()) {
- QRect r(0, 0, m_width * m_rasterSize, m_height * m_rasterSize);
+ TQRect r(0, 0, m_width * m_rasterSize, m_height * m_rasterSize);
r &= rc;
uint x = static_cast<int>(r.x() / m_rasterSize);
@@ -93,7 +93,7 @@ void KisImageRasteredCache::imageUpdated(QRect rc) {
}
}
-void KisImageRasteredCache::imageSizeChanged(Q_INT32 w, Q_INT32 h) {
+void KisImageRasteredCache::imageSizeChanged(TQ_INT32 w, TQ_INT32 h) {
KisImageSP image = m_view->canvasSubject()->currentImg();
@@ -120,7 +120,7 @@ void KisImageRasteredCache::imageSizeChanged(Q_INT32 w, Q_INT32 h) {
rasterX++;
}
- imageUpdated(QRect(0,0, image->width(), image->height()));
+ imageUpdated(TQRect(0,0, image->width(), image->height()));
}
void KisImageRasteredCache::timeOut() {
@@ -140,7 +140,7 @@ void KisImageRasteredCache::timeOut() {
// If there are still elements, we need to be called again (this emulates processEvents)
if (!m_queue.isEmpty()) {
- QTimer::singleShot(0, this, SLOT(timeOut()));
+ TQTimer::singleShot(0, this, TQT_SLOT(timeOut()));
} else {
emit cacheUpdated();
m_imageProjection = 0;
diff --git a/krita/plugins/viewplugins/histogram_docker/kis_imagerasteredcache.h b/krita/plugins/viewplugins/histogram_docker/kis_imagerasteredcache.h
index 6335eadb..7df7df8f 100644
--- a/krita/plugins/viewplugins/histogram_docker/kis_imagerasteredcache.h
+++ b/krita/plugins/viewplugins/histogram_docker/kis_imagerasteredcache.h
@@ -21,17 +21,18 @@
#ifndef _KIS_IMAGE_RASTERED_CACHE_H_
#define _KIS_IMAGE_RASTERED_CACHE_H_
-#include <qobject.h>
-#include <qvaluevector.h>
-#include <qvaluelist.h>
-#include <qtimer.h>
+#include <tqobject.h>
+#include <tqvaluevector.h>
+#include <tqvaluelist.h>
+#include <tqtimer.h>
#include <kis_paint_device.h>
class KisView;
-class KisImageRasteredCache : public QObject {
+class KisImageRasteredCache : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
class Observer {
@@ -48,8 +49,8 @@ signals:
void cacheUpdated();
private slots:
- void imageUpdated(QRect rc);
- void imageSizeChanged(Q_INT32 w, Q_INT32 h);
+ void imageUpdated(TQRect rc);
+ void imageSizeChanged(TQ_INT32 w, TQ_INT32 h);
void timeOut();
private:
@@ -59,15 +60,15 @@ private:
Observer* observer;
bool valid;
};
- typedef QValueVector< QValueVector<Element*> > Raster;
- typedef QValueList<Element*> Queue;
+ typedef TQValueVector< TQValueVector<Element*> > Raster;
+ typedef TQValueList<Element*> Queue;
void cleanUpElements();
Observer* m_observer;
Raster m_raster;
Queue m_queue;
- QTimer m_timer;
+ TQTimer m_timer;
int m_timeOutMSec;
int m_rasterSize;
int m_width, m_height;