sourceeditor.h

Go to the documentation of this file.
00001 //=============================================================================
00016 #ifndef __SOURCEEDITOR_H_INCLUDED__
00017 #define __SOURCEEDITOR_H_INCLUDED__
00018 
00019 #include <QtGui/QTextEdit>
00020 #include <QtGui/QSyntaxHighlighter>
00021 
00022 
00023 //=============================================================================
00024 //  CSourceEdit - text editor for GLSL source code.
00025 //=============================================================================
00026 
00034 class CSourceEdit : public QTextEdit
00035 {
00036     Q_OBJECT
00037 public:
00043     CSourceEdit( int shaderType );
00044 
00048     void loadInitialShaderSource( void );
00049 
00052     int shaderType( void ) const;
00053 
00057     void newFile( void );
00058 
00062     void open( void );
00063 
00067     bool save( void );
00068 
00071     bool saveAs( void );
00072 
00077     bool maybeSave( void );
00078 
00082     QString fileName( void ) const;
00083 
00087     void loadFile( const QString & fileName );
00088 
00089 signals:;
00093     void updateMainWindow( void );
00094 
00098     void shaderChangedCompletely( void );
00099 
00100 private slots:;
00101     void documentContentsChanged( void );
00102 
00103 private:
00104     bool saveFile( const QString & fileName );
00105     void setFileName( const QString & fileName );
00106     QString fileTypeFilter( void );
00107 
00108     // auto sizing
00109     QSize minimumSizeHint( void ) const { return QSize( 200, 100 ); }
00110     QSize        sizeHint( void ) const { return QSize( 500, 400 ); }
00111 
00112 
00113     // creates the syntax highlighter for GLSL
00114     // and assigns it to this CSourceEdit.
00115     void createSyntaxHighlighter( void );
00116     QSyntaxHighlighter* m_highlighter;
00117 
00118     int     m_shaderType;
00119     QString m_fileName; // empty string == untitled document
00120 };
00121 
00122 #endif  // __SOURCEEDITOR_H_INCLUDED__
00123 

Generated on Sun Mar 2 17:12:31 2008 for Shader Maker by  doxygen 1.5.4