aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/coreview/alu.h
blob: 4c9a73bbb874df8c25a817099367689f54a20f5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef COREVIEW_ALU_H
#define COREVIEW_ALU_H

#include <QGraphicsObject>
#include <qtmipsmachine.h>
#include "../coreview.h"
#include "connection.h"

namespace coreview {

class Alu : public QGraphicsObject {
public:
    Alu();

    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);

    void setPos(qreal x, qreal y);
    const Connector *connector_in_a() const;
    const Connector *connector_in_b() const;
    const Connector *connector_out() const;
    const Connector *connector_ctl() const;

private:
    QGraphicsSimpleTextItem name;
    Connector *con_in_a, *con_in_b, *con_out, *con_ctl;
};

}

#else

namespace coreview {
    class Alu;
}

#endif // COREVIEW_ALU_H