AsmInstructionsBar.h

Go to the documentation of this file.
00001 
00002 #ifndef ASM_INSTRUCTION_BAR
00003 #define ASM_INSTRUCTION_BAR
00004 
00005 #include <vector>
00006 #include <QList>
00007 #include <QVector>
00008 #include <QGraphicsView>
00009 #include <QGraphicsScene>
00010 
00011 class SgNode;
00012 class QMouseEvent;
00013 class QWheelEvent;
00014 class QGraphicsRectItem;
00015 class QGraphicsPolygonItem;
00016 
00017 
00023 class AsmInstructionsBar
00024    : public QGraphicsView
00025 {
00026    Q_OBJECT
00027 
00028    public:
00029       AsmInstructionsBar( QWidget *parent = NULL );
00030       virtual ~AsmInstructionsBar();
00031 
00032       int getNumberOfBlocks();
00033 
00034    public slots:
00035       //slots to set new nodes:
00036 
00041       void setRoot( SgNode *node );
00042 
00044       void setNode( SgNode *node );
00045 
00048       void setNode( int id );
00049 
00050    signals:
00052       void nodeActivated( SgNode *node );
00053       void nodeActivatedAlt( SgNode *node );
00056       void clicked( int id );
00057 
00058    protected:
00059 
00060       void setIndicator( );
00061 
00062       //virtual void resizeEvent(QResizeEvent *ev);
00063       virtual void mousePressEvent( QMouseEvent *e );
00064       virtual void mouseReleaseEvent( QMouseEvent *e );
00065       virtual void mouseMoveEvent( QMouseEvent *e );
00066       virtual void wheelEvent( QWheelEvent *e );
00067       virtual void dropEvent( QDropEvent * ev);
00068       virtual void dragMoveEvent( QDragMoveEvent * ev);
00069       virtual void dragEnterEvent( QDragEnterEvent * ev);
00070 
00071       QGraphicsScene scene;
00072 
00073       QVector<QGraphicsRectItem *> blockList;
00074       QGraphicsPolygonItem *indicatorBottom;
00075       QGraphicsRectItem    *indicatorMiddle;
00076       QGraphicsPolygonItem *indicatorTop;
00077 
00078       QGraphicsRectItem *currentBlock;
00079    
00080    private:
00081       void updatePosition( const QPoint& pos );
00082 
00083       SgNode *root;
00084 
00085       const uint64_t base_width;
00086       const float    height;
00087 
00088       bool pressed;
00089 };
00090 
00091 #endif

Generated on Tue Sep 15 14:48:47 2009 for RoseQtWidgets by  doxygen 1.4.7