geddeinite.h

00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Gav Wood                                        *
00003  *   gav@cs.york.ac.uk                                                     *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #ifndef GEDDEINITE_H
00022 #define GEDDEINITE_H
00023 
00024 #define __GEDDEI_BUILD
00025 
00026 #include "processorgroup.h"
00027 using namespace Geddei;
00028 
00029 #include <qvaluelist.h>
00030 #include <qptrlist.h>
00031 #include <qpoint.h>
00032 
00033 #include "geddeinitebase.h"
00034 
00035 class QDockWindow;
00036 class QTable;
00037 class QCanvas;
00038 class QCanvasItem;
00039 
00040 class BobsView;
00041 class Bob;
00042 class WatchProcessor;
00043 class ProcessorView;
00044 
00048 class GeddeiNite: public GeddeiNiteBase
00049 {
00050  Q_OBJECT
00051 
00052  QString theFilename;
00053 
00054  QPrinter *printer;
00055  QString filename;
00056  QCanvas *theCanvas;
00057  QCanvasItem *theActive;
00058  QDockWindow *theDockSelector, *theDockProperties;
00059  QTable *theProperties;
00060  ProcessorView *theSelector;
00061  WatchProcessor *theWatch;
00062  QPtrList<Bob> theBobs;
00063  ProcessorGroup theGroup;
00064  bool theRunning, theTested, theConnected, theIgnoreNext, theModified;
00065  int theDefaultBufferSize;
00066 
00067  void updateItems();
00068  void doSave(const QString &filename);
00069  void doLoad(const QString &filename);
00070  const bool connectAll();
00071  void disconnectAll();
00072 
00073  virtual void updateProperties();
00074  virtual void editRemove();
00075 
00076 private slots:
00077  void slotPropertyChanged(int row, int column);
00078  void slotRunToggled(bool testing);
00079  void fileOpen();
00080  void fileSave();
00081  void fileSaveAs();
00082  void filePrint();
00083  void slotDeployPlayer();
00084  void slotTest();
00085 
00086 protected:
00087  void closeEvent(QCloseEvent *);
00088 
00089 public:
00090  const QString makeUniqueName(const QString &type);
00091  void setActive(QCanvasItem *item = NULL);
00092  void setModified(bool modified = true);
00093 
00094  const int defaultBufferSize() const { return theDefaultBufferSize; }
00095  const bool tested() const { return theTested; }
00096  const bool connected() const { return theConnected; }
00097 
00098  ProcessorGroup &group() { return theGroup; }
00099  WatchProcessor *watch() { return theWatch; }
00100 
00101  const bool bobCollision(Bob *b);
00102  void addBob(Bob *b);
00103  void removeBob(Bob *b);
00104  Bob *getBob(const QString &name);
00105 
00106  GeddeiNite();
00107  ~GeddeiNite();
00108 };
00109 
00110 #endif

Generated on Thu Jul 13 06:56:33 2006 for Exscalibar by  doxygen 1.4.7