File: CutterApplication.h

package info (click to toggle)
radare2-cutter 1.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,768 kB
  • sloc: cpp: 38,432; python: 507; sh: 505; xml: 115; makefile: 89; ansic: 10; javascript: 3
file content (73 lines) | stat: -rw-r--r-- 1,626 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef CUTTERAPPLICATION_H
#define CUTTERAPPLICATION_H

#include <QEvent>
#include <QApplication>
#include <QList>
#include <QProxyStyle>

#include "core/MainWindow.h"

enum class AutomaticAnalysisLevel {
    Ask, None, AAA, AAAA
};

struct CutterCommandLineOptions {
    QStringList args;
    AutomaticAnalysisLevel analLevel = AutomaticAnalysisLevel::Ask;
    InitialOptions fileOpenOptions;
    QString pythonHome;
    bool outputRedirectionEnabled = true;
    bool enableCutterPlugins = true;
    bool enableR2Plugins = true;
};

class CutterApplication : public QApplication
{
    Q_OBJECT

public:
    CutterApplication(int &argc, char **argv);
    ~CutterApplication();

    MainWindow *getMainWindow()
    {
        return mainWindow;
    }

    void launchNewInstance(const QStringList &args = {});
protected:
    bool event(QEvent *e);

private:
    /**
     * @brief Load and translations depending on Language settings
     * @return true on success
     */
    bool loadTranslations();
    /**
     * @brief Parse commandline options and store them in a structure.
     * @return false if options have error
     */
    bool parseCommandLineOptions();
private:
    bool m_FileAlreadyDropped;
    MainWindow *mainWindow;
    CutterCommandLineOptions clOptions;
};


/**
 * @brief CutterProxyStyle is used to force shortcuts displaying in context menu
 */
class CutterProxyStyle : public QProxyStyle
{
    Q_OBJECT
public:
    /**
     * @brief it is enough to get notification about QMenu polishing to force shortcut displaying
     */
    void polish(QWidget *widget) override;
};

#endif // CUTTERAPPLICATION_H