mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-21 12:26:11 +00:00
Modified documentation format (#1240)
This commit is contained in:
parent
687ef2d799
commit
003d0d3c26
@ -26,9 +26,9 @@ protected:
|
|||||||
bool event(QEvent *e);
|
bool event(QEvent *e);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/*!
|
/**
|
||||||
* \brief Load and translations depending on Language settings
|
* @brief Load and translations depending on Language settings
|
||||||
* \return true on success
|
* @return true on success
|
||||||
*/
|
*/
|
||||||
bool loadTranslations();
|
bool loadTranslations();
|
||||||
|
|
||||||
@ -38,15 +38,15 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief CutterProxyStyle is used to force shortcuts displaying in context menu
|
* @brief CutterProxyStyle is used to force shortcuts displaying in context menu
|
||||||
*/
|
*/
|
||||||
class CutterProxyStyle : public QProxyStyle
|
class CutterProxyStyle : public QProxyStyle
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/*!
|
/**
|
||||||
* \brief it is enough to get notification about QMenu polishing to force shortcut displaying
|
* @brief it is enough to get notification about QMenu polishing to force shortcut displaying
|
||||||
*/
|
*/
|
||||||
void polish(QWidget *widget) override;
|
void polish(QWidget *widget) override;
|
||||||
};
|
};
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
#include "CutterApplication.h"
|
#include "CutterApplication.h"
|
||||||
#include "core/MainWindow.h"
|
#include "core/MainWindow.h"
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Migrate Settings used before Cutter 1.8
|
* @brief Migrate Settings used before Cutter 1.8
|
||||||
*/
|
*/
|
||||||
static void migrateSettings(QSettings &newSettings)
|
static void migrateSettings(QSettings &newSettings)
|
||||||
{
|
{
|
||||||
|
@ -11,8 +11,8 @@ BasicBlockHighlighter::~BasicBlockHighlighter()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Highlight the basic block at address
|
* @brief Highlight the basic block at address
|
||||||
*/
|
*/
|
||||||
void BasicBlockHighlighter::highlight(RVA address, const QColor &color)
|
void BasicBlockHighlighter::highlight(RVA address, const QColor &color)
|
||||||
{
|
{
|
||||||
@ -22,16 +22,16 @@ void BasicBlockHighlighter::highlight(RVA address, const QColor &color)
|
|||||||
bbMap[address] = block;
|
bbMap[address] = block;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Clear the basic block highlighting
|
* @brief Clear the basic block highlighting
|
||||||
*/
|
*/
|
||||||
void BasicBlockHighlighter::clear(RVA address)
|
void BasicBlockHighlighter::clear(RVA address)
|
||||||
{
|
{
|
||||||
bbMap.erase(address);
|
bbMap.erase(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Return a highlighted basic block
|
* @brief Return a highlighted basic block
|
||||||
*
|
*
|
||||||
* If there is nothing to highlight at specified address, returns nullptr
|
* If there is nothing to highlight at specified address, returns nullptr
|
||||||
*/
|
*/
|
||||||
|
@ -16,8 +16,8 @@ const QList<CutterQtTheme> kCutterQtThemesList = {
|
|||||||
|
|
||||||
Configuration *Configuration::mPtr = nullptr;
|
Configuration *Configuration::mPtr = nullptr;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief All asm.* options saved as settings. Values are the default values.
|
* @brief All asm.* options saved as settings. Values are the default values.
|
||||||
*/
|
*/
|
||||||
static const QHash<QString, QVariant> asmOptions = {
|
static const QHash<QString, QVariant> asmOptions = {
|
||||||
{ "asm.esil", false },
|
{ "asm.esil", false },
|
||||||
@ -136,28 +136,28 @@ void Configuration::resetAll()
|
|||||||
emit fontsUpdated();
|
emit fontsUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief get the current Locale set in Cutter's user configuration
|
* @brief get the current Locale set in Cutter's user configuration
|
||||||
* \return a QLocale object describes user's current locale
|
* @return a QLocale object describes user's current locale
|
||||||
*/
|
*/
|
||||||
QLocale Configuration::getCurrLocale() const
|
QLocale Configuration::getCurrLocale() const
|
||||||
{
|
{
|
||||||
return s.value("locale", QLocale().system()).toLocale();
|
return s.value("locale", QLocale().system()).toLocale();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief sets Cutter's locale
|
* @brief sets Cutter's locale
|
||||||
* \param l - a QLocale object describes the locate to configure
|
* @param l - a QLocale object describes the locate to configure
|
||||||
*/
|
*/
|
||||||
void Configuration::setLocale(const QLocale &l)
|
void Configuration::setLocale(const QLocale &l)
|
||||||
{
|
{
|
||||||
s.setValue("locale", l);
|
s.setValue("locale", l);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief set Cutter's interface language by a given locale name
|
* @brief set Cutter's interface language by a given locale name
|
||||||
* \param language - a string represents the name of a locale language
|
* @param language - a string represents the name of a locale language
|
||||||
* \return true on success
|
* @return true on success
|
||||||
*/
|
*/
|
||||||
bool Configuration::setLocaleByName(const QString &language)
|
bool Configuration::setLocaleByName(const QString &language)
|
||||||
{
|
{
|
||||||
@ -353,10 +353,10 @@ QString Configuration::getLogoFile()
|
|||||||
: QString(":/img/cutter_plain.svg");
|
: QString(":/img/cutter_plain.svg");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Configuration::setColor sets the local Cutter configuration color
|
* @brief Configuration::setColor sets the local Cutter configuration color
|
||||||
* \param name Color Name
|
* @param name Color Name
|
||||||
* \param color The color you want to set
|
* @param color The color you want to set
|
||||||
*/
|
*/
|
||||||
void Configuration::setColor(const QString &name, const QColor &color)
|
void Configuration::setColor(const QString &name, const QColor &color)
|
||||||
{
|
{
|
||||||
@ -471,9 +471,9 @@ void Configuration::setConfig(const QString &key, const QVariant &value)
|
|||||||
Core()->setConfig(key, value);
|
Core()->setConfig(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief this function will gather and return available translation for Cutter
|
* @brief this function will gather and return available translation for Cutter
|
||||||
* \return a list of all available translations
|
* @return a list of all available translations
|
||||||
*/
|
*/
|
||||||
QStringList Configuration::getAvailableTranslations()
|
QStringList Configuration::getAvailableTranslations()
|
||||||
{
|
{
|
||||||
@ -514,9 +514,9 @@ QStringList Configuration::getAvailableTranslations()
|
|||||||
return languages << QLatin1String("English");
|
return languages << QLatin1String("English");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief check if this is the first time Cutter's is executed on this computer
|
* @brief check if this is the first time Cutter's is executed on this computer
|
||||||
* \return true if this is first execution; otherwise returns false.
|
* @return true if this is first execution; otherwise returns false.
|
||||||
*/
|
*/
|
||||||
bool Configuration::isFirstExecution()
|
bool Configuration::isFirstExecution()
|
||||||
{
|
{
|
||||||
|
@ -97,23 +97,23 @@ public:
|
|||||||
QString getColorTheme() const { return s.value("theme", "cutter").toString(); }
|
QString getColorTheme() const { return s.value("theme", "cutter").toString(); }
|
||||||
void setColorTheme(const QString &theme);
|
void setColorTheme(const QString &theme);
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Get the value of a config var either from r2 or settings, depending on the key.
|
* @brief Get the value of a config var either from r2 or settings, depending on the key.
|
||||||
*/
|
*/
|
||||||
QVariant getConfigVar(const QString &key);
|
QVariant getConfigVar(const QString &key);
|
||||||
bool getConfigBool(const QString &key);
|
bool getConfigBool(const QString &key);
|
||||||
int getConfigInt(const QString &key);
|
int getConfigInt(const QString &key);
|
||||||
QString getConfigString(const QString &key);
|
QString getConfigString(const QString &key);
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Set the value of a config var either to r2 or settings, depending on the key.
|
* @brief Set the value of a config var either to r2 or settings, depending on the key.
|
||||||
*/
|
*/
|
||||||
void setConfig(const QString &key, const QVariant &value);
|
void setConfig(const QString &key, const QVariant &value);
|
||||||
bool isFirstExecution();
|
bool isFirstExecution();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Get list of available translation directories (depends on configuration and OS)
|
* @brief Get list of available translation directories (depends on configuration and OS)
|
||||||
* \return list of directories
|
* @return list of directories
|
||||||
*/
|
*/
|
||||||
QStringList getTranslationsDirectories() const;
|
QStringList getTranslationsDirectories() const;
|
||||||
|
|
||||||
|
@ -29,8 +29,8 @@ public:
|
|||||||
void restoreThread();
|
void restoreThread();
|
||||||
void saveThread();
|
void saveThread();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief RAII Helper class to call restoreThread() and saveThread() automatically
|
* @brief RAII Helper class to call restoreThread() and saveThread() automatically
|
||||||
*
|
*
|
||||||
* As long as an object of this class is in scope, the Python thread will remain restored.
|
* As long as an object of this class is in scope, the Python thread will remain restored.
|
||||||
*/
|
*/
|
||||||
|
@ -10,8 +10,8 @@ class RefreshDeferrer;
|
|||||||
using RefreshDeferrerParams = void *;
|
using RefreshDeferrerParams = void *;
|
||||||
using RefreshDeferrerParamsResult = void *;
|
using RefreshDeferrerParamsResult = void *;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Abstract class for accumulating params in RefreshDeferrer
|
* @brief Abstract class for accumulating params in RefreshDeferrer
|
||||||
*/
|
*/
|
||||||
class RefreshDeferrerAccumulator
|
class RefreshDeferrerAccumulator
|
||||||
{
|
{
|
||||||
@ -21,31 +21,31 @@ public:
|
|||||||
virtual ~RefreshDeferrerAccumulator() = default;
|
virtual ~RefreshDeferrerAccumulator() = default;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/*!
|
/**
|
||||||
* \brief Add a new param to the accumulator
|
* @brief Add a new param to the accumulator
|
||||||
*/
|
*/
|
||||||
virtual void accumulate(RefreshDeferrerParams params) =0;
|
virtual void accumulate(RefreshDeferrerParams params) =0;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Ignore the incoming params. Useful for freeing if necessary.
|
* @brief Ignore the incoming params. Useful for freeing if necessary.
|
||||||
*/
|
*/
|
||||||
virtual void ignoreParams(RefreshDeferrerParams params) =0;
|
virtual void ignoreParams(RefreshDeferrerParams params) =0;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Clear the current accumulator
|
* @brief Clear the current accumulator
|
||||||
*/
|
*/
|
||||||
virtual void clear() =0;
|
virtual void clear() =0;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Return the final result of the accumulation
|
* @brief Return the final result of the accumulation
|
||||||
*/
|
*/
|
||||||
virtual RefreshDeferrerParamsResult result() =0;
|
virtual RefreshDeferrerParamsResult result() =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Accumulator which simply replaces the current value by an incoming new one
|
* @brief Accumulator which simply replaces the current value by an incoming new one
|
||||||
* \tparam T The type of the param to store
|
* @tparam T The type of the param to store
|
||||||
*
|
*
|
||||||
* This accumulator takes the ownership of all params passed to it and deletes them automatically if not needed anymore!
|
* This accumulator takes the ownership of all params passed to it and deletes them automatically if not needed anymore!
|
||||||
*/
|
*/
|
||||||
@ -57,7 +57,7 @@ private:
|
|||||||
bool replaceIfNull;
|
bool replaceIfNull;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*!
|
/**
|
||||||
* \param Determines whether, if nullptr is passed, the current value should be replaced or kept.
|
* \param Determines whether, if nullptr is passed, the current value should be replaced or kept.
|
||||||
*/
|
*/
|
||||||
explicit ReplacingRefreshDeferrerAccumulator(bool replaceIfNull = true)
|
explicit ReplacingRefreshDeferrerAccumulator(bool replaceIfNull = true)
|
||||||
@ -95,8 +95,8 @@ protected:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Helper class for deferred refreshing in Widgets
|
* @brief Helper class for deferred refreshing in Widgets
|
||||||
*
|
*
|
||||||
* This class can handle the logic necessary to defer the refreshing of widgets when they are not visible.
|
* This class can handle the logic necessary to defer the refreshing of widgets when they are not visible.
|
||||||
* It contains an optional RefreshDeferrerAccumulator, which can be used to accumulate incoming events while
|
* It contains an optional RefreshDeferrerAccumulator, which can be used to accumulate incoming events while
|
||||||
@ -138,8 +138,8 @@ private:
|
|||||||
bool dirty = false;
|
bool dirty = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*!
|
/**
|
||||||
* \param acc The accumulator (can be nullptr). The RefreshDeferrer takes the ownership!
|
* @param acc The accumulator (can be nullptr). The RefreshDeferrer takes the ownership!
|
||||||
*/
|
*/
|
||||||
explicit RefreshDeferrer(RefreshDeferrerAccumulator *acc, QObject *parent = nullptr);
|
explicit RefreshDeferrer(RefreshDeferrerAccumulator *acc, QObject *parent = nullptr);
|
||||||
~RefreshDeferrer() override;
|
~RefreshDeferrer() override;
|
||||||
|
@ -415,11 +415,11 @@ bool CutterCore::tryFile(QString path, bool rw)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Opens a file using r2 API
|
* @brief Opens a file using r2 API
|
||||||
* \param path Path to file
|
* @param path Path to file
|
||||||
* \param mapaddr Map Address
|
* @param mapaddr Map Address
|
||||||
* \return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
bool CutterCore::openFile(QString path, RVA mapaddr)
|
bool CutterCore::openFile(QString path, RVA mapaddr)
|
||||||
{
|
{
|
||||||
|
@ -106,8 +106,8 @@ public:
|
|||||||
void setImmediateBase(const QString &r2BaseName, RVA offset = RVA_INVALID);
|
void setImmediateBase(const QString &r2BaseName, RVA offset = RVA_INVALID);
|
||||||
void setCurrentBits(int bits, RVA offset = RVA_INVALID);
|
void setCurrentBits(int bits, RVA offset = RVA_INVALID);
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Changes immediate displacement to structure offset
|
* @brief Changes immediate displacement to structure offset
|
||||||
* This function makes use of the "ta" command of r2 to apply structure
|
* This function makes use of the "ta" command of r2 to apply structure
|
||||||
* offset to the immediate displacement used in the given instruction
|
* offset to the immediate displacement used in the given instruction
|
||||||
* \param structureOffset The name of struct which will be applied
|
* \param structureOffset The name of struct which will be applied
|
||||||
@ -291,38 +291,38 @@ public:
|
|||||||
QList<ResourcesDescription> getAllResources();
|
QList<ResourcesDescription> getAllResources();
|
||||||
QList<VTableDescription> getAllVTables();
|
QList<VTableDescription> getAllVTables();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \return all loaded types
|
* @return all loaded types
|
||||||
*/
|
*/
|
||||||
QList<TypeDescription> getAllTypes();
|
QList<TypeDescription> getAllTypes();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \return all loaded primitive types
|
* @return all loaded primitive types
|
||||||
*/
|
*/
|
||||||
QList<TypeDescription> getAllPrimitiveTypes();
|
QList<TypeDescription> getAllPrimitiveTypes();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \return all loaded unions
|
* @return all loaded unions
|
||||||
*/
|
*/
|
||||||
QList<TypeDescription> getAllUnions();
|
QList<TypeDescription> getAllUnions();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \return all loaded structs
|
* @return all loaded structs
|
||||||
*/
|
*/
|
||||||
QList<TypeDescription> getAllStructs();
|
QList<TypeDescription> getAllStructs();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \return all loaded enums
|
* @return all loaded enums
|
||||||
*/
|
*/
|
||||||
QList<TypeDescription> getAllEnums();
|
QList<TypeDescription> getAllEnums();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \return all loaded typedefs
|
* @return all loaded typedefs
|
||||||
*/
|
*/
|
||||||
QList<TypeDescription> getAllTypedefs();
|
QList<TypeDescription> getAllTypedefs();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Adds new types
|
* @brief Adds new types
|
||||||
* It first uses the r_parse_c_string() function from radare2 API to parse the
|
* It first uses the r_parse_c_string() function from radare2 API to parse the
|
||||||
* supplied C file (in the form of a string). If there were errors, they are displayed.
|
* supplied C file (in the form of a string). If there were errors, they are displayed.
|
||||||
* If there were no errors, it uses sdb_query_lines() function from radare2 API
|
* If there were no errors, it uses sdb_query_lines() function from radare2 API
|
||||||
@ -333,10 +333,10 @@ public:
|
|||||||
QString addTypes(const char *str);
|
QString addTypes(const char *str);
|
||||||
QString addTypes(const QString &str) { return addTypes(str.toUtf8().constData()); }
|
QString addTypes(const QString &str) { return addTypes(str.toUtf8().constData()); }
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Checks if the given address is mapped to a region
|
* @brief Checks if the given address is mapped to a region
|
||||||
* \param addr The address to be checked
|
* @param addr The address to be checked
|
||||||
* \return true if addr is mapped, false otherwise
|
* @return true if addr is mapped, false otherwise
|
||||||
*/
|
*/
|
||||||
bool isAddressMapped(RVA addr);
|
bool isAddressMapped(RVA addr);
|
||||||
|
|
||||||
@ -394,19 +394,19 @@ signals:
|
|||||||
|
|
||||||
void projectSaved(bool successfully, const QString &name);
|
void projectSaved(bool successfully, const QString &name);
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* emitted when config regarding disassembly display changes
|
* emitted when config regarding disassembly display changes
|
||||||
*/
|
*/
|
||||||
void asmOptionsChanged();
|
void asmOptionsChanged();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* emitted when config regarding graph display changes
|
* emitted when config regarding graph display changes
|
||||||
*/
|
*/
|
||||||
void graphOptionsChanged();
|
void graphOptionsChanged();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief seekChanged is emitted each time radare2 seek value is modified
|
* @brief seekChanged is emitted each time radare2 seek value is modified
|
||||||
* \param offset
|
* @param offset
|
||||||
*/
|
*/
|
||||||
void seekChanged(RVA offset);
|
void seekChanged(RVA offset);
|
||||||
|
|
||||||
|
@ -25,18 +25,18 @@
|
|||||||
// Global information for Cutter
|
// Global information for Cutter
|
||||||
#define APPNAME "Cutter"
|
#define APPNAME "Cutter"
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Type to be used for all kinds of addresses/offsets in r2 address space.
|
* @brief Type to be used for all kinds of addresses/offsets in r2 address space.
|
||||||
*/
|
*/
|
||||||
typedef ut64 RVA;
|
typedef ut64 RVA;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Maximum value of RVA. Do NOT use this for specifying invalid values, use RVA_INVALID instead.
|
* @brief Maximum value of RVA. Do NOT use this for specifying invalid values, use RVA_INVALID instead.
|
||||||
*/
|
*/
|
||||||
#define RVA_MAX UT64_MAX
|
#define RVA_MAX UT64_MAX
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Value for specifying an invalid RVA.
|
* @brief Value for specifying an invalid RVA.
|
||||||
*/
|
*/
|
||||||
#define RVA_INVALID RVA_MAX
|
#define RVA_INVALID RVA_MAX
|
||||||
|
|
||||||
|
@ -433,8 +433,8 @@ void MainWindow::openNewFileFailed()
|
|||||||
mb.exec();
|
mb.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief displays the WelocmeDialog
|
* @brief displays the WelocmeDialog
|
||||||
*
|
*
|
||||||
* Upon first execution of Cutter, the WelcomeDialog would be showed to the user.
|
* Upon first execution of Cutter, the WelcomeDialog would be showed to the user.
|
||||||
* The Welcome dialog would be showed after a reset of Cutter's preferences by the user.
|
* The Welcome dialog would be showed after a reset of Cutter's preferences by the user.
|
||||||
@ -1179,8 +1179,8 @@ void MainWindow::addDockWidgetAction(QDockWidget *dockWidget, QAction *action)
|
|||||||
this->dockWidgetActions[action] = dockWidget;
|
this->dockWidgetActions[action] = dockWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Show a warning message box.
|
* @brief Show a warning message box.
|
||||||
*
|
*
|
||||||
* This API can either be used in Cutter internals, or by Python plugins.
|
* This API can either be used in Cutter internals, or by Python plugins.
|
||||||
*/
|
*/
|
||||||
|
@ -79,13 +79,13 @@ public:
|
|||||||
|
|
||||||
void initUI();
|
void initUI();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* @param quit whether to show destructive button in dialog
|
* @param quit whether to show destructive button in dialog
|
||||||
* @return if quit is true, false if the application should not close
|
* @return if quit is true, false if the application should not close
|
||||||
*/
|
*/
|
||||||
bool saveProject(bool quit = false);
|
bool saveProject(bool quit = false);
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* @param quit whether to show destructive button in dialog
|
* @param quit whether to show destructive button in dialog
|
||||||
* @return false if the application should not close
|
* @return false if the application should not close
|
||||||
*/
|
*/
|
||||||
|
@ -17,8 +17,8 @@ class EditMethodDialog : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*!
|
/**
|
||||||
* \param classFixed whether the user should be able to change the class. If false, a QComboBox will be shown, otherwise a plain QLabel.
|
* @param classFixed whether the user should be able to change the class. If false, a QComboBox will be shown, otherwise a plain QLabel.
|
||||||
*/
|
*/
|
||||||
explicit EditMethodDialog(bool classFixed, QWidget *parent = nullptr);
|
explicit EditMethodDialog(bool classFixed, QWidget *parent = nullptr);
|
||||||
~EditMethodDialog();
|
~EditMethodDialog();
|
||||||
@ -29,24 +29,24 @@ public:
|
|||||||
QString getClass();
|
QString getClass();
|
||||||
AnalMethodDescription getMethod();
|
AnalMethodDescription getMethod();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Helper function to display the dialog
|
* @brief Helper function to display the dialog
|
||||||
*
|
*
|
||||||
* \param title title of the dialog
|
* @param title title of the dialog
|
||||||
* \param classFixed whether the user should be able to change the class
|
* @param classFixed whether the user should be able to change the class
|
||||||
* \param className initial class name, will be overwritten if the user changed the class
|
* @param className initial class name, will be overwritten if the user changed the class
|
||||||
* \param desc initial data for the method information
|
* @param desc initial data for the method information
|
||||||
* \return whether the dialog was accepted by the user
|
* @return whether the dialog was accepted by the user
|
||||||
*/
|
*/
|
||||||
static bool showDialog(const QString &title, bool classFixed, QString *className, AnalMethodDescription *desc, QWidget *parent = nullptr);
|
static bool showDialog(const QString &title, bool classFixed, QString *className, AnalMethodDescription *desc, QWidget *parent = nullptr);
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Show the dialog to add a new method a given class
|
* @brief Show the dialog to add a new method a given class
|
||||||
*/
|
*/
|
||||||
static void newMethod(QString className = nullptr, const QString &meth = QString(), QWidget *parent = nullptr);
|
static void newMethod(QString className = nullptr, const QString &meth = QString(), QWidget *parent = nullptr);
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Show the dialog to edit a given method of a given class
|
* @brief Show the dialog to edit a given method of a given class
|
||||||
*/
|
*/
|
||||||
static void editMethod(const QString &className, const QString &meth, QWidget *parent = nullptr);
|
static void editMethod(const QString &className, const QString &meth, QWidget *parent = nullptr);
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ private:
|
|||||||
|
|
||||||
QComboBox *classComboBox = nullptr;
|
QComboBox *classComboBox = nullptr;
|
||||||
QLabel *classLabel = nullptr;
|
QLabel *classLabel = nullptr;
|
||||||
/*!
|
/**
|
||||||
* This will only be used when the dialog was created with classFixed = true in order to remember the class name.
|
* This will only be used when the dialog was created with classFixed = true in order to remember the class name.
|
||||||
*/
|
*/
|
||||||
QString fixedClass;
|
QString fixedClass;
|
||||||
|
@ -16,46 +16,46 @@ public:
|
|||||||
explicit LinkTypeDialog(QWidget *parent = nullptr);
|
explicit LinkTypeDialog(QWidget *parent = nullptr);
|
||||||
~LinkTypeDialog();
|
~LinkTypeDialog();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Sets the default type which will be displayed in the combo box
|
* @brief Sets the default type which will be displayed in the combo box
|
||||||
* \param type Default type to be used as default type
|
* @param type Default type to be used as default type
|
||||||
*/
|
*/
|
||||||
void setDefaultType(const QString &type);
|
void setDefaultType(const QString &type);
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Sets the value of the default address which will be displayed
|
* @brief Sets the value of the default address which will be displayed
|
||||||
* If the given address is linked to a type, then it also sets the default
|
* If the given address is linked to a type, then it also sets the default
|
||||||
* type to the currently linked type
|
* type to the currently linked type
|
||||||
* \param address The address to be used as default address
|
* @param address The address to be used as default address
|
||||||
*/
|
*/
|
||||||
void setDefaultAddress(QString address);
|
void setDefaultAddress(QString address);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Overrides the done() method of QDialog
|
* @brief Overrides the done() method of QDialog
|
||||||
* On clicking the Ok button, it links a valid address to a type.
|
* On clicking the Ok button, it links a valid address to a type.
|
||||||
* If "(No Type)" is selected as type, it removes the link.
|
* If "(No Type)" is selected as type, it removes the link.
|
||||||
* In case of an invalid address, it displays error message
|
* In case of an invalid address, it displays error message
|
||||||
* \param r The value which will be returned by exec()
|
* @param r The value which will be returned by exec()
|
||||||
*/
|
*/
|
||||||
void done(int r) override;
|
void done(int r) override;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Executed whenever the text inside exprLineEdit changes
|
* @brief Executed whenever the text inside exprLineEdit changes
|
||||||
* If expression evaluates to valid address, it is displayed in addressLineEdit
|
* If expression evaluates to valid address, it is displayed in addressLineEdit
|
||||||
* Otherwise "Invalid Address" is shown in addressLineEdit
|
* Otherwise "Invalid Address" is shown in addressLineEdit
|
||||||
* \param text The current value of exprLineEdit
|
* @param text The current value of exprLineEdit
|
||||||
*/
|
*/
|
||||||
void on_exprLineEdit_textChanged(const QString &text);
|
void on_exprLineEdit_textChanged(const QString &text);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::LinkTypeDialog *ui;
|
Ui::LinkTypeDialog *ui;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Used for finding the type which is linked to the given address
|
* @brief Used for finding the type which is linked to the given address
|
||||||
* \param address
|
* @param address
|
||||||
* \return The type linked to "address" if it exists, or empty string otherwise
|
* @return The type linked to "address" if it exists, or empty string otherwise
|
||||||
*/
|
*/
|
||||||
QString findLinkedType(RVA address);
|
QString findLinkedType(RVA address);
|
||||||
};
|
};
|
||||||
|
@ -18,22 +18,22 @@ public:
|
|||||||
~LoadNewTypesDialog();
|
~LoadNewTypesDialog();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/*!
|
/**
|
||||||
* \brief Executed when the user clicks the selectFileButton
|
* @brief Executed when the user clicks the selectFileButton
|
||||||
* Opens a File Dialog from where the user can select a file from where
|
* Opens a File Dialog from where the user can select a file from where
|
||||||
* the types will be loaded.
|
* the types will be loaded.
|
||||||
*/
|
*/
|
||||||
void on_selectFileButton_clicked();
|
void on_selectFileButton_clicked();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Executed whenever the text inside the textbox changes
|
* @brief Executed whenever the text inside the textbox changes
|
||||||
* When the text box is empty, the OK button is disabled.
|
* When the text box is empty, the OK button is disabled.
|
||||||
*/
|
*/
|
||||||
void on_plainTextEdit_textChanged();
|
void on_plainTextEdit_textChanged();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief done Closes the dialog and sets its result code to r
|
* @brief done Closes the dialog and sets its result code to r
|
||||||
* \param r The value which will be returned by exec()
|
* @param r The value which will be returned by exec()
|
||||||
*/
|
*/
|
||||||
void done(int r) override;
|
void done(int r) override;
|
||||||
|
|
||||||
@ -42,8 +42,8 @@ private:
|
|||||||
SyntaxHighlighter *syntaxHighLighter;
|
SyntaxHighlighter *syntaxHighLighter;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
/*!
|
/**
|
||||||
* \brief Emitted when new types are loaded
|
* @brief Emitted when new types are loaded
|
||||||
*/
|
*/
|
||||||
void newTypesLoaded();
|
void newTypesLoaded();
|
||||||
};
|
};
|
||||||
|
@ -46,12 +46,12 @@ protected:
|
|||||||
private:
|
private:
|
||||||
std::unique_ptr<Ui::NewFileDialog> ui;
|
std::unique_ptr<Ui::NewFileDialog> ui;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* @return true if list is not empty
|
* @return true if list is not empty
|
||||||
*/
|
*/
|
||||||
bool fillRecentFilesList();
|
bool fillRecentFilesList();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* @return true if list is not empty
|
* @return true if list is not empty
|
||||||
*/
|
*/
|
||||||
bool fillProjectsList();
|
bool fillProjectsList();
|
||||||
|
@ -8,8 +8,8 @@ namespace Ui {
|
|||||||
class RenameDialog;
|
class RenameDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief General Dialog for entering a name
|
* @brief General Dialog for entering a name
|
||||||
*/
|
*/
|
||||||
class RenameDialog : public QDialog
|
class RenameDialog : public QDialog
|
||||||
{
|
{
|
||||||
@ -24,13 +24,13 @@ public:
|
|||||||
|
|
||||||
void setPlaceholderText(const QString &text);
|
void setPlaceholderText(const QString &text);
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Helper function to display and execute the dialog
|
* @brief Helper function to display and execute the dialog
|
||||||
*
|
*
|
||||||
* \param title title of the dialog
|
* @param title title of the dialog
|
||||||
* \param name initial name, will be overwritten if the user entered something else
|
* @param name initial name, will be overwritten if the user entered something else
|
||||||
* \param placeholder placeholder text for the QLineEdit
|
* @param placeholder placeholder text for the QLineEdit
|
||||||
* \return whether the dialog was accepted by the user
|
* @return whether the dialog was accepted by the user
|
||||||
*/
|
*/
|
||||||
static bool showDialog(const QString &title, QString *name, const QString &placeholder, QWidget *parent = nullptr);
|
static bool showDialog(const QString &title, QString *name, const QString &placeholder, QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
@ -7,9 +7,9 @@
|
|||||||
|
|
||||||
#include "ui_WelcomeDialog.h"
|
#include "ui_WelcomeDialog.h"
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Constructs a WelcomeDialog object
|
* @brief Constructs a WelcomeDialog object
|
||||||
* \param parent
|
* @param parent
|
||||||
*/
|
*/
|
||||||
WelcomeDialog::WelcomeDialog(QWidget *parent) :
|
WelcomeDialog::WelcomeDialog(QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
@ -38,17 +38,17 @@ WelcomeDialog::WelcomeDialog(QWidget *parent) :
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Destroys the WelcomeDialog
|
* @brief Destroys the WelcomeDialog
|
||||||
*/
|
*/
|
||||||
WelcomeDialog::~WelcomeDialog()
|
WelcomeDialog::~WelcomeDialog()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief change Cutter's QT Theme as selected by the user
|
* @brief change Cutter's QT Theme as selected by the user
|
||||||
* \param index - a Slot being called after theme's value changes its index
|
* @param index - a Slot being called after theme's value changes its index
|
||||||
*/
|
*/
|
||||||
void WelcomeDialog::on_themeComboBox_currentIndexChanged(int index)
|
void WelcomeDialog::on_themeComboBox_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
@ -63,9 +63,9 @@ void WelcomeDialog::on_themeComboBox_currentIndexChanged(int index)
|
|||||||
ui->logoSvgWidget->load(Config()->getLogoFile());
|
ui->logoSvgWidget->load(Config()->getLogoFile());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief change Cutter's interface language as selected by the user
|
* @brief change Cutter's interface language as selected by the user
|
||||||
* \param index - a Slot being called after language combo box value changes its index
|
* @param index - a Slot being called after language combo box value changes its index
|
||||||
*/
|
*/
|
||||||
void WelcomeDialog::onLanguageComboBox_currentIndexChanged(int index)
|
void WelcomeDialog::onLanguageComboBox_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
@ -80,8 +80,8 @@ void WelcomeDialog::onLanguageComboBox_currentIndexChanged(int index)
|
|||||||
mb.exec();
|
mb.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief show Cutter's About dialog
|
* @brief show Cutter's About dialog
|
||||||
*/
|
*/
|
||||||
void WelcomeDialog::on_checkUpdateButton_clicked()
|
void WelcomeDialog::on_checkUpdateButton_clicked()
|
||||||
{
|
{
|
||||||
@ -90,8 +90,8 @@ void WelcomeDialog::on_checkUpdateButton_clicked()
|
|||||||
a->open();
|
a->open();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief accept user preferences, close the window and continue Cutter's execution
|
* @brief accept user preferences, close the window and continue Cutter's execution
|
||||||
*/
|
*/
|
||||||
void WelcomeDialog::on_continueButton_clicked()
|
void WelcomeDialog::on_continueButton_clicked()
|
||||||
{
|
{
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \class WelcomeDialog
|
* @class WelcomeDialog
|
||||||
* \brief The WelcomeDialog class will show the user the Welcome windows
|
* @brief The WelcomeDialog class will show the user the Welcome windows
|
||||||
* upon first execution of Cutter.
|
* upon first execution of Cutter.
|
||||||
*
|
*
|
||||||
* Upon first execution of Cutter, the WelcomeDialog would be showed to the user.
|
* Upon first execution of Cutter, the WelcomeDialog would be showed to the user.
|
||||||
|
@ -20,9 +20,9 @@ public slots:
|
|||||||
void setOffset(RVA offset);
|
void setOffset(RVA offset);
|
||||||
void setCanCopy(bool enabled);
|
void setCanCopy(bool enabled);
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Sets the value of curHighlightedWord
|
* @brief Sets the value of curHighlightedWord
|
||||||
* \param text The current highlighted word
|
* @param text The current highlighted word
|
||||||
*/
|
*/
|
||||||
void setCurHighlightedWord(const QString &text);
|
void setCurHighlightedWord(const QString &text);
|
||||||
|
|
||||||
@ -61,16 +61,16 @@ private slots:
|
|||||||
void on_actionSetToData_triggered();
|
void on_actionSetToData_triggered();
|
||||||
void on_actionSetToDataEx_triggered();
|
void on_actionSetToDataEx_triggered();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Executed on selecting an offset from the structureOffsetMenu
|
* @brief Executed on selecting an offset from the structureOffsetMenu
|
||||||
* Uses the applyStructureOffset() function of CutterCore to apply the
|
* Uses the applyStructureOffset() function of CutterCore to apply the
|
||||||
* structure offset
|
* structure offset
|
||||||
* \param action The action which trigered the event
|
* \param action The action which trigered the event
|
||||||
*/
|
*/
|
||||||
void on_actionStructureOffsetMenu_triggered(QAction *action);
|
void on_actionStructureOffsetMenu_triggered(QAction *action);
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Executed on selecting the "Link Type to Address" option
|
* @brief Executed on selecting the "Link Type to Address" option
|
||||||
* Opens the LinkTypeDialog box from where the user can link the address
|
* Opens the LinkTypeDialog box from where the user can link the address
|
||||||
* to a type
|
* to a type
|
||||||
*/
|
*/
|
||||||
@ -91,8 +91,8 @@ private:
|
|||||||
QKeySequence getDisplayOptionsSequence() const;
|
QKeySequence getDisplayOptionsSequence() const;
|
||||||
QList<QKeySequence> getAddBPSequence() const;
|
QList<QKeySequence> getAddBPSequence() const;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \return the shortcut key for "Link Type to Address" option
|
* @return the shortcut key for "Link Type to Address" option
|
||||||
*/
|
*/
|
||||||
QKeySequence getLinkTypeSequence() const;
|
QKeySequence getLinkTypeSequence() const;
|
||||||
|
|
||||||
|
@ -17,13 +17,13 @@ public:
|
|||||||
PluginManager();
|
PluginManager();
|
||||||
~PluginManager();
|
~PluginManager();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Load all plugins, should be called once on application start
|
* @brief Load all plugins, should be called once on application start
|
||||||
*/
|
*/
|
||||||
void loadPlugins();
|
void loadPlugins();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Destroy all loaded plugins, should be called once on application shutdown
|
* @brief Destroy all loaded plugins, should be called once on application shutdown
|
||||||
*/
|
*/
|
||||||
void destroyPlugins();
|
void destroyPlugins();
|
||||||
|
|
||||||
|
@ -18,36 +18,36 @@ class QTreeWidgetItem;
|
|||||||
class MainWindow;
|
class MainWindow;
|
||||||
class ClassesWidget;
|
class ClassesWidget;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Common abstract base class for Bin and Anal classes models
|
* @brief Common abstract base class for Bin and Anal classes models
|
||||||
*/
|
*/
|
||||||
class ClassesModel: public QAbstractItemModel
|
class ClassesModel: public QAbstractItemModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Columns { NAME = 0, TYPE, OFFSET, VTABLE, COUNT };
|
enum Columns { NAME = 0, TYPE, OFFSET, VTABLE, COUNT };
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief values for TypeRole data
|
* @brief values for TypeRole data
|
||||||
*/
|
*/
|
||||||
enum class RowType { Class = 0, Base, VTable, Method, Field };
|
enum class RowType { Class = 0, Base, VTable, Method, Field };
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Offset role of data for QModelIndex
|
* @brief Offset role of data for QModelIndex
|
||||||
*
|
*
|
||||||
* will contain values of type RVA
|
* will contain values of type RVA
|
||||||
*/
|
*/
|
||||||
static const int OffsetRole = Qt::UserRole;
|
static const int OffsetRole = Qt::UserRole;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Name role of data for QModelIndex
|
* @brief Name role of data for QModelIndex
|
||||||
*
|
*
|
||||||
* will contain values of QString, used for sorting,
|
* will contain values of QString, used for sorting,
|
||||||
* as well as identifying classes and methods
|
* as well as identifying classes and methods
|
||||||
*/
|
*/
|
||||||
static const int NameRole = Qt::UserRole + 1;
|
static const int NameRole = Qt::UserRole + 1;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Type role of data for QModelIndex
|
* @brief Type role of data for QModelIndex
|
||||||
*
|
*
|
||||||
* will contain values of RowType
|
* will contain values of RowType
|
||||||
*/
|
*/
|
||||||
@ -87,8 +87,8 @@ class AnalClassesModel: public ClassesModel
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/*!
|
/**
|
||||||
* \brief List entry below a class
|
* @brief List entry below a class
|
||||||
*
|
*
|
||||||
* This roughly corresponds to attributes of r2 anal classes, which means it is not an attribute in the sense of
|
* This roughly corresponds to attributes of r2 anal classes, which means it is not an attribute in the sense of
|
||||||
* a class member variable, but any kind of sub-info associated with the class.
|
* a class member variable, but any kind of sub-info associated with the class.
|
||||||
@ -104,15 +104,15 @@ private:
|
|||||||
Attribute(Type type, const QVariant &data) : type(type), data(data) {}
|
Attribute(Type type, const QVariant &data) : type(type), data(data) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* This must always stay sorted alphabetically.
|
* This must always stay sorted alphabetically.
|
||||||
*/
|
*/
|
||||||
QList<QString> classes;
|
QList<QString> classes;
|
||||||
|
|
||||||
RefreshDeferrer *refreshDeferrer;
|
RefreshDeferrer *refreshDeferrer;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Cache for class attributes
|
* @brief Cache for class attributes
|
||||||
*
|
*
|
||||||
* Maps class names to a list of Attributes.
|
* Maps class names to a list of Attributes.
|
||||||
* This is filled only when the attributes of a specific class are requested.
|
* This is filled only when the attributes of a specific class are requested.
|
||||||
|
@ -17,9 +17,9 @@ public:
|
|||||||
bool eventFilter(QObject *object, QEvent *event) override;
|
bool eventFilter(QObject *object, QEvent *event) override;
|
||||||
bool isVisibleToUser() { return isVisibleToUserCurrent; }
|
bool isVisibleToUser() { return isVisibleToUserCurrent; }
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Convenience method for creating and registering a RefreshDeferrer without any parameters
|
* @brief Convenience method for creating and registering a RefreshDeferrer without any parameters
|
||||||
* \param refreshNowFunc lambda taking no parameters, called when a refresh should occur
|
* @param refreshNowFunc lambda taking no parameters, called when a refresh should occur
|
||||||
*/
|
*/
|
||||||
template<typename Func>
|
template<typename Func>
|
||||||
RefreshDeferrer *createRefreshDeferrer(Func refreshNowFunc)
|
RefreshDeferrer *createRefreshDeferrer(Func refreshNowFunc)
|
||||||
@ -32,10 +32,10 @@ public:
|
|||||||
return deferrer;
|
return deferrer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Convenience method for creating and registering a RefreshDeferrer with a replacing Accumulator
|
* @brief Convenience method for creating and registering a RefreshDeferrer with a replacing Accumulator
|
||||||
* \param replaceIfNull passed to the ReplacingRefreshDeferrerAccumulator
|
* @param replaceIfNull passed to the ReplacingRefreshDeferrerAccumulator
|
||||||
* \param refreshNowFunc lambda taking a single parameter of type ParamResult, called when a refresh should occur
|
* @param refreshNowFunc lambda taking a single parameter of type ParamResult, called when a refresh should occur
|
||||||
*/
|
*/
|
||||||
template<class ParamResult, typename Func>
|
template<class ParamResult, typename Func>
|
||||||
RefreshDeferrer *createReplacingRefreshDeferrer(bool replaceIfNull, Func refreshNowFunc)
|
RefreshDeferrer *createReplacingRefreshDeferrer(bool replaceIfNull, Func refreshNowFunc)
|
||||||
|
@ -55,7 +55,7 @@ private:
|
|||||||
|
|
||||||
QString curHighlightedWord;
|
QString curHighlightedWord;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* offset of lines below the first line of the current seek
|
* offset of lines below the first line of the current seek
|
||||||
*/
|
*/
|
||||||
int cursorLineOffset;
|
int cursorLineOffset;
|
||||||
|
@ -63,7 +63,7 @@ public:
|
|||||||
QVariant data(const QModelIndex &index, int role) const;
|
QVariant data(const QModelIndex &index, int role) const;
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* @return true if the index changed
|
* @return true if the index changed
|
||||||
*/
|
*/
|
||||||
bool updateCurrentIndex();
|
bool updateCurrentIndex();
|
||||||
@ -139,8 +139,4 @@ private:
|
|||||||
void setScrollMode();
|
void setScrollMode();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // FUNCTIONSWIDGET_H
|
#endif // FUNCTIONSWIDGET_H
|
||||||
|
@ -11,8 +11,8 @@ class OverviewView : public GraphView
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
/*
|
/**
|
||||||
* \brief signal when mouse is pressed or moved so that
|
* @brief signal when mouse is pressed or moved so that
|
||||||
* Graph can refresh its contents corresponded with Overview
|
* Graph can refresh its contents corresponded with Overview
|
||||||
*/
|
*/
|
||||||
void mouseMoved();
|
void mouseMoved();
|
||||||
@ -21,13 +21,13 @@ public:
|
|||||||
OverviewView(QWidget *parent);
|
OverviewView(QWidget *parent);
|
||||||
~OverviewView() override;
|
~OverviewView() override;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief a rect on Overview to show where you are on Graph
|
* @brief a rect on Overview to show where you are on Graph
|
||||||
*/
|
*/
|
||||||
QRectF rangeRect;
|
QRectF rangeRect;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief Graph access this function to set minimum set of the data
|
* @brief Graph access this function to set minimum set of the data
|
||||||
* @param baseWidth width of Graph when it computed the blocks
|
* @param baseWidth width of Graph when it computed the blocks
|
||||||
* @param baseHeigh height of Graph when it computed the blocks
|
* @param baseHeigh height of Graph when it computed the blocks
|
||||||
* @param baseBlocks computed blocks passed by Graph
|
* @param baseBlocks computed blocks passed by Graph
|
||||||
@ -35,80 +35,80 @@ public:
|
|||||||
void setData(int baseWidth, int baseHeight, std::unordered_map<ut64, GraphBlock> baseBlocks);
|
void setData(int baseWidth, int baseHeight, std::unordered_map<ut64, GraphBlock> baseBlocks);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
/*
|
/**
|
||||||
* \brief refresh the view and adjust the scale
|
* @brief refresh the view and adjust the scale
|
||||||
*/
|
*/
|
||||||
void refreshView();
|
void refreshView();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/*
|
/**
|
||||||
* \brief update Colors.
|
* @brief update Colors.
|
||||||
* for example this will be called when the theme is changed.
|
* for example this will be called when the theme is changed.
|
||||||
*/
|
*/
|
||||||
void colorsUpdatedSlot();
|
void colorsUpdatedSlot();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/*
|
/**
|
||||||
* \brief mousePressEvent to start moving the rect.
|
* @brief mousePressEvent to start moving the rect.
|
||||||
*/
|
*/
|
||||||
void mousePressEvent(QMouseEvent *event) override;
|
void mousePressEvent(QMouseEvent *event) override;
|
||||||
/*
|
/**
|
||||||
* \brief mouseReleaseEvent to tell not to move the rect anymore.
|
* @brief mouseReleaseEvent to tell not to move the rect anymore.
|
||||||
*/
|
*/
|
||||||
void mouseReleaseEvent(QMouseEvent *event) override;
|
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||||
/*
|
/**
|
||||||
* \brief mouseMoveEvent to move the rect.
|
* @brief mouseMoveEvent to move the rect.
|
||||||
*/
|
*/
|
||||||
void mouseMoveEvent(QMouseEvent *event) override;
|
void mouseMoveEvent(QMouseEvent *event) override;
|
||||||
/*
|
/**
|
||||||
* \brief override this to prevent scrolling
|
* @brief override this to prevent scrolling
|
||||||
*/
|
*/
|
||||||
void wheelEvent(QWheelEvent *event) override;
|
void wheelEvent(QWheelEvent *event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/*
|
/**
|
||||||
* \brief this will be handled in mouse events to move the rect properly
|
* @brief this will be handled in mouse events to move the rect properly
|
||||||
* along with the mouse.
|
* along with the mouse.
|
||||||
*/
|
*/
|
||||||
bool mouseActive = false;
|
bool mouseActive = false;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief save the initial distance
|
* @brief save the initial distance
|
||||||
* between the point where the mouse was pressed and the point of the rect
|
* between the point where the mouse was pressed and the point of the rect
|
||||||
* so as to change the rect point properly along with mouse.
|
* so as to change the rect point properly along with mouse.
|
||||||
*/
|
*/
|
||||||
QPointF initialDiff;
|
QPointF initialDiff;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief draw the computed blocks passed by Graph
|
* @brief draw the computed blocks passed by Graph
|
||||||
*/
|
*/
|
||||||
virtual void drawBlock(QPainter &p, GraphView::GraphBlock &block) override;
|
virtual void drawBlock(QPainter &p, GraphView::GraphBlock &block) override;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief override the edgeConfiguration so as to
|
* @brief override the edgeConfiguration so as to
|
||||||
* adjust the width of the edges by the scale
|
* adjust the width of the edges by the scale
|
||||||
* @return EdgeConfiguration
|
* @return EdgeConfiguration
|
||||||
*/
|
*/
|
||||||
virtual GraphView::EdgeConfiguration edgeConfiguration(GraphView::GraphBlock &from,
|
virtual GraphView::EdgeConfiguration edgeConfiguration(GraphView::GraphBlock &from,
|
||||||
GraphView::GraphBlock *to) override;
|
GraphView::GraphBlock *to) override;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief override the paintEvent to draw the rect on Overview
|
* @brief override the paintEvent to draw the rect on Overview
|
||||||
*/
|
*/
|
||||||
void paintEvent(QPaintEvent *event) override;
|
void paintEvent(QPaintEvent *event) override;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief if the mouse is in the rect in Overview.
|
* @brief if the mouse is in the rect in Overview.
|
||||||
*/
|
*/
|
||||||
bool mouseContainsRect(QMouseEvent *event);
|
bool mouseContainsRect(QMouseEvent *event);
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief base background color changing depending on the theme
|
* @brief base background color changing depending on the theme
|
||||||
*/
|
*/
|
||||||
QColor disassemblyBackgroundColor;
|
QColor disassemblyBackgroundColor;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief color for each node changing depending on the theme
|
* @brief color for each node changing depending on the theme
|
||||||
*/
|
*/
|
||||||
QColor graphNodeColor;
|
QColor graphNodeColor;
|
||||||
};
|
};
|
||||||
|
@ -17,20 +17,20 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
RefreshDeferrer *refreshDeferrer;
|
RefreshDeferrer *refreshDeferrer;
|
||||||
/*
|
/**
|
||||||
* \brief this takes care of scaling the overview when the widget is resized
|
* @brief this takes care of scaling the overview when the widget is resized
|
||||||
*/
|
*/
|
||||||
void resizeEvent(QResizeEvent *event) override;
|
void resizeEvent(QResizeEvent *event) override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/*
|
/**
|
||||||
* \brief update the overview
|
* @brief update the overview
|
||||||
*/
|
*/
|
||||||
void updateContents();
|
void updateContents();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
/*
|
/**
|
||||||
* \brief emit signal to update the rect
|
* @brief emit signal to update the rect
|
||||||
*/
|
*/
|
||||||
void resized();
|
void resized();
|
||||||
};
|
};
|
||||||
|
@ -78,34 +78,34 @@ public:
|
|||||||
private slots:
|
private slots:
|
||||||
void refreshTypes();
|
void refreshTypes();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Show custom context menu
|
* @brief Show custom context menu
|
||||||
* \param pt Position of the place where the right mouse button was clicked
|
* @param pt Position of the place where the right mouse button was clicked
|
||||||
*/
|
*/
|
||||||
void showTypesContextMenu(const QPoint &pt);
|
void showTypesContextMenu(const QPoint &pt);
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Executed on clicking the Export Types option in the context menu
|
* @brief Executed on clicking the Export Types option in the context menu
|
||||||
* It shows the user a file dialog box to select a file where the types
|
* It shows the user a file dialog box to select a file where the types
|
||||||
* will be exported. It uses the "tc" command of radare2 to export the types.
|
* will be exported. It uses the "tc" command of radare2 to export the types.
|
||||||
*/
|
*/
|
||||||
void on_actionExport_Types_triggered();
|
void on_actionExport_Types_triggered();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Executed on clicking the Load New types option in the context menu
|
* @brief Executed on clicking the Load New types option in the context menu
|
||||||
* It will open the LoadNewTypesDialog where the user can either enter the
|
* It will open the LoadNewTypesDialog where the user can either enter the
|
||||||
* types manually, or can select a file from where the types will be loaded
|
* types manually, or can select a file from where the types will be loaded
|
||||||
*/
|
*/
|
||||||
void on_actionLoad_New_Types_triggered();
|
void on_actionLoad_New_Types_triggered();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Executed on clicking the Delete Type option in the context menu
|
* @brief Executed on clicking the Delete Type option in the context menu
|
||||||
* Upon confirmation from the user, it will delete the selected type.
|
* Upon confirmation from the user, it will delete the selected type.
|
||||||
*/
|
*/
|
||||||
void on_actionDelete_Type_triggered();
|
void on_actionDelete_Type_triggered();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Executed on clicking the Link To Address option in the context menu
|
* @brief Executed on clicking the Link To Address option in the context menu
|
||||||
* Opens the LinkTypeDialog box from where the user can link a address to a type
|
* Opens the LinkTypeDialog box from where the user can link a address to a type
|
||||||
*/
|
*/
|
||||||
void on_actionLink_Type_To_Address_triggered();
|
void on_actionLink_Type_To_Address_triggered();
|
||||||
@ -120,9 +120,9 @@ private:
|
|||||||
|
|
||||||
void setScrollMode();
|
void setScrollMode();
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* \brief Sets the contents of the ComboBox to the supplied contents
|
* @brief Sets the contents of the ComboBox to the supplied contents
|
||||||
* \param categories The list of categories which has to be added to the ComboBox
|
* @param categories The list of categories which has to be added to the ComboBox
|
||||||
*/
|
*/
|
||||||
void refreshCategoryCombo(const QStringList &categories);
|
void refreshCategoryCombo(const QStringList &categories);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user