21 #include <boost/any.hpp>
23 #include <QMainWindow>
29 #include "hurricane/Commons.h"
30 #include "hurricane/Observer.h"
31 #include "hurricane/Name.h"
32 #include "hurricane/Occurrence.h"
33 #include "hurricane/viewer/MoveCommand.h"
34 #include "hurricane/viewer/ZoomCommand.h"
35 #include "hurricane/viewer/RulerCommand.h"
36 #include "hurricane/viewer/SelectCommand.h"
37 #include "hurricane/viewer/HierarchyCommand.h"
38 #include "hurricane/viewer/CellWidget.h"
47 class MousePositionWidget;
48 class ControllerWidget;
77 enum { CellHistorySize = 10 };
78 enum Flag { InCellChange = 0x0001 };
79 enum FunctionFlag { NoFlags = 0x0000
82 typedef std::map< const QString, boost::any > ActionLut;
83 typedef bool (QWidget::* SlotMethod)();
85 static void notify (
CellViewer*,
unsigned int flags );
90 QMenu* createDebugMenu ();
91 bool hasMenu (
const QString& path )
const;
92 bool hasMenuAction (
const QString& path )
const;
93 QAction* getMenuAction (
const QString& path )
const;
94 QAction* addMenu (
const QString& path
96 ,
unsigned int flags=NoFlags
98 bool addToMenu (
const QString& path
99 , QString beforePath=
"" );
100 QAction* addToMenu (
const QString& path
102 , std::string textTip
103 , std::function<
void() >
105 , QString beforePath=
"" );
106 QAction* addToMenu (
const QString& path
108 , std::string textTip
109 , std::string scriptPath
110 , QString beforePath=
"" );
111 QAction* addToMenu ( QString path
114 ,
const QKeySequence& shortCut
115 , QIcon icon =QIcon()
116 , QString beforePath=
"" );
119 inline void setDbuMode (
int );
120 inline Observer<CellViewer>* getCellObserver ();
133 void reframe (
const Box& ,
bool historyEnable=
true );
134 void runScript ( QString scriptPath );
136 virtual std::string _getString ()
const;
140 void changeSelectionMode ();
141 void setShowSelection (
bool );
142 void setCumulativeSelection (
bool );
143 void setState ( shared_ptr<CellWidget::State>& );
144 void removeHistory (
Cell* );
145 void openHistoryCell ();
146 void openDesignBlob ();
147 void saveDesignBlob ();
148 void printDisplay ();
149 void print ( QPrinter* );
150 void imageDisplay ();
151 void raiseToolInterrupt ();
152 void clearToolInterrupt ();
153 void runScriptWidget ();
154 void runStressScript ();
155 inline void emitCellAboutToChange ();
156 inline void emitCellChanged ();
157 inline void emitCellPreModificated ();
158 inline void emitCellPostModificated ();
160 void cellLoadedFromDisk (
Cell* );
161 void showSelectionToggled (
bool );
162 void stateChanged ( shared_ptr<CellWidget::State>& );
163 void redrawCellWidget ();
164 void cellPreModificated ();
165 void cellPostModificated ();
168 void refreshTitle ();
169 void refreshHistory ();
170 void rebuildHistory ();
172 QString _getAbsWidgetPath (
const QString& relPath )
const;
173 QAction* _getParentMenu (
const QString& )
const;
174 void _runScript ( QString scriptPath );
177 static QString _prefixWPath;
178 Observer<CellViewer> _cellObserver;
179 QString _applicationName;
180 QAction* _openAction;
181 QAction* _cellHistoryAction[CellHistorySize];
182 QAction* _showSelectionAction;
184 ActionLut _actionCallbacks;
186 MousePositionWidget* _mousePosition;
187 ControllerWidget* _controller;
188 ScriptWidget* _script;
191 MoveCommand _moveCommand;
192 ZoomCommand _zoomCommand;
193 RulerCommand _rulerCommand;
194 SelectCommand _selectCommand;
195 HierarchyCommand _hierarchyCommand;
196 list< shared_ptr<CellWidget::State> >
201 UpdateState _updateState;
202 QString _pyScriptName;
208 inline Observer<CellViewer>* CellViewer::getCellObserver () {
return &_cellObserver; }
214 inline void CellViewer::emitCellAboutToChange () { _flags |= InCellChange; emit cellPreModificated(); }
215 inline void CellViewer::emitCellChanged () { _flags &= ~InCellChange; emit cellPostModificated(); }
216 inline void CellViewer::emitCellPreModificated () { emit cellPreModificated(); }
217 inline void CellViewer::emitCellPostModificated () { emit cellPostModificated(); }
220 { _cellWidget->setEnableRedrawInterrupt(state); }
222 inline void CellViewer::setDbuMode (
int mode )
223 { _cellWidget->setDbuMode(mode); }
A simple top level window embedding the CellWidget.
Definition: CellViewer.h:73
virtual Cell * getCellFromDb(const char *)
ControllerWidget * getControllerWidget()
Definition: CellViewer.h:211
CellWidget * getCellWidget()
Definition: CellViewer.h:209
void setEnableRedrawInterrupt(bool)
Definition: CellViewer.h:219
void unselect(Occurrence &)
virtual void setCell(Cell *)
void setAnonNetSelectable(bool)
CellViewer(QWidget *parent=NULL)
void setApplicationName(const QString &)
Definition: CellViewer.h:212
void select(Occurrence &)
bool isToolInterrupted() const
Definition: CellViewer.h:207
void renameCell(const char *)
void setLayerVisible(const Name &layer, bool visible)
Definition: CellViewer.h:213