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>
<name>TestWingEditorViewWidget</name>
<message>
<location filename="../testwingeditorviewwidget.cpp" line="48"/>
<location filename="../testwingeditorviewwidget.cpp" line="47"/>
<source>TestWingEditorView</source>
<translation></translation>
</message>

View File

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

View File

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

View File

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

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

View File

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

View File

@ -418,70 +418,75 @@
<context>
<name>EditorView</name>
<message>
<location filename="../../src/control/editorview.cpp" line="81"/>
<location filename="../../src/control/editorview.cpp" line="82"/>
<source>Cut</source>
<translation></translation>
</message>
<message>
<location filename="../../src/control/editorview.cpp" line="83"/>
<location filename="../../src/control/editorview.cpp" line="84"/>
<source>CutHex</source>
<translation></translation>
</message>
<message>
<location filename="../../src/control/editorview.cpp" line="85"/>
<location filename="../../src/control/editorview.cpp" line="86"/>
<source>Copy</source>
<translation></translation>
</message>
<message>
<location filename="../../src/control/editorview.cpp" line="87"/>
<location filename="../../src/control/editorview.cpp" line="88"/>
<source>CopyHex</source>
<translation></translation>
</message>
<message>
<location filename="../../src/control/editorview.cpp" line="89"/>
<location filename="../../src/control/editorview.cpp" line="90"/>
<source>Paste</source>
<translation></translation>
</message>
<message>
<location filename="../../src/control/editorview.cpp" line="91"/>
<location filename="../../src/control/editorview.cpp" line="92"/>
<source>PasteHex</source>
<translation></translation>
</message>
<message>
<location filename="../../src/control/editorview.cpp" line="93"/>
<location filename="../../src/control/editorview.cpp" line="94"/>
<source>Delete</source>
<translation></translation>
</message>
<message>
<location filename="../../src/control/editorview.cpp" line="96"/>
<location filename="../../src/control/editorview.cpp" line="97"/>
<source>Find</source>
<translation></translation>
</message>
<message>
<location filename="../../src/control/editorview.cpp" line="98"/>
<location filename="../../src/control/editorview.cpp" line="99"/>
<source>Goto</source>
<translation></translation>
</message>
<message>
<location filename="../../src/control/editorview.cpp" line="100"/>
<location filename="../../src/control/editorview.cpp" line="101"/>
<source>Fill</source>
<translation></translation>
</message>
<message>
<location filename="../../src/control/editorview.cpp" line="102"/>
<location filename="../../src/control/editorview.cpp" line="103"/>
<source>MetaData</source>
<translation></translation>
</message>
<message>
<location filename="../../src/control/editorview.cpp" line="104"/>
<location filename="../../src/control/editorview.cpp" line="105"/>
<source>BookMark</source>
<translation></translation>
</message>
<message>
<location filename="../../src/control/editorview.cpp" line="264"/>
<location filename="../../src/control/editorview.cpp" line="288"/>
<source>Untitled</source>
<translation></translation>
</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>
<name>EncodingDialog</name>
@ -2277,200 +2282,200 @@
<context>
<name>PluginSystem</name>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="2422"/>
<location filename="../../src/class/pluginsystem.cpp" line="2375"/>
<source>LoadingPlugin</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="2440"/>
<location filename="../../src/class/pluginsystem.cpp" line="2393"/>
<source>InvalidPluginBrokenInfo</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="2873"/>
<location filename="../../src/class/pluginsystem.cpp" line="2826"/>
<source>AppClosingCanceled:</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="2950"/>
<location filename="../../src/class/pluginsystem.cpp" line="2903"/>
<source>- PluginID:</source>
<translation>- ID</translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="2972"/>
<location filename="../../src/class/pluginsystem.cpp" line="2925"/>
<source>FoundDrvPluginCount</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3033"/>
<location filename="../../src/class/pluginsystem.cpp" line="2986"/>
<source>RegisterScriptFnUnSupportedTypes:</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3043"/>
<location filename="../../src/class/pluginsystem.cpp" line="3107"/>
<location filename="../../src/class/pluginsystem.cpp" line="2996"/>
<location filename="../../src/class/pluginsystem.cpp" line="3060"/>
<source>RegisterScriptFnInvalidSig:</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3051"/>
<location filename="../../src/class/pluginsystem.cpp" line="3115"/>
<location filename="../../src/class/pluginsystem.cpp" line="3004"/>
<location filename="../../src/class/pluginsystem.cpp" line="3068"/>
<source>RegisterScriptFnConflitSig:</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3166"/>
<location filename="../../src/class/pluginsystem.cpp" line="3119"/>
<source>InvalidEnumName:</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3176"/>
<location filename="../../src/class/pluginsystem.cpp" line="3129"/>
<source>InvalidEnumValue:</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3211"/>
<location filename="../../src/class/pluginsystem.cpp" line="3164"/>
<source>InvalidMarcosRegister:</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3456"/>
<location filename="../../src/class/pluginsystem.cpp" line="3409"/>
<source>ErrLoadPluginSDKVersion</source>
<translation> SDK </translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3460"/>
<location filename="../../src/class/pluginsystem.cpp" line="3413"/>
<source>ErrLoadPluginNoName</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3481"/>
<location filename="../../src/class/pluginsystem.cpp" line="3434"/>
<source>ErrLoadInitPlugin</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3488"/>
<location filename="../../src/class/pluginsystem.cpp" line="3441"/>
<source>PluginName :</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3489"/>
<location filename="../../src/class/pluginsystem.cpp" line="3442"/>
<source>PluginAuthor :</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3490"/>
<location filename="../../src/class/pluginsystem.cpp" line="3443"/>
<source>PluginWidgetRegister</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3594"/>
<location filename="../../src/class/pluginsystem.cpp" line="3547"/>
<source>ErrLoadExtPluginSDKVersion</source>
<translation> SDK </translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3597"/>
<location filename="../../src/class/pluginsystem.cpp" line="3550"/>
<source>ExtPluginAuthor :</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3598"/>
<location filename="../../src/class/pluginsystem.cpp" line="3551"/>
<source>ExtPluginWidgetRegister</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3614"/>
<location filename="../../src/class/pluginsystem.cpp" line="3567"/>
<source>ErrLoadInitExtPlugin</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3639"/>
<location filename="../../src/class/pluginsystem.cpp" line="3592"/>
<source>ChooseFile</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3646"/>
<location filename="../../src/class/pluginsystem.cpp" line="3651"/>
<location filename="../../src/class/pluginsystem.cpp" line="3599"/>
<location filename="../../src/class/pluginsystem.cpp" line="3604"/>
<source>Error</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3647"/>
<location filename="../../src/class/pluginsystem.cpp" line="3600"/>
<source>FileNotExist</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3652"/>
<location filename="../../src/class/pluginsystem.cpp" line="3605"/>
<source>FilePermission</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3682"/>
<location filename="../../src/class/pluginsystem.cpp" line="3635"/>
<source>EmptyNameDockWidget:</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3692"/>
<location filename="../../src/class/pluginsystem.cpp" line="3645"/>
<source>InvalidNameDockWidget:</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="3700"/>
<location filename="../../src/class/pluginsystem.cpp" line="3653"/>
<source>InvalidNullDockWidget:</source>
<translation></translation>
</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>
<translation> UI </translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="2998"/>
<location filename="../../src/class/pluginsystem.cpp" line="2951"/>
<source>UnsafePluginDir</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="461"/>
<location filename="../../src/class/pluginsystem.cpp" line="436"/>
<source>[EvilCall]</source>
<translation>調</translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="2447"/>
<location filename="../../src/class/pluginsystem.cpp" line="2400"/>
<source>InvalidPluginID</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="2450"/>
<location filename="../../src/class/pluginsystem.cpp" line="2403"/>
<source>InvalidDupPlugin</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="2915"/>
<location filename="../../src/class/pluginsystem.cpp" line="2868"/>
<source>FoundPluginCount</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="2946"/>
<location filename="../../src/class/pluginsystem.cpp" line="2899"/>
<source>PluginLoadingFailedSummary</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="2951"/>
<location filename="../../src/class/pluginsystem.cpp" line="2904"/>
<source>- Dependencies:</source>
<translation>- </translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="2953"/>
<location filename="../../src/class/pluginsystem.cpp" line="2906"/>
<source>PUID:</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="2954"/>
<location filename="../../src/class/pluginsystem.cpp" line="2907"/>
<source>Version:</source>
<translation></translation>
</message>
<message>
<location filename="../../src/class/pluginsystem.cpp" line="2961"/>
<location filename="../../src/class/pluginsystem.cpp" line="2914"/>
<source>PluginLoadingFinished</source>
<translation></translation>
</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>);
auto e = pluginCurrentEditor(plg);
if (e) {
_rwlock.lockForRead();
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;
}
return EditorView::readBasicTypeContent<T>(e, offset, _rwlock);
}
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>);
auto e = getCurrentPluginView(plg);
if (e) {
auto editor = e->hexEditor();
auto doc = editor->document();
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 EditorView::insertBasicTypeContent<T>(
e, offset, value, pluginCurrentUndoCmd(plg), _rwlock);
}
return false;
}
@ -324,18 +308,8 @@ private:
Q_STATIC_ASSERT(std::is_integral_v<T> || std::is_floating_point_v<T>);
auto e = getCurrentPluginView(plg);
if (e) {
auto editor = e->hexEditor();
auto doc = editor->document();
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 EditorView::writeBasicTypeContent<T>(
e, offset, value, pluginCurrentUndoCmd(plg), _rwlock);
}
return false;
}
@ -345,18 +319,8 @@ private:
Q_STATIC_ASSERT(std::is_integral_v<T> || std::is_floating_point_v<T>);
auto e = getCurrentPluginView(plg);
if (e) {
auto editor = e->hexEditor();
auto doc = editor->document();
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 EditorView::appendBasicTypeContent<T>(
e, value, pluginCurrentUndoCmd(plg), _rwlock);
}
return false;
}
@ -374,474 +338,419 @@ private:
// IWingPluginBase API
public:
WING_SERVICE void toast(WingHex::IWingPluginBase *sender,
const QPixmap &icon, const QString &message);
WING_SERVICE void toast(QObject *sender, const QPixmap &icon,
const QString &message);
// logging
WING_SERVICE void logTrace(WingHex::IWingPluginBase *sender,
const QString &message);
WING_SERVICE void logDebug(WingHex::IWingPluginBase *sender,
const QString &message);
WING_SERVICE void logInfo(WingHex::IWingPluginBase *sender,
const QString &message);
WING_SERVICE void logWarn(WingHex::IWingPluginBase *sender,
const QString &message);
WING_SERVICE void logError(WingHex::IWingPluginBase *sender,
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);
WING_SERVICE void logTrace(QObject *sender, const QString &message);
WING_SERVICE void logDebug(QObject *sender, const QString &message);
WING_SERVICE void logInfo(QObject *sender, const QString &message);
WING_SERVICE void logWarn(QObject *sender, const QString &message);
WING_SERVICE void logError(QObject *sender, const QString &message);
WING_SERVICE bool raiseDockWidget(QObject *sender, QWidget *w);
WING_SERVICE WingHex::AppTheme currentAppTheme(QObject *sender);
WING_SERVICE QDialog *createDialog(QObject *sender, QWidget *content);
public:
WING_SERVICE void msgAboutQt(WingHex::IWingPluginBase *sender,
QWidget *parent, const QString &title);
WING_SERVICE void msgAboutQt(QObject *sender, QWidget *parent,
const QString &title);
WING_SERVICE QMessageBox::StandardButton
msgInformation(WingHex::IWingPluginBase *sender, QWidget *parent,
const QString &title, const QString &text,
QMessageBox::StandardButtons buttons,
msgInformation(QObject *sender, QWidget *parent, const QString &title,
const QString &text, QMessageBox::StandardButtons buttons,
QMessageBox::StandardButton defaultButton);
WING_SERVICE QMessageBox::StandardButton
msgQuestion(WingHex::IWingPluginBase *sender, QWidget *parent,
const QString &title, const QString &text,
QMessageBox::StandardButtons buttons,
msgQuestion(QObject *sender, QWidget *parent, const QString &title,
const QString &text, QMessageBox::StandardButtons buttons,
QMessageBox::StandardButton defaultButton);
WING_SERVICE QMessageBox::StandardButton
msgWarning(WingHex::IWingPluginBase *sender, QWidget *parent,
const QString &title, const QString &text,
QMessageBox::StandardButtons buttons,
msgWarning(QObject *sender, QWidget *parent, const QString &title,
const QString &text, QMessageBox::StandardButtons buttons,
QMessageBox::StandardButton defaultButton);
WING_SERVICE QMessageBox::StandardButton
msgCritical(WingHex::IWingPluginBase *sender, QWidget *parent,
const QString &title, const QString &text,
QMessageBox::StandardButtons buttons,
msgCritical(QObject *sender, QWidget *parent, const QString &title,
const QString &text, QMessageBox::StandardButtons buttons,
QMessageBox::StandardButton defaultButton);
WING_SERVICE void msgAbout(WingHex::IWingPluginBase *sender,
QWidget *parent, const QString &title,
const QString &text);
WING_SERVICE void msgAbout(QObject *sender, QWidget *parent,
const QString &title, const QString &text);
WING_SERVICE QMessageBox::StandardButton
msgbox(WingHex::IWingPluginBase *sender, QWidget *parent,
QMessageBox::Icon icon, const QString &title, const QString &text,
msgbox(QObject *sender, QWidget *parent, QMessageBox::Icon icon,
const QString &title, const QString &text,
QMessageBox::StandardButtons buttons,
QMessageBox::StandardButton defaultButton);
public:
WING_SERVICE QString dlgGetText(WingHex::IWingPluginBase *sender,
QWidget *parent, const QString &title,
const QString &label,
WING_SERVICE QString dlgGetText(QObject *sender, QWidget *parent,
const QString &title, const QString &label,
QLineEdit::EchoMode echo,
const QString &text, bool *ok,
Qt::InputMethodHints inputMethodHints);
WING_SERVICE QString dlgGetMultiLineText(
WingHex::IWingPluginBase *sender, QWidget *parent, const QString &title,
const QString &label, const QString &text, bool *ok,
Qt::InputMethodHints inputMethodHints);
WING_SERVICE QString dlgGetItem(WingHex::IWingPluginBase *sender,
QWidget *parent, const QString &title,
const QString &label,
WING_SERVICE QString
dlgGetMultiLineText(QObject *sender, QWidget *parent, const QString &title,
const QString &label, const QString &text, bool *ok,
Qt::InputMethodHints inputMethodHints);
WING_SERVICE QString dlgGetItem(QObject *sender, QWidget *parent,
const QString &title, const QString &label,
const QStringList &items, int current,
bool editable, bool *ok,
Qt::InputMethodHints inputMethodHints);
WING_SERVICE int dlgGetInt(WingHex::IWingPluginBase *sender,
QWidget *parent, const QString &title,
const QString &label, int value, int minValue,
int maxValue, int step, bool *ok);
WING_SERVICE double dlgGetDouble(WingHex::IWingPluginBase *sender,
QWidget *parent, const QString &title,
const QString &label, double value,
double minValue, double maxValue,
int decimals, bool *ok, double step);
WING_SERVICE int dlgGetInt(QObject *sender, QWidget *parent,
const QString &title, const QString &label,
int value, int minValue, int maxValue, int step,
bool *ok);
WING_SERVICE double dlgGetDouble(QObject *sender, QWidget *parent,
const QString &title, const QString &label,
double value, double minValue,
double maxValue, int decimals, bool *ok,
double step);
public:
WING_SERVICE QString
dlgGetExistingDirectory(WingHex::IWingPluginBase *sender, QWidget *parent,
const QString &caption, const QString &dir,
QFileDialog::Options options);
WING_SERVICE QString dlgGetOpenFileName(
WingHex::IWingPluginBase *sender, QWidget *parent,
const QString &caption, const QString &dir, const QString &filter,
QString *selectedFilter, QFileDialog::Options options);
WING_SERVICE QString dlgGetExistingDirectory(QObject *sender,
QWidget *parent,
const QString &caption,
const QString &dir,
QFileDialog::Options options);
WING_SERVICE QString dlgGetOpenFileName(QObject *sender, QWidget *parent,
const QString &caption,
const QString &dir,
const QString &filter,
QString *selectedFilter,
QFileDialog::Options options);
WING_SERVICE QStringList dlgGetOpenFileNames(
WingHex::IWingPluginBase *sender, QWidget *parent,
const QString &caption, const QString &dir, const QString &filter,
QString *selectedFilter, QFileDialog::Options options);
WING_SERVICE QString dlgGetSaveFileName(
WingHex::IWingPluginBase *sender, QWidget *parent,
const QString &caption, const QString &dir, const QString &filter,
QString *selectedFilter, QFileDialog::Options options);
QObject *sender, QWidget *parent, const QString &caption,
const QString &dir, const QString &filter, QString *selectedFilter,
QFileDialog::Options options);
WING_SERVICE QString dlgGetSaveFileName(QObject *sender, QWidget *parent,
const QString &caption,
const QString &dir,
const QString &filter,
QString *selectedFilter,
QFileDialog::Options options);
WING_SERVICE QColor dlgGetColor(WingHex::IWingPluginBase *sender,
const QString &caption, QWidget *parent);
WING_SERVICE QColor dlgGetColor(QObject *sender, const QString &caption,
QWidget *parent);
// IWingPlugin API
public:
WING_SERVICE bool existsServiceHost(WingHex::IWingPluginBase *sender,
const QString &puid);
WING_SERVICE bool existsServiceHost(QObject *sender, const QString &puid);
WING_SERVICE bool
invokeService(WingHex::IWingPluginBase *sender, const QString &puid,
const char *method, Qt::ConnectionType type,
QGenericReturnArgument ret, QGenericArgument val0,
QGenericArgument val1, QGenericArgument val2,
QGenericArgument val3, QGenericArgument val4);
invokeService(QObject *sender, const QString &puid, const char *method,
Qt::ConnectionType type, QGenericReturnArgument ret,
QGenericArgument val0, QGenericArgument val1,
QGenericArgument val2, QGenericArgument val3,
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
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
currentPos(WingHex::IWingPluginBase *sender);
WING_SERVICE WingHex::HexPosition currentPos(QObject *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,
qsizetype index);
WING_SERVICE QByteArray selectedBytes(QObject *sender, qsizetype index);
WING_SERVICE QByteArrayList
selectionBytes(WingHex::IWingPluginBase *sender);
WING_SERVICE QByteArrayList selectionBytes(QObject *sender);
WING_SERVICE WingHex::HexPosition
selectionStart(WingHex::IWingPluginBase *sender, qsizetype index);
WING_SERVICE WingHex::HexPosition selectionStart(QObject *sender,
qsizetype index);
WING_SERVICE WingHex::HexPosition
selectionEnd(WingHex::IWingPluginBase *sender, qsizetype index);
WING_SERVICE WingHex::HexPosition selectionEnd(QObject *sender,
qsizetype index);
WING_SERVICE qsizetype selectionLength(WingHex::IWingPluginBase *sender,
qsizetype index);
WING_SERVICE qsizetype selectionLength(QObject *sender, 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,
qsizetype offset);
WING_SERVICE qint8 readInt8(QObject *sender, qsizetype offset);
WING_SERVICE qint16 readInt16(WingHex::IWingPluginBase *sender,
qsizetype offset);
WING_SERVICE qint16 readInt16(QObject *sender, qsizetype offset);
WING_SERVICE qint32 readInt32(WingHex::IWingPluginBase *sender,
qsizetype offset);
WING_SERVICE qint32 readInt32(QObject *sender, qsizetype offset);
WING_SERVICE qint64 readInt64(WingHex::IWingPluginBase *sender,
qsizetype offset);
WING_SERVICE qint64 readInt64(QObject *sender, qsizetype offset);
WING_SERVICE quint8 readUInt8(WingHex::IWingPluginBase *sender,
qsizetype offset);
WING_SERVICE quint8 readUInt8(QObject *sender, qsizetype offset);
WING_SERVICE quint16 readUInt16(WingHex::IWingPluginBase *sender,
qsizetype offset);
WING_SERVICE quint16 readUInt16(QObject *sender, qsizetype offset);
WING_SERVICE quint32 readUInt32(WingHex::IWingPluginBase *sender,
qsizetype offset);
WING_SERVICE quint32 readUInt32(QObject *sender, qsizetype offset);
WING_SERVICE quint64 readUInt64(WingHex::IWingPluginBase *sender,
qsizetype offset);
WING_SERVICE quint64 readUInt64(QObject *sender, qsizetype offset);
WING_SERVICE float readFloat(WingHex::IWingPluginBase *sender,
qsizetype offset);
WING_SERVICE float readFloat(QObject *sender, qsizetype offset);
WING_SERVICE double readDouble(WingHex::IWingPluginBase *sender,
qsizetype offset);
WING_SERVICE double readDouble(QObject *sender, qsizetype offset);
WING_SERVICE QString readString(WingHex::IWingPluginBase *sender,
qsizetype offset, const QString &encoding);
WING_SERVICE QString readString(QObject *sender, qsizetype offset,
const QString &encoding);
WING_SERVICE QByteArray readBytes(WingHex::IWingPluginBase *sender,
qsizetype offset, qsizetype count);
WING_SERVICE QByteArray readBytes(QObject *sender, qsizetype offset,
qsizetype count);
WING_SERVICE qsizetype findNext(WingHex::IWingPluginBase *sender,
qsizetype begin, const QByteArray &ba);
WING_SERVICE qsizetype findNext(QObject *sender, qsizetype begin,
const QByteArray &ba);
WING_SERVICE qsizetype findPrevious(WingHex::IWingPluginBase *sender,
qsizetype begin, const QByteArray &ba);
WING_SERVICE qsizetype findPrevious(QObject *sender, qsizetype begin,
const QByteArray &ba);
WING_SERVICE QString bookMarkComment(WingHex::IWingPluginBase *sender,
qsizetype pos);
WING_SERVICE QString bookMarkComment(QObject *sender, qsizetype pos);
WING_SERVICE bool existBookMark(WingHex::IWingPluginBase *sender,
qsizetype pos);
WING_SERVICE bool existBookMark(QObject *sender, qsizetype pos);
// document
WING_SERVICE bool switchDocument(WingHex::IWingPluginBase *sender,
int handle);
WING_SERVICE bool switchDocument(QObject *sender, int handle);
WING_SERVICE bool raiseDocument(WingHex::IWingPluginBase *sender,
int handle);
WING_SERVICE bool raiseDocument(QObject *sender, 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,
bool b);
WING_SERVICE bool setStringVisible(QObject *sender, bool b);
WING_SERVICE bool setAddressVisible(WingHex::IWingPluginBase *sender,
bool b);
WING_SERVICE bool setAddressVisible(QObject *sender, bool b);
WING_SERVICE bool setHeaderVisible(WingHex::IWingPluginBase *sender,
bool b);
WING_SERVICE bool setHeaderVisible(QObject *sender, bool b);
WING_SERVICE bool setAddressBase(WingHex::IWingPluginBase *sender,
quintptr base);
WING_SERVICE bool setAddressBase(QObject *sender, quintptr base);
WING_SERVICE bool beginMarco(WingHex::IWingPluginBase *sender,
const QString &txt);
WING_SERVICE bool beginMarco(QObject *sender, const QString &txt);
WING_SERVICE bool endMarco(WingHex::IWingPluginBase *sender);
WING_SERVICE bool endMarco(QObject *sender);
WING_SERVICE bool writeInt8(WingHex::IWingPluginBase *sender,
qsizetype offset, qint8 value);
WING_SERVICE bool writeInt8(QObject *sender, qsizetype offset, qint8 value);
WING_SERVICE bool writeInt16(WingHex::IWingPluginBase *sender,
qsizetype offset, qint16 value);
WING_SERVICE bool writeInt16(QObject *sender, qsizetype offset,
qint16 value);
WING_SERVICE bool writeInt32(WingHex::IWingPluginBase *sender,
qsizetype offset, qint32 value);
WING_SERVICE bool writeInt32(QObject *sender, qsizetype offset,
qint32 value);
WING_SERVICE bool writeInt64(WingHex::IWingPluginBase *sender,
qsizetype offset, qint64 value);
WING_SERVICE bool writeInt64(QObject *sender, qsizetype offset,
qint64 value);
WING_SERVICE bool writeUInt8(WingHex::IWingPluginBase *sender,
qsizetype offset, quint8 value);
WING_SERVICE bool writeUInt8(QObject *sender, qsizetype offset,
quint8 value);
WING_SERVICE bool writeUInt16(WingHex::IWingPluginBase *sender,
qsizetype offset, quint16 value);
WING_SERVICE bool writeUInt16(QObject *sender, qsizetype offset,
quint16 value);
WING_SERVICE bool writeUInt32(WingHex::IWingPluginBase *sender,
qsizetype offset, quint32 value);
WING_SERVICE bool writeUInt32(QObject *sender, qsizetype offset,
quint32 value);
WING_SERVICE bool writeUInt64(WingHex::IWingPluginBase *sender,
qsizetype offset, quint64 value);
WING_SERVICE bool writeUInt64(QObject *sender, qsizetype offset,
quint64 value);
WING_SERVICE bool writeFloat(WingHex::IWingPluginBase *sender,
qsizetype offset, float value);
WING_SERVICE bool writeFloat(QObject *sender, qsizetype offset,
float value);
WING_SERVICE bool writeDouble(WingHex::IWingPluginBase *sender,
qsizetype offset, double value);
WING_SERVICE bool writeDouble(QObject *sender, qsizetype offset,
double value);
WING_SERVICE bool writeString(WingHex::IWingPluginBase *sender,
qsizetype offset, const QString &value,
WING_SERVICE bool writeString(QObject *sender, qsizetype offset,
const QString &value,
const QString &encoding);
WING_SERVICE bool writeBytes(WingHex::IWingPluginBase *sender,
qsizetype offset, const QByteArray &data);
WING_SERVICE bool writeBytes(QObject *sender, qsizetype offset,
const QByteArray &data);
WING_SERVICE bool insertInt8(WingHex::IWingPluginBase *sender,
qsizetype offset, qint8 value);
WING_SERVICE bool insertInt8(QObject *sender, qsizetype offset,
qint8 value);
WING_SERVICE bool insertInt16(WingHex::IWingPluginBase *sender,
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,
WING_SERVICE bool insertInt16(QObject *sender, qsizetype offset,
qint16 value);
WING_SERVICE bool appendInt32(WingHex::IWingPluginBase *sender,
WING_SERVICE bool insertInt32(QObject *sender, qsizetype offset,
qint32 value);
WING_SERVICE bool appendInt64(WingHex::IWingPluginBase *sender,
WING_SERVICE bool insertInt64(QObject *sender, qsizetype offset,
qint64 value);
WING_SERVICE bool appendUInt8(WingHex::IWingPluginBase *sender,
WING_SERVICE bool insertUInt8(QObject *sender, qsizetype offset,
quint8 value);
WING_SERVICE bool appendUInt16(WingHex::IWingPluginBase *sender,
WING_SERVICE bool insertUInt16(QObject *sender, qsizetype offset,
quint16 value);
WING_SERVICE bool appendUInt32(WingHex::IWingPluginBase *sender,
WING_SERVICE bool insertUInt32(QObject *sender, qsizetype offset,
quint32 value);
WING_SERVICE bool appendUInt64(WingHex::IWingPluginBase *sender,
WING_SERVICE bool insertUInt64(QObject *sender, qsizetype offset,
quint64 value);
WING_SERVICE bool appendFloat(WingHex::IWingPluginBase *sender,
WING_SERVICE bool insertFloat(QObject *sender, qsizetype offset,
float value);
WING_SERVICE bool appendDouble(WingHex::IWingPluginBase *sender,
WING_SERVICE bool insertDouble(QObject *sender, qsizetype offset,
double value);
WING_SERVICE bool appendString(WingHex::IWingPluginBase *sender,
WING_SERVICE bool insertString(QObject *sender, qsizetype offset,
const QString &value,
const QString &encoding);
WING_SERVICE bool appendBytes(WingHex::IWingPluginBase *sender,
WING_SERVICE bool insertBytes(QObject *sender, qsizetype offset,
const QByteArray &data);
WING_SERVICE bool removeBytes(WingHex::IWingPluginBase *sender,
qsizetype offset, qsizetype len);
WING_SERVICE bool appendInt8(QObject *sender, qint8 value);
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
WING_SERVICE bool moveTo(WingHex::IWingPluginBase *sender, qsizetype line,
qsizetype column, int nibbleindex,
WING_SERVICE bool moveTo(QObject *sender, qsizetype line, qsizetype column,
int nibbleindex, bool clearSelection);
WING_SERVICE bool moveTo(QObject *sender, qsizetype offset,
bool clearSelection);
WING_SERVICE bool moveTo(WingHex::IWingPluginBase *sender, qsizetype offset,
bool clearSelection);
WING_SERVICE bool select(WingHex::IWingPluginBase *sender, qsizetype offset,
WING_SERVICE bool select(QObject *sender, qsizetype offset,
qsizetype length, SelectionMode mode);
WING_SERVICE bool setInsertionMode(WingHex::IWingPluginBase *sender,
bool isinsert);
WING_SERVICE bool setInsertionMode(QObject *sender, bool isinsert);
WING_SERVICE bool metadata(WingHex::IWingPluginBase *sender,
qsizetype begin, qsizetype length,
const QColor &fgcolor, const QColor &bgcolor,
const QString &comment);
WING_SERVICE bool metadata(QObject *sender, qsizetype begin,
qsizetype length, const QColor &fgcolor,
const QColor &bgcolor, const QString &comment);
WING_SERVICE bool removeMetadata(WingHex::IWingPluginBase *sender,
qsizetype offset);
WING_SERVICE bool removeMetadata(QObject *sender, 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,
bool b);
WING_SERVICE bool setMetafgVisible(QObject *sender, bool b);
WING_SERVICE bool setMetabgVisible(WingHex::IWingPluginBase *sender,
bool b);
WING_SERVICE bool setMetabgVisible(QObject *sender, bool b);
WING_SERVICE bool setMetaCommentVisible(WingHex::IWingPluginBase *sender,
bool b);
WING_SERVICE bool setMetaCommentVisible(QObject *sender, bool b);
// 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);
WING_SERVICE WingHex::ErrFile openExtFile(WingHex::IWingPluginBase *sender,
const QString &ext,
const QString &file);
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,
int handle);
WING_SERVICE WingHex::ErrFile openWorkSpace(QObject *sender,
const QString &filename);
WING_SERVICE WingHex::ErrFile closeFile(WingHex::IWingPluginBase *sender,
int handle, bool force);
WING_SERVICE WingHex::ErrFile closeHandle(QObject *sender, int handle);
WING_SERVICE WingHex::ErrFile saveFile(WingHex::IWingPluginBase *sender,
int handle);
WING_SERVICE WingHex::ErrFile closeFile(QObject *sender, int handle,
bool force);
WING_SERVICE WingHex::ErrFile exportFile(WingHex::IWingPluginBase *sender,
int handle,
WING_SERVICE WingHex::ErrFile saveFile(QObject *sender, int handle);
WING_SERVICE WingHex::ErrFile exportFile(QObject *sender, int handle,
const QString &savename);
WING_SERVICE WingHex::ErrFile saveAsFile(WingHex::IWingPluginBase *sender,
int handle,
WING_SERVICE WingHex::ErrFile saveAsFile(QObject *sender, int handle,
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,
bool force);
WING_SERVICE WingHex::ErrFile closeCurrent(QObject *sender, bool force);
WING_SERVICE WingHex::ErrFile saveCurrent(WingHex::IWingPluginBase *sender);
WING_SERVICE WingHex::ErrFile saveCurrent(QObject *sender);
WING_SERVICE WingHex::ErrFile
exportCurrent(WingHex::IWingPluginBase *sender, const QString &savename);
WING_SERVICE WingHex::ErrFile exportCurrent(QObject *sender,
const QString &savename);
WING_SERVICE WingHex::ErrFile
saveAsCurrent(WingHex::IWingPluginBase *sender, const QString &savename);
WING_SERVICE WingHex::ErrFile saveAsCurrent(QObject *sender,
const QString &savename);
// bookmark
WING_SERVICE bool addBookMark(WingHex::IWingPluginBase *sender,
qsizetype pos, const QString &comment);
WING_SERVICE bool addBookMark(QObject *sender, qsizetype pos,
const QString &comment);
WING_SERVICE bool modBookMark(WingHex::IWingPluginBase *sender,
qsizetype pos, const QString &comment);
WING_SERVICE bool modBookMark(QObject *sender, qsizetype pos,
const QString &comment);
WING_SERVICE bool removeBookMark(WingHex::IWingPluginBase *sender,
qsizetype pos);
WING_SERVICE bool removeBookMark(QObject *sender, qsizetype pos);
WING_SERVICE bool clearBookMark(WingHex::IWingPluginBase *sender);
WING_SERVICE bool clearBookMark(QObject *sender);
// extension
WING_SERVICE bool closeAllFiles(WingHex::IWingPluginBase *sender);
WING_SERVICE bool closeAllFiles(QObject *sender);
public:
WING_SERVICE bool dataVisualText(WingHex::IWingPluginBase *sender,
const QString &data, const QString &title);
WING_SERVICE bool dataVisualText(QObject *sender, const QString &data,
const QString &title);
WING_SERVICE bool dataVisualTextList(WingHex::IWingPluginBase *sender,
WING_SERVICE bool dataVisualTextList(QObject *sender,
const QStringList &data,
const QString &title,
WingHex::ClickedCallBack clicked,
WingHex::ClickedCallBack dblClicked);
WING_SERVICE bool dataVisualTextTree(WingHex::IWingPluginBase *sender,
const QString &json,
WING_SERVICE bool dataVisualTextTree(QObject *sender, const QString &json,
const QString &title,
WingHex::ClickedCallBack clicked,
WingHex::ClickedCallBack dblClicked);
WING_SERVICE bool dataVisualTextTable(WingHex::IWingPluginBase *sender,
const QString &json,
WING_SERVICE bool dataVisualTextTable(QObject *sender, const QString &json,
const QStringList &headers,
const QStringList &headerNames,
const QString &title,
@ -849,33 +758,25 @@ public:
WingHex::ClickedCallBack dblClicked);
// API for Qt Plugin Only
WING_SERVICE bool
dataVisualTextListByModel(WingHex::IWingPluginBase *sender,
QAbstractItemModel *model, const QString &title,
WingHex::ClickedCallBack clicked,
WingHex::ClickedCallBack dblClicked);
WING_SERVICE bool dataVisualTextListByModel(
QObject *sender, QAbstractItemModel *model, const QString &title,
WingHex::ClickedCallBack clicked, WingHex::ClickedCallBack dblClicked);
WING_SERVICE bool
dataVisualTextTableByModel(WingHex::IWingPluginBase *sender,
QAbstractItemModel *model, const QString &title,
WingHex::ClickedCallBack clicked,
WingHex::ClickedCallBack dblClicked);
WING_SERVICE bool dataVisualTextTableByModel(
QObject *sender, QAbstractItemModel *model, const QString &title,
WingHex::ClickedCallBack clicked, WingHex::ClickedCallBack dblClicked);
WING_SERVICE bool
dataVisualTextTreeByModel(WingHex::IWingPluginBase *sender,
QAbstractItemModel *model, const QString &title,
WingHex::ClickedCallBack clicked,
WingHex::ClickedCallBack dblClicked);
WING_SERVICE bool dataVisualTextTreeByModel(
QObject *sender, QAbstractItemModel *model, const QString &title,
WingHex::ClickedCallBack clicked, WingHex::ClickedCallBack dblClicked);
private:
WingHex::IWingPlugin *checkPluginAndReport(WingHex::IWingPluginBase *sender,
WingHex::IWingPlugin *checkPluginAndReport(QObject *sender,
const char *func);
WingHex::IWingDevice *checkBaseAndReport(WingHex::IWingPluginBase *sender,
const char *func);
WingHex::IWingDevice *checkBaseAndReport(QObject *sender, const char *func);
bool checkErrAllAllowAndReport(WingHex::IWingPluginBase *sender,
const char *func);
bool checkErrAllAllowAndReport(QObject *sender, const char *func);
private:
CallTable _plgFns;

View File

@ -348,7 +348,7 @@ void WingAngelAPI::installMsgboxAPI(asIScriptEngine *engine) {
QMessageBox::StandardButtons,
QMessageBox::StandardButton)>(
engine,
std::bind(&WingHex::IWingPlugin::critical, this, nullptr,
std::bind(&WingHex::IWingPlugin::msgCritical, this, nullptr,
std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3, std::placeholders::_4),
"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
#define EDITORVIEW_H
#include <QObject>
#include <QReadWriteLock>
#include <QStackedWidget>
#include "QHexView/qhexview.h"
@ -51,6 +51,93 @@ public:
public:
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:
explicit EditorView(QWidget *parent = nullptr);
virtual ~EditorView() override;
@ -141,6 +228,299 @@ private:
int contextSize,
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:
template <typename Func>
inline void newAction(QWidget *parent, const QString &icon,
@ -208,6 +588,9 @@ private:
QString _ext;
WingHex::WingIODevice *_dev = nullptr;
QString _file;
QReadWriteLock _rwlock;
CallTable _viewFns;
};
#endif // EDITORVIEW_H

View File

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

View File

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