00001 00002 #ifndef MAINWINDOW_H 00003 #define MAINWINDOW_H 00004 00005 #include "ui_boomerang.h" 00006 #include "ui_about.h" 00007 #include "types.h" 00008 #include <vector> 00009 #include <map> 00010 #include <set> 00011 00012 class DecompilerThread; 00013 class QToolButton; 00014 00015 class MainWindow : public QMainWindow 00016 { 00017 Q_OBJECT 00018 00019 public: 00020 MainWindow(QWidget *parent = 0); 00021 00022 void errorLoadingFile(); 00023 00024 public slots: 00025 void loadComplete(); 00026 void decodeComplete(); 00027 void decompileComplete(); 00028 void generateCodeComplete(); 00029 void showLoadPage(); 00030 void showDecodePage(); 00031 void showDecompilePage(); 00032 void showGenerateCodePage(); 00033 void on_inputFileBrowseButton_clicked(); 00034 void on_outputPathBrowseButton_clicked(); 00035 void on_inputFileComboBox_editTextChanged(const QString &text); 00036 void on_inputFileComboBox_currentIndexChanged(const QString &text); 00037 void on_outputPathComboBox_editTextChanged(QString &text); 00038 void showConsideringProc(const QString &parent, const QString &name); 00039 void showDecompilingProc(const QString &name); 00040 void showNewUserProc(const QString &name, unsigned int addr); 00041 void showNewLibProc(const QString &name, const QString ¶ms); 00042 void showRemoveUserProc(const QString &name, unsigned int addr); 00043 void showRemoveLibProc(const QString &name); 00044 void showNewEntrypoint(unsigned int addr, const QString &name); 00045 void showMachineType(const QString &machine); 00046 void showNewCluster(const QString &name); 00047 void showNewProcInCluster(const QString &name, const QString &cluster); 00048 void showDebuggingPoint(const QString &name, const QString &description); 00049 void showNewSection(const QString &name, unsigned int start, unsigned int end); 00050 void showRTLEditor(const QString &name); 00051 00052 void on_clusters_itemDoubleClicked(QTreeWidgetItem *item, int column); 00053 void on_decompileProcsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column); 00054 void on_actionEnable_toggled(bool b); 00055 void on_actionStep_activated(); 00056 void on_userProcs_horizontalHeader_sectionClicked(int logicalIndex); 00057 void on_userProcs_cellDoubleClicked(int row, int column); 00058 void on_userProcs_cellChanged(int row, int column); 00059 void on_libProcs_cellDoubleClicked(int row, int column); 00060 void on_actionOpen_activated(); 00061 void on_actionSave_activated(); 00062 void on_actionClose_activated(); 00063 void on_actionAbout_activated(); 00064 void on_actionAboutQt_activated(); 00065 void on_tabWidget_currentChanged(int index); 00066 00067 void on_actionCut_activated(); 00068 void on_actionCopy_activated(); 00069 void on_actionPaste_activated(); 00070 void on_actionDelete_activated(); 00071 void on_actionFind_activated(); 00072 void on_actionFind_Next_activated(); 00073 void on_actionGo_To_activated(); 00074 void on_actionSelect_All_activated(); 00075 00076 void on_actionLoad_activated(); 00077 void on_actionDecode_activated(); 00078 void on_actionDecompile_activated(); 00079 void on_actionGenerate_Code_activated(); 00080 void on_actionStructs_activated(); 00081 void on_structName_returnPressed(); 00082 00083 void on_actionBoomerang_Website_activated(); 00084 00085 void on_enableDFTAcheckBox_toggled(bool b); 00086 void on_enableNoDecodeChildren_toggled(bool b); 00087 00088 void on_entrypoints_currentItemChanged(QTableWidgetItem *current, QTableWidgetItem *previous); 00089 void on_addButton_pressed(); 00090 void on_removeButton_pressed(); 00091 00092 void closeCurrentTab(); 00093 void currentTabTextChanged(); 00094 00095 protected: 00096 void showInitPage(); 00097 void saveSettings(); 00098 00099 private: 00100 Ui::MainWindow ui; 00101 DecompilerThread *decompilerThread; 00102 00103 QToolButton *step; 00104 00105 int decompiledCount, codeGenCount; 00106 std::map<QWidget*, QString> openFiles; 00107 std::set<QWidget*> signatureFiles; 00108 00109 QWidget *structs; 00110 bool loadingSettings; 00111 }; 00112 00113 #endif 00114