/* This file is part of moth. moth is a program for creating and editing textured 3D models. Copyright (C) 2004 Peter Uray. moth is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. moth is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with moth; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __MMAINWINDOW_H__ #define __MMAINWINDOW_H__ #include #include #include #include #include #include #include #include #include class MMainWindow : public QMainWindow { Q_OBJECT signals: // No signals. public slots: // file menu callbacks. void onProjectNew(void); void onDocumentNew(void); void onDocumentOpen(void); void onDocumentSave(void); void onDocumentSaveAs(void); void onPreferences(void); void onQuit(void); // edit menu callbacks. void onUndo(void); void onRedo(void); void onCut(void); void onCopy(void); void onPaste(void); void onToolStrength(int index); void onSelect(void); void onZoom(void); void onMove(void); void onRotate(void); void onScale(void); void onSelectVertex(void); void onCreateVertex(void); void onCreateTriangle(void); void onMoveVertex(void); void onRotateVertex(void); void onScaleVertex(void); void onMagnet(void); void onFlipEdge(void); void onSnapToMaster(void); void on3DView(void); void onXYView(void); void onYZView(void); void onZXView(void); void onQuadView(void); void onTextureView(void); // some menu callbacks. void onImport(int index); void onExport(int index); void onAbout(void); public: enum MFunction { Select=1, Zoom, Move, Rotate, Scale, SelectVertex, CreateVertex, CreateTriangle, MoveVertex, RotateVertex, ScaleVertex, Magnet, FlipEdge, SnapToMaster, Void, }; virtual ~MMainWindow(void); void setHistoryButtonState(bool undoState, bool redoState); void updateToolbar(void); MFunction getActiveFunction(void); static MMainWindow *get(void); void setPositionDisplay(QString contents); float getToolStrength(void); protected: MMainWindow(const char *caption); // map close events to the handler. void closeEvent(QCloseEvent *e) { onQuit(); } private: void setActiveFunction(MFunction function); QToolBar *_toolBar; QToolButton *_newDocumentButton; QToolButton *_openFileButton; QToolButton *_saveFileButton; QToolButton *_undoButton; QToolButton *_redoButton; QToolButton *_selectSelectButton; QToolButton *_selectZoomButton; QToolButton *_selectMoveButton; QToolButton *_selectRotateButton; QToolButton *_selectScaleButton; QToolButton *_selectMagnetButton; QToolButton *_selectSelectVertexButton; QToolButton *_selectCreateVertexButton; QToolButton *_selectCreateTriangleButton; QToolButton *_selectMoveVertexButton; QToolButton *_selectRotateVertexButton; QToolButton *_selectScaleVertexButton; QToolButton *_selectFlipEdgeButton; QToolButton *_selectSnapToMasterButton; QToolButton *_select3DViewButton; QToolButton *_selectXYViewButton; QToolButton *_selectYZViewButton; QToolButton *_selectZXViewButton; QToolButton *_selectQuadViewButton; QToolButton *_selectTextureViewButton; /// The menu bar menus. QPopupMenu *_fileMenu; QPopupMenu *_editMenu; QPopupMenu *_toolMenu; //QPopupMenu *importMenu; //QPopupMenu *exportMenu; /// The position display. QLabel *_positionDisplay; float _toolStrength; MFunction _activeFunction; static MMainWindow *_this; }; #endif