RenderThread.h

Go to the documentation of this file.
00001 /**<!-------------------------------------------------------------------->
00002    @class  RenderThread
00003    @author Travis Fischer (fisch0920@gmail.com)
00004    @author Matthew Jacobs (jacobs.mh@gmail.com)
00005    @date   Fall 2008
00006    
00007    @brief
00008       Intermediary for communicating/blocking between Gui and non-Gui threads 
00009    in Qt
00010    <!-------------------------------------------------------------------->**/
00011 
00012 #ifndef RENDER_THREAD_H_
00013 #define RENDER_THREAD_H_
00014 
00015 #include <QThread>
00016 #include <common/common.h>
00017 
00018 class Renderer;
00019 class ImageCanvas;
00020 
00021 class RenderThread : public QThread {
00022    
00023    public:
00024       RenderThread(Renderer *renderer);
00025       virtual ~RenderThread();
00026       
00027    protected:
00028       virtual void run();
00029       
00030    protected:
00031       Renderer *m_renderer;
00032 };
00033 
00034 // this class acts as a signal emitter in the current thread
00035 // its intended to be created, used once, then destroyed
00036 class LocalSyscallProxy : public QObject {
00037    Q_OBJECT
00038    
00039    public:
00040       LocalSyscallProxy(ImageCanvas *canvas, QObject *mainProxy = NULL);
00041       void repaint(int x1, int y1, int w, int h);
00042       void connectTo(QObject *mainProxy);
00043       
00044    signals:
00045       void sig_repaint(void*, int x1, int y1, int w, int h);
00046       
00047    private:
00048       ImageCanvas *m_canvas;
00049 };
00050 
00051 // all instances of this class will push themselves into the main thread
00052 class MainSyscallProxy : public QObject {
00053    Q_OBJECT
00054    
00055    public:
00056       MainSyscallProxy();
00057       
00058    public slots:
00059       void slot_repaint(void *target, int x1, int y1, int w, int h);
00060 };
00061 
00062 #endif
00063 

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6