+#ifndef _VLP_EDITOR_H
+#define _VLP_EDITOR_H
-#ifndef QWERTY_H
-#define QWERTY_H
+#include <QtGui/QTextEdit>
+#include <QtGui/QMainWindow>
+#include <QtGui/QLineEdit>
+#include <QtGui/QPushButton>
+#include <QtGui/QLabel>
-#include <qwidget.h>
-#include <qmenubar.h>
-#include <qmlined.h>
-#include <qlist.h>
-#include <qstrlist.h>
-#include <qframe.h>
-#include <qmlined.h>
-#include <qlined.h>
-#include <qpushbt.h>
-#include <qcombo.h>
-#include <qlabel.h>
+#include "ui/editor.h"
+/**
+ * @file
+ */
+
+namespace loglan {
+namespace vlp {
#define COMP_MODE 1
#define GEN_MODE 2
#define ALL_MODE 3
-
-
-typedef struct
-{
- char name[255],filename[255];
+typedef struct {
+ char name[255];
+ char filename[255];
} FuncEntry;
-typedef struct
-{
- QList<FuncEntry> dictionary;
- QStrList names;
- char name[255];
+typedef struct {
+ QList<FuncEntry> dictionary;
+ QStringList names;
+ char name[255];
} CategoryEntry;
+class Editor : public QMainWindow, private Ui::EditorWindow {
+ Q_OBJECT
+public:
+ QString compiler_path;
+ QString gen_path;
+ QString file_path;
+ Editor(int argc, char **argv);
+ ~Editor();
+ void compile(int mode);
-class My_Edit:public QMultiLineEdit
-{
-Q_OBJECT
-public:
- My_Edit(QWidget *parent=0,const char *name=0);
- virtual void keyPressEvent(QKeyEvent *ev);
-signals:
- void cursorMove();
-};
-
-class Editor : public QWidget
-{
- Q_OBJECT
public:
- QString compiler_path;
- QString gen_path;
- QString file_path;
-
- Editor(char *hdir=0, QWidget *parent=0, const char *name=0);
- ~Editor();
-
- void compile(int mode);
-
-public slots:
- void load();
- void load( const char *fileName );
- void save();
- void save( const char *fileName );
- void save_as();
- void create();
- void props();
- void print();
- void cmp();
- void gen();
- void comp_all();
-
- void log_unit();
- void log_prog();
-
- void findText();
- void find_next();
-// void gotoline();
- void updateline();
-
-protected:
- void resizeEvent( QResizeEvent * );
- virtual void closeEvent ( QCloseEvent * e );
-
+ void load(const char *fileName);
+ void save(const char *fileName);
private:
- QMenuBar *m;
- My_Edit *e;
- QMultiLineEdit *msg;
- QLabel *position;
- QString fname;
- char find_text[256];
- bool sensitive;
- char HomeDir[255];
-
+ QString fname;
+ QString find_text;
+ bool sensitive;
+ char HomeDir[255];
+
+private slots:
+ void on_actionNew_triggered();
+ void on_actionOpen_triggered();
+ void on_actionSave_triggered();
+ void on_actionSave_as_triggered();
+ void on_actionQuit_triggered();
+ void on_actionCopy_triggered();
+ void on_actionPaste_triggered();
+ void on_actionCut_triggered();
+ void on_actionClear_all_triggered();
+ void on_actionFind_triggered();
+ void on_actionFind_Next_triggered();
+ void on_actionPreferences_triggered();
+
+ void on_actionCompile_triggered();
+ void on_actionGen_triggered();
+ void on_actionCompile_Gen_triggered();
+
+ void on_actionProgram_structure_triggered();
+ void on_actionUnit_structure_triggered();
+
+
+ void on_editor_cursorPositionChanged();
};
+}
+}
-#endif // QWERTY_H
+#endif // _VLP_EDITOR_H