00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef BOBPORT_H
00021 #define BOBPORT_H
00022
00023 #define __GEDDEI_BUILD
00024
00025 #include "processor.h"
00026 using namespace Geddei;
00027
00028 #include <qcanvas.h>
00029 #include <qptrlist.h>
00030 #include <qpoint.h>
00031 #include <qobject.h>
00032
00033 #include "refresher.h"
00034
00035 class QPainter;
00036 class QDomElement;
00037 class QDomDocument;
00038
00039 class GeddeiNite;
00040 class Bob;
00041 class BobLink;
00042
00046 class BobPort: public QObject, public QCanvasEllipse, public Refresher
00047 {
00048 Q_OBJECT
00049
00050 QPoint thePos;
00051 int theIndex;
00052 Bob *theBob;
00053 bool theIsInput;
00054 QPtrList<BobLink> theLinks;
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065 float theFill;
00066 void updateLinks();
00067 virtual void drawShape(QPainter &p);
00068
00069 Processor *processor();
00070
00071 public slots:
00072 void updateProfile();
00073
00074 public:
00075 static int RTTI;
00076 virtual int rtti() const { return 1001; }
00077
00078 int numLinks() { return theLinks.count(); }
00079
00080 bool connectYourself();
00081 void disconnectYourself();
00082 void saveYourself(QDomElement &element, QDomDocument &doc);
00083 void loadYourself(QDomElement &element);
00084
00085 void refresh();
00086 bool isInput() { return theIsInput; }
00087 void setPos(QPoint p);
00088 GeddeiNite *geddeiNite();
00089
00090 bool isSiblingOf(BobPort *p) { return p->theBob == theBob; }
00091
00092 void addLink(BobLink *link) { theLinks.append(link); }
00093 void removeLink(BobLink *link) { theLinks.remove(link); }
00094
00095 BobPort(Bob *bob, bool isInput, int index, int x = 0, int y = 0);
00096 ~BobPort();
00097 };
00098
00099 #endif