fix: 插件系统调整;编辑视图绑定对应的 Hex 视图;

This commit is contained in:
寂静的羽夏 2025-03-28 19:06:18 +08:00
parent b63cb626d1
commit 445401ceeb
14 changed files with 2235 additions and 770 deletions

View File

@ -365,7 +365,7 @@
<context> <context>
<name>TestWingEditorViewWidget</name> <name>TestWingEditorViewWidget</name>
<message> <message>
<location filename="../testwingeditorviewwidget.cpp" line="48"/> <location filename="../testwingeditorviewwidget.cpp" line="47"/>
<source>TestWingEditorView</source> <source>TestWingEditorView</source>
<translation></translation> <translation></translation>
</message> </message>

View File

@ -210,7 +210,7 @@ void TestForm::on_btnWarning_clicked() {
} }
void TestForm::on_btnCritical_clicked() { void TestForm::on_btnCritical_clicked() {
critical( msgCritical(
this, ui->leMsgTitle->text(), ui->leMsgText->text(), getMsgButtons(), this, ui->leMsgTitle->text(), ui->leMsgText->text(), getMsgButtons(),
QMessageBox::StandardButton(ui->cbMsgDefButton->currentData().toInt())); QMessageBox::StandardButton(ui->cbMsgDefButton->currentData().toInt()));
} }
@ -337,7 +337,7 @@ void TestForm::on_btnTextTree_clicked() {
dataVisualTextTree(ui->teDataVisual->toPlainText(), dataVisualTextTree(ui->teDataVisual->toPlainText(),
QStringLiteral("TestForm"), _click, _dblclick); QStringLiteral("TestForm"), _click, _dblclick);
if (!ret) { if (!ret) {
critical(this, QStringLiteral("Test"), tr("UpdateTextTreeError")); msgCritical(this, QStringLiteral("Test"), tr("UpdateTextTreeError"));
} }
} }
@ -346,7 +346,7 @@ void TestForm::on_btnTextTable_clicked() {
ui->teDataVisual->toPlainText(), {"wingsummer", "wingsummer"}, {}, ui->teDataVisual->toPlainText(), {"wingsummer", "wingsummer"}, {},
QStringLiteral("TestForm"), _click, _dblclick); QStringLiteral("TestForm"), _click, _dblclick);
if (!ret) { if (!ret) {
critical(this, QStringLiteral("Test"), tr("UpdateTextTreeError")); msgCritical(this, QStringLiteral("Test"), tr("UpdateTextTreeError"));
} }
} }
@ -360,8 +360,8 @@ void TestForm::on_btnTextListByModel_clicked() {
auto ret = dataVisualTextListByModel(model, QStringLiteral("TestForm"), auto ret = dataVisualTextListByModel(model, QStringLiteral("TestForm"),
_click, _dblclick); _click, _dblclick);
if (!ret) { if (!ret) {
critical(this, QStringLiteral("Test"), msgCritical(this, QStringLiteral("Test"),
tr("UpdateTextListByModelError")); tr("UpdateTextListByModelError"));
} }
} }
@ -370,8 +370,8 @@ void TestForm::on_btnTextTableByModel_clicked() {
auto ret = dataVisualTextTableByModel(model, QStringLiteral("TestForm"), auto ret = dataVisualTextTableByModel(model, QStringLiteral("TestForm"),
_click, _dblclick); _click, _dblclick);
if (!ret) { if (!ret) {
critical(this, QStringLiteral("Test"), msgCritical(this, QStringLiteral("Test"),
tr("UpdateTextTableByModelError")); tr("UpdateTextTableByModelError"));
} }
} }
@ -381,8 +381,8 @@ void TestForm::on_btnTextTreeByModel_clicked() {
auto ret = dataVisualTextTreeByModel(model, QStringLiteral("TestForm"), auto ret = dataVisualTextTreeByModel(model, QStringLiteral("TestForm"),
_click, _dblclick); _click, _dblclick);
if (!ret) { if (!ret) {
critical(this, QStringLiteral("Test"), msgCritical(this, QStringLiteral("Test"),
tr("UpdateTextTreeByModelError")); tr("UpdateTextTreeByModelError"));
} }
} }

View File

@ -24,9 +24,8 @@
QList<TestWingEditorViewWidget *> TestWingEditorViewWidget::m_instances; QList<TestWingEditorViewWidget *> TestWingEditorViewWidget::m_instances;
TestWingEditorViewWidget::TestWingEditorViewWidget(WingHex::IWingPlugin *plg, TestWingEditorViewWidget::TestWingEditorViewWidget(QWidget *parent)
QWidget *parent) : WingHex::WingEditorViewWidget(parent) {
: WingHex::WingEditorViewWidget(plg, parent) {
auto layout = new QVBoxLayout(this); auto layout = new QVBoxLayout(this);
auto lbl = new QLabel(QStringLiteral("TestWingEditorView"), this); auto lbl = new QLabel(QStringLiteral("TestWingEditorView"), this);
lbl->setAlignment(Qt::AlignCenter); lbl->setAlignment(Qt::AlignCenter);

View File

@ -39,15 +39,13 @@ public:
virtual QString id() const override; virtual QString id() const override;
public: public:
virtual WingEditorViewWidget *create(WingHex::IWingPlugin *plg, virtual WingEditorViewWidget *create(QWidget *parent) const override {
QWidget *parent) const override { return new TestWingEditorViewWidget(parent);
return new TestWingEditorViewWidget(plg, parent);
} }
}; };
public: public:
explicit TestWingEditorViewWidget(WingHex::IWingPlugin *plg, explicit TestWingEditorViewWidget(QWidget *parent = nullptr);
QWidget *parent = nullptr);
virtual ~TestWingEditorViewWidget(); virtual ~TestWingEditorViewWidget();
void setEnableMeta(bool b); void setEnableMeta(bool b);

@ -1 +1 @@
Subproject commit 8e392b3609f39a987fa2e52e3dcf782eb5a07850 Subproject commit f0889de684ba323663cf5a715298e9b0fd4915e8

View File

@ -418,70 +418,75 @@
<context> <context>
<name>EditorView</name> <name>EditorView</name>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="81"/> <location filename="../../src/control/editorview.cpp" line="82"/>
<source>Cut</source> <source>Cut</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="83"/> <location filename="../../src/control/editorview.cpp" line="84"/>
<source>CutHex</source> <source>CutHex</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="85"/> <location filename="../../src/control/editorview.cpp" line="86"/>
<source>Copy</source> <source>Copy</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="87"/> <location filename="../../src/control/editorview.cpp" line="88"/>
<source>CopyHex</source> <source>CopyHex</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="89"/> <location filename="../../src/control/editorview.cpp" line="90"/>
<source>Paste</source> <source>Paste</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="91"/> <location filename="../../src/control/editorview.cpp" line="92"/>
<source>PasteHex</source> <source>PasteHex</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="93"/> <location filename="../../src/control/editorview.cpp" line="94"/>
<source>Delete</source> <source>Delete</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="96"/> <location filename="../../src/control/editorview.cpp" line="97"/>
<source>Find</source> <source>Find</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="98"/> <location filename="../../src/control/editorview.cpp" line="99"/>
<source>Goto</source> <source>Goto</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="100"/> <location filename="../../src/control/editorview.cpp" line="101"/>
<source>Fill</source> <source>Fill</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="102"/> <location filename="../../src/control/editorview.cpp" line="103"/>
<source>MetaData</source> <source>MetaData</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="104"/> <location filename="../../src/control/editorview.cpp" line="105"/>
<source>BookMark</source> <source>BookMark</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="264"/> <location filename="../../src/control/editorview.cpp" line="288"/>
<source>Untitled</source> <source>Untitled</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<location filename="../../src/control/editorview.cpp" line="835"/>
<source>Not allowed operation in non-UI thread</source>
<translation type="unfinished"> UI 线</translation>
</message>
</context> </context>
<context> <context>
<name>EncodingDialog</name> <name>EncodingDialog</name>
@ -2277,200 +2282,200 @@
<context> <context>
<name>PluginSystem</name> <name>PluginSystem</name>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2422"/> <location filename="../../src/class/pluginsystem.cpp" line="2375"/>
<source>LoadingPlugin</source> <source>LoadingPlugin</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2440"/> <location filename="../../src/class/pluginsystem.cpp" line="2393"/>
<source>InvalidPluginBrokenInfo</source> <source>InvalidPluginBrokenInfo</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2873"/> <location filename="../../src/class/pluginsystem.cpp" line="2826"/>
<source>AppClosingCanceled:</source> <source>AppClosingCanceled:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2950"/> <location filename="../../src/class/pluginsystem.cpp" line="2903"/>
<source>- PluginID:</source> <source>- PluginID:</source>
<translation>- ID</translation> <translation>- ID</translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2972"/> <location filename="../../src/class/pluginsystem.cpp" line="2925"/>
<source>FoundDrvPluginCount</source> <source>FoundDrvPluginCount</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3033"/> <location filename="../../src/class/pluginsystem.cpp" line="2986"/>
<source>RegisterScriptFnUnSupportedTypes:</source> <source>RegisterScriptFnUnSupportedTypes:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3043"/> <location filename="../../src/class/pluginsystem.cpp" line="2996"/>
<location filename="../../src/class/pluginsystem.cpp" line="3107"/> <location filename="../../src/class/pluginsystem.cpp" line="3060"/>
<source>RegisterScriptFnInvalidSig:</source> <source>RegisterScriptFnInvalidSig:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3051"/> <location filename="../../src/class/pluginsystem.cpp" line="3004"/>
<location filename="../../src/class/pluginsystem.cpp" line="3115"/> <location filename="../../src/class/pluginsystem.cpp" line="3068"/>
<source>RegisterScriptFnConflitSig:</source> <source>RegisterScriptFnConflitSig:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3166"/> <location filename="../../src/class/pluginsystem.cpp" line="3119"/>
<source>InvalidEnumName:</source> <source>InvalidEnumName:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3176"/> <location filename="../../src/class/pluginsystem.cpp" line="3129"/>
<source>InvalidEnumValue:</source> <source>InvalidEnumValue:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3211"/> <location filename="../../src/class/pluginsystem.cpp" line="3164"/>
<source>InvalidMarcosRegister:</source> <source>InvalidMarcosRegister:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3456"/> <location filename="../../src/class/pluginsystem.cpp" line="3409"/>
<source>ErrLoadPluginSDKVersion</source> <source>ErrLoadPluginSDKVersion</source>
<translation> SDK </translation> <translation> SDK </translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3460"/> <location filename="../../src/class/pluginsystem.cpp" line="3413"/>
<source>ErrLoadPluginNoName</source> <source>ErrLoadPluginNoName</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3481"/> <location filename="../../src/class/pluginsystem.cpp" line="3434"/>
<source>ErrLoadInitPlugin</source> <source>ErrLoadInitPlugin</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3488"/> <location filename="../../src/class/pluginsystem.cpp" line="3441"/>
<source>PluginName :</source> <source>PluginName :</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3489"/> <location filename="../../src/class/pluginsystem.cpp" line="3442"/>
<source>PluginAuthor :</source> <source>PluginAuthor :</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3490"/> <location filename="../../src/class/pluginsystem.cpp" line="3443"/>
<source>PluginWidgetRegister</source> <source>PluginWidgetRegister</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3594"/> <location filename="../../src/class/pluginsystem.cpp" line="3547"/>
<source>ErrLoadExtPluginSDKVersion</source> <source>ErrLoadExtPluginSDKVersion</source>
<translation> SDK </translation> <translation> SDK </translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3597"/> <location filename="../../src/class/pluginsystem.cpp" line="3550"/>
<source>ExtPluginAuthor :</source> <source>ExtPluginAuthor :</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3598"/> <location filename="../../src/class/pluginsystem.cpp" line="3551"/>
<source>ExtPluginWidgetRegister</source> <source>ExtPluginWidgetRegister</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3614"/> <location filename="../../src/class/pluginsystem.cpp" line="3567"/>
<source>ErrLoadInitExtPlugin</source> <source>ErrLoadInitExtPlugin</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3639"/> <location filename="../../src/class/pluginsystem.cpp" line="3592"/>
<source>ChooseFile</source> <source>ChooseFile</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3646"/> <location filename="../../src/class/pluginsystem.cpp" line="3599"/>
<location filename="../../src/class/pluginsystem.cpp" line="3651"/> <location filename="../../src/class/pluginsystem.cpp" line="3604"/>
<source>Error</source> <source>Error</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3647"/> <location filename="../../src/class/pluginsystem.cpp" line="3600"/>
<source>FileNotExist</source> <source>FileNotExist</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3652"/> <location filename="../../src/class/pluginsystem.cpp" line="3605"/>
<source>FilePermission</source> <source>FilePermission</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3682"/> <location filename="../../src/class/pluginsystem.cpp" line="3635"/>
<source>EmptyNameDockWidget:</source> <source>EmptyNameDockWidget:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3692"/> <location filename="../../src/class/pluginsystem.cpp" line="3645"/>
<source>InvalidNameDockWidget:</source> <source>InvalidNameDockWidget:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3700"/> <location filename="../../src/class/pluginsystem.cpp" line="3653"/>
<source>InvalidNullDockWidget:</source> <source>InvalidNullDockWidget:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3838"/> <location filename="../../src/class/pluginsystem.cpp" line="3791"/>
<source>Not allowed operation in non-UI thread</source> <source>Not allowed operation in non-UI thread</source>
<translation> UI 线</translation> <translation> UI 线</translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2998"/> <location filename="../../src/class/pluginsystem.cpp" line="2951"/>
<source>UnsafePluginDir</source> <source>UnsafePluginDir</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="461"/> <location filename="../../src/class/pluginsystem.cpp" line="436"/>
<source>[EvilCall]</source> <source>[EvilCall]</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2447"/> <location filename="../../src/class/pluginsystem.cpp" line="2400"/>
<source>InvalidPluginID</source> <source>InvalidPluginID</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2450"/> <location filename="../../src/class/pluginsystem.cpp" line="2403"/>
<source>InvalidDupPlugin</source> <source>InvalidDupPlugin</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2915"/> <location filename="../../src/class/pluginsystem.cpp" line="2868"/>
<source>FoundPluginCount</source> <source>FoundPluginCount</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2946"/> <location filename="../../src/class/pluginsystem.cpp" line="2899"/>
<source>PluginLoadingFailedSummary</source> <source>PluginLoadingFailedSummary</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2951"/> <location filename="../../src/class/pluginsystem.cpp" line="2904"/>
<source>- Dependencies:</source> <source>- Dependencies:</source>
<translation>- </translation> <translation>- </translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2953"/> <location filename="../../src/class/pluginsystem.cpp" line="2906"/>
<source>PUID:</source> <source>PUID:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2954"/> <location filename="../../src/class/pluginsystem.cpp" line="2907"/>
<source>Version:</source> <source>Version:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2961"/> <location filename="../../src/class/pluginsystem.cpp" line="2914"/>
<source>PluginLoadingFinished</source> <source>PluginLoadingFinished</source>
<translation></translation> <translation></translation>
</message> </message>

View File

@ -418,70 +418,75 @@
<context> <context>
<name>EditorView</name> <name>EditorView</name>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="81"/> <location filename="../../src/control/editorview.cpp" line="82"/>
<source>Cut</source> <source>Cut</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="83"/> <location filename="../../src/control/editorview.cpp" line="84"/>
<source>CutHex</source> <source>CutHex</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="85"/> <location filename="../../src/control/editorview.cpp" line="86"/>
<source>Copy</source> <source>Copy</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="87"/> <location filename="../../src/control/editorview.cpp" line="88"/>
<source>CopyHex</source> <source>CopyHex</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="89"/> <location filename="../../src/control/editorview.cpp" line="90"/>
<source>Paste</source> <source>Paste</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="91"/> <location filename="../../src/control/editorview.cpp" line="92"/>
<source>PasteHex</source> <source>PasteHex</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="93"/> <location filename="../../src/control/editorview.cpp" line="94"/>
<source>Delete</source> <source>Delete</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="96"/> <location filename="../../src/control/editorview.cpp" line="97"/>
<source>Find</source> <source>Find</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="98"/> <location filename="../../src/control/editorview.cpp" line="99"/>
<source>Goto</source> <source>Goto</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="100"/> <location filename="../../src/control/editorview.cpp" line="101"/>
<source>Fill</source> <source>Fill</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="102"/> <location filename="../../src/control/editorview.cpp" line="103"/>
<source>MetaData</source> <source>MetaData</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="104"/> <location filename="../../src/control/editorview.cpp" line="105"/>
<source>BookMark</source> <source>BookMark</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/control/editorview.cpp" line="264"/> <location filename="../../src/control/editorview.cpp" line="288"/>
<source>Untitled</source> <source>Untitled</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<location filename="../../src/control/editorview.cpp" line="835"/>
<source>Not allowed operation in non-UI thread</source>
<translation type="unfinished"> UI </translation>
</message>
</context> </context>
<context> <context>
<name>EncodingDialog</name> <name>EncodingDialog</name>
@ -2277,200 +2282,200 @@
<context> <context>
<name>PluginSystem</name> <name>PluginSystem</name>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2422"/> <location filename="../../src/class/pluginsystem.cpp" line="2375"/>
<source>LoadingPlugin</source> <source>LoadingPlugin</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2440"/> <location filename="../../src/class/pluginsystem.cpp" line="2393"/>
<source>InvalidPluginBrokenInfo</source> <source>InvalidPluginBrokenInfo</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2873"/> <location filename="../../src/class/pluginsystem.cpp" line="2826"/>
<source>AppClosingCanceled:</source> <source>AppClosingCanceled:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2950"/> <location filename="../../src/class/pluginsystem.cpp" line="2903"/>
<source>- PluginID:</source> <source>- PluginID:</source>
<translation>- ID</translation> <translation>- ID</translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2972"/> <location filename="../../src/class/pluginsystem.cpp" line="2925"/>
<source>FoundDrvPluginCount</source> <source>FoundDrvPluginCount</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3033"/> <location filename="../../src/class/pluginsystem.cpp" line="2986"/>
<source>RegisterScriptFnUnSupportedTypes:</source> <source>RegisterScriptFnUnSupportedTypes:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3043"/> <location filename="../../src/class/pluginsystem.cpp" line="2996"/>
<location filename="../../src/class/pluginsystem.cpp" line="3107"/> <location filename="../../src/class/pluginsystem.cpp" line="3060"/>
<source>RegisterScriptFnInvalidSig:</source> <source>RegisterScriptFnInvalidSig:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3051"/> <location filename="../../src/class/pluginsystem.cpp" line="3004"/>
<location filename="../../src/class/pluginsystem.cpp" line="3115"/> <location filename="../../src/class/pluginsystem.cpp" line="3068"/>
<source>RegisterScriptFnConflitSig:</source> <source>RegisterScriptFnConflitSig:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3166"/> <location filename="../../src/class/pluginsystem.cpp" line="3119"/>
<source>InvalidEnumName:</source> <source>InvalidEnumName:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3176"/> <location filename="../../src/class/pluginsystem.cpp" line="3129"/>
<source>InvalidEnumValue:</source> <source>InvalidEnumValue:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3211"/> <location filename="../../src/class/pluginsystem.cpp" line="3164"/>
<source>InvalidMarcosRegister:</source> <source>InvalidMarcosRegister:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3456"/> <location filename="../../src/class/pluginsystem.cpp" line="3409"/>
<source>ErrLoadPluginSDKVersion</source> <source>ErrLoadPluginSDKVersion</source>
<translation> SDK </translation> <translation> SDK </translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3460"/> <location filename="../../src/class/pluginsystem.cpp" line="3413"/>
<source>ErrLoadPluginNoName</source> <source>ErrLoadPluginNoName</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3481"/> <location filename="../../src/class/pluginsystem.cpp" line="3434"/>
<source>ErrLoadInitPlugin</source> <source>ErrLoadInitPlugin</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3488"/> <location filename="../../src/class/pluginsystem.cpp" line="3441"/>
<source>PluginName :</source> <source>PluginName :</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3489"/> <location filename="../../src/class/pluginsystem.cpp" line="3442"/>
<source>PluginAuthor :</source> <source>PluginAuthor :</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3490"/> <location filename="../../src/class/pluginsystem.cpp" line="3443"/>
<source>PluginWidgetRegister</source> <source>PluginWidgetRegister</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3594"/> <location filename="../../src/class/pluginsystem.cpp" line="3547"/>
<source>ErrLoadExtPluginSDKVersion</source> <source>ErrLoadExtPluginSDKVersion</source>
<translation> SDK </translation> <translation> SDK </translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3597"/> <location filename="../../src/class/pluginsystem.cpp" line="3550"/>
<source>ExtPluginAuthor :</source> <source>ExtPluginAuthor :</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3598"/> <location filename="../../src/class/pluginsystem.cpp" line="3551"/>
<source>ExtPluginWidgetRegister</source> <source>ExtPluginWidgetRegister</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3614"/> <location filename="../../src/class/pluginsystem.cpp" line="3567"/>
<source>ErrLoadInitExtPlugin</source> <source>ErrLoadInitExtPlugin</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3639"/> <location filename="../../src/class/pluginsystem.cpp" line="3592"/>
<source>ChooseFile</source> <source>ChooseFile</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3646"/> <location filename="../../src/class/pluginsystem.cpp" line="3599"/>
<location filename="../../src/class/pluginsystem.cpp" line="3651"/> <location filename="../../src/class/pluginsystem.cpp" line="3604"/>
<source>Error</source> <source>Error</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3647"/> <location filename="../../src/class/pluginsystem.cpp" line="3600"/>
<source>FileNotExist</source> <source>FileNotExist</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3652"/> <location filename="../../src/class/pluginsystem.cpp" line="3605"/>
<source>FilePermission</source> <source>FilePermission</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3682"/> <location filename="../../src/class/pluginsystem.cpp" line="3635"/>
<source>EmptyNameDockWidget:</source> <source>EmptyNameDockWidget:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3692"/> <location filename="../../src/class/pluginsystem.cpp" line="3645"/>
<source>InvalidNameDockWidget:</source> <source>InvalidNameDockWidget:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3700"/> <location filename="../../src/class/pluginsystem.cpp" line="3653"/>
<source>InvalidNullDockWidget:</source> <source>InvalidNullDockWidget:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="3838"/> <location filename="../../src/class/pluginsystem.cpp" line="3791"/>
<source>Not allowed operation in non-UI thread</source> <source>Not allowed operation in non-UI thread</source>
<translation> UI </translation> <translation> UI </translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2998"/> <location filename="../../src/class/pluginsystem.cpp" line="2951"/>
<source>UnsafePluginDir</source> <source>UnsafePluginDir</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="461"/> <location filename="../../src/class/pluginsystem.cpp" line="436"/>
<source>[EvilCall]</source> <source>[EvilCall]</source>
<translation>調</translation> <translation>調</translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2447"/> <location filename="../../src/class/pluginsystem.cpp" line="2400"/>
<source>InvalidPluginID</source> <source>InvalidPluginID</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2450"/> <location filename="../../src/class/pluginsystem.cpp" line="2403"/>
<source>InvalidDupPlugin</source> <source>InvalidDupPlugin</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2915"/> <location filename="../../src/class/pluginsystem.cpp" line="2868"/>
<source>FoundPluginCount</source> <source>FoundPluginCount</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2946"/> <location filename="../../src/class/pluginsystem.cpp" line="2899"/>
<source>PluginLoadingFailedSummary</source> <source>PluginLoadingFailedSummary</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2951"/> <location filename="../../src/class/pluginsystem.cpp" line="2904"/>
<source>- Dependencies:</source> <source>- Dependencies:</source>
<translation>- </translation> <translation>- </translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2953"/> <location filename="../../src/class/pluginsystem.cpp" line="2906"/>
<source>PUID:</source> <source>PUID:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2954"/> <location filename="../../src/class/pluginsystem.cpp" line="2907"/>
<source>Version:</source> <source>Version:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/class/pluginsystem.cpp" line="2961"/> <location filename="../../src/class/pluginsystem.cpp" line="2914"/>
<source>PluginLoadingFinished</source> <source>PluginLoadingFinished</source>
<translation></translation> <translation></translation>
</message> </message>

File diff suppressed because it is too large Load Diff

View File

@ -280,13 +280,7 @@ private:
Q_STATIC_ASSERT(std::is_integral_v<T> || std::is_floating_point_v<T>); Q_STATIC_ASSERT(std::is_integral_v<T> || std::is_floating_point_v<T>);
auto e = pluginCurrentEditor(plg); auto e = pluginCurrentEditor(plg);
if (e) { if (e) {
_rwlock.lockForRead(); return EditorView::readBasicTypeContent<T>(e, offset, _rwlock);
auto buffer = e->hexEditor()->document()->read(offset, sizeof(T));
if (buffer.size() == sizeof(T)) {
auto pb = reinterpret_cast<const T *>(buffer.constData());
_rwlock.unlock();
return *pb;
}
} }
if constexpr (std::is_floating_point_v<T>) { if constexpr (std::is_floating_point_v<T>) {
@ -302,18 +296,8 @@ private:
Q_STATIC_ASSERT(std::is_integral_v<T> || std::is_floating_point_v<T>); Q_STATIC_ASSERT(std::is_integral_v<T> || std::is_floating_point_v<T>);
auto e = getCurrentPluginView(plg); auto e = getCurrentPluginView(plg);
if (e) { if (e) {
auto editor = e->hexEditor(); return EditorView::insertBasicTypeContent<T>(
auto doc = editor->document(); e, offset, value, pluginCurrentUndoCmd(plg), _rwlock);
auto buffer = reinterpret_cast<const char *>(&value);
auto uc = pluginCurrentUndoCmd(plg);
auto cmd = doc->MakeInsert(uc, editor->cursor(), offset,
QByteArray(buffer, sizeof(T)));
if (uc == nullptr && cmd) {
_rwlock.lockForWrite();
doc->pushMakeUndo(cmd);
_rwlock.unlock();
return true;
}
} }
return false; return false;
} }
@ -324,18 +308,8 @@ private:
Q_STATIC_ASSERT(std::is_integral_v<T> || std::is_floating_point_v<T>); Q_STATIC_ASSERT(std::is_integral_v<T> || std::is_floating_point_v<T>);
auto e = getCurrentPluginView(plg); auto e = getCurrentPluginView(plg);
if (e) { if (e) {
auto editor = e->hexEditor(); return EditorView::writeBasicTypeContent<T>(
auto doc = editor->document(); e, offset, value, pluginCurrentUndoCmd(plg), _rwlock);
auto buffer = reinterpret_cast<const char *>(&value);
auto uc = pluginCurrentUndoCmd(plg);
auto cmd = doc->MakeReplace(uc, editor->cursor(), offset,
QByteArray(buffer, sizeof(T)));
if (uc == nullptr && cmd) {
_rwlock.lockForWrite();
doc->pushMakeUndo(cmd);
_rwlock.unlock();
return true;
}
} }
return false; return false;
} }
@ -345,18 +319,8 @@ private:
Q_STATIC_ASSERT(std::is_integral_v<T> || std::is_floating_point_v<T>); Q_STATIC_ASSERT(std::is_integral_v<T> || std::is_floating_point_v<T>);
auto e = getCurrentPluginView(plg); auto e = getCurrentPluginView(plg);
if (e) { if (e) {
auto editor = e->hexEditor(); return EditorView::appendBasicTypeContent<T>(
auto doc = editor->document(); e, value, pluginCurrentUndoCmd(plg), _rwlock);
auto buffer = reinterpret_cast<const char *>(&value);
auto uc = pluginCurrentUndoCmd(plg);
auto cmd = doc->MakeAppend(uc, editor->cursor(),
QByteArray(buffer, sizeof(T)));
if (uc == nullptr && cmd) {
_rwlock.lockForWrite();
doc->pushMakeUndo(cmd);
_rwlock.unlock();
return true;
}
} }
return false; return false;
} }
@ -374,474 +338,419 @@ private:
// IWingPluginBase API // IWingPluginBase API
public: public:
WING_SERVICE void toast(WingHex::IWingPluginBase *sender, WING_SERVICE void toast(QObject *sender, const QPixmap &icon,
const QPixmap &icon, const QString &message); const QString &message);
// logging // logging
WING_SERVICE void logTrace(WingHex::IWingPluginBase *sender, WING_SERVICE void logTrace(QObject *sender, const QString &message);
const QString &message); WING_SERVICE void logDebug(QObject *sender, const QString &message);
WING_SERVICE void logDebug(WingHex::IWingPluginBase *sender, WING_SERVICE void logInfo(QObject *sender, const QString &message);
const QString &message); WING_SERVICE void logWarn(QObject *sender, const QString &message);
WING_SERVICE void logInfo(WingHex::IWingPluginBase *sender, WING_SERVICE void logError(QObject *sender, const QString &message);
const QString &message); WING_SERVICE bool raiseDockWidget(QObject *sender, QWidget *w);
WING_SERVICE void logWarn(WingHex::IWingPluginBase *sender,
const QString &message); WING_SERVICE WingHex::AppTheme currentAppTheme(QObject *sender);
WING_SERVICE void logError(WingHex::IWingPluginBase *sender, WING_SERVICE QDialog *createDialog(QObject *sender, QWidget *content);
const QString &message);
WING_SERVICE bool raiseDockWidget(WingHex::IWingPluginBase *sender,
QWidget *w);
WING_SERVICE WingHex::AppTheme
currentAppTheme(WingHex::IWingPluginBase *sender);
WING_SERVICE QDialog *createDialog(WingHex::IWingPluginBase *sender,
QWidget *content);
public: public:
WING_SERVICE void msgAboutQt(WingHex::IWingPluginBase *sender, WING_SERVICE void msgAboutQt(QObject *sender, QWidget *parent,
QWidget *parent, const QString &title); const QString &title);
WING_SERVICE QMessageBox::StandardButton WING_SERVICE QMessageBox::StandardButton
msgInformation(WingHex::IWingPluginBase *sender, QWidget *parent, msgInformation(QObject *sender, QWidget *parent, const QString &title,
const QString &title, const QString &text, const QString &text, QMessageBox::StandardButtons buttons,
QMessageBox::StandardButtons buttons,
QMessageBox::StandardButton defaultButton); QMessageBox::StandardButton defaultButton);
WING_SERVICE QMessageBox::StandardButton WING_SERVICE QMessageBox::StandardButton
msgQuestion(WingHex::IWingPluginBase *sender, QWidget *parent, msgQuestion(QObject *sender, QWidget *parent, const QString &title,
const QString &title, const QString &text, const QString &text, QMessageBox::StandardButtons buttons,
QMessageBox::StandardButtons buttons,
QMessageBox::StandardButton defaultButton); QMessageBox::StandardButton defaultButton);
WING_SERVICE QMessageBox::StandardButton WING_SERVICE QMessageBox::StandardButton
msgWarning(WingHex::IWingPluginBase *sender, QWidget *parent, msgWarning(QObject *sender, QWidget *parent, const QString &title,
const QString &title, const QString &text, const QString &text, QMessageBox::StandardButtons buttons,
QMessageBox::StandardButtons buttons,
QMessageBox::StandardButton defaultButton); QMessageBox::StandardButton defaultButton);
WING_SERVICE QMessageBox::StandardButton WING_SERVICE QMessageBox::StandardButton
msgCritical(WingHex::IWingPluginBase *sender, QWidget *parent, msgCritical(QObject *sender, QWidget *parent, const QString &title,
const QString &title, const QString &text, const QString &text, QMessageBox::StandardButtons buttons,
QMessageBox::StandardButtons buttons,
QMessageBox::StandardButton defaultButton); QMessageBox::StandardButton defaultButton);
WING_SERVICE void msgAbout(WingHex::IWingPluginBase *sender, WING_SERVICE void msgAbout(QObject *sender, QWidget *parent,
QWidget *parent, const QString &title, const QString &title, const QString &text);
const QString &text);
WING_SERVICE QMessageBox::StandardButton WING_SERVICE QMessageBox::StandardButton
msgbox(WingHex::IWingPluginBase *sender, QWidget *parent, msgbox(QObject *sender, QWidget *parent, QMessageBox::Icon icon,
QMessageBox::Icon icon, const QString &title, const QString &text, const QString &title, const QString &text,
QMessageBox::StandardButtons buttons, QMessageBox::StandardButtons buttons,
QMessageBox::StandardButton defaultButton); QMessageBox::StandardButton defaultButton);
public: public:
WING_SERVICE QString dlgGetText(WingHex::IWingPluginBase *sender, WING_SERVICE QString dlgGetText(QObject *sender, QWidget *parent,
QWidget *parent, const QString &title, const QString &title, const QString &label,
const QString &label,
QLineEdit::EchoMode echo, QLineEdit::EchoMode echo,
const QString &text, bool *ok, const QString &text, bool *ok,
Qt::InputMethodHints inputMethodHints); Qt::InputMethodHints inputMethodHints);
WING_SERVICE QString dlgGetMultiLineText( WING_SERVICE QString
WingHex::IWingPluginBase *sender, QWidget *parent, const QString &title, dlgGetMultiLineText(QObject *sender, QWidget *parent, const QString &title,
const QString &label, const QString &text, bool *ok, const QString &label, const QString &text, bool *ok,
Qt::InputMethodHints inputMethodHints); Qt::InputMethodHints inputMethodHints);
WING_SERVICE QString dlgGetItem(WingHex::IWingPluginBase *sender, WING_SERVICE QString dlgGetItem(QObject *sender, QWidget *parent,
QWidget *parent, const QString &title, const QString &title, const QString &label,
const QString &label,
const QStringList &items, int current, const QStringList &items, int current,
bool editable, bool *ok, bool editable, bool *ok,
Qt::InputMethodHints inputMethodHints); Qt::InputMethodHints inputMethodHints);
WING_SERVICE int dlgGetInt(WingHex::IWingPluginBase *sender, WING_SERVICE int dlgGetInt(QObject *sender, QWidget *parent,
QWidget *parent, const QString &title, const QString &title, const QString &label,
const QString &label, int value, int minValue, int value, int minValue, int maxValue, int step,
int maxValue, int step, bool *ok); bool *ok);
WING_SERVICE double dlgGetDouble(WingHex::IWingPluginBase *sender, WING_SERVICE double dlgGetDouble(QObject *sender, QWidget *parent,
QWidget *parent, const QString &title, const QString &title, const QString &label,
const QString &label, double value, double value, double minValue,
double minValue, double maxValue, double maxValue, int decimals, bool *ok,
int decimals, bool *ok, double step); double step);
public: public:
WING_SERVICE QString WING_SERVICE QString dlgGetExistingDirectory(QObject *sender,
dlgGetExistingDirectory(WingHex::IWingPluginBase *sender, QWidget *parent, QWidget *parent,
const QString &caption, const QString &dir, const QString &caption,
QFileDialog::Options options); const QString &dir,
WING_SERVICE QString dlgGetOpenFileName( QFileDialog::Options options);
WingHex::IWingPluginBase *sender, QWidget *parent, WING_SERVICE QString dlgGetOpenFileName(QObject *sender, QWidget *parent,
const QString &caption, const QString &dir, const QString &filter, const QString &caption,
QString *selectedFilter, QFileDialog::Options options); const QString &dir,
const QString &filter,
QString *selectedFilter,
QFileDialog::Options options);
WING_SERVICE QStringList dlgGetOpenFileNames( WING_SERVICE QStringList dlgGetOpenFileNames(
WingHex::IWingPluginBase *sender, QWidget *parent, QObject *sender, QWidget *parent, const QString &caption,
const QString &caption, const QString &dir, const QString &filter, const QString &dir, const QString &filter, QString *selectedFilter,
QString *selectedFilter, QFileDialog::Options options); QFileDialog::Options options);
WING_SERVICE QString dlgGetSaveFileName( WING_SERVICE QString dlgGetSaveFileName(QObject *sender, QWidget *parent,
WingHex::IWingPluginBase *sender, QWidget *parent, const QString &caption,
const QString &caption, const QString &dir, const QString &filter, const QString &dir,
QString *selectedFilter, QFileDialog::Options options); const QString &filter,
QString *selectedFilter,
QFileDialog::Options options);
WING_SERVICE QColor dlgGetColor(WingHex::IWingPluginBase *sender, WING_SERVICE QColor dlgGetColor(QObject *sender, const QString &caption,
const QString &caption, QWidget *parent); QWidget *parent);
// IWingPlugin API // IWingPlugin API
public: public:
WING_SERVICE bool existsServiceHost(WingHex::IWingPluginBase *sender, WING_SERVICE bool existsServiceHost(QObject *sender, const QString &puid);
const QString &puid);
WING_SERVICE bool WING_SERVICE bool
invokeService(WingHex::IWingPluginBase *sender, const QString &puid, invokeService(QObject *sender, const QString &puid, const char *method,
const char *method, Qt::ConnectionType type, Qt::ConnectionType type, QGenericReturnArgument ret,
QGenericReturnArgument ret, QGenericArgument val0, QGenericArgument val0, QGenericArgument val1,
QGenericArgument val1, QGenericArgument val2, QGenericArgument val2, QGenericArgument val3,
QGenericArgument val3, QGenericArgument val4); QGenericArgument val4);
bool invokeService(QObject *sender, const QString &selfpuid,
const QString &puid, const char *method,
Qt::ConnectionType type, QGenericReturnArgument ret,
QGenericArgument val0, QGenericArgument val1,
QGenericArgument val2, QGenericArgument val3,
QGenericArgument val4);
WING_SERVICE bool isCurrentDocEditing(WingHex::IWingPluginBase *sender); WING_SERVICE bool isCurrentDocEditing(QObject *sender);
WING_SERVICE QString currentDocFilename(WingHex::IWingPluginBase *sender); WING_SERVICE QString currentDocFilename(QObject *sender);
// document // document
WING_SERVICE bool isReadOnly(WingHex::IWingPluginBase *sender); WING_SERVICE bool isReadOnly(QObject *sender);
WING_SERVICE bool isInsertionMode(WingHex::IWingPluginBase *sender); WING_SERVICE bool isInsertionMode(QObject *sender);
WING_SERVICE bool isKeepSize(WingHex::IWingPluginBase *sender); WING_SERVICE bool isKeepSize(QObject *sender);
WING_SERVICE bool isLocked(WingHex::IWingPluginBase *sender); WING_SERVICE bool isLocked(QObject *sender);
WING_SERVICE qsizetype documentLines(WingHex::IWingPluginBase *sender); WING_SERVICE qsizetype documentLines(QObject *sender);
WING_SERVICE qsizetype documentBytes(WingHex::IWingPluginBase *sender); WING_SERVICE qsizetype documentBytes(QObject *sender);
WING_SERVICE WingHex::HexPosition WING_SERVICE WingHex::HexPosition currentPos(QObject *sender);
currentPos(WingHex::IWingPluginBase *sender);
WING_SERVICE qsizetype currentRow(WingHex::IWingPluginBase *sender); WING_SERVICE qsizetype currentRow(QObject *sender);
WING_SERVICE qsizetype currentColumn(WingHex::IWingPluginBase *sender); WING_SERVICE qsizetype currentColumn(QObject *sender);
WING_SERVICE qsizetype currentOffset(WingHex::IWingPluginBase *sender); WING_SERVICE qsizetype currentOffset(QObject *sender);
WING_SERVICE qsizetype selectedLength(WingHex::IWingPluginBase *sender); WING_SERVICE qsizetype selectedLength(QObject *sender);
WING_SERVICE QByteArray selectedBytes(WingHex::IWingPluginBase *sender, WING_SERVICE QByteArray selectedBytes(QObject *sender, qsizetype index);
qsizetype index);
WING_SERVICE QByteArrayList WING_SERVICE QByteArrayList selectionBytes(QObject *sender);
selectionBytes(WingHex::IWingPluginBase *sender);
WING_SERVICE WingHex::HexPosition WING_SERVICE WingHex::HexPosition selectionStart(QObject *sender,
selectionStart(WingHex::IWingPluginBase *sender, qsizetype index); qsizetype index);
WING_SERVICE WingHex::HexPosition WING_SERVICE WingHex::HexPosition selectionEnd(QObject *sender,
selectionEnd(WingHex::IWingPluginBase *sender, qsizetype index); qsizetype index);
WING_SERVICE qsizetype selectionLength(WingHex::IWingPluginBase *sender, WING_SERVICE qsizetype selectionLength(QObject *sender, qsizetype index);
qsizetype index);
WING_SERVICE qsizetype selectionCount(WingHex::IWingPluginBase *sender); WING_SERVICE qsizetype selectionCount(QObject *sender);
WING_SERVICE bool stringVisible(WingHex::IWingPluginBase *sender); WING_SERVICE bool stringVisible(QObject *sender);
WING_SERVICE bool addressVisible(WingHex::IWingPluginBase *sender); WING_SERVICE bool addressVisible(QObject *sender);
WING_SERVICE bool headerVisible(WingHex::IWingPluginBase *sender); WING_SERVICE bool headerVisible(QObject *sender);
WING_SERVICE quintptr addressBase(WingHex::IWingPluginBase *sender); WING_SERVICE quintptr addressBase(QObject *sender);
WING_SERVICE bool isModified(WingHex::IWingPluginBase *sender); WING_SERVICE bool isModified(QObject *sender);
WING_SERVICE qint8 readInt8(WingHex::IWingPluginBase *sender, WING_SERVICE qint8 readInt8(QObject *sender, qsizetype offset);
qsizetype offset);
WING_SERVICE qint16 readInt16(WingHex::IWingPluginBase *sender, WING_SERVICE qint16 readInt16(QObject *sender, qsizetype offset);
qsizetype offset);
WING_SERVICE qint32 readInt32(WingHex::IWingPluginBase *sender, WING_SERVICE qint32 readInt32(QObject *sender, qsizetype offset);
qsizetype offset);
WING_SERVICE qint64 readInt64(WingHex::IWingPluginBase *sender, WING_SERVICE qint64 readInt64(QObject *sender, qsizetype offset);
qsizetype offset);
WING_SERVICE quint8 readUInt8(WingHex::IWingPluginBase *sender, WING_SERVICE quint8 readUInt8(QObject *sender, qsizetype offset);
qsizetype offset);
WING_SERVICE quint16 readUInt16(WingHex::IWingPluginBase *sender, WING_SERVICE quint16 readUInt16(QObject *sender, qsizetype offset);
qsizetype offset);
WING_SERVICE quint32 readUInt32(WingHex::IWingPluginBase *sender, WING_SERVICE quint32 readUInt32(QObject *sender, qsizetype offset);
qsizetype offset);
WING_SERVICE quint64 readUInt64(WingHex::IWingPluginBase *sender, WING_SERVICE quint64 readUInt64(QObject *sender, qsizetype offset);
qsizetype offset);
WING_SERVICE float readFloat(WingHex::IWingPluginBase *sender, WING_SERVICE float readFloat(QObject *sender, qsizetype offset);
qsizetype offset);
WING_SERVICE double readDouble(WingHex::IWingPluginBase *sender, WING_SERVICE double readDouble(QObject *sender, qsizetype offset);
qsizetype offset);
WING_SERVICE QString readString(WingHex::IWingPluginBase *sender, WING_SERVICE QString readString(QObject *sender, qsizetype offset,
qsizetype offset, const QString &encoding); const QString &encoding);
WING_SERVICE QByteArray readBytes(WingHex::IWingPluginBase *sender, WING_SERVICE QByteArray readBytes(QObject *sender, qsizetype offset,
qsizetype offset, qsizetype count); qsizetype count);
WING_SERVICE qsizetype findNext(WingHex::IWingPluginBase *sender, WING_SERVICE qsizetype findNext(QObject *sender, qsizetype begin,
qsizetype begin, const QByteArray &ba); const QByteArray &ba);
WING_SERVICE qsizetype findPrevious(WingHex::IWingPluginBase *sender, WING_SERVICE qsizetype findPrevious(QObject *sender, qsizetype begin,
qsizetype begin, const QByteArray &ba); const QByteArray &ba);
WING_SERVICE QString bookMarkComment(WingHex::IWingPluginBase *sender, WING_SERVICE QString bookMarkComment(QObject *sender, qsizetype pos);
qsizetype pos);
WING_SERVICE bool existBookMark(WingHex::IWingPluginBase *sender, WING_SERVICE bool existBookMark(QObject *sender, qsizetype pos);
qsizetype pos);
// document // document
WING_SERVICE bool switchDocument(WingHex::IWingPluginBase *sender, WING_SERVICE bool switchDocument(QObject *sender, int handle);
int handle);
WING_SERVICE bool raiseDocument(WingHex::IWingPluginBase *sender, WING_SERVICE bool raiseDocument(QObject *sender, int handle);
int handle);
WING_SERVICE bool setLockedFile(WingHex::IWingPluginBase *sender, bool b); WING_SERVICE bool setLockedFile(QObject *sender, bool b);
WING_SERVICE bool setKeepSize(WingHex::IWingPluginBase *sender, bool b); WING_SERVICE bool setKeepSize(QObject *sender, bool b);
WING_SERVICE bool setStringVisible(WingHex::IWingPluginBase *sender, WING_SERVICE bool setStringVisible(QObject *sender, bool b);
bool b);
WING_SERVICE bool setAddressVisible(WingHex::IWingPluginBase *sender, WING_SERVICE bool setAddressVisible(QObject *sender, bool b);
bool b);
WING_SERVICE bool setHeaderVisible(WingHex::IWingPluginBase *sender, WING_SERVICE bool setHeaderVisible(QObject *sender, bool b);
bool b);
WING_SERVICE bool setAddressBase(WingHex::IWingPluginBase *sender, WING_SERVICE bool setAddressBase(QObject *sender, quintptr base);
quintptr base);
WING_SERVICE bool beginMarco(WingHex::IWingPluginBase *sender, WING_SERVICE bool beginMarco(QObject *sender, const QString &txt);
const QString &txt);
WING_SERVICE bool endMarco(WingHex::IWingPluginBase *sender); WING_SERVICE bool endMarco(QObject *sender);
WING_SERVICE bool writeInt8(WingHex::IWingPluginBase *sender, WING_SERVICE bool writeInt8(QObject *sender, qsizetype offset, qint8 value);
qsizetype offset, qint8 value);
WING_SERVICE bool writeInt16(WingHex::IWingPluginBase *sender, WING_SERVICE bool writeInt16(QObject *sender, qsizetype offset,
qsizetype offset, qint16 value); qint16 value);
WING_SERVICE bool writeInt32(WingHex::IWingPluginBase *sender, WING_SERVICE bool writeInt32(QObject *sender, qsizetype offset,
qsizetype offset, qint32 value); qint32 value);
WING_SERVICE bool writeInt64(WingHex::IWingPluginBase *sender, WING_SERVICE bool writeInt64(QObject *sender, qsizetype offset,
qsizetype offset, qint64 value); qint64 value);
WING_SERVICE bool writeUInt8(WingHex::IWingPluginBase *sender, WING_SERVICE bool writeUInt8(QObject *sender, qsizetype offset,
qsizetype offset, quint8 value); quint8 value);
WING_SERVICE bool writeUInt16(WingHex::IWingPluginBase *sender, WING_SERVICE bool writeUInt16(QObject *sender, qsizetype offset,
qsizetype offset, quint16 value); quint16 value);
WING_SERVICE bool writeUInt32(WingHex::IWingPluginBase *sender, WING_SERVICE bool writeUInt32(QObject *sender, qsizetype offset,
qsizetype offset, quint32 value); quint32 value);
WING_SERVICE bool writeUInt64(WingHex::IWingPluginBase *sender, WING_SERVICE bool writeUInt64(QObject *sender, qsizetype offset,
qsizetype offset, quint64 value); quint64 value);
WING_SERVICE bool writeFloat(WingHex::IWingPluginBase *sender, WING_SERVICE bool writeFloat(QObject *sender, qsizetype offset,
qsizetype offset, float value); float value);
WING_SERVICE bool writeDouble(WingHex::IWingPluginBase *sender, WING_SERVICE bool writeDouble(QObject *sender, qsizetype offset,
qsizetype offset, double value); double value);
WING_SERVICE bool writeString(WingHex::IWingPluginBase *sender, WING_SERVICE bool writeString(QObject *sender, qsizetype offset,
qsizetype offset, const QString &value, const QString &value,
const QString &encoding); const QString &encoding);
WING_SERVICE bool writeBytes(WingHex::IWingPluginBase *sender, WING_SERVICE bool writeBytes(QObject *sender, qsizetype offset,
qsizetype offset, const QByteArray &data); const QByteArray &data);
WING_SERVICE bool insertInt8(WingHex::IWingPluginBase *sender, WING_SERVICE bool insertInt8(QObject *sender, qsizetype offset,
qsizetype offset, qint8 value); qint8 value);
WING_SERVICE bool insertInt16(WingHex::IWingPluginBase *sender, WING_SERVICE bool insertInt16(QObject *sender, qsizetype offset,
qsizetype offset, qint16 value);
WING_SERVICE bool insertInt32(WingHex::IWingPluginBase *sender,
qsizetype offset, qint32 value);
WING_SERVICE bool insertInt64(WingHex::IWingPluginBase *sender,
qsizetype offset, qint64 value);
WING_SERVICE bool insertUInt8(WingHex::IWingPluginBase *sender,
qsizetype offset, quint8 value);
WING_SERVICE bool insertUInt16(WingHex::IWingPluginBase *sender,
qsizetype offset, quint16 value);
WING_SERVICE bool insertUInt32(WingHex::IWingPluginBase *sender,
qsizetype offset, quint32 value);
WING_SERVICE bool insertUInt64(WingHex::IWingPluginBase *sender,
qsizetype offset, quint64 value);
WING_SERVICE bool insertFloat(WingHex::IWingPluginBase *sender,
qsizetype offset, float value);
WING_SERVICE bool insertDouble(WingHex::IWingPluginBase *sender,
qsizetype offset, double value);
WING_SERVICE bool insertString(WingHex::IWingPluginBase *sender,
qsizetype offset, const QString &value,
const QString &encoding);
WING_SERVICE bool insertBytes(WingHex::IWingPluginBase *sender,
qsizetype offset, const QByteArray &data);
WING_SERVICE bool appendInt8(WingHex::IWingPluginBase *sender, qint8 value);
WING_SERVICE bool appendInt16(WingHex::IWingPluginBase *sender,
qint16 value); qint16 value);
WING_SERVICE bool appendInt32(WingHex::IWingPluginBase *sender, WING_SERVICE bool insertInt32(QObject *sender, qsizetype offset,
qint32 value); qint32 value);
WING_SERVICE bool appendInt64(WingHex::IWingPluginBase *sender, WING_SERVICE bool insertInt64(QObject *sender, qsizetype offset,
qint64 value); qint64 value);
WING_SERVICE bool appendUInt8(WingHex::IWingPluginBase *sender, WING_SERVICE bool insertUInt8(QObject *sender, qsizetype offset,
quint8 value); quint8 value);
WING_SERVICE bool appendUInt16(WingHex::IWingPluginBase *sender, WING_SERVICE bool insertUInt16(QObject *sender, qsizetype offset,
quint16 value); quint16 value);
WING_SERVICE bool appendUInt32(WingHex::IWingPluginBase *sender, WING_SERVICE bool insertUInt32(QObject *sender, qsizetype offset,
quint32 value); quint32 value);
WING_SERVICE bool appendUInt64(WingHex::IWingPluginBase *sender, WING_SERVICE bool insertUInt64(QObject *sender, qsizetype offset,
quint64 value); quint64 value);
WING_SERVICE bool appendFloat(WingHex::IWingPluginBase *sender, WING_SERVICE bool insertFloat(QObject *sender, qsizetype offset,
float value); float value);
WING_SERVICE bool appendDouble(WingHex::IWingPluginBase *sender, WING_SERVICE bool insertDouble(QObject *sender, qsizetype offset,
double value); double value);
WING_SERVICE bool appendString(WingHex::IWingPluginBase *sender, WING_SERVICE bool insertString(QObject *sender, qsizetype offset,
const QString &value, const QString &value,
const QString &encoding); const QString &encoding);
WING_SERVICE bool appendBytes(WingHex::IWingPluginBase *sender, WING_SERVICE bool insertBytes(QObject *sender, qsizetype offset,
const QByteArray &data); const QByteArray &data);
WING_SERVICE bool removeBytes(WingHex::IWingPluginBase *sender, WING_SERVICE bool appendInt8(QObject *sender, qint8 value);
qsizetype offset, qsizetype len);
WING_SERVICE bool appendInt16(QObject *sender, qint16 value);
WING_SERVICE bool appendInt32(QObject *sender, qint32 value);
WING_SERVICE bool appendInt64(QObject *sender, qint64 value);
WING_SERVICE bool appendUInt8(QObject *sender, quint8 value);
WING_SERVICE bool appendUInt16(QObject *sender, quint16 value);
WING_SERVICE bool appendUInt32(QObject *sender, quint32 value);
WING_SERVICE bool appendUInt64(QObject *sender, quint64 value);
WING_SERVICE bool appendFloat(QObject *sender, float value);
WING_SERVICE bool appendDouble(QObject *sender, double value);
WING_SERVICE bool appendString(QObject *sender, const QString &value,
const QString &encoding);
WING_SERVICE bool appendBytes(QObject *sender, const QByteArray &data);
WING_SERVICE bool removeBytes(QObject *sender, qsizetype offset,
qsizetype len);
// cursor // cursor
WING_SERVICE bool moveTo(WingHex::IWingPluginBase *sender, qsizetype line, WING_SERVICE bool moveTo(QObject *sender, qsizetype line, qsizetype column,
qsizetype column, int nibbleindex, int nibbleindex, bool clearSelection);
WING_SERVICE bool moveTo(QObject *sender, qsizetype offset,
bool clearSelection); bool clearSelection);
WING_SERVICE bool moveTo(WingHex::IWingPluginBase *sender, qsizetype offset, WING_SERVICE bool select(QObject *sender, qsizetype offset,
bool clearSelection);
WING_SERVICE bool select(WingHex::IWingPluginBase *sender, qsizetype offset,
qsizetype length, SelectionMode mode); qsizetype length, SelectionMode mode);
WING_SERVICE bool setInsertionMode(WingHex::IWingPluginBase *sender, WING_SERVICE bool setInsertionMode(QObject *sender, bool isinsert);
bool isinsert);
WING_SERVICE bool metadata(WingHex::IWingPluginBase *sender, WING_SERVICE bool metadata(QObject *sender, qsizetype begin,
qsizetype begin, qsizetype length, qsizetype length, const QColor &fgcolor,
const QColor &fgcolor, const QColor &bgcolor, const QColor &bgcolor, const QString &comment);
const QString &comment);
WING_SERVICE bool removeMetadata(WingHex::IWingPluginBase *sender, WING_SERVICE bool removeMetadata(QObject *sender, qsizetype offset);
qsizetype offset);
WING_SERVICE bool clearMetadata(WingHex::IWingPluginBase *sender); WING_SERVICE bool clearMetadata(QObject *sender);
WING_SERVICE bool setMetaVisible(WingHex::IWingPluginBase *sender, bool b); WING_SERVICE bool setMetaVisible(QObject *sender, bool b);
WING_SERVICE bool setMetafgVisible(WingHex::IWingPluginBase *sender, WING_SERVICE bool setMetafgVisible(QObject *sender, bool b);
bool b);
WING_SERVICE bool setMetabgVisible(WingHex::IWingPluginBase *sender, WING_SERVICE bool setMetabgVisible(QObject *sender, bool b);
bool b);
WING_SERVICE bool setMetaCommentVisible(WingHex::IWingPluginBase *sender, WING_SERVICE bool setMetaCommentVisible(QObject *sender, bool b);
bool b);
// mainwindow // mainwindow
WING_SERVICE WingHex::ErrFile newFile(WingHex::IWingPluginBase *sender); WING_SERVICE WingHex::ErrFile newFile(QObject *sender);
WING_SERVICE WingHex::ErrFile openFile(WingHex::IWingPluginBase *sender, WING_SERVICE WingHex::ErrFile openFile(QObject *sender,
const QString &filename); const QString &filename);
WING_SERVICE WingHex::ErrFile openExtFile(WingHex::IWingPluginBase *sender,
const QString &ext,
const QString &file);
WING_SERVICE WingHex::ErrFile WING_SERVICE WingHex::ErrFile
openWorkSpace(WingHex::IWingPluginBase *sender, const QString &filename); openExtFile(QObject *sender, const QString &ext, const QString &file);
WING_SERVICE WingHex::ErrFile closeHandle(WingHex::IWingPluginBase *sender, WING_SERVICE WingHex::ErrFile openWorkSpace(QObject *sender,
int handle); const QString &filename);
WING_SERVICE WingHex::ErrFile closeFile(WingHex::IWingPluginBase *sender, WING_SERVICE WingHex::ErrFile closeHandle(QObject *sender, int handle);
int handle, bool force);
WING_SERVICE WingHex::ErrFile saveFile(WingHex::IWingPluginBase *sender, WING_SERVICE WingHex::ErrFile closeFile(QObject *sender, int handle,
int handle); bool force);
WING_SERVICE WingHex::ErrFile exportFile(WingHex::IWingPluginBase *sender, WING_SERVICE WingHex::ErrFile saveFile(QObject *sender, int handle);
int handle,
WING_SERVICE WingHex::ErrFile exportFile(QObject *sender, int handle,
const QString &savename); const QString &savename);
WING_SERVICE WingHex::ErrFile saveAsFile(WingHex::IWingPluginBase *sender, WING_SERVICE WingHex::ErrFile saveAsFile(QObject *sender, int handle,
int handle,
const QString &savename); const QString &savename);
WING_SERVICE WingHex::ErrFile openCurrent(WingHex::IWingPluginBase *sender); WING_SERVICE WingHex::ErrFile openCurrent(QObject *sender);
WING_SERVICE WingHex::ErrFile closeCurrent(WingHex::IWingPluginBase *sender, WING_SERVICE WingHex::ErrFile closeCurrent(QObject *sender, bool force);
bool force);
WING_SERVICE WingHex::ErrFile saveCurrent(WingHex::IWingPluginBase *sender); WING_SERVICE WingHex::ErrFile saveCurrent(QObject *sender);
WING_SERVICE WingHex::ErrFile WING_SERVICE WingHex::ErrFile exportCurrent(QObject *sender,
exportCurrent(WingHex::IWingPluginBase *sender, const QString &savename); const QString &savename);
WING_SERVICE WingHex::ErrFile WING_SERVICE WingHex::ErrFile saveAsCurrent(QObject *sender,
saveAsCurrent(WingHex::IWingPluginBase *sender, const QString &savename); const QString &savename);
// bookmark // bookmark
WING_SERVICE bool addBookMark(WingHex::IWingPluginBase *sender, WING_SERVICE bool addBookMark(QObject *sender, qsizetype pos,
qsizetype pos, const QString &comment); const QString &comment);
WING_SERVICE bool modBookMark(WingHex::IWingPluginBase *sender, WING_SERVICE bool modBookMark(QObject *sender, qsizetype pos,
qsizetype pos, const QString &comment); const QString &comment);
WING_SERVICE bool removeBookMark(WingHex::IWingPluginBase *sender, WING_SERVICE bool removeBookMark(QObject *sender, qsizetype pos);
qsizetype pos);
WING_SERVICE bool clearBookMark(WingHex::IWingPluginBase *sender); WING_SERVICE bool clearBookMark(QObject *sender);
// extension // extension
WING_SERVICE bool closeAllFiles(WingHex::IWingPluginBase *sender); WING_SERVICE bool closeAllFiles(QObject *sender);
public: public:
WING_SERVICE bool dataVisualText(WingHex::IWingPluginBase *sender, WING_SERVICE bool dataVisualText(QObject *sender, const QString &data,
const QString &data, const QString &title); const QString &title);
WING_SERVICE bool dataVisualTextList(WingHex::IWingPluginBase *sender, WING_SERVICE bool dataVisualTextList(QObject *sender,
const QStringList &data, const QStringList &data,
const QString &title, const QString &title,
WingHex::ClickedCallBack clicked, WingHex::ClickedCallBack clicked,
WingHex::ClickedCallBack dblClicked); WingHex::ClickedCallBack dblClicked);
WING_SERVICE bool dataVisualTextTree(WingHex::IWingPluginBase *sender, WING_SERVICE bool dataVisualTextTree(QObject *sender, const QString &json,
const QString &json,
const QString &title, const QString &title,
WingHex::ClickedCallBack clicked, WingHex::ClickedCallBack clicked,
WingHex::ClickedCallBack dblClicked); WingHex::ClickedCallBack dblClicked);
WING_SERVICE bool dataVisualTextTable(WingHex::IWingPluginBase *sender, WING_SERVICE bool dataVisualTextTable(QObject *sender, const QString &json,
const QString &json,
const QStringList &headers, const QStringList &headers,
const QStringList &headerNames, const QStringList &headerNames,
const QString &title, const QString &title,
@ -849,33 +758,25 @@ public:
WingHex::ClickedCallBack dblClicked); WingHex::ClickedCallBack dblClicked);
// API for Qt Plugin Only // API for Qt Plugin Only
WING_SERVICE bool WING_SERVICE bool dataVisualTextListByModel(
dataVisualTextListByModel(WingHex::IWingPluginBase *sender, QObject *sender, QAbstractItemModel *model, const QString &title,
QAbstractItemModel *model, const QString &title, WingHex::ClickedCallBack clicked, WingHex::ClickedCallBack dblClicked);
WingHex::ClickedCallBack clicked,
WingHex::ClickedCallBack dblClicked);
WING_SERVICE bool WING_SERVICE bool dataVisualTextTableByModel(
dataVisualTextTableByModel(WingHex::IWingPluginBase *sender, QObject *sender, QAbstractItemModel *model, const QString &title,
QAbstractItemModel *model, const QString &title, WingHex::ClickedCallBack clicked, WingHex::ClickedCallBack dblClicked);
WingHex::ClickedCallBack clicked,
WingHex::ClickedCallBack dblClicked);
WING_SERVICE bool WING_SERVICE bool dataVisualTextTreeByModel(
dataVisualTextTreeByModel(WingHex::IWingPluginBase *sender, QObject *sender, QAbstractItemModel *model, const QString &title,
QAbstractItemModel *model, const QString &title, WingHex::ClickedCallBack clicked, WingHex::ClickedCallBack dblClicked);
WingHex::ClickedCallBack clicked,
WingHex::ClickedCallBack dblClicked);
private: private:
WingHex::IWingPlugin *checkPluginAndReport(WingHex::IWingPluginBase *sender, WingHex::IWingPlugin *checkPluginAndReport(QObject *sender,
const char *func); const char *func);
WingHex::IWingDevice *checkBaseAndReport(WingHex::IWingPluginBase *sender, WingHex::IWingDevice *checkBaseAndReport(QObject *sender, const char *func);
const char *func);
bool checkErrAllAllowAndReport(WingHex::IWingPluginBase *sender, bool checkErrAllAllowAndReport(QObject *sender, const char *func);
const char *func);
private: private:
CallTable _plgFns; CallTable _plgFns;

View File

@ -348,7 +348,7 @@ void WingAngelAPI::installMsgboxAPI(asIScriptEngine *engine) {
QMessageBox::StandardButtons, QMessageBox::StandardButtons,
QMessageBox::StandardButton)>( QMessageBox::StandardButton)>(
engine, engine,
std::bind(&WingHex::IWingPlugin::critical, this, nullptr, std::bind(&WingHex::IWingPlugin::msgCritical, this, nullptr,
std::placeholders::_1, std::placeholders::_2, std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3, std::placeholders::_4), std::placeholders::_3, std::placeholders::_4),
"void critical(const string &in title, const string &in text, " "void critical(const string &in title, const string &in text, "

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,7 @@
#ifndef EDITORVIEW_H #ifndef EDITORVIEW_H
#define EDITORVIEW_H #define EDITORVIEW_H
#include <QObject> #include <QReadWriteLock>
#include <QStackedWidget> #include <QStackedWidget>
#include "QHexView/qhexview.h" #include "QHexView/qhexview.h"
@ -51,6 +51,93 @@ public:
public: public:
static QString getDeviceFileName(const QString &ext, const QString &file); static QString getDeviceFileName(const QString &ext, const QString &file);
public:
// helper functions for plugin system
template <typename T>
static T readBasicTypeContent(EditorView *view, qsizetype offset,
QReadWriteLock &lock) {
Q_ASSERT(view);
Q_STATIC_ASSERT(std::is_integral_v<T> || std::is_floating_point_v<T>);
lock.lockForRead();
auto buffer = view->hexEditor()->document()->read(offset, sizeof(T));
if (buffer.size() == sizeof(T)) {
auto pb = reinterpret_cast<const T *>(buffer.constData());
lock.unlock();
return *pb;
}
if constexpr (std::is_floating_point_v<T>) {
return qQNaN();
} else {
return T(0);
}
}
template <typename T>
static bool insertBasicTypeContent(EditorView *view, qsizetype offset,
const T &value, QUndoCommand *uc,
QReadWriteLock &lock) {
Q_ASSERT(view);
Q_STATIC_ASSERT(std::is_integral_v<T> || std::is_floating_point_v<T>);
auto editor = view->hexEditor();
auto doc = editor->document();
auto buffer = reinterpret_cast<const char *>(&value);
auto cmd = doc->MakeInsert(uc, editor->cursor(), offset,
QByteArray(buffer, sizeof(T)));
if (uc == nullptr && cmd) {
lock.lockForWrite();
doc->pushMakeUndo(cmd);
lock.unlock();
return true;
}
return false;
}
template <typename T>
static bool writeBasicTypeContent(EditorView *view, qsizetype offset,
const T &value, QUndoCommand *uc,
QReadWriteLock &lock) {
Q_ASSERT(view);
Q_STATIC_ASSERT(std::is_integral_v<T> || std::is_floating_point_v<T>);
auto editor = view->hexEditor();
auto doc = editor->document();
auto buffer = reinterpret_cast<const char *>(&value);
auto cmd = doc->MakeReplace(uc, editor->cursor(), offset,
QByteArray(buffer, sizeof(T)));
if (uc == nullptr && cmd) {
lock.lockForWrite();
doc->pushMakeUndo(cmd);
lock.unlock();
return true;
}
return false;
}
template <typename T>
static bool appendBasicTypeContent(EditorView *view, const T &value,
QUndoCommand *uc, QReadWriteLock &lock) {
Q_ASSERT(view);
Q_STATIC_ASSERT(std::is_integral_v<T> || std::is_floating_point_v<T>);
auto editor = view->hexEditor();
auto doc = editor->document();
auto buffer = reinterpret_cast<const char *>(&value);
auto cmd = doc->MakeAppend(uc, editor->cursor(),
QByteArray(buffer, sizeof(T)));
if (uc == nullptr && cmd) {
lock.lockForWrite();
doc->pushMakeUndo(cmd);
lock.unlock();
return true;
}
return false;
}
public: public:
explicit EditorView(QWidget *parent = nullptr); explicit EditorView(QWidget *parent = nullptr);
virtual ~EditorView() override; virtual ~EditorView() override;
@ -141,6 +228,299 @@ private:
int contextSize, int contextSize,
int maxDisplayBytes); int maxDisplayBytes);
void applyFunctionTables(WingHex::WingEditorViewWidget *view,
const CallTable &fns);
private:
bool checkErrAndReport(QObject *sender, const char *func);
bool checkThreadAff();
private:
WING_SERVICE bool existsServiceHost(QObject *caller, const QString &puid);
WING_SERVICE bool
invokeService(QObject *caller, const QString &puid, const char *method,
Qt::ConnectionType type, QGenericReturnArgument ret,
QGenericArgument val0, QGenericArgument val1,
QGenericArgument val2, QGenericArgument val3,
QGenericArgument val4);
private:
WING_SERVICE QString currentDocFilename(QObject *caller);
// document
WING_SERVICE bool isReadOnly(QObject *caller);
WING_SERVICE bool isInsertionMode(QObject *caller);
WING_SERVICE bool isKeepSize(QObject *caller);
WING_SERVICE bool isLocked(QObject *caller);
WING_SERVICE qsizetype documentLines(QObject *caller);
WING_SERVICE qsizetype documentBytes(QObject *caller);
WING_SERVICE WingHex::HexPosition currentPos(QObject *caller);
WING_SERVICE qsizetype currentRow(QObject *caller);
WING_SERVICE qsizetype currentColumn(QObject *caller);
WING_SERVICE qsizetype currentOffset(QObject *caller);
WING_SERVICE qsizetype selectedLength(QObject *caller);
WING_SERVICE QByteArray selectedBytes(QObject *caller, qsizetype index);
WING_SERVICE QByteArrayList selectionBytes(QObject *caller);
WING_SERVICE WingHex::HexPosition selectionStart(QObject *caller,
qsizetype index);
WING_SERVICE WingHex::HexPosition selectionEnd(QObject *caller,
qsizetype index);
WING_SERVICE qsizetype selectionLength(QObject *caller, qsizetype index);
WING_SERVICE qsizetype selectionCount(QObject *caller);
WING_SERVICE bool stringVisible(QObject *caller);
WING_SERVICE bool addressVisible(QObject *caller);
WING_SERVICE bool headerVisible(QObject *caller);
WING_SERVICE quintptr addressBase(QObject *caller);
WING_SERVICE bool isModified(QObject *caller);
WING_SERVICE qint8 readInt8(QObject *caller, qsizetype offset);
WING_SERVICE qint16 readInt16(QObject *caller, qsizetype offset);
WING_SERVICE qint32 readInt32(QObject *caller, qsizetype offset);
WING_SERVICE qint64 readInt64(QObject *caller, qsizetype offset);
WING_SERVICE quint8 readUInt8(QObject *caller, qsizetype offset);
WING_SERVICE quint16 readUInt16(QObject *caller, qsizetype offset);
WING_SERVICE quint32 readUInt32(QObject *caller, qsizetype offset);
WING_SERVICE quint64 readUInt64(QObject *caller, qsizetype offset);
WING_SERVICE float readFloat(QObject *caller, qsizetype offset);
WING_SERVICE double readDouble(QObject *caller, qsizetype offset);
WING_SERVICE QString readString(QObject *caller, qsizetype offset,
const QString &encoding);
WING_SERVICE QByteArray readBytes(QObject *caller, qsizetype offset,
qsizetype count);
WING_SERVICE qsizetype findNext(QObject *caller, qsizetype begin,
const QByteArray &ba);
WING_SERVICE qsizetype findPrevious(QObject *caller, qsizetype begin,
const QByteArray &ba);
WING_SERVICE QString bookMarkComment(QObject *caller, qsizetype pos);
WING_SERVICE bool existBookMark(QObject *caller, qsizetype pos);
WING_SERVICE bool setLockedFile(QObject *caller, bool b);
WING_SERVICE bool setKeepSize(QObject *caller, bool b);
WING_SERVICE bool setStringVisible(QObject *caller, bool b);
WING_SERVICE bool setAddressVisible(QObject *caller, bool b);
WING_SERVICE bool setHeaderVisible(QObject *caller, bool b);
WING_SERVICE bool setAddressBase(QObject *caller, quintptr base);
WING_SERVICE bool beginMarco(QObject *caller, const QString &txt);
bool endMarco(QObject *caller);
WING_SERVICE bool writeInt8(QObject *caller, qsizetype offset, qint8 value);
WING_SERVICE bool writeInt16(QObject *caller, qsizetype offset,
qint16 value);
WING_SERVICE bool writeInt32(QObject *caller, qsizetype offset,
qint32 value);
WING_SERVICE bool writeInt64(QObject *caller, qsizetype offset,
qint64 value);
WING_SERVICE bool writeUInt8(QObject *caller, qsizetype offset,
quint8 value);
WING_SERVICE bool writeUInt16(QObject *caller, qsizetype offset,
quint16 value);
WING_SERVICE bool writeUInt32(QObject *caller, qsizetype offset,
quint32 value);
WING_SERVICE bool writeUInt64(QObject *caller, qsizetype offset,
quint64 value);
WING_SERVICE bool writeFloat(QObject *caller, qsizetype offset,
float value);
WING_SERVICE bool writeDouble(QObject *caller, qsizetype offset,
double value);
WING_SERVICE
bool writeString(QObject *caller, qsizetype offset, const QString &value,
const QString &encoding);
WING_SERVICE bool writeBytes(QObject *caller, qsizetype offset,
const QByteArray &data);
WING_SERVICE bool insertInt8(QObject *caller, qsizetype offset,
qint8 value);
WING_SERVICE bool insertInt16(QObject *caller, qsizetype offset,
qint16 value);
WING_SERVICE bool insertInt32(QObject *caller, qsizetype offset,
qint32 value);
WING_SERVICE bool insertInt64(QObject *caller, qsizetype offset,
qint64 value);
WING_SERVICE bool insertUInt8(QObject *caller, qsizetype offset,
quint8 value);
WING_SERVICE
bool insertUInt16(QObject *caller, qsizetype offset, quint16 value);
WING_SERVICE
bool insertUInt32(QObject *caller, qsizetype offset, quint32 value);
WING_SERVICE bool insertUInt64(QObject *caller, qsizetype offset,
quint64 value);
WING_SERVICE bool insertFloat(QObject *caller, qsizetype offset,
float value);
WING_SERVICE bool insertDouble(QObject *caller, qsizetype offset,
double value);
WING_SERVICE bool insertString(QObject *caller, qsizetype offset,
const QString &value,
const QString &encoding);
WING_SERVICE bool insertBytes(QObject *caller, qsizetype offset,
const QByteArray &data);
WING_SERVICE bool appendInt8(QObject *caller, qint8 value);
WING_SERVICE bool appendInt16(QObject *caller, qint16 value);
WING_SERVICE bool appendInt32(QObject *caller, qint32 value);
WING_SERVICE bool appendInt64(QObject *caller, qint64 value);
WING_SERVICE bool appendUInt8(QObject *caller, quint8 value);
WING_SERVICE bool appendUInt16(QObject *caller, quint16 value);
WING_SERVICE bool appendUInt32(QObject *caller, quint32 value);
WING_SERVICE bool appendUInt64(QObject *caller, quint64 value);
WING_SERVICE bool appendFloat(QObject *caller, float value);
WING_SERVICE bool appendDouble(QObject *caller, double value);
WING_SERVICE bool appendString(QObject *caller, const QString &value,
const QString &encoding);
WING_SERVICE bool appendBytes(QObject *caller, const QByteArray &data);
WING_SERVICE bool removeBytes(QObject *caller, qsizetype offset,
qsizetype len);
// cursor
WING_SERVICE bool moveTo(QObject *caller, qsizetype line, qsizetype column,
int nibbleindex, bool clearSelection);
WING_SERVICE bool moveTo(QObject *caller, qsizetype offset,
bool clearSelection);
WING_SERVICE bool select(QObject *caller, qsizetype offset,
qsizetype length, SelectionMode mode);
WING_SERVICE bool setInsertionMode(QObject *caller, bool isinsert);
// metadata
WING_SERVICE bool metadata(QObject *caller, qsizetype begin,
qsizetype length, const QColor &fgcolor,
const QColor &bgcolor, const QString &comment);
WING_SERVICE bool removeMetadata(QObject *caller, qsizetype offset);
WING_SERVICE bool clearMetadata(QObject *caller);
WING_SERVICE bool setMetaVisible(QObject *caller, bool b);
WING_SERVICE bool setMetafgVisible(QObject *caller, bool b);
WING_SERVICE bool setMetabgVisible(QObject *caller, bool b);
WING_SERVICE bool setMetaCommentVisible(QObject *caller, bool b);
// bookmark
WING_SERVICE bool addBookMark(QObject *caller, qsizetype pos,
const QString &comment);
WING_SERVICE bool modBookMark(QObject *caller, qsizetype pos,
const QString &comment);
WING_SERVICE bool removeBookMark(QObject *caller, qsizetype pos);
WING_SERVICE bool clearBookMark(QObject *caller);
private:
WING_SERVICE void toast(QObject *caller, const QPixmap &icon,
const QString &message);
WING_SERVICE void logTrace(QObject *caller, const QString &message);
WING_SERVICE void logDebug(QObject *caller, const QString &message);
WING_SERVICE void logWarn(QObject *caller, const QString &message);
WING_SERVICE void logError(QObject *caller, const QString &message);
WING_SERVICE void logInfo(QObject *caller, const QString &message);
WING_SERVICE bool raiseDockWidget(QObject *caller, QWidget *w);
// theme
WING_SERVICE WingHex::AppTheme currentAppTheme(QObject *caller);
// not available for AngelScript
// only for plugin UI extenstion
WING_SERVICE QDialog *createDialog(QObject *caller, QWidget *content);
private:
WING_SERVICE void msgAboutQt(QObject *caller, QWidget *parent = nullptr,
const QString &title = QString());
WING_SERVICE QMessageBox::StandardButton msgInformation(
QObject *caller, QWidget *parent, const QString &title,
const QString &text,
QMessageBox::StandardButtons buttons = QMessageBox::Ok,
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
WING_SERVICE QMessageBox::StandardButton msgQuestion(
QObject *caller, QWidget *parent, const QString &title,
const QString &text,
QMessageBox::StandardButtons buttons =
QMessageBox::StandardButtons(QMessageBox::Yes | QMessageBox::No),
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
WING_SERVICE QMessageBox::StandardButton msgWarning(
QObject *caller, QWidget *parent, const QString &title,
const QString &text,
QMessageBox::StandardButtons buttons = QMessageBox::Ok,
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
WING_SERVICE QMessageBox::StandardButton msgCritical(
QObject *caller, QWidget *parent, const QString &title,
const QString &text,
QMessageBox::StandardButtons buttons = QMessageBox::Ok,
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
WING_SERVICE void msgAbout(QObject *caller, QWidget *parent,
const QString &title, const QString &text);
WING_SERVICE QMessageBox::StandardButton
msgbox(QObject *caller, QWidget *parent, QMessageBox::Icon icon,
const QString &title, const QString &text,
QMessageBox::StandardButtons buttons = QMessageBox::NoButton,
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
private:
WING_SERVICE QString dlgGetText(QObject *caller, QWidget *parent,
const QString &title, const QString &label,
QLineEdit::EchoMode echo,
const QString &text, bool *ok,
Qt::InputMethodHints inputMethodHints);
WING_SERVICE QString
dlgGetMultiLineText(QObject *caller, QWidget *parent, const QString &title,
const QString &label, const QString &text, bool *ok,
Qt::InputMethodHints inputMethodHints);
WING_SERVICE QString dlgGetItem(QObject *caller, QWidget *parent,
const QString &title, const QString &label,
const QStringList &items, int current,
bool editable, bool *ok,
Qt::InputMethodHints inputMethodHints);
WING_SERVICE int dlgGetInt(QObject *caller, QWidget *parent,
const QString &title, const QString &label,
int value, int minValue, int maxValue, int step,
bool *ok);
WING_SERVICE double dlgGetDouble(QObject *caller, QWidget *parent,
const QString &title, const QString &label,
double value, double minValue,
double maxValue, int decimals, bool *ok,
double step);
private:
WING_SERVICE QString dlgGetExistingDirectory(QObject *caller,
QWidget *parent,
const QString &caption,
const QString &dir,
QFileDialog::Options options);
WING_SERVICE QString dlgGetOpenFileName(QObject *caller, QWidget *parent,
const QString &caption,
const QString &dir,
const QString &filter,
QString *selectedFilter,
QFileDialog::Options options);
WING_SERVICE QStringList dlgGetOpenFileNames(
QObject *caller, QWidget *parent, const QString &caption,
const QString &dir, const QString &filter, QString *selectedFilter,
QFileDialog::Options options);
WING_SERVICE QString dlgGetSaveFileName(QObject *caller, QWidget *parent,
const QString &caption,
const QString &dir,
const QString &filter,
QString *selectedFilter,
QFileDialog::Options options);
private:
WING_SERVICE QColor dlgGetColor(QObject *caller, const QString &caption,
QWidget *parent);
private: private:
template <typename Func> template <typename Func>
inline void newAction(QWidget *parent, const QString &icon, inline void newAction(QWidget *parent, const QString &icon,
@ -208,6 +588,9 @@ private:
QString _ext; QString _ext;
WingHex::WingIODevice *_dev = nullptr; WingHex::WingIODevice *_dev = nullptr;
QString _file; QString _file;
QReadWriteLock _rwlock;
CallTable _viewFns;
}; };
#endif // EDITORVIEW_H #endif // EDITORVIEW_H

View File

@ -3182,7 +3182,7 @@ void MainWindow::registerEditorView(EditorView *editor, const QString &ws) {
for (auto p = m_editorViewWidgets.constKeyValueBegin(); for (auto p = m_editorViewWidgets.constKeyValueBegin();
p != m_editorViewWidgets.constKeyValueEnd(); p++) { p != m_editorViewWidgets.constKeyValueEnd(); p++) {
for (auto &w : p->second) { for (auto &w : p->second) {
auto v = w->create(p->first, editor); auto v = w->create(editor);
auto id = w->id(); auto id = w->id();
editor->registerView(id, v); editor->registerView(id, v);
connect(v, &WingEditorViewWidget::savedStateChanged, this, connect(v, &WingEditorViewWidget::savedStateChanged, this,

View File

@ -595,11 +595,9 @@ private:
// these variables will be invalid after restoring state // these variables will be invalid after restoring state
ads::CDockAreaWidget *m_leftViewArea = nullptr; ads::CDockAreaWidget *m_leftViewArea = nullptr;
ads::CDockAreaWidget *m_rightViewArea = ads::CDockAreaWidget *m_rightViewArea = nullptr;
nullptr; // 闂傚倷娴囧畷鍨叏閺夋嚚娲閵堝懐锛熼梻渚囧墮缁夋挳鎮為崹顐犱簻闁圭儤鍨甸顏堟煥濞戞艾鏋庨柍瑙勫灴閹瑩宕f径濠冪亷闂備浇顕栭崰鏇犲垝濞嗘劒绻嗛柟闂寸劍閺呮粎绱掑☉姗嗗剱鐞氀囨⒒閸屾凹鐓柛瀣鐓ら柕鍫濐槸缁犵姷鈧箍鍎卞ú銊х不閺傛鐔嗛悹杞拌閸庢垿鏌嶇紒妯活棃闁哄睙鍡欑杸闁规儳鍟挎潏鍛存⒑鏉炴壆绛忛柟鍑ゆ嫹
ads::CDockAreaWidget *m_topViewArea = nullptr; ads::CDockAreaWidget *m_topViewArea = nullptr;
ads::CDockAreaWidget *m_bottomViewArea = ads::CDockAreaWidget *m_bottomViewArea = nullptr;
nullptr; // 闂傚倷娴囧畷鍨叏閺夋嚚娲閵堝懐锛熼梻渚囧墮缁夋挳鎮為崹顐犱簻闁圭儤鍨甸顏堟煥濞戞艾鏋庨柍瑙勫灴閹瑩宕f径濠冪亷闂備浇顕栭崰鏇犲垝濞嗘劒绻嗛柟闂寸劍閺呮粎绱掑☉姗嗗剱鐞氀囨⒒閸屾凹鐓柛瀣鐓ら柕鍫濐槸缁犵姷鈧箍鍎卞ú銊х不閺傛鐔嗛悹杞拌閸庢垿鏌嶇紒妯活棃闁哄睙鍡欑杸闁规儳鍟挎潏鍛存⒑鏉炴壆绛忛柟鍑ゆ嫹
//================================ //================================