From 098e06a39b79cf40833c062d577e086a9d998d2d Mon Sep 17 00:00:00 2001 From: Mike Solar Date: Sun, 13 Aug 2023 12:16:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=B5=8B=E8=AF=95=EF=BC=8C?= =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OfficeAssistant_msvc/MyButton.cpp | 9 +- .../OfficeAssistant_msvc.vcxproj | 17 +- .../OfficeAssistant_msvc.vcxproj.filters | 51 +- .../OfficeAssistant_msvc.vcxproj.user | 4 +- OfficeAssistant_msvc/addapp.cpp | 164 ++ OfficeAssistant_msvc/addapp.h | 63 + OfficeAssistant_msvc/addapp.ui | 33 + OfficeAssistant_msvc/addcategory.cpp | 73 + OfficeAssistant_msvc/addcategory.h | 25 + OfficeAssistant_msvc/addcategory.ui | 47 + OfficeAssistant_msvc/applicationmanager.cpp | 274 +++ OfficeAssistant_msvc/applicationmanager.h | 76 + OfficeAssistant_msvc/applicationmanager.ui | 20 + .../applicationmanagerpage.cpp | 238 +++ OfficeAssistant_msvc/applicationmanagerpage.h | 44 + .../applicationmanagerpage.ui | 22 + OfficeAssistant_msvc/config.h | 21 +- OfficeAssistant_msvc/exitmanager.h | 5 +- OfficeAssistant_msvc/globalvariables.h | 2 + OfficeAssistant_msvc/main.cpp | 7 + OfficeAssistant_msvc/mainscreen.cpp | 20 + OfficeAssistant_msvc/mainscreen.h | 3 +- OfficeAssistant_msvc/mainwindow.cpp | 96 +- OfficeAssistant_msvc/mainwindow.h | 4 + OfficeAssistant_msvc/mainwindowlayout.cpp | 7 +- OfficeAssistant_msvc/mb.h | 1176 +++++++++++++ OfficeAssistant_msvc/minibutton.cpp | 62 + OfficeAssistant_msvc/minibutton.h | 32 + OfficeAssistant_msvc/minibutton.ui | 22 + OfficeAssistant_msvc/mysettingsdialog.cpp | 11 + OfficeAssistant_msvc/navbar.cpp | 32 +- OfficeAssistant_msvc/navbar.h | 134 +- OfficeAssistant_msvc/netio.cpp | 151 +- OfficeAssistant_msvc/netio.h | 11 +- OfficeAssistant_msvc/qminiblink.cpp | 127 +- OfficeAssistant_msvc/qminiblink.h | 60 +- OfficeAssistant_msvc/sqlitehelper.cpp | 293 +++- OfficeAssistant_msvc/sqlitehelper.h | 17 +- OfficeAssistant_msvc/wke.h | 1548 ----------------- identifier.sqlite | Bin 24576 -> 28672 bytes 40 files changed, 3219 insertions(+), 1782 deletions(-) create mode 100644 OfficeAssistant_msvc/addapp.cpp create mode 100644 OfficeAssistant_msvc/addapp.h create mode 100644 OfficeAssistant_msvc/addapp.ui create mode 100644 OfficeAssistant_msvc/addcategory.cpp create mode 100644 OfficeAssistant_msvc/addcategory.h create mode 100644 OfficeAssistant_msvc/addcategory.ui create mode 100644 OfficeAssistant_msvc/applicationmanager.cpp create mode 100644 OfficeAssistant_msvc/applicationmanager.h create mode 100644 OfficeAssistant_msvc/applicationmanager.ui create mode 100644 OfficeAssistant_msvc/applicationmanagerpage.cpp create mode 100644 OfficeAssistant_msvc/applicationmanagerpage.h create mode 100644 OfficeAssistant_msvc/applicationmanagerpage.ui create mode 100644 OfficeAssistant_msvc/mb.h create mode 100644 OfficeAssistant_msvc/minibutton.cpp create mode 100644 OfficeAssistant_msvc/minibutton.h create mode 100644 OfficeAssistant_msvc/minibutton.ui delete mode 100644 OfficeAssistant_msvc/wke.h diff --git a/OfficeAssistant_msvc/MyButton.cpp b/OfficeAssistant_msvc/MyButton.cpp index 31522b1..3411d7b 100644 --- a/OfficeAssistant_msvc/MyButton.cpp +++ b/OfficeAssistant_msvc/MyButton.cpp @@ -1,8 +1,9 @@ // // Created by HW on 2023/07/26. // -#define TEXT_SIZE 7 #include "MyButton.h" +#include "config.h" + MyButton::MyButton(ButtonStruct &buttonStruct,int width,int height,QList *buttons,QWidget *parent) : QPushButton(parent) { this->buttons=buttons; this->width2=width; @@ -30,7 +31,11 @@ MyButton::~MyButton() { void MyButton::paintEvent(QPaintEvent *e) { QPushButton::paintEvent(e); - QPainter painter(this); + QRectF rect(0, 0, this->width(), this->height()); + QColor qColor; + qColor.setNamedColor(background_color); + QPainter painter(this); + painter.fillRect(rect, qColor); painter.setRenderHint(QPainter::Antialiasing); int logo_width=width()/3; int logo_x=width()/3; diff --git a/OfficeAssistant_msvc/OfficeAssistant_msvc.vcxproj b/OfficeAssistant_msvc/OfficeAssistant_msvc.vcxproj index 407053c..2584906 100644 --- a/OfficeAssistant_msvc/OfficeAssistant_msvc.vcxproj +++ b/OfficeAssistant_msvc/OfficeAssistant_msvc.vcxproj @@ -102,15 +102,20 @@ + + + + + + - @@ -119,10 +124,15 @@ + + + + + @@ -131,9 +141,14 @@ + + + + + diff --git a/OfficeAssistant_msvc/OfficeAssistant_msvc.vcxproj.filters b/OfficeAssistant_msvc/OfficeAssistant_msvc.vcxproj.filters index ccae62c..9449889 100644 --- a/OfficeAssistant_msvc/OfficeAssistant_msvc.vcxproj.filters +++ b/OfficeAssistant_msvc/OfficeAssistant_msvc.vcxproj.filters @@ -32,10 +32,10 @@ Header Files - + Header Files - + Header Files @@ -70,6 +70,21 @@ Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + @@ -102,6 +117,21 @@ Source Files + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + @@ -116,10 +146,25 @@ Form Files + + Form Files + + + Form Files + + + Form Files + Form Files - + + Form Files + + + Form Files + + Form Files diff --git a/OfficeAssistant_msvc/OfficeAssistant_msvc.vcxproj.user b/OfficeAssistant_msvc/OfficeAssistant_msvc.vcxproj.user index e4c8fb0..ceea808 100644 --- a/OfficeAssistant_msvc/OfficeAssistant_msvc.vcxproj.user +++ b/OfficeAssistant_msvc/OfficeAssistant_msvc.vcxproj.user @@ -5,9 +5,9 @@ WindowsLocalDebugger - 2023-08-08T01:58:42.4896992Z + 2023-08-12T03:22:21.9071424Z - 2023-08-08T01:58:34.1935757Z + 2023-08-12T03:22:23.0360904Z \ No newline at end of file diff --git a/OfficeAssistant_msvc/addapp.cpp b/OfficeAssistant_msvc/addapp.cpp new file mode 100644 index 0000000..cdfdf25 --- /dev/null +++ b/OfficeAssistant_msvc/addapp.cpp @@ -0,0 +1,164 @@ +#include "addapp.h" +#include +#include +#include +#include + +#include "applicationmanager.h" + +#if _MSC_VER >=1936 +#include +namespace fs = std::filesystem; +#else +#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING +#include +namespace fs = std::experimental::filesystem; +#endif + +AddApp::AddApp(bool isEdit, Record2 *row , QWidget* parent) + : QDialog(parent) +{ + ui.setupUi(this); + SQLiteHelper sqlite_helper; + setFixedSize(450, 450); + setWindowFlags(Qt::WindowCloseButtonHint); + form = new QFormLayout; + name = new QLineEdit; + form->addRow(QString::fromLocal8Bit("名称"), name); + if(isEdit) + { + name_label = new QLabel(orig_name_str); + form->addRow(QString::fromLocal8Bit("全名"), name_label); + } + else + { + orig_name = new QLineEdit; + form->addRow(QString::fromLocal8Bit("全名"), orig_name); + } + if(row==nullptr) + { + path = new QPushButton(QString::fromLocal8Bit("浏览")); + connect(path, &QPushButton::clicked, this, &AddApp::broswer_exe); + form->addRow(QString::fromLocal8Bit("路径"), path); + sort = new QLineEdit; + sort->setValidator(new QIntValidator(10, 100)); + form->addRow(QString::fromLocal8Bit("排序"), sort); + QList categrories; + layout_inner = new QVBoxLayout; + sqlite_helper.get_category(categrories); + + for (auto category : categrories) + { + if ((category.id == 1) || (category.id == 8) || (category.id == 4) || (category.id == 5 || category.id == 3)) + { + continue; + } + QCheckBox* check_box = new QCheckBox(category.name); + layout_inner->addWidget(check_box); + categories_list.insert(category.id, check_box); + } + form->addRow(QString::fromLocal8Bit("类别"), layout_inner); + submit_btn = new QPushButton(QString::fromLocal8Bit("提交")); + form->addWidget(submit_btn); + this->setLayout(form); + connect(path, &QPushButton::click, this, &AddApp::broswer_exe); + connect(submit_btn, &QPushButton::clicked, this, &AddApp::submit); + this->isEdit = isEdit; + }else + { + path = new QPushButton(QString::fromLocal8Bit("浏览")); + path_str = row->exe_file; + path->setText(QString::fromWCharArray(fs::path(path_str.toStdWString()).filename().c_str())); + connect(path, &QPushButton::clicked, this, &AddApp::broswer_exe); + form->addRow(QString::fromLocal8Bit("路径"), path); + sort = new QLineEdit; + sort->setText(QString::number(row->sort)); + sort->setValidator(new QIntValidator(10, 100)); + form->addRow(QString::fromLocal8Bit("排序"), sort); + QList categrories; + layout_inner = new QVBoxLayout; + sqlite_helper.get_category(categrories); + + for (auto category : categrories) + { + if ((category.id == 1) || (category.id == 8) || (category.id == 4) || (category.id == 5 || category.id == 3)) + { + continue; + } + QCheckBox* check_box = new QCheckBox(category.name); + if(row->categories[category.id]) + { + check_box->setCheckState(Qt::Checked); + } + layout_inner->addWidget(check_box); + categories_list.insert(category.id, check_box); + } + form->addRow(QString::fromLocal8Bit("类别"), layout_inner); + submit_btn = new QPushButton(QString::fromLocal8Bit("提交")); + form->addWidget(submit_btn); + this->setLayout(form); + connect(path, &QPushButton::click, this, &AddApp::broswer_exe); + connect(submit_btn, &QPushButton::clicked, this, &AddApp::submit); + this->isEdit = isEdit; + } + +} + +AddApp::~AddApp() +{ + //delete categories; + delete name; + if(isEdit) + { + delete name_label; + }else + { + delete orig_name; + } + delete path; + delete sort; + delete submit_btn; + delete form; +} + +void AddApp::broswer_exe(){ + path_str = QFileDialog::getOpenFileName(this, QString::fromLocal8Bit("选择程序"), + QApplication::applicationDirPath(), QString::fromLocal8Bit("应用程序 (*.exe)")); + fs::path file(path_str.toStdWString()); + path->setText(QString::fromStdWString(file.filename().c_str())); +} + +void AddApp::submit() { + if((!orig_name->text().isEmpty())&&(!path->text().isEmpty())) + { + orig_name_str = orig_name->text(); + name_str = orig_name_str; + sort_str = sort->text(); + } + else + { + QMessageBox::critical(this, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("未填写名称或路径")); + return; + } + categories = new bool[8]; + categories[0] = true; + categories[2] = true; + categories[7] = true; + categories[3] = false; + categories[4] = false; + for(auto key:categories_list.keys()) + { + if(key==0||key==2||key==7||key==3||key==4) + { + continue; + } + else + { + categories[key - 1] = categories_list[key]->checkState(); + } + } + categories[0] = true; + categories[7] = true; + changed = true; + close(); +} diff --git a/OfficeAssistant_msvc/addapp.h b/OfficeAssistant_msvc/addapp.h new file mode 100644 index 0000000..bb217cc --- /dev/null +++ b/OfficeAssistant_msvc/addapp.h @@ -0,0 +1,63 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +struct Record2; +#include "ui_addapp.h" + +class AddApp : public QDialog +{ + Q_OBJECT + +public: + AddApp(bool isEdit = false, Record2 *orig_name_str=nullptr,QWidget* parent = nullptr); + ~AddApp(); + QString get_exe_path() + { + return path_str; + } + QString get_orig_name() + { + return orig_name_str; + } + QString get_name() + { + return name_str; + } + QString get_sort() + { + return sort_str; + } + bool *get_categories() + { + return categories; + } + bool changed = false; +private: + Ui::AddAppClass ui; + QFormLayout *form; + bool *categories; + QPushButton *path; + QPushButton* submit_btn; + QLineEdit *name; + QLabel *name_label; + QLineEdit *orig_name; + QLineEdit *sort; + QMap categories_list; + QString sort_str; + QString name_str; + QString orig_name_str; + QString path_str; + QVBoxLayout* layout_inner; + bool isEdit; +private slots: + void broswer_exe(); + void submit(); + +}; diff --git a/OfficeAssistant_msvc/addapp.ui b/OfficeAssistant_msvc/addapp.ui new file mode 100644 index 0000000..9cfa2eb --- /dev/null +++ b/OfficeAssistant_msvc/addapp.ui @@ -0,0 +1,33 @@ + + + AddAppClass + + + + 0 + 0 + 450 + 600 + + + + + 0 + 0 + + + + 娣诲姞搴旂敤 + + + + icon/wechat.icoicon/wechat.ico + + + backgroound-color:#ffffff + + + + + + diff --git a/OfficeAssistant_msvc/addcategory.cpp b/OfficeAssistant_msvc/addcategory.cpp new file mode 100644 index 0000000..231e46e --- /dev/null +++ b/OfficeAssistant_msvc/addcategory.cpp @@ -0,0 +1,73 @@ +#include "addcategory.h" +#include +AddCategory::AddCategory(QWidget* parent) + : QDialog(parent) +{ + ui.setupUi(this); + setWindowFlags(Qt::WindowCloseButtonHint); + setFixedSize(900, 600); + //connect(ui.submit, &QPushButton::click, this, &AddCategory::submit); + QStringList title; + ui.tableWidget->setColumnCount(3); + title << QString::fromLocal8Bit("名称") << QString::fromLocal8Bit("显示") << QString::fromLocal8Bit("排序"); + ui.tableWidget->setHorizontalHeaderLabels(title); + sqlite_helper.get_category(categrories); + ui.tableWidget->setRowCount(categrories.count()); + int i = 0; + for(auto category : categrories) + { + ui.tableWidget->setItem(i, 0, new QTableWidgetItem(category.name)); + if(category.id==1&&category.id==8) + { + ui.tableWidget->item(i, 0)->setFlags(ui.tableWidget->item(i, 0)->flags() & (~Qt::ItemIsEditable)); + } + QComboBox* combo_box = new QComboBox; + combo_box->addItem(QString::fromLocal8Bit("显示"), true); + combo_box->addItem(QString::fromLocal8Bit("不显示"), false); + if(category.display==true) + { + combo_box->setCurrentIndex(0); + }else + { + combo_box->setCurrentIndex(1); + } + ui.tableWidget->setCellWidget(i, 1, combo_box); + ui.tableWidget->setItem(i, 2, new QTableWidgetItem(QString::number(category.sort))); + combo_boxes << combo_box; + i++; + } + //submit_btn = new QPushButton(QString::fromLocal8Bit("提交")); + connect(ui.submit, &QPushButton::clicked, this, &AddCategory::submit); +} +AddCategory::~AddCategory() +{ + for(auto combo_box : combo_boxes) + { + delete combo_box; + } +} +void AddCategory::submit() +{ + int num = categrories.count(); + QList categrories_new; + int i=0; + for(Categrory categrory:categrories) + { + categrory.name = ui.tableWidget->item(i, 0)->text(); + QComboBox * combox =(QComboBox *)ui.tableWidget->cellWidget(i, 1); + categrory.display = combox->currentData().toBool(); + bool ok; + categrory.sort = ui.tableWidget->item(i, 2)->text().toInt(&ok, 10); + if(!ok) + { + QMessageBox::critical(this, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("排序列中有一行不是数字")); + return; + } + categrories_new << categrory; + i++; + } + categrories.clear(); + categrories = categrories_new; + changed = true; + close(); +} diff --git a/OfficeAssistant_msvc/addcategory.h b/OfficeAssistant_msvc/addcategory.h new file mode 100644 index 0000000..f7dc3a9 --- /dev/null +++ b/OfficeAssistant_msvc/addcategory.h @@ -0,0 +1,25 @@ +#pragma once + +#include +#include +#include +#include "sqlitehelper.h" +#include "ui_addcategory.h" + +class AddCategory : public QDialog +{ + Q_OBJECT + +public: + AddCategory(QWidget *parent = nullptr); + ~AddCategory(); + QList categrories; + bool changed = false; +private: + Ui::AddCategoryClass ui; + SQLiteHelper sqlite_helper; + QPushButton* submit_btn; + QList combo_boxes; +private slots: + void submit(); +}; diff --git a/OfficeAssistant_msvc/addcategory.ui b/OfficeAssistant_msvc/addcategory.ui new file mode 100644 index 0000000..989b033 --- /dev/null +++ b/OfficeAssistant_msvc/addcategory.ui @@ -0,0 +1,47 @@ + + + AddCategoryClass + + + + 0 + 0 + 900 + 600 + + + + 绫诲埆鍚嶇О + + + + icon/wechat.icoicon/wechat.ico + + + + + 90 + 70 + 711 + 411 + + + + + + + 380 + 520 + 150 + 46 + + + + 纭畾 + + + + + + + diff --git a/OfficeAssistant_msvc/applicationmanager.cpp b/OfficeAssistant_msvc/applicationmanager.cpp new file mode 100644 index 0000000..cf47e2d --- /dev/null +++ b/OfficeAssistant_msvc/applicationmanager.cpp @@ -0,0 +1,274 @@ +#include "applicationmanager.h" +#include "applicationmanagerpage.h" +#include "config.h" +#include "addapp.h" +#include "addcategory.h" +#include "sqlitehelper.h" +#include + +#include "globalvariables.h" + +ApplicationManager::ApplicationManager(QWidget *parent) + : QWidget(parent) +{ + ui.setupUi(this); + resize(parent->width(), parent->height()); + miniblink = new QMiniBlink(this); + miniblink->init(); + miniblink->show(); + connect(this, &ApplicationManager::changeUrl, miniblink, &QMiniBlink::switchUrl); + layout = new QVBoxLayout(this); + layout_top = new QHBoxLayout(this); + layout_top->setAlignment(Qt::AlignRight); + layout_top->setMargin(5); + layout_bottom = new QHBoxLayout(this); + QList categrories; + sqlite_helper.get_category(categrories); + sqlite_helper.get_buttons(button_structs); + for (auto button_struct : button_structs) + { + MiniButton* button = new MiniButton(button_struct, this); + button->setText(button_struct.text); + //button->show(); + button->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); + button->setMaximumWidth(TEXT_SIZE * button->text().length() * scale * 3 + 40); + button->setMaximumHeight(TEXT_SIZE * scale * 3 + 20); + //button->resize(TEXT_SIZE * button->text().length() * scale * 3 + 20, TEXT_SIZE * scale * 3 + 10); + buttons << button; + layout_top->addWidget(button, 1); + connect(button, &MiniButton::click0, button, &MiniButton::onclick1); + connect(button, &MiniButton::click1, this, &ApplicationManager::onclick1); + } + //ui.tabWidget->setStyleSheet("border:none;"); + //ui.tabWidget->setMinimumHeight(40); + //ui.tabWidget->setMovable(false); + //ui.tabWidget->setDocumentMode(false); + //ui.tabWidget->setCurrentIndex(0); + tab_bar = new QTabBar(this); + tab_bar->addTab(QString::fromLocal8Bit("全部")); + layout_bottom_top = new QVBoxLayout; + + for(int i=2;i<=8;i++) + { + tab_bar->addTab(categrories[i - 2].name); + } + layout_bottom_top->addWidget(tab_bar, 1); + application_manager_page_all = new ApplicationManagerPage(ALL, this, this); + connect(this, &ApplicationManager::refresh, application_manager_page_all, &ApplicationManagerPage::refresh); + layout_bottom_top->addWidget(application_manager_page_all, 19); + map.insert(1, application_manager_page_all); + for(int i=2;i<=8;i++) + { + ApplicationManagerPage* application_manager_page = new ApplicationManagerPage(i, this, this); + connect(this, &ApplicationManager::refresh, application_manager_page, &ApplicationManagerPage::refresh); + layout_bottom_top->addWidget(application_manager_page, 19); + application_manager_page->setHidden(true); + map.insert(i, application_manager_page); + } + tab_bar->setCurrentIndex(0); + connect(tab_bar, &QTabBar::currentChanged, this, &ApplicationManager::tabChange); + QString style = "QTabBar::tab{height:80;width:150; border:2px} QTabBar::tab:hover{ border:2px;height:80;width:150;color:"; + style += DEFAULT_COVER_COLOR; + style += ";}QTabBar::tab:selected { border:2px;height:80;width:150;color:"; + style += DEFAULT_COVER_COLOR; + style += ";}"; + tab_bar->setStyleSheet(style); + tab_bar->setDrawBase(false); + /*ApplicationManagerPage* application_manager_page_all = new ApplicationManagerPage(ALL,this); + QHBoxLayout *application_manager_page_all_layout = new QHBoxLayout; + application_manager_page_all_layout->addWidget(application_manager_page_all); + pages.insert(application_manager_page_all_layout, application_manager_page_all); + ui.tab_1->setLayout(application_manager_page_all_layout); + ui.tabWidget->setTabText(0,QString::fromLocal8Bit("全部")); + + ApplicationManagerPage* application_manager_page_elite = new ApplicationManagerPage(ELITE,this); + QHBoxLayout* application_manager_page_elite_layout = new QHBoxLayout; + application_manager_page_elite_layout->addWidget(application_manager_page_elite); + ui.tab_2->setLayout(application_manager_page_elite_layout); + pages.insert(application_manager_page_elite_layout, application_manager_page_elite); + ui.tabWidget->setTabText(1, categrories[0].name); + + ApplicationManagerPage* application_manager_page_soft = new ApplicationManagerPage(SOFT,this); + QHBoxLayout* application_manager_page_soft_layout = new QHBoxLayout; + application_manager_page_soft_layout->addWidget(application_manager_page_soft); + pages.insert(application_manager_page_soft_layout, application_manager_page_soft); + ui.tab_3->setLayout(application_manager_page_soft_layout); + ui.tabWidget->setTabText(2, categrories[1].name); + + ApplicationManagerPage* application_manager_page_system = new ApplicationManagerPage(SYSTEM,this); + QHBoxLayout* application_manager_page_system_layout = new QHBoxLayout; + application_manager_page_system_layout->addWidget(application_manager_page_system); + pages.insert(application_manager_page_system_layout, application_manager_page_system); + ui.tab_4->setLayout(application_manager_page_system_layout); + ui.tabWidget->setTabText(3, categrories[2].name); + + ApplicationManagerPage* application_manager_page_inner = new ApplicationManagerPage(INNER,this); + QHBoxLayout* application_manager_page_inner_layout = new QHBoxLayout; + application_manager_page_inner_layout->addWidget(application_manager_page_inner); + pages.insert(application_manager_page_inner_layout, application_manager_page_inner); + ui.tab_5->setLayout(application_manager_page_inner_layout); + ui.tabWidget->setTabText(4, categrories[3].name); + + ApplicationManagerPage* application_manager_page_custom_1 = new ApplicationManagerPage(CUSTOM_1, this); + QHBoxLayout* application_manager_page_custom_1_layout = new QHBoxLayout; + application_manager_page_custom_1_layout->addWidget(application_manager_page_custom_1); + pages.insert(application_manager_page_custom_1_layout, application_manager_page_custom_1); + ui.tab_6->setLayout(application_manager_page_custom_1_layout); + ui.tabWidget->setTabText(5, categrories[4].name); + + ApplicationManagerPage* application_manager_page_custom_2 = new ApplicationManagerPage(CUSTOM_2, this); + QHBoxLayout* application_manager_page_custom_2_layout = new QHBoxLayout; + application_manager_page_custom_2_layout->addWidget(application_manager_page_custom_2); + pages.insert(application_manager_page_custom_2_layout, application_manager_page_custom_2); + ui.tab_7->setLayout(application_manager_page_custom_2_layout); + ui.tabWidget->setTabText(6, categrories[5].name); + + ApplicationManagerPage* application_manager_page_others = new ApplicationManagerPage(OTHERS,this); + QHBoxLayout* application_manager_page_others_layout = new QHBoxLayout; + application_manager_page_others_layout->addWidget(application_manager_page_others); + pages.insert(application_manager_page_others_layout, application_manager_page_others); + ui.tab_8->setLayout(application_manager_page_others_layout); + ui.tabWidget->setTabText(7, categrories[6].name);*/ + layout_bottom->addLayout(layout_bottom_top,7); + layout_bottom->addWidget(miniblink, 3); + layout->addLayout(layout_top, 1); + layout->addLayout(layout_bottom, 9); + setLayout(layout); +} + +ApplicationManager::~ApplicationManager() +{ + for(auto button:buttons) + { + delete button; + } + for(auto layout:pages.keys()) + { + delete pages[layout]; + delete layout; + } + delete miniblink; + delete layout_top; + delete layout_bottom; + delete layout; +} + +void ApplicationManager::onclick1(QString op, QString func, QString path, QString url) +{ + if(op=="self") + { + if(func=="app_add") + { + AddApp add_app; + add_app.exec(); + if(add_app.changed) + { + bool ok = sqlite_helper.insert_software(add_app.get_name(), add_app.get_orig_name(), add_app.get_exe_path(), + add_app.get_sort(), add_app.get_categories()); + if (!ok) + { + QMessageBox::critical(this, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("插入失败")); + } + + emit refresh(); + /*table->insertRow(table->rowCount()-1); + table->setItem(table->rowCount(), 0, new QTableWidgetItem(add_app.get_name())); + table->setItem(table->rowCount(), 1, new QTableWidgetItem(add_app.get_orig_name())); + Record2 record2; + srand(time(nullptr)); + + int id = rand(); + if(idsetText(QString::fromLocal8Bit("设置")); + connect(record2.settings, &MiniButton::click0, record2.settings, &MiniButton::onclick2); + connect(record2.settings, &MiniButton::click2, this, &ApplicationManager::onclick2); + record2.open = new MiniButton(id, "open"); + record2.open->setText(QString::fromLocal8Bit("打开")); + connect(record2.open, &MiniButton::click0, record2.open, &MiniButton::onclick2); + connect(record2.open, &MiniButton::click2, this, &ApplicationManager::onclick2); + record2.exe_file = add_app.get_exe_path(); + record2.orig_name = add_app.get_orig_name(); + table->setCellWidget(table->rowCount(), 4, record2.settings); + table->setCellWidget(table->rowCount(), 5, record2.open); + rows.insert(id, record2);*/ + } + } + else if (func == "app_update") + { + bool software_ok = sqlite_helper.update_software(); + bool app_ok = sqlite_helper.update_app(); + if(software_ok&&app_ok) + { + QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("更新成功")); + } + else + { + QMessageBox::critical(this, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("更新部分或全部失败")); + } + }else if(func=="app_category") + { + AddCategory add_category; + add_category.exec(); + if(add_category.changed) + { + for(int i=0;i<7;i++) + { + tab_bar->setTabText(i + 1, add_category.categrories[i].name); + } + bool ok = sqlite_helper.set_category(add_category.categrories); + if (!ok) + { + QMessageBox::critical(this, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("添加失败")); + } + } + } + }else if(op=="soft") + { + emit changeUrl(url); + ShellExecute(GetDesktopWindow(), L"open", path.toStdWString().c_str(), L"", L"", SW_SHOW); + }else if(op=="app") + { + emit changeUrl(url); + QString str = QApplication::applicationDirPath() + path; + ShellExecute(GetDesktopWindow(), L"open",str.toStdWString().c_str(), L"", L"", SW_SHOW); + }else if(op=="url") + { + emit changeUrl(url); + } +} + +void ApplicationManager::onclick2(QString orig_name, QString op) +{ + if (op == "open") + { + emit changeUrl(application_manager_page_all->rows[orig_name].url); + WinExec(application_manager_page_all->rows[orig_name].exe_file.toStdString().c_str(), SW_SHOW); + } + else if (op == "settings") + { + AddApp add_app(true, &application_manager_page_all->rows[orig_name]); + add_app.exec(); + if (add_app.changed) + { + bool ok = sqlite_helper.edit_software(add_app.get_name(), add_app.get_orig_name(), add_app.get_exe_path(), add_app.get_sort(), add_app.get_categories()); + if (!ok) + { + QMessageBox::critical(this, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("编辑失败")); + } + } + } +} + +void ApplicationManager::tabChange(int index) +{ + tab_bar->setHidden(false); + for(auto i:map.keys()) + { + map[i]->setHidden(true); + } + map[index + 1]->setHidden(false); +} diff --git a/OfficeAssistant_msvc/applicationmanager.h b/OfficeAssistant_msvc/applicationmanager.h new file mode 100644 index 0000000..90b2f34 --- /dev/null +++ b/OfficeAssistant_msvc/applicationmanager.h @@ -0,0 +1,76 @@ +#pragma once + +#include +#include "sqlitehelper.h" +#include "buttonstruct.h" +#include +#include +#include +#include +#include +#include +#include +#include "minibutton.h" +#include +#include "qminiblink.h" +#include "ui_applicationmanager.h" +#include +#include +class ApplicationManagerPage; + +struct Record2 +{ + /*QLabel *name; + QLabel *orig_name; + QLabel *dev; + QLabel *use_time;*/ + QSvgWidget* icon; + MiniButton* settings; + MiniButton * open; + QString orig_name; + QString exe_file; + QCheckBox *check_box; + int sort; + QString url; + bool categories[8]; +}; + +struct Title +{ + QLabel* name; + QLabel* orig_name; + QLabel* dev; + QLabel* use_time; + QLabel* op; +}; +class ApplicationManager : public QWidget +{ + Q_OBJECT +signals: + void changeUrl(QString url); + void refresh(); +public: + ApplicationManager(QWidget *parent = nullptr); + ~ApplicationManager(); +private: + QHash pages; + QVBoxLayout* layout; + QTabBar *tab_bar; + QMap map; + QHBoxLayout* layout_top; + QHBoxLayout* layout_bottom; + QMiniBlink* miniblink; + QList buttons; + QList softwares; + QList button_structs; + ApplicationManagerPage* application_manager_page_all; + Ui::ApplicationManagerClass ui; + SQLiteHelper sqlite_helper; + QVBoxLayout *layout_bottom_top; + QTableWidget *table; + Title title; +public slots: + void onclick1(QString op, QString func, QString path, QString url); + void onclick2(QString orig_name, QString op); + void tabChange(int index); +}; diff --git a/OfficeAssistant_msvc/applicationmanager.ui b/OfficeAssistant_msvc/applicationmanager.ui new file mode 100644 index 0000000..1780858 --- /dev/null +++ b/OfficeAssistant_msvc/applicationmanager.ui @@ -0,0 +1,20 @@ + + + ApplicationManagerClass + + + + 0 + 0 + 600 + 400 + + + + ApplicationManager + + + + + + diff --git a/OfficeAssistant_msvc/applicationmanagerpage.cpp b/OfficeAssistant_msvc/applicationmanagerpage.cpp new file mode 100644 index 0000000..de77f89 --- /dev/null +++ b/OfficeAssistant_msvc/applicationmanagerpage.cpp @@ -0,0 +1,238 @@ +#include "applicationmanagerpage.h" + +#include +#include +#include "applicationmanager.h" +#include "config.h" + +ApplicationManagerPage::ApplicationManagerPage(int category, ApplicationManager *application_manager,QWidget *parent) + : QWidget(parent) +{ + ui.setupUi(this); + this->category = category; + this->application_manager = application_manager; + sqlite_helper.get_buttons(button_structs); + layout = new QVBoxLayout; + sqlite_helper.get_all_software(softwares, category); + table = new QTableWidget(this); + table->setColumnCount(8); + QStringList titles; + titles<< QString::fromLocal8Bit("图标") << QString::fromLocal8Bit("名称") << QString::fromLocal8Bit("全名") << QString::fromLocal8Bit("开发者") << QString::fromLocal8Bit("最后使用日期") << QString::fromLocal8Bit("添加到导航条") <setHorizontalHeaderLabels(titles); + table->setEditTriggers(QAbstractItemView::NoEditTriggers); + table->setStyleSheet("QTableWidget{border:1px;outline:1px;align: center;} QQTableWidget::widget QTableWidget::item {text-align: center;}"); + table->horizontalHeader()->setDefaultAlignment(Qt::AlignHCenter | Qt::AlignVCenter); + int i = 0; + for (i = 0; i < 8; i++) + { + table->horizontalHeader()->setSectionResizeMode(i, QHeaderView::Stretch); + + } + i = 0; + QTableWidgetItem* item = new QTableWidgetItem; + item->setTextAlignment(Qt::AlignCenter); + table->setItemPrototype(item); + for (auto software : softwares) + { + table->insertRow(i); + + table->setItem(i, 1, new QTableWidgetItem(software.name)); + table->setItem(i, 2, new QTableWidgetItem(software.orig_name)); + table->setItem(i, 3, new QTableWidgetItem(software.dev)); + QString date; + std::tm* time; + time = std::localtime(&software.use_time); + date = QString::number(1900 + time->tm_year, 10); + date += "/"; + date += QString::number(1 + time->tm_mon, 10); + date += "/"; + date += QString::number(time->tm_mday, 10); + table->setItem(i, 4, new QTableWidgetItem(date)); + Record2 record2; + record2.icon = new QSvgWidget; + QFile file(software.logo); + if(file.exists()) + { + record2.icon->load(software.logo); + } + else { + record2.icon->load(QApplication::applicationDirPath() + DEFAULT_IMAGE); + } + record2.icon->setMaximumSize(80, 80); + table->setCellWidget(i, 0, record2.icon); + record2.settings = new MiniButton(software.orig_name, "settings"); + record2.settings->setText(QString::fromLocal8Bit("设置")); + record2.settings->setMaximumSize(60, 40); + connect(record2.settings, &MiniButton::click0, record2.settings, &MiniButton::onclick2); + connect(record2.settings, &MiniButton::click2, application_manager, &ApplicationManager::onclick2); + record2.open = new MiniButton(software.orig_name, "open"); + record2.open->setText(QString::fromLocal8Bit("打开")); + record2.open->setMaximumSize(60, 40); + connect(record2.open, &MiniButton::click0, record2.open, &MiniButton::onclick2); + connect(record2.open, &MiniButton::click2, application_manager, &ApplicationManager::onclick2); + record2.exe_file = software.path; + record2.orig_name = software.orig_name; + record2.url = software.url; + for(int i=0;i<8;i++) + { + record2.categories[i] = false; + } + for(int i=0;i<8;i++) + { + if (software.category_id.contains(QString::number(i))) + { + record2.categories[i] = true; + } + } + record2.sort = software.sort; + record2.check_box = new QCheckBox; + if(software.type=="navbar") + { + record2.check_box->setCheckState(Qt::Checked); + checked.insert(software.orig_name, true); + } + else + { + record2.check_box->setCheckState(Qt::Unchecked); + checked.insert(software.orig_name, false); + } + connect(record2.check_box, &QCheckBox::clicked, this, &ApplicationManagerPage::onclicked); + QTableWidgetItem* check_box_item = new QTableWidgetItem; + table->setItem(i, 5, check_box_item); + table->setCellWidget(i, 5, record2.check_box); + check_box_item->setTextAlignment(Qt::AlignCenter); + table->setCellWidget(i, 6, record2.settings); + //table->item(i, 5)->setTextAlignment(Qt::AlignCenter); + table->setCellWidget(i, 7, record2.open); + //table->item(i, 6)->setTextAlignment(Qt::AlignCenter); + rows.insert(software.orig_name, record2); + table->resizeColumnToContents(0); + //table->item(i, 0)->setTextAlignment(Qt::AlignCenter); + //table->verticalHeader()->setSectionResizeMode(i, QHeaderView::ResizeToContents); + i++; + } + layout->addWidget(table); + setLayout(layout); + +} +ApplicationManagerPage::~ApplicationManagerPage() +{ + for (auto button : buttons) + { + delete button; + } + delete table; + delete layout; +} + +void ApplicationManagerPage::onclicked() +{ + for(int i=0;irowCount();i++) + { + if(((QCheckBox *)table->cellWidget(i,4))->checkState()==Qt::Checked) + { + if(!checked[table->item(i,1)->text()]) + { + QString orig_name = table->item(i, 1)->text(); + bool ok=sqlite_helper.edit_software(table->item(i, 0)->text(), orig_name, rows[orig_name].exe_file, QString::number(rows[orig_name].sort), rows[orig_name].categories,"navbar"); + if(!ok) + { + QMessageBox::critical(this, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("更新部分或全部失败")); + break; + } + } + }else + { + if (checked[table->item(i, 1)->text()]) + { + QString orig_name = table->item(i, 1)->text(); + bool ok = sqlite_helper.edit_software(table->item(i, 0)->text(), orig_name, rows[orig_name].exe_file, QString::number(rows[orig_name].sort), rows[orig_name].categories, "app"); + if (!ok) + { + QMessageBox::critical(this, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("更新部分或全部失败")); + break; + } + } + } + } + emit application_manager->refresh(); +} + +void ApplicationManagerPage::refresh() +{ + int rowcount = table->rowCount(); + for(int i=0;iremoveRow(0); + } + for(auto row:rows) + { + disconnect(row.settings, &MiniButton::click0, row.settings, &MiniButton::onclick2); + disconnect(row.settings, &MiniButton::click2, application_manager, &ApplicationManager::onclick2); + disconnect(row.open, &MiniButton::click0, row.open, &MiniButton::onclick2); + disconnect(row.open, &MiniButton::click2, application_manager, &ApplicationManager::onclick2); + disconnect(row.check_box, &QCheckBox::clicked, this, &ApplicationManagerPage::onclicked); + } + softwares.clear(); + sqlite_helper.get_all_software(softwares, category); + int i = 0; + for (auto software : softwares) + { + table->insertRow(i); + table->setItem(i, 0, new QTableWidgetItem(software.name)); + table->setItem(i, 1, new QTableWidgetItem(software.orig_name)); + table->setItem(i, 2, new QTableWidgetItem(software.dev)); + QString date; + std::tm* time; + time = std::localtime(&software.use_time); + date = QString::number(1900 + time->tm_year, 10); + date += "/"; + date += QString::number(1 + time->tm_mon, 10); + date += "/"; + date += QString::number(time->tm_mday, 10); + table->setItem(i, 3, new QTableWidgetItem(date)); + Record2 record2; + record2.settings = new MiniButton(software.orig_name, "settings"); + record2.settings->setText(QString::fromLocal8Bit("设置")); + record2.settings->setMaximumSize(60, 40); + connect(record2.settings, &MiniButton::click0, record2.settings, &MiniButton::onclick2); + connect(record2.settings, &MiniButton::click2, application_manager, &ApplicationManager::onclick2); + record2.open = new MiniButton(software.orig_name, "open"); + record2.open->setText(QString::fromLocal8Bit("打开")); + record2.open->setMaximumSize(60, 40); connect(record2.open, &MiniButton::click0, record2.open, &MiniButton::onclick2); + connect(record2.open, &MiniButton::click2, application_manager, &ApplicationManager::onclick2); + record2.exe_file = software.path; + record2.orig_name = software.orig_name; + for (int i = 0; i < 8; i++) + { + record2.categories[i] = false; + } + for (int i = 0; i < 8; i++) + { + if (software.category_id.contains(QString::number(i))) + { + record2.categories[i] = true; + } + } + record2.sort = software.sort; + record2.check_box = new QCheckBox; + if (software.type == "navbar") + { + record2.check_box->setCheckState(Qt::Checked); + checked.insert(software.orig_name, true); + } + else + { + record2.check_box->setCheckState(Qt::Unchecked); + checked.insert(software.orig_name, false); + } + connect(record2.check_box, &QCheckBox::clicked, this, &ApplicationManagerPage::onclicked); + table->setCellWidget(i, 4, record2.check_box); + table->setCellWidget(i, 5, record2.settings); + //table->item(i, 5)->setTextAlignment(Qt::AlignCenter); + table->setCellWidget(i, 6, record2.open); + //table->item(i, 6)->setTextAlignment(Qt::AlignCenter); + rows.insert(software.orig_name, record2); + i++; + } +} diff --git a/OfficeAssistant_msvc/applicationmanagerpage.h b/OfficeAssistant_msvc/applicationmanagerpage.h new file mode 100644 index 0000000..995a59c --- /dev/null +++ b/OfficeAssistant_msvc/applicationmanagerpage.h @@ -0,0 +1,44 @@ +#pragma once + +#include +#include +#include + +#include "minibutton.h" +#include "qminiblink.h" +#include "sqlitehelper.h" +#include "ui_applicationmanagerpage.h" + +class ApplicationManager; +struct Title; +struct Record2; + +class ApplicationManagerPage : public QWidget +{ + Q_OBJECT + +public: + ApplicationManagerPage(int category, ApplicationManager *application_manager,QWidget *parent = nullptr); + ~ApplicationManagerPage(); + QMap rows; + +private: + Ui::ApplicationManagerPageClass ui; + QVBoxLayout* layout; + QHBoxLayout* layout_top; + QHBoxLayout* layout_bottom; + QMiniBlink* miniblink; + QList buttons; + QList softwares; + QList button_structs; + QHash checked; + SQLiteHelper sqlite_helper; + QGridLayout* layout_left; + QTableWidget* table; + ApplicationManager* application_manager; + Title *title; + int category; +public slots: + void refresh(); + void onclicked(); +}; diff --git a/OfficeAssistant_msvc/applicationmanagerpage.ui b/OfficeAssistant_msvc/applicationmanagerpage.ui new file mode 100644 index 0000000..1fa13fe --- /dev/null +++ b/OfficeAssistant_msvc/applicationmanagerpage.ui @@ -0,0 +1,22 @@ + + ApplicationManagerPageClass + + + ApplicationManagerPageClass + + + + 0 + 0 + 600 + 400 + + + + ApplicationManagerPage + $centralwidget$ + + + + + diff --git a/OfficeAssistant_msvc/config.h b/OfficeAssistant_msvc/config.h index 641758b..adcbe42 100644 --- a/OfficeAssistant_msvc/config.h +++ b/OfficeAssistant_msvc/config.h @@ -6,7 +6,8 @@ #define OFFICEASSISTANT_CONFIG_H #define CONFIG_URL "http://softapi.s103.y01.cn/addons/Kmdsoft/Index/config" //获取导航栏信息的地址 #define OP_URL "http://softapi.s103.y01.cn/addons/Kmdsoft/Index/op" //上传是否设置开机启动、是否建立桌面快捷方式的地址 -#define DEVICE_URL "http://softapi.s103.y01.cn/addons/Kmdsoft/Index/device" //上传设备信息的地址 +#define DEVICE_URL "http://softapi.s103.y01.cn/addons/Kmdsoft/Index/device" //上传设备信息的地址 +#define WECHAT_URL " http://softapi.s103.y01.cn/addons/Kmdsoft/Wxdk/open" #define BASE_URL "http://softapi.s103.y01.cn/" //域名 #define DEFAULT_FILE "/config/default_navbar.kmd" //默认导航栏文件位置 #define KEY "3b046cfe4a2a3e62141a4840f2006210a3224e3615312bef6e19f4983921abe0" //Key @@ -18,7 +19,23 @@ #define ADD_SHORTCUT 2 #define VERSION "1.0.0" //软件版本 #define RELEASE "20230801" //Release -#define SOFTWARE_URL "http://softapi.1.y01.cn/addons/Kmdsoft/Index/soft" +#define SOFTWARE_URL "http://softapi.s103.y01.cn/addons/Kmdsoft/App/update/type/add" +#define DEFAULT_BACKGROUND_COLOR "#333332" #define DEFAULT_COLOR "#3399FF" +#define DEFAULT_TEXT_COLOR "#FFFFFF" +#define DEFAULT_COVER_COLOR "#0033FF" #define DEFAULT_IMAGE "/images/icon/default.svg" +#define DEFAULT_LOGO "/images/logo.png" +#define TITLE " " +#define TEXT_SIZE 7 +#define TEXT_SIZE_BIG 10 +//分类 +#define ALL 1 +#define ELITE 2 +#define SOFT 3 +#define SYSTEM 4 +#define INNER 5 +#define CUSTOM_1 6 +#define CUSTOM_2 7 +#define OTHERS 8 #endif //OFFICEASSISTANT_CONFIG_H diff --git a/OfficeAssistant_msvc/exitmanager.h b/OfficeAssistant_msvc/exitmanager.h index 77261c9..2d0a820 100644 --- a/OfficeAssistant_msvc/exitmanager.h +++ b/OfficeAssistant_msvc/exitmanager.h @@ -2,6 +2,7 @@ #include #include +#include "sqlitehelper.h" template class AutoDeleteList { @@ -37,7 +38,9 @@ public: // 退出应用程序 void exit(int exitCode = 0) { - + SQLiteHelper sqlite_helper; + sqlite_helper.db.close(); + QSqlDatabase::removeDatabase("mydb"); // 发射退出应用程序信号 emit exitApplication(exitCode); } diff --git a/OfficeAssistant_msvc/globalvariables.h b/OfficeAssistant_msvc/globalvariables.h index 6d9f4a2..803fe88 100644 --- a/OfficeAssistant_msvc/globalvariables.h +++ b/OfficeAssistant_msvc/globalvariables.h @@ -10,4 +10,6 @@ extern ExitManager exit_manager; extern double scale; extern MainWindowLayout *mainWindowLayout; extern QString url_param; +extern bool autostart; +extern bool agree; #endif //OFFICEASSISTANT_GLOBALVARIABLES_H diff --git a/OfficeAssistant_msvc/main.cpp b/OfficeAssistant_msvc/main.cpp index db9b549..c18e57e 100644 --- a/OfficeAssistant_msvc/main.cpp +++ b/OfficeAssistant_msvc/main.cpp @@ -2,9 +2,16 @@ #include #include double scale; +bool autostart = false; +bool agree = false; int main(int argc, char *argv[]) { QApplication a(argc, argv); + QStringList args = a.arguments(); + if(args.contains("autostart")) + { + autostart = true; + } HDC hdc = GetDC(NULL); scale = GetDeviceCaps(hdc, LOGPIXELSX)/96; ReleaseDC(NULL,hdc); diff --git a/OfficeAssistant_msvc/mainscreen.cpp b/OfficeAssistant_msvc/mainscreen.cpp index e8db25d..2f25207 100644 --- a/OfficeAssistant_msvc/mainscreen.cpp +++ b/OfficeAssistant_msvc/mainscreen.cpp @@ -37,6 +37,9 @@ MainScreen::MainScreen(QWidget *parent) : //button->setStyleSheet("text-color:white"); layout = new QHBoxLayout; miniblink = new QMiniBlink(this); + application_manager = new ApplicationManager(this); + application_manager->setHidden(true); + layout->addWidget(application_manager); layout->addWidget(widget, 1); layout->addWidget(miniblink, 4); this->setLayout(layout); @@ -64,8 +67,10 @@ MainScreen::~MainScreen() { delete layout_left; delete button; emit ondestroy(); + layout->removeWidget(application_manager); layout->removeWidget(miniblink); layout->removeWidget(widget); + delete application_manager; delete miniblink; delete widget; delete layout; @@ -79,13 +84,28 @@ void MainScreen::firstUrl(QString url) void MainScreen::clickButton1(QString op,QString url) { QString url_full = BASE_URL + url + url_param; if (op == "openwechat") { + OpenWeChatRequest open_wechat_request; + QString msg = open_wechat_request.sendRequest(); + if(msg!="ok") + { + QMessageBox::information(this, QString::fromLocal8Bit("提示"), msg); + return; + } widget->setHidden(false); miniblink->setHidden(false); + application_manager->setHidden(true); emit changeUrl(url_full); } + else if(op=="app_mgr") + { + miniblink->setHidden(true); + widget->setHidden(true); + application_manager->setHidden(false); + } else { widget->setHidden(true); miniblink->setHidden(false); + application_manager->setHidden(true); emit changeUrl(url_full); } } diff --git a/OfficeAssistant_msvc/mainscreen.h b/OfficeAssistant_msvc/mainscreen.h index af3ac49..e6d5e70 100644 --- a/OfficeAssistant_msvc/mainscreen.h +++ b/OfficeAssistant_msvc/mainscreen.h @@ -9,8 +9,8 @@ #include #include #include -#include "wke.h" #include "qminiblink.h" +#include "applicationmanager.h" class MyThread; QT_BEGIN_NAMESPACE namespace Ui { class MainScreen; } @@ -37,6 +37,7 @@ private: QVBoxLayout *layout_left; QPushButton *button; QIcon *icon; + ApplicationManager* application_manager; QWidget *broswer; static bool isInited(); QWidget *widget; diff --git a/OfficeAssistant_msvc/mainwindow.cpp b/OfficeAssistant_msvc/mainwindow.cpp index ce2ae8a..c585f10 100644 --- a/OfficeAssistant_msvc/mainwindow.cpp +++ b/OfficeAssistant_msvc/mainwindow.cpp @@ -6,27 +6,117 @@ #include "mainwindow.h" #include "ui_MainWindow.h" +#include "netio.h" #include "config.h" ExitManager exit_manager; MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); + agree = false; QDesktopWidget* desktopWidget = QApplication::desktop(); QRect deskRect = desktopWidget->availableGeometry(); resize(deskRect.width()*0.8, deskRect.height()*0.8); setWindowState(Qt::WindowMaximized); mainWindowLayout=new MainWindowLayout(this); setCentralWidget(mainWindowLayout); - setWindowTitle(QString::fromLocal8Bit(NAME)); + setWindowTitle(QString::fromLocal8Bit(TITLE)); QString path = QApplication::applicationDirPath(); path += LOGO_TITLEBAR; icon = new QIcon(path); setWindowIcon(*icon); - - + setStyleSheet("*{font-family:SimHei;}"); + QFile file(QApplication::applicationDirPath() + DEFAULT_FILE); + if(!file.open(QIODevice::Text|QIODevice::ReadOnly)) + { + QMessageBox::warning(nullptr, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("无法打开配置文件")); + exit_manager.exit(1); + } + QByteArray buffer; + buffer = file.readAll(); + file.close(); + QJsonDocument document = QJsonDocument::fromJson(buffer); + if(document.isObject()) + { + if(document.object().value("agree").isUndefined()) + { + QMessageBox msg; + msg.setWindowTitle(QString::fromLocal8Bit("用户体验改善计划")); + msg.setText(QString::fromLocal8Bit("为改善我们的服务质量,我们将向服务器发送以下信息:\n" + "1.您的计算机配置;\n" + "2.您计算机上的软件安装列表;\n" + "3.您是否设置了开机启动,以及是不是通过开机启动的方式启动本软件。\n" + "第二项信息是我们提供服务所必需的,如您选择不同意但继续使用本软件,则第二项数据将正常发送,但第一项和第三项数据不会发送。选择不同意不影响您使用本软件。")); + msg.addButton(QString::fromLocal8Bit("同意"), QMessageBox::AcceptRole); + msg.addButton(QString::fromLocal8Bit("不同意"), QMessageBox::RejectRole); + int ret = msg.exec(); + if(ret==QMessageBox::AcceptRole) + { + QJsonObject obj_root = document.object(); + obj_root.insert("agree", true); + document.setObject(obj_root); + agree = true; + DeviceRequest* device_request = new DeviceRequest;//构造函数直接发出去数据了 + delete device_request; + }else + { + QJsonObject obj_root = document.object(); + obj_root.insert("agree", false); + document.setObject(obj_root); + agree = false; + } + if(file.open(QIODevice::WriteOnly|QIODevice::Text)) + { + file.write(document.toJson()); + file.close(); + } + } + else if(document.object().value("agree").toBool()) + { + agree = true; + DeviceRequest* device_request = new DeviceRequest; + delete device_request; + } + } + else + { + QMessageBox msg; + msg.setWindowTitle(QString::fromLocal8Bit("用户体验改善计划")); + msg.setText(QString::fromLocal8Bit("为改善我们的服务质量,我们将向服务器发送以下信息:\n" + "1.您的计算机配置;\n" + "2.您计算机上的软件安装列表;\n" + "3.您是否设置了开机启动,以及是不是通过开机启动的方式启动本软件。\n" + "第二项信息是我们提供服务所必需的,如您选择不同意但继续使用本软件,则第二项数据将正常发送,但第一项和第三项数据不会发送。选择不同意不影响您使用本软件。")); + msg.addButton(QString::fromLocal8Bit("同意"), QMessageBox::AcceptRole); + msg.addButton(QString::fromLocal8Bit("不同意"), QMessageBox::RejectRole); + int ret = msg.exec(); + if (ret == QMessageBox::AcceptRole) + { + QJsonObject obj_root; + obj_root.insert("agree", true); + document.setObject(obj_root); + agree = true; + DeviceRequest* device_request = new DeviceRequest;//构造函数直接发出去数据了 + delete device_request; + } + else + { + QJsonObject obj_root; + obj_root.insert("agree", false); + document.setObject(obj_root); + agree = false; + } + if (file.open(QIODevice::WriteOnly | QIODevice::Text)) + { + file.write(document.toJson()); + file.close(); + } + } } MainWindow::~MainWindow() { + SQLiteHelper sqlite_helper; + sqlite_helper.db.close(); + QSqlDatabase::removeDatabase("mydb"); delete icon; this->setCentralWidget(nullptr); delete mainWindowLayout; diff --git a/OfficeAssistant_msvc/mainwindow.h b/OfficeAssistant_msvc/mainwindow.h index 0c4b22a..44ce8a2 100644 --- a/OfficeAssistant_msvc/mainwindow.h +++ b/OfficeAssistant_msvc/mainwindow.h @@ -8,6 +8,10 @@ #include #include #include "mainwindowlayout.h" +#include +#include +#include +#include #include diff --git a/OfficeAssistant_msvc/mainwindowlayout.cpp b/OfficeAssistant_msvc/mainwindowlayout.cpp index ddd0dce..7478e2e 100644 --- a/OfficeAssistant_msvc/mainwindowlayout.cpp +++ b/OfficeAssistant_msvc/mainwindowlayout.cpp @@ -13,9 +13,6 @@ MainWindowLayout::MainWindowLayout(QWidget *parent) : QWidget(parent), ui(new Ui::MainWindowLayout) { ui->setupUi(this); setContentsMargins(0, 0, 0, 0); - SQLiteHelper sqlite_helper; - sqlite_helper.update_app(); - sqlite_helper.update_software(); layout=new QVBoxLayout(this); mainWindowLayout = this; QList list; @@ -78,6 +75,10 @@ void MainWindowLayout::clickButton(QString op, QString func, QString url,QString settings->exec(); delete settings; } + else + { + emit clickButton1(func, url); + } } else if(op=="soft"){ ShellExecute(GetDesktopWindow(), L"open",path.toStdWString().c_str(),L"",initial_position.toStdWString().c_str(),SW_SHOW); diff --git a/OfficeAssistant_msvc/mb.h b/OfficeAssistant_msvc/mb.h new file mode 100644 index 0000000..2597526 --- /dev/null +++ b/OfficeAssistant_msvc/mb.h @@ -0,0 +1,1176 @@ +锘/* +* +* wolar@qq.com +* http://miniblink.net +* https://github.com/weolar/miniblink49 +* https://miniblink.net/views/doc/index.html api鏂囨。鍦板潃 +* licence Apache-2.0 +* +*/ + +#ifndef MB_DEFINE_H +#define MB_DEFINE_H + +#include + +////////////////////////////////////////////////////////////////////////// + +#define MB_CALL_TYPE __stdcall + +typedef struct _mbRect { + int x; + int y; + int w; + int h; + +#if defined(__cplusplus) + _mbRect() + { + x = 0; + y = 0; + w = 0; + h = 0; + } + _mbRect(int xVal, int yVal, int wVal, int hVal) + { + x = xVal; + y = yVal; + w = wVal; + h = hVal; + } + _mbRect(const _mbRect& other) + { + x = other.x; + y = other.y; + w = other.w; + h = other.h; + } +#endif +} mbRect; + +typedef struct _mbPoint { + int x; + int y; +} mbPoint; + +typedef struct _mbSize { + int w; + int h; +} mbSize; + +typedef enum { + MB_LBUTTON = 0x01, + MB_RBUTTON = 0x02, + MB_SHIFT = 0x04, + MB_CONTROL = 0x08, + MB_MBUTTON = 0x10, +} mbMouseFlags; + +typedef enum { + MB_EXTENDED = 0x0100, + MB_REPEAT = 0x4000, +} mbKeyFlags; + +typedef enum { + MB_MSG_MOUSEMOVE = 0x0200, + MB_MSG_LBUTTONDOWN = 0x0201, + MB_MSG_LBUTTONUP = 0x0202, + MB_MSG_LBUTTONDBLCLK = 0x0203, + MB_MSG_RBUTTONDOWN = 0x0204, + MB_MSG_RBUTTONUP = 0x0205, + MB_MSG_RBUTTONDBLCLK = 0x0206, + MB_MSG_MBUTTONDOWN = 0x0207, + MB_MSG_MBUTTONUP = 0x0208, + MB_MSG_MBUTTONDBLCLK = 0x0209, + MB_MSG_MOUSEWHEEL = 0x020A, +} mbMouseMsg; + +#if !defined(__cplusplus) +#ifndef HAVE_WCHAR_T +typedef unsigned short wchar_t; +#endif +#endif + +#include + +#if defined(__cplusplus) +#define MB_EXTERN_C extern "C" +#else +#define MB_EXTERN_C +#endif + +typedef char utf8; + +typedef enum { + MB_PROXY_NONE, + MB_PROXY_HTTP, + MB_PROXY_SOCKS4, + MB_PROXY_SOCKS4A, + MB_PROXY_SOCKS5, + MB_PROXY_SOCKS5HOSTNAME +} mbProxyType; + +typedef struct { + mbProxyType type; + char hostname[100]; + unsigned short port; + char username[50]; + char password[50]; +} mbProxy; + +typedef enum _mbSettingMask { + MB_SETTING_PROXY = 1, + MB_ENABLE_NODEJS = 1 << 3, + MB_ENABLE_DISABLE_H5VIDEO = 1 << 4, + MB_ENABLE_DISABLE_PDFVIEW = 1 << 5, + MB_ENABLE_DISABLE_CC = 1 << 6, + MB_ENABLE_ENABLE_EGLGLES2 = 1 << 7, // 娴嬭瘯鍔熻兘锛岃鍕夸娇鐢 + MB_ENABLE_ENABLE_SWIFTSHAER = 1 << 8, // 娴嬭瘯鍔熻兘锛岃鍕夸娇鐢 +} mbSettingMask; + +typedef void(MB_CALL_TYPE* mbOnBlinkThreadInitCallback)(void* param); + +#define kMbVersion 20200319 +#define kMbMaxVersion 20600319 + +typedef struct _mbSettings { + mbProxy proxy; + unsigned int mask; // 208 offset + mbOnBlinkThreadInitCallback blinkThreadInitCallback; + void* blinkThreadInitCallbackParam; + intptr_t version; + const wchar_t* mainDllPath; + HMODULE mainDllHandle; + const char* config; +} mbSettings; + +typedef struct _mbViewSettings { + int size; + unsigned int bgColor; +} mbViewSettings; + +typedef void* mbWebFrameHandle; +typedef void* mbNetJob; + +#if defined(__cplusplus) +namespace mb { class MbWebView; } +#else +struct _tagMbWebView; +#endif +typedef intptr_t mbWebView; + +#ifdef _WIN64 +typedef __int64 mbWebView; +#else +typedef int mbWebView; +#endif + +#define NULL_WEBVIEW 0 + +typedef BOOL(*mbCookieVisitor)( + void* params, + const char* name, + const char* value, + const char* domain, + const char* path, // If |path| is non-empty only URLs at or below the path will get the cookie value. + int secure, // If |secure| is true the cookie will only be sent for HTTPS requests. + int httpOnly, // If |httponly| is true the cookie will only be sent for HTTP requests. + int* expires // The cookie expiration date is only valid if |has_expires| is true. + ); + +typedef enum { + mbCookieCommandClearAllCookies, + mbCookieCommandClearSessionCookies, + mbCookieCommandFlushCookiesToFile, + mbCookieCommandReloadCookiesFromFile, +} mbCookieCommand; + +typedef enum { + MB_NAVIGATION_TYPE_LINKCLICK, + MB_NAVIGATION_TYPE_FORMSUBMITTE, + MB_NAVIGATION_TYPE_BACKFORWARD, + MB_NAVIGATION_TYPE_RELOAD, + MB_NAVIGATION_TYPE_FORMRESUBMITT, + MB_NAVIGATION_TYPE_OTHER +} mbNavigationType; + +typedef enum { + kMbCursorInfoPointer, + kMbCursorInfoCross, + kMbCursorInfoHand, + kMbCursorInfoIBeam, + kMbCursorInfoWait, + kMbCursorInfoHelp, + kMbCursorInfoEastResize, + kMbCursorInfoNorthResize, + kMbCursorInfoNorthEastResize, + kMbCursorInfoNorthWestResize, + kMbCursorInfoSouthResize, + kMbCursorInfoSouthEastResize, + kMbCursorInfoSouthWestResize, + kMbCursorInfoWestResize, + kMbCursorInfoNorthSouthResize, + kMbCursorInfoEastWestResize, + kMbCursorInfoNorthEastSouthWestResize, + kMbCursorInfoNorthWestSouthEastResize, + kMbCursorInfoColumnResize, + kMbCursorInfoRowResize, + kMbCursorInfoMiddlePanning, + kMbCursorInfoEastPanning, + kMbCursorInfoNorthPanning, + kMbCursorInfoNorthEastPanning, + kMbCursorInfoNorthWestPanning, + kMbCursorInfoSouthPanning, + kMbCursorInfoSouthEastPanning, + kMbCursorInfoSouthWestPanning, + kMbCursorInfoWestPanning, + kMbCursorInfoMove, + kMbCursorInfoVerticalText, + kMbCursorInfoCell, + kMbCursorInfoContextMenu, + kMbCursorInfoAlias, + kMbCursorInfoProgress, + kMbCursorInfoNoDrop, + kMbCursorInfoCopy, + kMbCursorInfoNone, + kMbCursorInfoNotAllowed, + kMbCursorInfoZoomIn, + kMbCursorInfoZoomOut, + kMbCursorInfoGrab, + kMbCursorInfoGrabbing, + kMbCursorInfoCustom +} mbCursorInfoType; + +typedef struct { + int x; + int y; + int width; + int height; + + BOOL menuBarVisible; + BOOL statusBarVisible; + BOOL toolBarVisible; + BOOL locationBarVisible; + BOOL scrollbarsVisible; + BOOL resizable; + BOOL fullscreen; +} mbWindowFeatures; + +typedef struct _mbPrintSettings { + int structSize; + int dpi; + int width; + int height; + int marginTop; + int marginBottom; + int marginLeft; + int marginRight; + BOOL isPrintPageHeadAndFooter; + BOOL isPrintBackgroud; + BOOL isLandscape; + BOOL isPrintToMultiPage; +} mbPrintSettings; + +struct mbString; +typedef mbString* mbStringPtr; + +typedef struct _mbMemBuf { + int size; + void* data; + size_t length; +} mbMemBuf; + +typedef struct { + struct Item { + enum mbStorageType { + // String data with an associated MIME type. Depending on the MIME type, there may be + // optional metadata attributes as well. + StorageTypeString, + // Stores the name of one file being dragged into the renderer. + StorageTypeFilename, + // An image being dragged out of the renderer. Contains a buffer holding the image data + // as well as the suggested name for saving the image to. + StorageTypeBinaryData, + // Stores the filesystem URL of one file being dragged into the renderer. + StorageTypeFileSystemFile, + } storageType; + + // Only valid when storageType == StorageTypeString. + mbMemBuf* stringType; + mbMemBuf* stringData; + + // Only valid when storageType == StorageTypeFilename. + mbMemBuf* filenameData; + mbMemBuf* displayNameData; + + // Only valid when storageType == StorageTypeBinaryData. + mbMemBuf* binaryData; + + // Title associated with a link when stringType == "text/uri-list". + // Filename when storageType == StorageTypeBinaryData. + mbMemBuf* title; + + // Only valid when storageType == StorageTypeFileSystemFile. + mbMemBuf* fileSystemURL; + long long fileSystemFileSize; + + // Only valid when stringType == "text/html". + mbMemBuf* baseURL; + }; + + struct Item* m_itemList; + int m_itemListLength; + + int m_modifierKeyState; // State of Shift/Ctrl/Alt/Meta keys. + mbMemBuf* m_filesystemId; +} mbWebDragData; + +typedef enum { + mbWebDragOperationNone = 0, + mbWebDragOperationCopy = 1, + mbWebDragOperationLink = 2, + mbWebDragOperationGeneric = 4, + mbWebDragOperationPrivate = 8, + mbWebDragOperationMove = 16, + mbWebDragOperationDelete = 32, + mbWebDragOperationEvery = 0xffffffff +} mbWebDragOperation; + +typedef mbWebDragOperation mbWebDragOperationsMask; + +typedef enum { + MB_RESOURCE_TYPE_MAIN_FRAME = 0, // top level page + MB_RESOURCE_TYPE_SUB_FRAME = 1, // frame or iframe + MB_RESOURCE_TYPE_STYLESHEET = 2, // a CSS stylesheet + MB_RESOURCE_TYPE_SCRIPT = 3, // an external script + MB_RESOURCE_TYPE_IMAGE = 4, // an image (jpg/gif/png/etc) + MB_RESOURCE_TYPE_FONT_RESOURCE = 5, // a font + MB_RESOURCE_TYPE_SUB_RESOURCE = 6, // an "other" subresource. + MB_RESOURCE_TYPE_OBJECT = 7, // an object (or embed) tag for a plugin, + // or a resource that a plugin requested. + MB_RESOURCE_TYPE_MEDIA = 8, // a media resource. + MB_RESOURCE_TYPE_WORKER = 9, // the main resource of a dedicated + // worker. + MB_RESOURCE_TYPE_SHARED_WORKER = 10, // the main resource of a shared worker. + MB_RESOURCE_TYPE_PREFETCH = 11, // an explicitly requested prefetch + MB_RESOURCE_TYPE_FAVICON = 12, // a favicon + MB_RESOURCE_TYPE_XHR = 13, // a XMLHttpRequest + MB_RESOURCE_TYPE_PING = 14, // a ping request for + MB_RESOURCE_TYPE_SERVICE_WORKER = 15, // the main resource of a service worker. + MB_RESOURCE_TYPE_LAST_TYPE +} mbResourceType; + +typedef enum _mbRequestType { + kMbRequestTypeInvalidation, + kMbRequestTypeGet, + kMbRequestTypePost, + kMbRequestTypePut, +} mbRequestType; + +typedef struct _mbSlist { + char* data; + struct _mbSlist* next; +} mbSlist; + +typedef enum _mbMenuItemId { + kMbMenuSelectedAllId = 1 << 1, + kMbMenuSelectedTextId = 1 << 2, + kMbMenuUndoId = 1 << 3, + kMbMenuCopyImageId = 1 << 4, + kMbMenuInspectElementAtId = 1 << 5, + kMbMenuCutId = 1 << 6, + kMbMenuPasteId = 1 << 7, + kMbMenuPrintId = 1 << 8, + kMbMenuGoForwardId = 1 << 9, + kMbMenuGoBackId = 1 << 10, + kMbMenuReloadId = 1 << 11, +} mbMenuItemId; + +typedef void* mbWebSocketChannel; + +typedef struct _mbWebsocketHookCallbacks { + mbStringPtr(MB_CALL_TYPE* onWillConnect)(mbWebView webView, void* param, mbWebSocketChannel channel, const utf8* url, BOOL* needHook); + + BOOL(MB_CALL_TYPE* onConnected)(mbWebView webView, void* param, mbWebSocketChannel channel); + mbStringPtr(MB_CALL_TYPE* onReceive)(mbWebView webView, void* param, mbWebSocketChannel channel, int opCode, const char* buf, size_t len, BOOL* isContinue); + mbStringPtr(MB_CALL_TYPE* onSend)(mbWebView webView, void* param, mbWebSocketChannel channel, int opCode, const char* buf, size_t len, BOOL* isContinue); + void(MB_CALL_TYPE* onError)(mbWebView webView, void* param, mbWebSocketChannel channel); +} mbWebsocketHookCallbacks; + +////////////////////////////////////////////////////////////////////////// + +typedef enum { + kMbJsTypeNumber = 0, + kMbJsTypeString = 1, + kMbJsTypeBool = 2, + //kMbJsTypeObject = 3, + //kMbJsTypeFunction = 4, + kMbJsTypeUndefined = 5, + //kMbJsTypeArray = 6, + kMbJsTypeNull = 7, + kMbJsTypeV8Value = 8, +} mbJsType; + +typedef long long int64_t; +typedef int64_t mbJsValue; +typedef void* mbJsExecState; + +typedef void(MB_CALL_TYPE *mbOnGetPdfPageDataCallback)(mbWebView webView, void* param, void* data, size_t size); + +typedef void(MB_CALL_TYPE *mbRunJsCallback)(mbWebView webView, void* param, mbJsExecState es, mbJsValue v); +typedef void(MB_CALL_TYPE* mbJsQueryCallback)(mbWebView webView, void* param, mbJsExecState es, int64_t queryId, int customMsg, const utf8* request); + +typedef void(MB_CALL_TYPE *mbTitleChangedCallback)(mbWebView webView, void* param, const utf8* title); +typedef void(MB_CALL_TYPE *mbMouseOverUrlChangedCallback)(mbWebView webView, void* param, const utf8* url); +typedef void(MB_CALL_TYPE *mbURLChangedCallback)(mbWebView webView, void* param, const utf8* url, BOOL canGoBack, BOOL canGoForward); +typedef void(MB_CALL_TYPE *mbURLChangedCallback2)(mbWebView webView, void* param, mbWebFrameHandle frameId, const utf8* url); +typedef void(MB_CALL_TYPE *mbPaintUpdatedCallback)(mbWebView webView, void* param, const HDC hdc, int x, int y, int cx, int cy); +typedef void(MB_CALL_TYPE* mbAcceleratedPaintCallback)(mbWebView webView, void* param, int type, const mbRect* dirytRects, const size_t dirytRectsSize,void* sharedHandle); +typedef void(MB_CALL_TYPE *mbPaintBitUpdatedCallback)(mbWebView webView, void* param, const void* buffer, const mbRect* r, int width, int height); +typedef void(MB_CALL_TYPE *mbAlertBoxCallback)(mbWebView webView, void* param, const utf8* msg); +typedef BOOL(MB_CALL_TYPE *mbConfirmBoxCallback)(mbWebView webView, void* param, const utf8* msg); +typedef mbStringPtr(MB_CALL_TYPE *mbPromptBoxCallback)(mbWebView webView, void* param, const utf8* msg, const utf8* defaultResult); +typedef BOOL(MB_CALL_TYPE *mbNavigationCallback)(mbWebView webView, void* param, mbNavigationType navigationType, const utf8* url); +typedef mbWebView(MB_CALL_TYPE *mbCreateViewCallback)(mbWebView webView, void* param, mbNavigationType navigationType, const utf8* url, const mbWindowFeatures* windowFeatures); +typedef void(MB_CALL_TYPE *mbDocumentReadyCallback)(mbWebView webView, void* param, mbWebFrameHandle frameId); +typedef BOOL(MB_CALL_TYPE *mbCloseCallback)(mbWebView webView, void* param, void* unuse); +typedef BOOL(MB_CALL_TYPE *mbDestroyCallback)(mbWebView webView, void* param, void* unuse); +typedef void(MB_CALL_TYPE *mbOnShowDevtoolsCallback)(mbWebView webView, void* param); +typedef void(MB_CALL_TYPE *mbDidCreateScriptContextCallback)(mbWebView webView, void* param, mbWebFrameHandle frameId, void* context, int extensionGroup, int worldId); +typedef BOOL(MB_CALL_TYPE *mbGetPluginListCallback)(BOOL refresh, void* pluginListBuilder, void* param); +typedef BOOL(MB_CALL_TYPE *mbNetResponseCallback)(mbWebView webView, void* param, const utf8* url, mbNetJob job); +typedef void(MB_CALL_TYPE *mbThreadCallback)(void* param1, void* param2); +typedef void(MB_CALL_TYPE *mbNodeOnCreateProcessCallback)(mbWebView webView, void* param, const WCHAR* applicationPath, const WCHAR* arguments, STARTUPINFOW* startup); + +typedef enum { + MB_LOADING_SUCCEEDED, + MB_LOADING_FAILED, + MB_LOADING_CANCELED +} mbLoadingResult; + +typedef void(MB_CALL_TYPE *mbLoadingFinishCallback)(mbWebView webView, void* param, mbWebFrameHandle frameId, const utf8* url, mbLoadingResult result, const utf8* failedReason); +typedef BOOL(MB_CALL_TYPE *mbDownloadCallback)(mbWebView webView, void* param, mbWebFrameHandle frameId, const char* url, void* downloadJob); + +typedef enum { + mbLevelDebug = 4, + mbLevelLog = 1, + mbLevelInfo = 5, + mbLevelWarning = 2, + mbLevelError = 3, + mbLevelRevokedError = 6, + mbLevelLast = mbLevelRevokedError +} mbConsoleLevel; +typedef void(MB_CALL_TYPE *mbConsoleCallback)(mbWebView webView, void* param, mbConsoleLevel level, const utf8* message, const utf8* sourceName, unsigned sourceLine, const utf8* stackTrace); + +typedef void(MB_CALL_TYPE *mbOnCallUiThread)(mbWebView webView, void* paramOnInThread); +typedef void(MB_CALL_TYPE *mbCallUiThread)(mbWebView webView, mbOnCallUiThread func, void* param); + +//mbNet-------------------------------------------------------------------------------------- +typedef BOOL(MB_CALL_TYPE *mbLoadUrlBeginCallback)(mbWebView webView, void* param, const char* url, mbNetJob job); +typedef void(MB_CALL_TYPE *mbLoadUrlEndCallback)(mbWebView webView, void* param, const char* url, mbNetJob job, void* buf, int len); +typedef void(MB_CALL_TYPE *mbLoadUrlFailCallback)(mbWebView webView, void* param, const char* url, mbNetJob job); +typedef void(MB_CALL_TYPE *mbLoadUrlHeadersReceivedCallback)(mbWebView webView, void* param, const char* url, mbNetJob job); +typedef void(MB_CALL_TYPE *mbLoadUrlFinishCallback)(mbWebView webView, void* param, const utf8* url, mbNetJob job, int len); + +typedef void(MB_CALL_TYPE *mbDidCreateScriptContextCallback)(mbWebView webView, void* param, mbWebFrameHandle frameId, void* context, int extensionGroup, int worldId); +typedef void(MB_CALL_TYPE *mbWillReleaseScriptContextCallback)(mbWebView webView, void* param, mbWebFrameHandle frameId, void* context, int worldId); +typedef BOOL(MB_CALL_TYPE *mbNetResponseCallback)(mbWebView webView, void* param, const char* url, void* job); +typedef void(MB_CALL_TYPE *mbNetGetFaviconCallback)(mbWebView webView, void* param, const utf8* url, mbMemBuf* buf); + +enum MbAsynRequestState { + kMbAsynRequestStateOk = 0, + kMbAsynRequestStateFail = 1, +}; + +typedef void(MB_CALL_TYPE* mbCanGoBackForwardCallback)(mbWebView webView, void* param, MbAsynRequestState state, BOOL b); +typedef void(MB_CALL_TYPE* mbGetCookieCallback)(mbWebView webView, void* param, MbAsynRequestState state, const utf8* cookie); + +typedef void* v8ContextPtr; +typedef void* v8Isolate; + +typedef void(MB_CALL_TYPE* mbGetSourceCallback)(mbWebView webView, void* param, const utf8* mhtml); +typedef void(MB_CALL_TYPE* mbGetContentAsMarkupCallback)(mbWebView webView, void* param, const utf8* content, size_t size); + +typedef struct mbWebUrlRequest* mbWebUrlRequestPtr; +typedef struct mbWebUrlResponse* mbWebUrlResponsePtr; + +typedef void(MB_CALL_TYPE* mbOnUrlRequestWillRedirectCallback)(mbWebView webView, void* param, mbWebUrlRequestPtr oldRequest, mbWebUrlRequestPtr request, mbWebUrlResponsePtr redirectResponse); +typedef void(MB_CALL_TYPE* mbOnUrlRequestDidReceiveResponseCallback)(mbWebView webView, void* param, mbWebUrlRequestPtr request, mbWebUrlResponsePtr response); +typedef void(MB_CALL_TYPE* mbOnUrlRequestDidReceiveDataCallback)(mbWebView webView, void* param, mbWebUrlRequestPtr request, const char* data, int dataLength); +typedef void(MB_CALL_TYPE* mbOnUrlRequestDidFailCallback)(mbWebView webView, void* param, mbWebUrlRequestPtr request, const utf8* error); +typedef void(MB_CALL_TYPE* mbOnUrlRequestDidFinishLoadingCallback)(mbWebView webView, void* param, mbWebUrlRequestPtr request, double finishTime); + +typedef struct _mbUrlRequestCallbacks { + mbOnUrlRequestWillRedirectCallback willRedirectCallback; + mbOnUrlRequestDidReceiveResponseCallback didReceiveResponseCallback; + mbOnUrlRequestDidReceiveDataCallback didReceiveDataCallback; + mbOnUrlRequestDidFailCallback didFailCallback; + mbOnUrlRequestDidFinishLoadingCallback didFinishLoadingCallback; +} mbUrlRequestCallbacks; + +typedef enum _mbDownloadOpt { + kMbDownloadOptCancel, + kMbDownloadOptCacheData, +} mbDownloadOpt; + +typedef void(MB_CALL_TYPE*mbNetJobDataRecvCallback)(void* ptr, mbNetJob job, const char* data, int length); +typedef void(MB_CALL_TYPE*mbNetJobDataFinishCallback)(void* ptr, mbNetJob job, mbLoadingResult result); + +typedef struct _mbNetJobDataBind { + void* param; + mbNetJobDataRecvCallback recvCallback; + mbNetJobDataFinishCallback finishCallback; +} mbNetJobDataBind; + +typedef void(MB_CALL_TYPE*mbPopupDialogSaveNameCallback)(void* ptr, const wchar_t* filePath); + +typedef struct _mbDownloadBind { + void* param; + mbNetJobDataRecvCallback recvCallback; + mbNetJobDataFinishCallback finishCallback; + mbPopupDialogSaveNameCallback saveNameCallback; +} mbDownloadBind; + +typedef struct _mbFileFilter { + const utf8* name; // 渚嬪"image"銆"Movies" + const utf8* extensions; // 渚嬪"jpg|png|gif" +} mbFileFilter; + +enum mbDialogProperties { + kMbDialogPropertiesOpenFile = 1 << 1, // 鍏佽閫夋嫨鏂囦欢 + kMbDialogPropertiesOpenDirectory = 1 << 2, // 鍏佽閫夋嫨鏂囦欢澶 + kMbDialogPropertiesMultiSelections = 1 << 3, // 鍏佽澶氶夈 + kMbDialogPropertiesShowHiddenFiles = 1 << 4, // 鏄剧ず瀵硅瘽妗嗕腑鐨勯殣钘忔枃浠躲 + kMbDialogPropertiesCreateDirectory = 1 << 5, // macOS - 鍏佽浣犻氳繃瀵硅瘽妗嗙殑褰㈠紡鍒涘缓鏂扮殑鐩綍銆 + kMbDialogPropertiesPromptToCreate = 1 << 6, // Windows - 濡傛灉杈撳叆鐨勬枃浠惰矾寰勫湪瀵硅瘽妗嗕腑涓嶅瓨鍦, 鍒欐彁绀哄垱寤恒 杩欏苟涓嶆槸鐪熺殑鍦ㄨ矾寰勪笂鍒涘缓涓涓枃浠讹紝鑰屾槸鍏佽杩斿洖涓浜涗笉瀛樺湪鐨勫湴鍧浜ょ敱搴旂敤绋嬪簭鍘诲垱寤恒 + kMbDialogPropertiesNoResolveAliases = 1 << 7, // macOS - 绂佺敤鑷姩鐨勫埆鍚嶈矾寰(绗﹀彿閾炬帴) 瑙f瀽銆 鎵閫夊埆鍚嶇幇鍦ㄥ皢浼氳繑鍥炲埆鍚嶈矾寰勮岄潪鍏剁洰鏍囪矾寰勩 + kMbDialogPropertiesTreatPackageAsDirectory = 1 << 8, // macOS - 灏嗗寘(濡.app 鏂囦欢澶) 瑙嗕负鐩綍鑰屼笉鏄枃浠躲 + kMbDialogPropertiesDontAddToRecent = 1 << 9, // Windows - 涓嶈灏嗘鍦ㄦ墦寮鐨勯」鐩坊鍔犲埌鏈杩戠殑鏂囨。鍒楄〃涓 +}; + +typedef struct _mbDialogOptions { + int magic; // 'mbdo' + const utf8* title; + const utf8* defaultPath; + const utf8* buttonLabel; + mbFileFilter* filters; + int filtersCount; + mbDialogProperties prop; + const utf8* message; + BOOL securityScopedBookmarks; +} mbDialogOptions; + +typedef struct _mbDownloadOptions { + int magic; // 'mbdo' + BOOL saveAsPathAndName; +} mbDownloadOptions; + +typedef mbDownloadOpt(MB_CALL_TYPE* mbDownloadInBlinkThreadCallback)( + mbWebView webView, + void* params, + size_t expectedContentLength, + const char* url, + const char* mime, + const char* disposition, + mbNetJob job, + mbNetJobDataBind* dataBind + ); + +typedef struct _mbPdfDatas { + int count; + size_t* sizes; + const void** datas; +} mbPdfDatas; + +typedef void(MB_CALL_TYPE* mbPrintPdfDataCallback)(mbWebView webview, void* param, const mbPdfDatas* datas); + +typedef struct _mbScreenshotSettings { + int structSize; + int width; + int height; +} mbScreenshotSettings; + +typedef void(MB_CALL_TYPE* mbPrintBitmapCallback)(mbWebView webview, void* param, const char* data, size_t size); +typedef void(MB_CALL_TYPE* mbOnScreenshot)(mbWebView webView, void* param, const char* data, size_t size); + +typedef enum _mbHttBodyElementType { + mbHttBodyElementTypeData, + mbHttBodyElementTypeFile, +} mbHttBodyElementType; + +typedef struct _mbPostBodyElement { + int size; + mbHttBodyElementType type; + mbMemBuf* data; + mbStringPtr filePath; + __int64 fileStart; + __int64 fileLength; // -1 means to the end of the file. +} mbPostBodyElement; + +typedef struct _mbPostBodyElements { + int size; + mbPostBodyElement** element; + size_t elementSize; + bool isDirty; +} mbPostBodyElements; + +typedef struct _mbWillSendRequestInfo { + mbStringPtr url; + mbStringPtr newUrl; + mbResourceType resourceType; + int httpResponseCode; + mbStringPtr method; + mbStringPtr referrer; + void* headers; +} mbWillSendRequestInfo; + +typedef enum _mbViewLoadType { + MB_DID_START_LOADING, + MB_DID_STOP_LOADING, + MB_DID_NAVIGATE, + MB_DID_NAVIGATE_IN_PAGE, + MB_DID_GET_RESPONSE_DETAILS, + MB_DID_GET_REDIRECT_REQUEST, + MB_DID_POST_REQUEST, +} mbViewLoadType; + +typedef struct _mbViewLoadCallbackInfo { + int size; + mbWebFrameHandle frame; + mbWillSendRequestInfo* willSendRequestInfo; + const char* url; + mbPostBodyElements* postBody; + mbNetJob job; +} mbViewLoadCallbackInfo; + +typedef void(MB_CALL_TYPE* mbNetViewLoadInfoCallback)(mbWebView webView, void* param, mbViewLoadType type, mbViewLoadCallbackInfo* info); + +//mbwindow----------------------------------------------------------------------------------- +typedef enum _mbWindowType { + MB_WINDOW_TYPE_POPUP, + MB_WINDOW_TYPE_TRANSPARENT, + MB_WINDOW_TYPE_CONTROL +} mbWindowType; + +typedef enum _mbWindowInfo { + MB_WINDOW_INFO_SHARTD_TEXTURE_ENABLE = 1 << 16, +} mbWindowInfo; + +typedef BOOL(MB_CALL_TYPE *mbWindowClosingCallback)(mbWebView webview, void* param); +typedef void(MB_CALL_TYPE *mbWindowDestroyCallback)(mbWebView webview, void* param); + +typedef struct _mbDraggableRegion { + RECT bounds; + BOOL draggable; +} mbDraggableRegion; +typedef void(MB_CALL_TYPE *mbDraggableRegionsChangedCallback)(mbWebView webview, void* param, const mbDraggableRegion* rects, int rectCount); + +typedef enum _mbPrintintStep { + kPrintintStepStart, + kPrintintStepPreview, + kPrintintStepPrinting, +} mbPrintintStep; + +typedef struct _mbPrintintSettings { + int dpi; + int width; + int height; + float scale; +} mbPrintintSettings; + +typedef struct _mbDefaultPrinterSettings { + int structSize; // 榛樿鏄4 * 10 + BOOL isLandscape; // 鏄惁涓烘í鍚戞墦鍗版牸寮 + BOOL isPrintHeadFooter; // + BOOL isPrintBackgroud; // 鏄惁鎵撳嵃鑳屾櫙 + int edgeDistanceLeft; // 涓婅竟璺濆崟浣嶏細姣背 + int edgeDistanceTop; + int edgeDistanceRight; + int edgeDistanceBottom; + int copies; // 榛樿鎵撳嵃浠芥暟 + int paperType; // DMPAPER_A4绛 +#if defined(__cplusplus) + inline _mbDefaultPrinterSettings(); +#endif +} mbDefaultPrinterSettings; + +#if defined(__cplusplus) +_mbDefaultPrinterSettings::_mbDefaultPrinterSettings() +{ + isLandscape = false; + isPrintHeadFooter = false; + isPrintBackgroud = true; + edgeDistanceLeft = 0; + edgeDistanceTop = 10; + edgeDistanceRight = 0; + edgeDistanceBottom = 10; + copies = 1; + paperType = 9; +} +#endif + +typedef BOOL(MB_CALL_TYPE *mbPrintingCallback)(mbWebView webview, void* param, mbPrintintStep step, HDC hDC, const mbPrintintSettings* settings, int pageCount); + +typedef mbStringPtr(MB_CALL_TYPE *mbImageBufferToDataURLCallback)(mbWebView webView, void* param, const char* data, size_t size); + +//JavaScript Bind----------------------------------------------------------------------------------- + +////////////////////////////////////////////////////////////////////////// + +#define MB_DEFINE_ITERATOR0(returnVal, name, description) \ + typedef returnVal(MB_CALL_TYPE* FN_##name)(); \ + __declspec(selectany) FN_##name name = ((FN_##name)0); + +#define MB_DEFINE_ITERATOR1(returnVal, name, p1, description) \ + typedef returnVal(MB_CALL_TYPE* FN_##name)(p1); \ + __declspec(selectany) FN_##name name = ((FN_##name)0); + +#define MB_DEFINE_ITERATOR2(returnVal, name, p1, p2, description) \ + typedef returnVal(MB_CALL_TYPE* FN_##name)(p1, p2); \ + __declspec(selectany) FN_##name name = ((FN_##name)0); + +#define MB_DEFINE_ITERATOR3(returnVal, name, p1, p2, p3, description) \ + typedef returnVal(MB_CALL_TYPE* FN_##name)(p1, p2, p3); \ + __declspec(selectany) FN_##name name = ((FN_##name)0); + +#define MB_DEFINE_ITERATOR4(returnVal, name, p1, p2, p3, p4, description) \ + typedef returnVal(MB_CALL_TYPE* FN_##name)(p1, p2, p3, p4); \ + __declspec(selectany) FN_##name name = ((FN_##name)0); + +#define MB_DEFINE_ITERATOR5(returnVal, name, p1, p2, p3, p4, p5, description) \ + typedef returnVal(MB_CALL_TYPE* FN_##name)(p1, p2, p3, p4, p5); \ + __declspec(selectany) FN_##name name = ((FN_##name)0); + +#define MB_DEFINE_ITERATOR6(returnVal, name, p1, p2, p3, p4, p5, p6, description) \ + typedef returnVal(MB_CALL_TYPE* FN_##name)(p1, p2, p3, p4, p5, p6); \ + __declspec(selectany) FN_##name name = ((FN_##name)0); + +#define MB_DEFINE_ITERATOR7(returnVal, name, p1, p2, p3, p4, p5, p6, p7, description) \ + typedef returnVal(MB_CALL_TYPE* FN_##name)(p1, p2, p3, p4, p5, p6, p7); \ + __declspec(selectany) FN_##name name = ((FN_##name)0); + +#define MB_DEFINE_ITERATOR8(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, description) \ + typedef returnVal(MB_CALL_TYPE* FN_##name)(p1, p2, p3, p4, p5, p6, p7, p8); \ + __declspec(selectany) FN_##name name = ((FN_##name)0); + +#define MB_DEFINE_ITERATOR9(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, description) \ + typedef returnVal(MB_CALL_TYPE* FN_##name)(p1, p2, p3, p4, p5, p6, p7, p8, p9); \ + __declspec(selectany) FN_##name name = ((FN_##name)0); + +#define MB_DEFINE_ITERATOR10(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, description) \ + typedef returnVal(MB_CALL_TYPE* FN_##name)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \ + __declspec(selectany) FN_##name name = ((FN_##name)0); + +#define MB_DEFINE_ITERATOR11(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, description) \ + typedef returnVal(MB_CALL_TYPE* FN_##name)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \ + __declspec(selectany) FN_##name name = ((FN_##name)0); + +// --- + +#define MB_DLLEXPORT __declspec(dllexport) + +#define MB_DECLARE_ITERATOR0(returnVal, name, description) \ + MB_EXTERN_C MB_DLLEXPORT returnVal MB_CALL_TYPE name(); + +#define MB_DECLARE_ITERATOR1(returnVal, name, p1, description) \ + MB_EXTERN_C MB_DLLEXPORT returnVal MB_CALL_TYPE name(p1); + +#define MB_DECLARE_ITERATOR2(returnVal, name, p1, p2, description) \ + MB_EXTERN_C MB_DLLEXPORT returnVal MB_CALL_TYPE name(p1, p2); + +#define MB_DECLARE_ITERATOR3(returnVal, name, p1, p2, p3, description) \ + MB_EXTERN_C MB_DLLEXPORT returnVal MB_CALL_TYPE name(p1, p2, p3); + +#define MB_DECLARE_ITERATOR4(returnVal, name, p1, p2, p3, p4, description) \ + MB_EXTERN_C MB_DLLEXPORT returnVal MB_CALL_TYPE name(p1, p2, p3, p4); + +#define MB_DECLARE_ITERATOR5(returnVal, name, p1, p2, p3, p4, p5, description) \ + MB_EXTERN_C MB_DLLEXPORT returnVal MB_CALL_TYPE name(p1, p2, p3, p4, p5); + +#define MB_DECLARE_ITERATOR6(returnVal, name, p1, p2, p3, p4, p5, p6, description) \ + MB_EXTERN_C MB_DLLEXPORT returnVal MB_CALL_TYPE name(p1, p2, p3, p4, p5, p6); + +#define MB_DECLARE_ITERATOR7(returnVal, name, p1, p2, p3, p4, p5, p6, p7, description) \ + MB_EXTERN_C MB_DLLEXPORT returnVal MB_CALL_TYPE name(p1, p2, p3, p4, p5, p6, p7); + +#define MB_DECLARE_ITERATOR8(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, description) \ + MB_EXTERN_C MB_DLLEXPORT returnVal MB_CALL_TYPE name(p1, p2, p3, p4, p5, p6, p7, p8); + +#define MB_DECLARE_ITERATOR9(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, description) \ + MB_EXTERN_C MB_DLLEXPORT returnVal MB_CALL_TYPE name(p1, p2, p3, p4, p5, p6, p7, p8, p9); + +#define MB_DECLARE_ITERATOR10(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, description) \ + MB_EXTERN_C MB_DLLEXPORT returnVal MB_CALL_TYPE name(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); + +#define MB_DECLARE_ITERATOR11(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, description) \ + MB_EXTERN_C MB_DLLEXPORT returnVal MB_CALL_TYPE name(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); + +// --- + +#define MB_GET_PTR_ITERATOR(name) \ + name = (FN_##name)GetProcAddress(g_hMiniblinkMod, #name); \ + if (!name) \ + MessageBoxA(((HWND)0), "mb api not found", #name, 0); + +#define MB_GET_PTR_ITERATOR0(returnVal, name, description) \ + MB_GET_PTR_ITERATOR(name); + +#define MB_GET_PTR_ITERATOR1(returnVal, name, p1, description) \ + MB_GET_PTR_ITERATOR(name); + +#define MB_GET_PTR_ITERATOR2(returnVal, name, p1, p2, description) \ + MB_GET_PTR_ITERATOR(name); + +#define MB_GET_PTR_ITERATOR3(returnVal, name, p1, p2, p3, description) \ + MB_GET_PTR_ITERATOR(name); + +#define MB_GET_PTR_ITERATOR4(returnVal, name, p1, p2, p3, p4, description) \ + MB_GET_PTR_ITERATOR(name); + +#define MB_GET_PTR_ITERATOR5(returnVal, name, p1, p2, p3, p4, p5, description) \ + MB_GET_PTR_ITERATOR(name); + +#define MB_GET_PTR_ITERATOR6(returnVal, name, p1, p2, p3, p4, p5, p6, description) \ + MB_GET_PTR_ITERATOR(name); + +#define MB_GET_PTR_ITERATOR7(returnVal, name, p1, p2, p3, p4, p5, p6, p7, description) \ + MB_GET_PTR_ITERATOR(name); + +#define MB_GET_PTR_ITERATOR8(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, description) \ + MB_GET_PTR_ITERATOR(name); + +#define MB_GET_PTR_ITERATOR9(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, description) \ + MB_GET_PTR_ITERATOR(name); + +#define MB_GET_PTR_ITERATOR10(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, description) \ + MB_GET_PTR_ITERATOR(name); + +#define MB_GET_PTR_ITERATOR11(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, description) \ + MB_GET_PTR_ITERATOR(name); + +// 浠ヤ笅鏄痬b鐨勫鍑哄嚱鏁般傛牸寮忔寜鐓с愯繑鍥炵被鍨嬨戙愬嚱鏁板悕銆戙愬弬鏁般戞潵鎺掑垪 +#define MB_FOR_EACH_DEFINE_FUNCTION(ITERATOR0, ITERATOR1, ITERATOR2, ITERATOR3, ITERATOR4, ITERATOR5, ITERATOR6, ITERATOR7, ITERATOR8, ITERATOR9, ITERATOR10, ITERATOR11) \ +ITERATOR0(void, mbUninit, "") \ +ITERATOR0(mbSettings*, mbCreateInitSettings, "鏂逛究c#绛夊叾浠栬瑷鍒涘缓setting缁撴瀯浣") \ +ITERATOR3(void, mbSetInitSettings, mbSettings* settings, const char* name, const char* value, "") \ +ITERATOR0(mbWebView, mbCreateWebView, "") \ +ITERATOR1(void, mbDestroyWebView, mbWebView webview, "") \ +ITERATOR6(mbWebView, mbCreateWebWindow, mbWindowType type, HWND parent, int x, int y, int width, int height, "") \ +ITERATOR7(mbWebView, mbCreateWebCustomWindow, HWND parent, DWORD style, DWORD styleEx, int x, int y, int width, int height, "") \ +ITERATOR5(void, mbMoveWindow, mbWebView webview, int x, int y, int w, int h, "") \ +ITERATOR1(void, mbMoveToCenter, mbWebView webview, "") \ +ITERATOR2(void, mbSetAutoDrawToHwnd, mbWebView webview, BOOL b, "绂诲睆妯″紡涓嬫帶鍒舵槸鍚﹁嚜鍔ㄤ笂灞") \ +ITERATOR2(void, mbGetCaretRect, mbWebView webviewHandle, mbRect* r, "") \ +\ +ITERATOR2(void, mbSetAudioMuted, mbWebView webview, BOOL b, "") \ +ITERATOR1(BOOL, mbIsAudioMuted, mbWebView webview, "") \ +\ +ITERATOR2(mbStringPtr, mbCreateString, const utf8* str, size_t length, "") \ +ITERATOR2(mbStringPtr, mbCreateStringWithoutNullTermination, const utf8* str, size_t length, "") \ +ITERATOR1(void, mbDeleteString, mbStringPtr str, "") \ +ITERATOR1(size_t, mbGetStringLen, mbStringPtr str, "") \ +ITERATOR1(const utf8*, mbGetString, mbStringPtr str, "") \ +\ +ITERATOR2(void, mbSetProxy, mbWebView webView, const mbProxy* proxy, "") \ +ITERATOR3(void, mbSetDebugConfig, mbWebView webView, const char* debugString, const char* param, "") \ +\ +ITERATOR3(void, mbNetSetData, mbNetJob jobPtr, void* buf, int len, "璋冪敤姝ゅ嚱鏁板悗,缃戠粶灞傛敹鍒版暟鎹細瀛樺偍鍦ㄤ竴buf鍐,鎺ユ敹鏁版嵁瀹屾垚鍚庡搷搴擮nLoadUrlEnd浜嬩欢.#姝よ皟鐢ㄤ弗閲嶅奖鍝嶆ц兘,鎱庣敤" \ + "姝ゅ嚱鏁板拰mbNetSetData鐨勫尯鍒槸锛宮bNetHookRequest浼氬湪鎺ュ彈鍒扮湡姝g綉缁滄暟鎹悗鍐嶈皟鐢ㄥ洖璋冿紝骞跺厑璁稿洖璋冧慨鏀圭綉缁滄暟鎹"\ + "鑰宮bNetSetData鏄湪缃戠粶鏁版嵁杩樻病鍙戦佺殑鏃跺欎慨鏀") \ +ITERATOR1(void, mbNetHookRequest, mbNetJob jobPtr, "") \ +ITERATOR2(void, mbNetChangeRequestUrl, mbNetJob jobPtr, const char* url, "") \ +ITERATOR1(void, mbNetContinueJob, mbNetJob jobPtr, "") \ +ITERATOR1(const mbSlist*, mbNetGetRawHttpHeadInBlinkThread, mbNetJob jobPtr, "") \ +ITERATOR1(const mbSlist*, mbNetGetRawResponseHeadInBlinkThread, mbNetJob jobPtr, "") \ +ITERATOR1(BOOL, mbNetHoldJobToAsynCommit, mbNetJob jobPtr, "") \ +ITERATOR1(void, mbNetCancelRequest, mbNetJob jobPtr, "")\ +ITERATOR3(void, mbNetOnResponse, mbWebView webviewHandle, mbNetResponseCallback callback, void* param, "娉ㄦ剰姝ゆ帴鍙g殑鍥炶皟鏄湪鍙﹀涓嚎绋")\ +\ +ITERATOR3(void, mbNetSetWebsocketCallback, mbWebView webview, const mbWebsocketHookCallbacks* callbacks, void* param, "")\ +ITERATOR3(void, mbNetSendWsText, mbWebSocketChannel channel, const char* buf, size_t len, "")\ +ITERATOR3(void, mbNetSendWsBlob, mbWebSocketChannel channel, const char* buf, size_t len, "")\ +\ +ITERATOR2(void, mbNetEnableResPacket, mbWebView webviewHandle, const WCHAR* pathName, "")\ +\ +ITERATOR1(mbPostBodyElements*, mbNetGetPostBody, mbNetJob jobPtr, "") \ +ITERATOR2(mbPostBodyElements*, mbNetCreatePostBodyElements, mbWebView webView, size_t length, "") \ +ITERATOR1(void, mbNetFreePostBodyElements, mbPostBodyElements* elements, "") \ +ITERATOR1(mbPostBodyElement*, mbNetCreatePostBodyElement, mbWebView webView, "") \ +ITERATOR1(void, mbNetFreePostBodyElement, mbPostBodyElement* element, "") \ +\ +ITERATOR3(mbWebUrlRequestPtr, mbNetCreateWebUrlRequest, const utf8* url, const utf8* method, const utf8* mime, "")\ +ITERATOR3(void, mbNetAddHTTPHeaderFieldToUrlRequest, mbWebUrlRequestPtr request, const utf8* name, const utf8* value, "")\ +ITERATOR4(int, mbNetStartUrlRequest, mbWebView webView, mbWebUrlRequestPtr request, void* param, const mbUrlRequestCallbacks* callbacks, "")\ +ITERATOR1(int, mbNetGetHttpStatusCode, mbWebUrlResponsePtr response, "")\ +ITERATOR1(mbRequestType, mbNetGetRequestMethod, mbNetJob jobPtr, "")\ +ITERATOR1(__int64, mbNetGetExpectedContentLength, mbWebUrlResponsePtr response, "")\ +ITERATOR1(const utf8*, mbNetGetResponseUrl, mbWebUrlResponsePtr response, "")\ +ITERATOR1(void, mbNetCancelWebUrlRequest, int requestId, "")\ +ITERATOR2(void, mbSetViewProxy, mbWebView webView, const mbProxy* proxy, "")\ +ITERATOR2(void, mbNetSetMIMEType, mbNetJob jobPtr, const char* type, "") \ +ITERATOR1(const char*, mbNetGetMIMEType, mbNetJob jobPtr, "鍙兘鍦╞link绾跨▼璋冪敤锛堥潪涓荤嚎绋嬶級") \ +ITERATOR3(const utf8*, mbNetGetHTTPHeaderField, mbNetJob job, const char* key, BOOL fromRequestOrResponse, "") \ +ITERATOR1(const char*, mbNetGetReferrer, mbNetJob jobPtr, "鑾峰彇request鐨剅eferrer") \ +ITERATOR4(void, mbNetSetHTTPHeaderField, mbNetJob jobPtr, const wchar_t* key, const wchar_t* value, BOOL response, "") \ +\ +ITERATOR2(void, mbSetMouseEnabled, mbWebView webView, BOOL b, "") \ +ITERATOR2(void, mbSetTouchEnabled, mbWebView webView, BOOL b, "") \ +ITERATOR2(void, mbSetSystemTouchEnabled, mbWebView webView, BOOL b, "") \ +ITERATOR2(void, mbSetContextMenuEnabled, mbWebView webView, BOOL b, "") \ +ITERATOR2(void, mbSetNavigationToNewWindowEnable, mbWebView webView, BOOL b, "") \ +ITERATOR2(void, mbSetHeadlessEnabled, mbWebView webView, BOOL b, "鍙互鍏抽棴娓叉煋") \ +ITERATOR2(void, mbSetDragDropEnable, mbWebView webView, BOOL b, "鍙互鍏抽棴鎷栨嫿鏂囦欢銆佹枃瀛") \ +ITERATOR2(void, mbSetDragEnable, mbWebView webView, BOOL b, "鍙叧闂嚜鍔ㄥ搷搴擶M_DROPFILES娑堟伅璁╃綉椤靛姞杞芥湰鍦版枃浠") \ +ITERATOR3(void, mbSetContextMenuItemShow, mbWebView webView, mbMenuItemId item, BOOL isShow, "璁剧疆鏌愰」menu鏄惁鏄剧ず") \ +\ +ITERATOR2(void, mbSetHandle, mbWebView webView, HWND wnd, "") \ +ITERATOR3(void, mbSetHandleOffset, mbWebView webView, int x, int y, "") \ +ITERATOR1(HWND, mbGetHostHWND, mbWebView webView, "") \ +ITERATOR2(void, mbSetTransparent, mbWebView webviewHandle, BOOL transparent, "") \ +ITERATOR2(void, mbSetViewSettings, mbWebView webviewHandle, const mbViewSettings* settings, "") \ +\ +ITERATOR2(void, mbSetCspCheckEnable, mbWebView webView, BOOL b, "") \ +ITERATOR2(void, mbSetNpapiPluginsEnabled, mbWebView webView, BOOL b, "") \ +ITERATOR2(void, mbSetMemoryCacheEnable, mbWebView webView, BOOL b, "") \ +ITERATOR3(void, mbSetCookie, mbWebView webView, const utf8* url, const utf8* cookie, "cookie鏍煎紡蹇呴』鏄:PRODUCTINFO=webxpress; domain=.fidelity.com; path=/; secure") \ +ITERATOR2(void, mbSetCookieEnabled, mbWebView webView, BOOL enable, "") \ +ITERATOR2(void, mbSetCookieJarPath, mbWebView webView, const WCHAR* path, "") \ +ITERATOR2(void, mbSetCookieJarFullPath, mbWebView webView, const WCHAR* path, "") \ +ITERATOR2(void, mbSetLocalStorageFullPath, mbWebView webView, const WCHAR* path, "") \ +ITERATOR1(const utf8*, mbGetTitle, mbWebView webView, "") \ +ITERATOR2(void, mbSetWindowTitle, mbWebView webView, const utf8* title, "") \ +ITERATOR2(void, mbSetWindowTitleW, mbWebView webView, const wchar_t* title, "") \ +ITERATOR1(const utf8*, mbGetUrl, mbWebView webView, "") \ +ITERATOR1(int, mbGetCursorInfoType, mbWebView webView, "") \ +ITERATOR2(void, mbAddPluginDirectory, mbWebView webView, const WCHAR* path, "") \ +ITERATOR2(void, mbSetUserAgent, mbWebView webView, const utf8* userAgent, "") \ +ITERATOR2(void, mbSetZoomFactor, mbWebView webView, float factor, "") \ +ITERATOR1(float, mbGetZoomFactor, mbWebView webView, "") \ +ITERATOR2(void, mbSetDiskCacheEnabled, mbWebView webView, BOOL enable, "") \ +ITERATOR2(void, mbSetDiskCachePath, mbWebView webView, const WCHAR* path, "") \ +ITERATOR2(void, mbSetDiskCacheLimit, mbWebView webView, size_t limit, "") \ +ITERATOR2(void, mbSetDiskCacheLimitDisk, mbWebView webView, size_t limit, "") \ +ITERATOR2(void, mbSetDiskCacheLevel, mbWebView webView, int Level, "") \ +\ +ITERATOR2(void, mbSetResourceGc, mbWebView webView, int intervalSec, "") \ +\ +ITERATOR3(void, mbCanGoForward, mbWebView webView, mbCanGoBackForwardCallback callback, void* param, "") \ +ITERATOR3(void, mbCanGoBack, mbWebView webView, mbCanGoBackForwardCallback callback, void* param, "") \ +ITERATOR3(void, mbGetCookie, mbWebView webView, mbGetCookieCallback callback, void* param, "") \ +ITERATOR1(const utf8*, mbGetCookieOnBlinkThread, mbWebView webView, "") \ +ITERATOR1(void, mbClearCookie, mbWebView webView, "") \ +\ +ITERATOR3(void, mbResize, mbWebView webView, int w, int h, "") \ +\ +ITERATOR3(void, mbOnNavigation, mbWebView webView, mbNavigationCallback callback, void* param, "") \ +ITERATOR3(void, mbOnNavigationSync, mbWebView webView, mbNavigationCallback callback, void* param, "") \ +ITERATOR3(void, mbOnCreateView, mbWebView webView, mbCreateViewCallback callback, void* param, "") \ +ITERATOR3(void, mbOnDocumentReady, mbWebView webView, mbDocumentReadyCallback callback, void* param, "") \ +ITERATOR3(void, mbOnDocumentReadyInBlinkThread, mbWebView webView, mbDocumentReadyCallback callback, void* param, "") \ +ITERATOR3(void, mbOnPaintUpdated, mbWebView webView, mbPaintUpdatedCallback callback, void* callbackParam, "") \ +ITERATOR3(void, mbOnPaintBitUpdated, mbWebView webView, mbPaintBitUpdatedCallback callback, void* callbackParam, "") \ +ITERATOR3(void, mbOnAcceleratedPaint, mbWebView webView, mbAcceleratedPaintCallback callback, void* callbackParam, "") \ +ITERATOR3(void, mbOnLoadUrlBegin, mbWebView webView, mbLoadUrlBeginCallback callback, void* callbackParam, "") \ +ITERATOR3(void, mbOnLoadUrlEnd, mbWebView webView, mbLoadUrlEndCallback callback, void* callbackParam, "") \ +ITERATOR3(void, mbOnLoadUrlFail, mbWebView webView, mbLoadUrlFailCallback callback, void* callbackParam, "") \ +ITERATOR3(void, mbOnLoadUrlHeadersReceived, mbWebView webView, mbLoadUrlHeadersReceivedCallback callback, void* callbackParam, "") \ +ITERATOR3(void, mbOnLoadUrlFinish, mbWebView webView, mbLoadUrlFinishCallback callback, void* callbackParam, "") \ +ITERATOR3(void, mbOnTitleChanged, mbWebView webView, mbTitleChangedCallback callback, void* callbackParam, "") \ +ITERATOR3(void, mbOnURLChanged, mbWebView webView, mbURLChangedCallback callback, void* callbackParam, "") \ +ITERATOR3(void, mbOnLoadingFinish, mbWebView webView, mbLoadingFinishCallback callback, void* param, "") \ +ITERATOR3(void, mbOnDownload, mbWebView webView, mbDownloadCallback callback, void* param, "") \ +ITERATOR3(void, mbOnDownloadInBlinkThread, mbWebView webView, mbDownloadInBlinkThreadCallback callback, void* param, "") \ +ITERATOR3(void, mbOnAlertBox, mbWebView webView, mbAlertBoxCallback callback, void* param, "") \ +ITERATOR3(void, mbOnConfirmBox, mbWebView webView, mbConfirmBoxCallback callback, void* param, "") \ +ITERATOR3(void, mbOnPromptBox, mbWebView webView, mbPromptBoxCallback callback, void* param, "") \ +ITERATOR3(void, mbOnNetGetFavicon, mbWebView webView, mbNetGetFaviconCallback callback, void* param, "") \ +ITERATOR3(void, mbOnConsole, mbWebView webView, mbConsoleCallback callback, void* param, "") \ +ITERATOR3(BOOL, mbOnClose, mbWebView webView, mbCloseCallback callback, void* param, "") \ +ITERATOR3(BOOL, mbOnDestroy, mbWebView webView, mbDestroyCallback callback, void* param, "") \ +ITERATOR3(BOOL, mbOnPrinting, mbWebView webView, mbPrintingCallback callback, void* param, "") \ +ITERATOR3(void, mbOnPluginList, mbWebView webView, mbGetPluginListCallback callback, void* callbackParam, "") \ +ITERATOR3(void, mbOnImageBufferToDataURL, mbWebView webView, mbImageBufferToDataURLCallback callback, void* callbackParam, "") \ +ITERATOR3(void, mbOnDidCreateScriptContext, mbWebView webView, mbDidCreateScriptContextCallback callback, void* callbackParam, "") \ +ITERATOR3(void, mbOnWillReleaseScriptContext, mbWebView webView, mbWillReleaseScriptContextCallback callback, void* callbackParam, "") \ +\ +ITERATOR1(void, mbGoBack, mbWebView webView, "") \ +ITERATOR1(void, mbGoForward, mbWebView webView, "") \ +ITERATOR2(void, mbGoToOffset, mbWebView webView, int offset, "") \ +ITERATOR2(void, mbGoToIndex, mbWebView webView, int index, "") \ +ITERATOR2(void, mbNavigateAtIndex, mbWebView webView, int index, "") \ +ITERATOR1(int, mbGetNavigateIndex, mbWebView webView, "") \ +ITERATOR1(void, mbStopLoading, mbWebView webView, "") \ +ITERATOR1(void, mbReload, mbWebView webView, "") \ +ITERATOR2(void, mbPerformCookieCommand, mbWebView webView, mbCookieCommand command, "") \ +ITERATOR3(void, mbInsertCSSByFrame, mbWebView webView, mbWebFrameHandle frameId, const utf8* cssText, "") \ +\ +ITERATOR1(void, mbEditorSelectAll, mbWebView webView, "") \ +ITERATOR1(void, mbEditorUnSelect, mbWebView webView, "") \ +ITERATOR1(void, mbEditorCopy, mbWebView webView, "") \ +ITERATOR1(void, mbEditorCut, mbWebView webView, "") \ +ITERATOR1(void, mbEditorPaste, mbWebView webView, "") \ +ITERATOR1(void, mbEditorDelete, mbWebView webView, "") \ +ITERATOR1(void, mbEditorUndo, mbWebView webView, "") \ +ITERATOR1(void, mbEditorRedo, mbWebView webView, "") \ +ITERATOR2(void, mbSetEditable, mbWebView webView, bool editable, "") \ +\ +ITERATOR5(BOOL, mbFireMouseEvent, mbWebView webView, unsigned int message, int x, int y, unsigned int flags, "") \ +ITERATOR4(BOOL, mbFireContextMenuEvent, mbWebView webView, int x, int y, unsigned int flags, "") \ +ITERATOR5(BOOL, mbFireMouseWheelEvent, mbWebView webView, int x, int y, int delta, unsigned int flags, "") \ +ITERATOR4(BOOL, mbFireKeyUpEvent, mbWebView webView, unsigned int virtualKeyCode, unsigned int flags, BOOL systemKey, "") \ +ITERATOR4(BOOL, mbFireKeyDownEvent, mbWebView webView, unsigned int virtualKeyCode, unsigned int flags, BOOL systemKey, "") \ +ITERATOR4(BOOL, mbFireKeyPressEvent, mbWebView webView, unsigned int charCode, unsigned int flags, BOOL systemKey, "") \ +ITERATOR6(BOOL, mbFireWindowsMessage, mbWebView webView, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT* result, "") \ +\ +ITERATOR1(void, mbSetFocus, mbWebView webView, "") \ +ITERATOR1(void, mbKillFocus, mbWebView webView, "") \ +\ +ITERATOR2(void, mbShowWindow, mbWebView webview, BOOL show, "") \ +\ +ITERATOR2(void, mbLoadURL, mbWebView webView, const utf8* url, "") \ +ITERATOR3(void, mbLoadHtmlWithBaseUrl, mbWebView webView, const utf8* html, const utf8* baseUrl, "") \ +ITERATOR4(void, mbPostURL, mbWebView webView, const utf8* url, const char* postData, int postLen, "") \ +\ +ITERATOR1(HDC, mbGetLockedViewDC, mbWebView webView, "") \ +ITERATOR1(void, mbUnlockViewDC, mbWebView webView, "") \ +\ +ITERATOR1(void, mbWake, mbWebView webView, "") \ +\ +ITERATOR2(void*, mbJsToV8Value, mbJsExecState es, mbJsValue v, "") \ +ITERATOR2(mbJsExecState, mbGetGlobalExecByFrame, mbWebView webView, mbWebFrameHandle frameId, "") \ +ITERATOR2(double, mbJsToDouble, mbJsExecState es, mbJsValue v, "") \ +ITERATOR2(BOOL, mbJsToBoolean, mbJsExecState es, mbJsValue v, "") \ +ITERATOR2(const utf8*, mbJsToString, mbJsExecState es, mbJsValue v, "") \ +ITERATOR2(mbJsType, mbGetJsValueType, mbJsExecState es, mbJsValue v, "") \ +ITERATOR3(void, mbOnJsQuery, mbWebView webView, mbJsQueryCallback callback, void* param, "") \ +ITERATOR4(void, mbResponseQuery, mbWebView webView, int64_t queryId, int customMsg, const utf8* response, "") \ +ITERATOR7(void, mbRunJs, mbWebView webView, mbWebFrameHandle frameId, const utf8* script, BOOL isInClosure, mbRunJsCallback callback, void* param, void* unuse, "") \ +ITERATOR4(mbJsValue, mbRunJsSync, mbWebView webView, mbWebFrameHandle frameId, const utf8* script, BOOL isInClosure, "") \ +ITERATOR1(mbWebFrameHandle, mbWebFrameGetMainFrame, mbWebView webView, "") \ +ITERATOR2(BOOL, mbIsMainFrame, mbWebView webView, mbWebFrameHandle frameId, "") \ +ITERATOR2(void, mbSetNodeJsEnable, mbWebView webView, BOOL b, "") \ +\ +ITERATOR5(void, mbSetDeviceParameter, mbWebView webView, const char* device, const char* paramStr, int paramInt, float paramFloat, "") \ +\ +ITERATOR4(void, mbGetContentAsMarkup, mbWebView webView, mbGetContentAsMarkupCallback calback, void* param, mbWebFrameHandle frameId, "") \ +ITERATOR3(void, mbGetSource, mbWebView webView, mbGetSourceCallback calback, void* param, "") \ +ITERATOR3(void, mbUtilSerializeToMHTML, mbWebView webView, mbGetSourceCallback calback, void* param, "") \ +ITERATOR1(const char*, mbUtilCreateRequestCode, const char* registerInfo, "") \ +ITERATOR1(BOOL, mbUtilIsRegistered, const wchar_t* defaultPath, "") \ +ITERATOR3(BOOL, mbUtilPrint, mbWebView webView, mbWebFrameHandle frameId, const mbPrintSettings* printParams, "") \ +ITERATOR1(const utf8*, mbUtilBase64Encode, const utf8* str, "") \ +ITERATOR1(const utf8*, mbUtilBase64Decode, const utf8* str, "") \ +ITERATOR1(const utf8*, mbUtilDecodeURLEscape, const utf8* url, "") \ +ITERATOR1(const utf8*, mbUtilEncodeURLEscape, const utf8* url, "") \ +ITERATOR1(const mbMemBuf*, mbUtilCreateV8Snapshot, const utf8* str, "") \ +ITERATOR5(void, mbUtilPrintToPdf, mbWebView webView, mbWebFrameHandle frameId, const mbPrintSettings* settings, mbPrintPdfDataCallback callback, void* param, "") \ +ITERATOR5(void, mbUtilPrintToBitmap, mbWebView webView, mbWebFrameHandle frameId, const mbScreenshotSettings* settings, mbPrintBitmapCallback callback, void* param, "") \ +ITERATOR4(void, mbUtilScreenshot, mbWebView webView, const mbScreenshotSettings* settings, mbOnScreenshot callback, void* param, "") \ +ITERATOR2(BOOL, mbUtilsSilentPrint, mbWebView webView, const char* settings, "") \ +ITERATOR2(void, mbUtilSetDefaultPrinterSettings, mbWebView webView, const mbDefaultPrinterSettings* setting, "") \ +\ +ITERATOR3(BOOL, mbPopupDownloadMgr, mbWebView webView, const char* url, void* downloadJob, "") \ +ITERATOR9(mbDownloadOpt, mbPopupDialogAndDownload, mbWebView webView, const mbDialogOptions* dialogOpt, size_t contentLength, const char* url, \ + const char* mime, const char* disposition, mbNetJob job, mbNetJobDataBind* dataBind, mbDownloadBind* callbackBind, "") \ +ITERATOR10(mbDownloadOpt, mbDownloadByPath, mbWebView webView, const mbDownloadOptions* downloadOptions, const WCHAR* path, size_t contentLength, const char* url, \ + const char* mime, const char* disposition, mbNetJob job, mbNetJobDataBind* dataBind, mbDownloadBind* callbackBind, "") \ +\ +ITERATOR3(void, mbGetPdfPageData, mbWebView webView, mbOnGetPdfPageDataCallback callback, void* param, "") \ +\ +ITERATOR3(mbMemBuf*, mbCreateMemBuf, mbWebView webView, void* buf, size_t length, "") \ +ITERATOR1(void, mbFreeMemBuf, mbMemBuf* buf, "") \ +\ +ITERATOR3(void, mbSetUserKeyValue, mbWebView webView, const char* key, void* value, "") \ +ITERATOR2(void*, mbGetUserKeyValue, mbWebView webView, const char* key, "") \ +\ +ITERATOR4(void, mbPluginListBuilderAddPlugin, void* builder, const utf8* name, const utf8* description, const utf8* fileName, "") \ +ITERATOR3(void, mbPluginListBuilderAddMediaTypeToLastPlugin, void* builder, const utf8* name, const utf8* description, "") \ +ITERATOR2(void, mbPluginListBuilderAddFileExtensionToLastMediaType, void* builder, const utf8* fileExtension, "") \ +\ +ITERATOR0(v8Isolate, mbGetBlinkMainThreadIsolate, "") \ +ITERATOR3(void, mbWebFrameGetMainWorldScriptContext, mbWebView webView, mbWebFrameHandle frameId, v8ContextPtr contextOut, "") \ +ITERATOR0(void, mbEnableHighDPISupport, "") \ +ITERATOR0(void, mbRunMessageLoop, "") \ +\ +ITERATOR1(int, mbGetContentWidth, mbWebView webView, "") \ +ITERATOR1(int, mbGetContentHeight, mbWebView webView, "") \ +ITERATOR0(mbWebView, mbGetWebViewForCurrentContext, "") \ +ITERATOR5(BOOL, mbRegisterEmbedderCustomElement, mbWebView webviewHandle, mbWebFrameHandle frameId, const char* name, void* options, void* outResult, "") \ +ITERATOR3(void, mbOnNodeCreateProcess, mbWebView webviewHandle, mbNodeOnCreateProcessCallback callback, void* param, "") \ +ITERATOR3(void, mbOnThreadIdle, mbThreadCallback callback, void* param1, void* param2, "") \ +ITERATOR3(void, mbOnBlinkThreadInit, mbThreadCallback callback, void* param1, void* param2, "") \ +ITERATOR3(void, mbCallBlinkThreadAsync, mbThreadCallback callback, void* param1, void* param2, "") \ +ITERATOR3(void, mbCallBlinkThreadSync, mbThreadCallback callback, void* param1, void* param2, "") \ +ITERATOR3(void, mbCallUiThreadSync, mbThreadCallback callback, void* param1, void* param2, "") \ +ITERATOR3(void, mbCallUiThreadAsync, mbThreadCallback callback, void* param1, void* param2, "") \ +ITERATOR1(void*, mbGetProcAddr, const char* name, "") + +#if ENABLE_MBVIP == 1 + +MB_EXTERN_C MB_DLLEXPORT void MB_CALL_TYPE mbInit(const mbSettings* settings); + +MB_FOR_EACH_DEFINE_FUNCTION(MB_DECLARE_ITERATOR0, MB_DECLARE_ITERATOR1, MB_DECLARE_ITERATOR2, \ + MB_DECLARE_ITERATOR3, MB_DECLARE_ITERATOR4, MB_DECLARE_ITERATOR5, MB_DECLARE_ITERATOR6, MB_DECLARE_ITERATOR7, MB_DECLARE_ITERATOR8, MB_DECLARE_ITERATOR9, MB_DECLARE_ITERATOR10, MB_DECLARE_ITERATOR11) + +#elif DISABLE_MBVIP != 1 + +MB_FOR_EACH_DEFINE_FUNCTION(MB_DEFINE_ITERATOR0, MB_DEFINE_ITERATOR1, MB_DEFINE_ITERATOR2, \ + MB_DEFINE_ITERATOR3, MB_DEFINE_ITERATOR4, MB_DEFINE_ITERATOR5, MB_DEFINE_ITERATOR6, MB_DEFINE_ITERATOR7, MB_DEFINE_ITERATOR8, MB_DEFINE_ITERATOR9, MB_DEFINE_ITERATOR10, MB_DEFINE_ITERATOR11) + +typedef void (MB_CALL_TYPE *FN_mbInit)(const mbSettings* settings); + +#ifdef _WIN64 +__declspec(selectany) const wchar_t* kMbDllPath = L"mb_x64.dll"; +__declspec(selectany) const wchar_t* kMbMainDllPath = L"miniblink_x64.dll"; +#else +__declspec(selectany) const wchar_t* kMbDllPath = L"mb.dll"; +__declspec(selectany) const wchar_t* kMbMainDllPath = L"node.dll"; +#endif + +__declspec(selectany) HMODULE g_hMiniblinkMod = nullptr; + +inline void mbSetMbDllPath(const wchar_t* dllPath) +{ + kMbDllPath = dllPath; +} + +inline void mbSetMbMainDllPath(const wchar_t* dllPath) +{ + kMbMainDllPath = dllPath; +} + +inline void mbFillFuncPtr() +{ + if (!g_hMiniblinkMod) { + LoadLibraryW(kMbMainDllPath); + g_hMiniblinkMod = LoadLibraryW(kMbDllPath); + } + + if (!mbCreateWebView) { + MB_FOR_EACH_DEFINE_FUNCTION(MB_GET_PTR_ITERATOR0, MB_GET_PTR_ITERATOR1, MB_GET_PTR_ITERATOR2, MB_GET_PTR_ITERATOR3, \ + MB_GET_PTR_ITERATOR4, MB_GET_PTR_ITERATOR5, MB_GET_PTR_ITERATOR6, MB_GET_PTR_ITERATOR7, MB_GET_PTR_ITERATOR8, MB_GET_PTR_ITERATOR9, MB_GET_PTR_ITERATOR10, MB_GET_PTR_ITERATOR11); + } +} + +inline void mbInit(const mbSettings* settings) +{ + bool needFill = nullptr == g_hMiniblinkMod; + if (!g_hMiniblinkMod) { + LoadLibraryW(kMbMainDllPath); + g_hMiniblinkMod = LoadLibraryW(kMbDllPath); + } + FN_mbInit mbInitExFunc = (FN_mbInit)GetProcAddress(g_hMiniblinkMod, "mbInit"); + mbInitExFunc(settings); + + if (needFill) + mbFillFuncPtr(); + + return; +} + +#endif + + + +#endif // MB_DEFINE_H + diff --git a/OfficeAssistant_msvc/minibutton.cpp b/OfficeAssistant_msvc/minibutton.cpp new file mode 100644 index 0000000..cc9d09f --- /dev/null +++ b/OfficeAssistant_msvc/minibutton.cpp @@ -0,0 +1,62 @@ +#include "minibutton.h" +#include +#include "config.h" +#include "globalvariables.h" + +MiniButton::MiniButton(QString orig_name, QString op, QWidget* parent) +{ + this->orig_name = orig_name; + q_color.setNamedColor(DEFAULT_BACKGROUND_COLOR); + + this->op = op; + connect(this, &MiniButton::click, this, &MiniButton::onclick2); +} +MiniButton::MiniButton(ButtonStruct button_struct, QWidget *parent) + : QPushButton(parent) +{ + ui.setupUi(this); + q_color.setNamedColor(DEFAULT_COVER_COLOR); + QString style_sheet = "MiniButton:{background-color:"; + style_sheet += DEFAULT_TEXT_COLOR; + style_sheet += ";}"; + setStyleSheet(style_sheet); + connect(this, &MiniButton::click, this, &MiniButton::onclick1); + this->button_struct = button_struct; +} + +MiniButton::~MiniButton() +{} + +void MiniButton::paintEvent(QPaintEvent* event) +{ + QPushButton::paintEvent(event); + setContentsMargins(0, 0, 0, 0); + QRect rect(0, 0, this->width(), this->height()); + QPainter painter(this); + + painter.fillRect(rect, q_color); + int text_x = (width() - TEXT_SIZE * text().length() * scale * 3) / 2; + int text_y = (height()- TEXT_SIZE * scale * 3)/2; + QFont ft; + ft.setPixelSize(TEXT_SIZE); + QRectF text_rect(text_x, text_y, TEXT_SIZE * text().length() * scale * 3, TEXT_SIZE * scale * 3); + painter.setPen(DEFAULT_TEXT_COLOR); + painter.drawText(text_rect, Qt::AlignCenter, text()); + +} + +void MiniButton::mouseReleaseEvent(QMouseEvent* event) +{ + emit click0(); +} + +void MiniButton::onclick1() +{ + emit click1(button_struct.op, button_struct.func, button_struct.path, button_struct.url); +} + +void MiniButton::onclick2() +{ + emit click2(this->orig_name,this->op); +} + diff --git a/OfficeAssistant_msvc/minibutton.h b/OfficeAssistant_msvc/minibutton.h new file mode 100644 index 0000000..6bd668c --- /dev/null +++ b/OfficeAssistant_msvc/minibutton.h @@ -0,0 +1,32 @@ +#pragma once + +#include + +#include "buttonstruct.h" +#include "ui_minibutton.h" + +class MiniButton : public QPushButton +{ + Q_OBJECT +signals: + void click1(QString op, QString func, QString path, QString url); + void click2(QString orig_name,QString op); + void click0(); +public: + MiniButton(QString orig_name, QString op, QWidget* parent = nullptr); + MiniButton(ButtonStruct button_struct, QWidget *parent = nullptr); + ~MiniButton(); +protected: + void paintEvent(QPaintEvent* event) override; + void mouseReleaseEvent(QMouseEvent* event) override; +private: + QString orig_name; + QString op; + QColor q_color; + Ui::MiniButtonClass ui; + bool checked = false; + ButtonStruct button_struct; +public slots: + void onclick1(); + void onclick2(); +}; diff --git a/OfficeAssistant_msvc/minibutton.ui b/OfficeAssistant_msvc/minibutton.ui new file mode 100644 index 0000000..64fc880 --- /dev/null +++ b/OfficeAssistant_msvc/minibutton.ui @@ -0,0 +1,22 @@ + + MiniButtonClass + + + MiniButtonClass + + + + 0 + 0 + 600 + 400 + + + + MiniButton + $centralwidget$ + + + + + diff --git a/OfficeAssistant_msvc/mysettingsdialog.cpp b/OfficeAssistant_msvc/mysettingsdialog.cpp index 11d08c4..0644825 100644 --- a/OfficeAssistant_msvc/mysettingsdialog.cpp +++ b/OfficeAssistant_msvc/mysettingsdialog.cpp @@ -56,6 +56,7 @@ void MySettingsDialog::autoStart(int state) } QString app = QApplication::applicationFilePath(); app.replace("/", "\\"); + app += " autostart"; qDebug() << app.toStdWString().c_str(); lRet = RegSetValueEx(hKey, LENG_NAME, 0, REG_SZ, (BYTE*)app.toStdWString().c_str(), app.length()*sizeof(wchar_t)); if (lRet == ERROR_SUCCESS) @@ -63,6 +64,11 @@ void MySettingsDialog::autoStart(int state) QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("创建开机启动项成功")); } RegCloseKey(hKey); + if(agree) + { + OpRequest op_request("auto_start", "true"); + op_request.sendRequest(); + } } else if (state == Qt::Unchecked) { HKEY hRoot = HKEY_CURRENT_USER; @@ -82,6 +88,11 @@ void MySettingsDialog::autoStart(int state) QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("移除开机启动项成功。")); } RegCloseKey(hKey); + if(agree) + { + OpRequest op_request("auto_start", "false"); + op_request.sendRequest(); + } } } diff --git a/OfficeAssistant_msvc/navbar.cpp b/OfficeAssistant_msvc/navbar.cpp index d95cdf4..54a60d5 100644 --- a/OfficeAssistant_msvc/navbar.cpp +++ b/OfficeAssistant_msvc/navbar.cpp @@ -12,6 +12,7 @@ #include #include "mainwindowlayout.h" #include "globalvariables.h" +#include "MyButton.h" #include "sqlitehelper.h" #ifdef _DEBUG #pragma comment(lib, "Qt5Svgd.lib") @@ -54,20 +55,28 @@ NavBar::NavBar(ConfigResponse *configResponse, MainScreen *mainScreen,QWidget *p config_request.sendRequest(&config_response); SQLiteHelper sqlite_helper; sqlite_helper.get_software(&buttonStructs, &config_response); - if(config_response.succeed==true) + if(!config_response.succeed) { - getLogoFromInternet(&config_response); + qColor.setNamedColor(DEFAULT_BACKGROUND_COLOR); + }else { - getLogoFromLocal(); + qColor.setNamedColor(config_response.basic.backgroud_color); } layout2 = new QHBoxLayout; layout_right = new QHBoxLayout; layout_left = new QHBoxLayout; logo_label = new QLabel(this); + logo_label->setAttribute(Qt::WA_TranslucentBackground); //*logo = logo->scaled(this->width() / (5 / scale), this->height()); logo_label->setScaledContents(true); - logo_label->setPixmap(QPixmap::fromImage(*logo)); + QPixmap pixmap(QApplication::applicationDirPath() + DEFAULT_LOGO); + pixmap.setMask(pixmap.createMaskFromColor(QColor(Qt::transparent))); + logo_label->setAutoFillBackground(true); + QPalette palette = logo_label->palette(); + palette.setColor(QPalette::Window, Qt::transparent); + logo_label->setPalette(palette); + logo_label->setPixmap(pixmap); logo_label->setMaximumHeight(parent->height() / 8); layout_left->addWidget(logo_label); layout_left->setAlignment(Qt::AlignCenter); @@ -104,7 +113,6 @@ NavBar::~NavBar() { } layout2->removeWidget(logo_label); delete logo_label; - delete logo; //delete layout_left; delete layout_right; delete layout2; @@ -129,7 +137,7 @@ void NavBar::resizeEvent(QResizeEvent *event) { } logo_label->setMaximumSize(event->size().width() / 5, event->size().height()); } -void NavBar::getLogoFromInternet(ConfigResponse *configResponse) { +/*void NavBar::getLogoFromInternet(ConfigResponse *configResponse) { qColor.setNamedColor(configResponse->basic.backgroud_color); QUrl url_logo(configResponse->basic.logo_url); @@ -147,7 +155,7 @@ void NavBar::getLogoFromInternet(ConfigResponse *configResponse) { reply->close(); if (downloadSuccess == true) { *buffer = reply->readAll(); - logo = new QImage(); + logo = new ; logo->loadFromData(*buffer); buffer->clear(); }else @@ -157,7 +165,7 @@ void NavBar::getLogoFromInternet(ConfigResponse *configResponse) { delete manager; manager = nullptr; -} +}*/ void NavBar::storeToBuffer() { buffer = new QByteArray; @@ -169,7 +177,7 @@ void NavBar::cancelDownload() { downloadSuccess = false; } -void NavBar::getLogoFromLocal() { +/*void NavBar::getLogoFromLocal() { QString dir = QApplication::applicationDirPath(); QFile file(dir + DEFAULT_FILE); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { @@ -186,9 +194,7 @@ void NavBar::getLogoFromLocal() { *obj_root = qJsonDocument->object(); delete qJsonDocument; QString logo_path = obj_root->value("basic").toObject().value("logo").toString(); - logo = new QImage(logo_path); - QString color= obj_root->value("basic").toObject().value("backgroud_color").toString(); - qColor.setNamedColor(color); + logo = new QPixmap(logo_path); QJsonArray *array = new QJsonArray; } else { @@ -198,4 +204,4 @@ void NavBar::getLogoFromLocal() { } delete obj_root; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/OfficeAssistant_msvc/navbar.h b/OfficeAssistant_msvc/navbar.h index 32f3f68..fef7429 100644 --- a/OfficeAssistant_msvc/navbar.h +++ b/OfficeAssistant_msvc/navbar.h @@ -1,67 +1,67 @@ -// -// Created by HW on 2023/07/26. -// - -#ifndef OFFICEASSISTANT_NAVBAR_H -#define OFFICEASSISTANT_NAVBAR_H - -#include -#include -#include -#include "netio.h" -#include "MyButton.h" -#include -#include -#include -#include "buttonstruct.h" -#include -#include "mainscreen.h" -#include -#include "mainwindowlayout.h" - - -QT_BEGIN_NAMESPACE -namespace Ui { class NavBar; } -QT_END_NAMESPACE - -class NavBar : public QWidget { -Q_OBJECT -signals: - void firstUrl(QString url); -public: - NavBar(ConfigResponse *configResponse,MainScreen *mainScreen,QWidget *parent = nullptr); - - ~NavBar() override; -protected: - void paintEvent(QPaintEvent *event) override; - - void resizeEvent(QResizeEvent *event) override; - - -private: - Ui::NavBar *ui; - QColor qColor; - QList buttons; - QList buttonStructs; - QByteArray *buffer; - int width2; - int height2; - QNetworkAccessManager *manager; - QNetworkReply *reply; - QEventLoop eventLoop; - QImage *logo; - QLabel *logo_label; - bool downloadSuccess=true; - void getLogoFromInternet(ConfigResponse *configResponse); - void getLogoFromLocal(); - MainScreen *mainScreen; - QHBoxLayout *layout_left; - QHBoxLayout *layout_right; - QHBoxLayout *layout2; -private slots: - void storeToBuffer(); - void cancelDownload(); -}; - - -#endif //OFFICEASSISTANT_NAVBAR_H +// +// Created by HW on 2023/07/26. +// + +#ifndef OFFICEASSISTANT_NAVBAR_H +#define OFFICEASSISTANT_NAVBAR_H + +#include +#include +#include +#include "netio.h" +#include "MyButton.h" +#include +#include +#include +#include "buttonstruct.h" +#include +#include "mainscreen.h" +#include +#include "mainwindowlayout.h" + + +QT_BEGIN_NAMESPACE +namespace Ui { class NavBar; } +QT_END_NAMESPACE + +class NavBar : public QWidget { +Q_OBJECT +signals: + void firstUrl(QString url); +public: + NavBar(ConfigResponse *configResponse,MainScreen *mainScreen,QWidget *parent = nullptr); + + ~NavBar() override; +protected: + void paintEvent(QPaintEvent *event) override; + + void resizeEvent(QResizeEvent *event) override; + + +private: + Ui::NavBar *ui; + QColor qColor; + QList buttons; + QList buttonStructs; + QByteArray *buffer; + int width2; + int height2; + QNetworkAccessManager *manager; + QNetworkReply *reply; + QEventLoop eventLoop; + QPixmap *logo; + QLabel *logo_label; + bool downloadSuccess=true; + //void getLogoFromInternet(ConfigResponse *configResponse); + //void getLogoFromLocal(); + MainScreen *mainScreen; + QHBoxLayout *layout_left; + QHBoxLayout *layout_right; + QHBoxLayout *layout2; +private slots: + void storeToBuffer(); + void cancelDownload(); +}; + + +#endif //OFFICEASSISTANT_NAVBAR_H diff --git a/OfficeAssistant_msvc/netio.cpp b/OfficeAssistant_msvc/netio.cpp index c40676c..c78f677 100644 --- a/OfficeAssistant_msvc/netio.cpp +++ b/OfficeAssistant_msvc/netio.cpp @@ -60,7 +60,7 @@ RequestBodyBase::RequestBodyBase(){ if(!infFile->open(QIODevice::ReadOnly|QIODevice::Text)){ QMessageBox::critical(nullptr,QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("无法打开配置文件")); delete infFile; - exit(1); + exit_manager.exit(1); } //读取配置文件 QByteArray bytes; @@ -73,19 +73,19 @@ RequestBodyBase::RequestBodyBase(){ //读取数据,写入对应字段 QJsonObject obj_root=qJsonDocument.object(); if(obj_root.value("product")==QJsonValue::Undefined){ - QMessageBox::warning(nullptr, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("配置文件损坏")); - exit(1); + QMessageBox::critical(nullptr, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("配置文件损坏")); + exit_manager.exit(1); } product=obj_root.value("product").toString(); - if(obj_root.value("parter_id")==QJsonValue::Undefined){ - QMessageBox::warning(nullptr, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("配置文件损坏")); - exit(1); + if(obj_root.value("partner_id")==QJsonValue::Undefined){ + QMessageBox::critical(nullptr , QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("配置文件损坏")); + exit_manager.exit(1); } - parter_id=obj_root.value("parter_id").toString(); + parter_id=obj_root.value("partner_id").toString(); }else{ //处理错误 - QMessageBox::warning(nullptr, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("配置文件损坏")); - exit(1); + QMessageBox::critical(nullptr, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("配置文件损坏")); + exit_manager.exit(1); } //获取操作系统版本 this->os="Windows"; @@ -188,6 +188,13 @@ RequestBodyBase::RequestBodyBase(){ void ConfigRequest::sendRequest(ConfigResponse *configResponse) { timer = new QTimer(this); + if(agree) + { + QJsonObject obj_root = qJsonDocument.object(); + obj_root.insert("autostart", autostart); + qJsonDocument.setObject(obj_root); + } + QNetworkAccessManager *httpMgr = new QNetworkAccessManager(); QNetworkRequest requestInfo; //HTTP请求 @@ -208,12 +215,13 @@ void ConfigRequest::sendRequest(ConfigResponse *configResponse) { timer->stop(); //delete httpMgr; QJsonDocument result; + QByteArray buffer; configResponse->succeed = false; //memset(configResponse,0,sizeof(*configResponse)); auto error = reply->error(); //如果没有错误 if(reply->error() == QNetworkReply::NoError) { - result = QJsonDocument::fromJson(reply->readAll()); + buffer = reply->readAll(); }else{ //如果有错误 configResponse->succeed=false; @@ -223,7 +231,7 @@ void ConfigRequest::sendRequest(ConfigResponse *configResponse) { return; } //qDebug() << result.toJson(); - + result = QJsonDocument::fromJson(buffer); //如果数据完整 if(result.isObject()){ QJsonObject obj_root=result.object(); @@ -264,6 +272,7 @@ void ConfigRequest::sendRequest(ConfigResponse *configResponse) { delete httpMgr; } void RequestBodyBase::cancelDownload() { + downloadSuccess = false; disconnect(reply, &QNetworkReply::finished, &eventLoop, &QEventLoop::quit); eventLoop.quit(); reply->abort(); @@ -575,7 +584,7 @@ DeviceRequest::DeviceRequest() : RequestBodyBase() { eventLoop.exec(); delete httpMgr; } -bool SoftwareRequest::sendRequest(QHash *records) +bool SoftwareRequest::sendRequest(QHash&startMenu, QHash *records) { timer = new QTimer(this); QNetworkAccessManager* httpMgr = new QNetworkAccessManager(); @@ -590,8 +599,20 @@ bool SoftwareRequest::sendRequest(QHash *records) object.insert("path", record.path); array.append(object); } + QJsonArray menu_list; + for(auto name:startMenu.keys()) + { + QJsonObject object; + object.insert("name", name); + object.insert("path", startMenu[name]); + menu_list.append(object); + } QJsonObject obj_root = qJsonDocument.object(); - obj_root.insert("software", array); + QJsonObject object; + object.insert("reg", array); + object.insert("start", menu_list); + obj_root.insert("data", object); + obj_root.insert("type", "update"); qJsonDocument.setObject(obj_root); QString url = SOFTWARE_URL; requestInfo.setUrl(url); @@ -607,15 +628,16 @@ bool SoftwareRequest::sendRequest(QHash *records) //启动循环 eventLoop.exec(); timer->stop(); + delete timer; QJsonDocument result; // auto error = reply->error(); //如果没有错误 + qDebug() << reply->error(); if (reply->error() == QNetworkReply::NoError) { result = QJsonDocument::fromJson(reply->readAll()); } else { //如果有错误 - delete timer; delete httpMgr; return false; } @@ -628,15 +650,51 @@ bool SoftwareRequest::sendRequest(QHash *records) for (auto value : array) { QJsonObject object = value.toObject(); QString orig_name = object.value("orig_name").toString(); - (*records)[orig_name].logo = object.value("img").toString(); + if (orig_name.isEmpty()) + { + delete httpMgr; + return false; + } + QNetworkAccessManager manager; + downloadSuccess = true; + QUrl url_logo(object.value("img").toString()); + QNetworkRequest* request_logo = new QNetworkRequest(url_logo); + reply = manager.get(*request_logo); + QTimer timer; + timer.setInterval(5000); + connect(reply, &QNetworkReply::finished, &eventLoop, &QEventLoop::quit); + connect(&timer, &QTimer::timeout, this, &SoftwareRequest::cancelDownload); + eventLoop.exec(); + timer.stop(); + QByteArray buffer; + delete request_logo; + reply->close(); + QString dir = QApplication::applicationDirPath() + "/images/software/"; + if (downloadSuccess == true) { + buffer = reply->readAll(); + QFile file(dir + orig_name + ".svg"); + if (file.open(QIODevice::WriteOnly | QIODevice::Text)) + { + file.write(buffer); + file.close(); + } + } + + (*records)[orig_name].logo = dir + orig_name + ".svg"; + (*records)[orig_name].name = object.value("name").toString(); + (*records)[orig_name].locked = object.value("locked").toBool(); (*records)[orig_name].url = object.value("url").toString(); (*records)[orig_name].path = object.value("path").toString(); + if ((*records)[orig_name].path.isEmpty()) + { + delete httpMgr; + return false; + } } } else { //数据不完整 //delete reply; - delete timer; delete httpMgr; return false; } @@ -644,3 +702,64 @@ bool SoftwareRequest::sendRequest(QHash *records) return true; } +QString OpenWeChatRequest::sendRequest(bool notuse) +{ + timer = new QTimer(this); + QNetworkAccessManager* httpMgr = new QNetworkAccessManager(); + QNetworkRequest requestInfo; + //HTTP请求 + //请求头 + requestInfo.setUrl(QUrl(WECHAT_URL)); + requestInfo.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/json")); + //保存响应的变量 + reply = httpMgr->post(requestInfo, qJsonDocument.toJson()); + //开启一个循环,直到超时或者获取到数据为止 + connect(reply, &QNetworkReply::finished, this, &OpenWeChatRequest::cancelDownload); + //设置定时器防止超时 + connect(timer, &QTimer::timeout, &eventLoop, &QEventLoop::quit); + timer->start(5000); + //启动循环 + eventLoop.exec(); + timer->stop(); + QByteArray buffer = reply->readAll(); + QJsonDocument reply_json = QJsonDocument::fromJson(buffer); + if(!reply_json.isObject()) + { + delete timer; + delete httpMgr; + delete reply; + return "ok"; + } + delete timer; + delete httpMgr; + delete reply; + return reply_json.object().value("msg").toString(); +} + +void OpRequest::sendRequest() +{ + timer = new QTimer(this); + QJsonObject object = qJsonDocument.object(); + object.insert(op, op_value); + qJsonDocument.setObject(object); + QNetworkAccessManager* httpMgr = new QNetworkAccessManager(); + QNetworkRequest requestInfo; + //HTTP请求 + //请求头 + requestInfo.setUrl(QUrl(OP_URL)); + requestInfo.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/json")); + //保存响应的变量 + reply = httpMgr->post(requestInfo, qJsonDocument.toJson()); + //开启一个循环,直到超时或者获取到数据为止 + connect(reply, &QNetworkReply::finished, this, &OpRequest::cancelDownload); + //设置定时器防止超时 + connect(timer, &QTimer::timeout, &eventLoop, &QEventLoop::quit); + timer->start(5000); + //启动循环 + eventLoop.exec(); + timer->stop(); + delete timer; + delete httpMgr; + delete reply; +} + diff --git a/OfficeAssistant_msvc/netio.h b/OfficeAssistant_msvc/netio.h index ca0904a..0f10150 100644 --- a/OfficeAssistant_msvc/netio.h +++ b/OfficeAssistant_msvc/netio.h @@ -58,6 +58,7 @@ protected: QNetworkReply *reply; QEventLoop eventLoop; QTimer *timer; + bool downloadSuccess = true; protected slots: void cancelDownload(); }; @@ -95,6 +96,7 @@ protected: }; class DeviceRequest:RequestBodyBase{ +public: DeviceRequest(); }; @@ -117,6 +119,13 @@ inline QString getMachineGUID() { class SoftwareRequest :public RequestBodyBase { public: SoftwareRequest():RequestBodyBase(){} - bool sendRequest(QHash*records); + bool sendRequest(QHash&startMenu, QHash*records); +}; + +class OpenWeChatRequest:public RequestBodyBase +{ +public: + OpenWeChatRequest():RequestBodyBase(){} + QString sendRequest(bool notuse=false/*为了构成函数重载,凑数的*/); }; #endif //OFFICEASSISTANT_NETIO_H diff --git a/OfficeAssistant_msvc/qminiblink.cpp b/OfficeAssistant_msvc/qminiblink.cpp index 45ef1aa..0643b8a 100644 --- a/OfficeAssistant_msvc/qminiblink.cpp +++ b/OfficeAssistant_msvc/qminiblink.cpp @@ -1,64 +1,63 @@ -#include "qminiblink.h" -#include -#include -#pragma comment (lib,"Comctl32.lib") - -QMiniBlink::QMiniBlink(QWidget *parent) - : QWidget(parent){ - - this->parent = parent; - wkeView = nullptr; - //QSizePolicy sizePolicy(QSizePolicy::Policy::Expanding, QSizePolicy::QSizePolicy::Expanding); - //setSizePolicy(sizePolicy); -} -void QMiniBlink::init() { - ui.setupUi(this); - wkeInit(); - RECT rect; - GetWindowRect((HWND)parent->winId(), &rect); - resize(rect.right - rect.left, rect.bottom - rect.top); - this->wkeView = wkeCreateWebWindow(WKE_WINDOW_TYPE_CONTROL, (HWND)this->winId(), 0, 0, rect.right - rect.left, rect.bottom - rect.top); - - wkeSetNavigationToNewWindowEnable(this->wkeView, false); - wkeShowWindow(this->wkeView, TRUE); - SetParent(wkeGetWindowHandle(this->wkeView), (HWND)this->winId()); - wkeMoveWindow(this->wkeView, 0, 0, rect.right - rect.left, rect.bottom - rect.top); - //while(this->firstUrl.isEmpty()){} - //wkeLoadURL(this->wkeView, this->firstUrl.toStdString().c_str()); - SetWindowSubclass((HWND)this->winId(), subClassProc, 0, (DWORD_PTR)this); - //wkeRunMessageLoop(); -} -QMiniBlink::~QMiniBlink(){ - qDebug() << "Destroyed"; -} -void QMiniBlink::ondestroy() { - if (this->wkeView != nullptr) { - wkeDestroyWebView(wkeView); - qDebug() << "Destroyed"; - } - wkeShutdown(); -} -void QMiniBlink::switchUrl(QString url) { - wkeLoadURL(wkeView, url.toStdString().c_str()); -} -LRESULT CALLBACK QMiniBlink::subClassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData) -{ - QMiniBlink *obj = (QMiniBlink *)dwRefData; - if (obj == nullptr) - return DefSubclassProc(hWnd, uMsg, wParam, lParam); - switch (uMsg) { - case WM_SIZE: - obj->autojustWebViewSize(); - break; - default: - break; - } - return DefSubclassProc(hWnd, uMsg, wParam, lParam); -} -void QMiniBlink::autojustWebViewSize() -{ - RECT rect; - GetWindowRect((HWND)this->winId(), &rect); - wkeMoveWindow(wkeView, 0, 0, rect.right - rect.left, rect.bottom - rect.top); - -} +#include "qminiblink.h" +#include +#include +#pragma comment (lib,"Comctl32.lib") + +QMiniBlink::QMiniBlink(QWidget *parent) + : QWidget(parent){ + + this->parent = parent; + //QSizePolicy sizePolicy(QSizePolicy::Policy::Expanding, QSizePolicy::QSizePolicy::Expanding); + //setSizePolicy(sizePolicy); +} +void QMiniBlink::init() { + ui.setupUi(this); + mbSettings settings; + memset(&settings, 0, sizeof(mbSettings)); + mbInit(&settings); + RECT rect; + GetWindowRect((HWND)parent->winId(), &rect); + resize(rect.right - rect.left, rect.bottom - rect.top); + this->mbView = mbCreateWebWindow(MB_WINDOW_TYPE_CONTROL, (HWND)this->winId(), 0, 0, rect.right - rect.left, rect.bottom - rect.top); + + mbSetNavigationToNewWindowEnable(this->mbView, false); + mbShowWindow(this->mbView, TRUE); + SetParent(mbGetHostHWND(this->mbView), (HWND)this->winId()); + mbMoveWindow(this->mbView, 0, 0, rect.right - rect.left, rect.bottom - rect.top); + //while(this->firstUrl.isEmpty()){} + //mbLoadURL(this->mbView, this->firstUrl.toStdString().c_str()); + SetWindowSubclass((HWND)this->winId(), subClassProc, 0, (DWORD_PTR)this); + //mbRunMessageLoop(); +} +QMiniBlink::~QMiniBlink(){ + qDebug() << "Destroyed"; +} +void QMiniBlink::ondestroy() { + mbDestroyWebView(mbView); + qDebug() << "Destroyed"; + mbUninit(); +} +void QMiniBlink::switchUrl(QString url) { + mbLoadURL(mbView, url.toStdString().c_str()); +} +LRESULT CALLBACK QMiniBlink::subClassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData) +{ + QMiniBlink *obj = (QMiniBlink *)dwRefData; + if (obj == nullptr) + return DefSubclassProc(hWnd, uMsg, wParam, lParam); + switch (uMsg) { + case WM_SIZE: + obj->autojustWebViewSize(); + break; + default: + break; + } + return DefSubclassProc(hWnd, uMsg, wParam, lParam); +} +void QMiniBlink::autojustWebViewSize() +{ + RECT rect; + GetWindowRect((HWND)this->winId(), &rect); + mbMoveWindow(mbView, 0, 0, rect.right - rect.left, rect.bottom - rect.top); + +} diff --git a/OfficeAssistant_msvc/qminiblink.h b/OfficeAssistant_msvc/qminiblink.h index 72e7ef4..f026ab9 100644 --- a/OfficeAssistant_msvc/qminiblink.h +++ b/OfficeAssistant_msvc/qminiblink.h @@ -1,30 +1,30 @@ -#pragma once - -#include -#include "ui_qminiblink.h" -#include "wke.h" -#include -#include - -class QMiniBlink : public QWidget -{ - Q_OBJECT - -public: - QMiniBlink(QWidget *parent = nullptr); - ~QMiniBlink(); - void init(); - - void autojustWebViewSize(); - QString firstUrl; -public slots: - void ondestroy(); - void switchUrl(QString url); -private: - Ui::QMiniBlink ui; - wkeWebView wkeView; - QWidget *parent; - int w; - int h; - static LRESULT CALLBACK subClassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData); -}; +#pragma once + +#include +#include "ui_qminiblink.h" +#include "mb.h" +#include +#include + +class QMiniBlink : public QWidget +{ + Q_OBJECT + +public: + QMiniBlink(QWidget *parent = nullptr); + ~QMiniBlink(); + void init(); + + void autojustWebViewSize(); + QString firstUrl; +public slots: + void ondestroy(); + void switchUrl(QString url); +private: + Ui::QMiniBlink ui; + mbWebView mbView; + QWidget *parent; + int w; + int h; + static LRESULT CALLBACK subClassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData); +}; diff --git a/OfficeAssistant_msvc/sqlitehelper.cpp b/OfficeAssistant_msvc/sqlitehelper.cpp index 4103cbe..805091f 100644 --- a/OfficeAssistant_msvc/sqlitehelper.cpp +++ b/OfficeAssistant_msvc/sqlitehelper.cpp @@ -34,7 +34,8 @@ namespace fs = std::filesystem; #include namespace fs = std::experimental::filesystem; #endif -bool getMenu(std::wstring &path_str,QList *paths) + +bool getMenu(std::wstring &path_str,QHash *paths) { fs::directory_iterator* it = new fs::directory_iterator(path_str); for (auto file : *it) @@ -65,7 +66,8 @@ bool getMenu(std::wstring &path_str,QList *paths) hr = pShellItem->GetPath(szTargetPath, sizeof(szTargetPath), &fd, 0); ; if (SUCCEEDED(hr)) { - *paths << QString::fromWCharArray(szTargetPath); + QString filename = file.path().filename().string().c_str(); + *paths->insert(filename,QString::fromWCharArray(szTargetPath)); } else { @@ -134,14 +136,12 @@ SQLiteHelper::SQLiteHelper(QObject *parent) SQLiteHelper::~SQLiteHelper() { - db.close(); - QSqlDatabase::removeDatabase("mydb"); } bool SQLiteHelper::update_software() { HKEY hKeyUninstall = nullptr; - QList* paths = new QList; + QHash* paths = new QHash; /*QSqlQuery query; QString sql = "select * from kmd_menu;"; query.exec(sql); @@ -176,7 +176,7 @@ bool SQLiteHelper::update_software() records.insert(path, record); }*/ //开始菜单中已安装软件列表 - /*WCHAR path[MAX_PATH]; + WCHAR path[MAX_PATH]; HRESULT hr = SHGetFolderPathW(nullptr, CSIDL_COMMON_PROGRAMS, nullptr, 0, path);//获取ProgramData中开始菜单的路径 std::wstring path_str(path); getMenu(path_str, paths); @@ -188,7 +188,7 @@ bool SQLiteHelper::update_software() hr = SHGetFolderPathW(nullptr, CSIDL_PROGRAMS, nullptr, 0, path);//获取用户文件夹中开始菜单的路径 path_str.clear(); path_str = std::wstring(path); - getMenu(path_str, paths); */ + getMenu(path_str, paths); // 打开注册表中的已安装软件列表 QHash reg_records; HKEY hKey; @@ -656,7 +656,13 @@ bool SQLiteHelper::update_software() } //进行网络请求,补全字段 SoftwareRequest software_request; - software_request.sendRequest(&public_programs_list); + bool ok=software_request.sendRequest(*paths,&public_programs_list); + if(!ok) + { + return false; + + } + QSqlQuery begin(db); if (!begin.exec("begin;")) { @@ -703,7 +709,7 @@ bool SQLiteHelper::update_software() sql += ",'"; sql += public_programs_list[key].type; sql += "','"; - sql += public_programs_list[key].category_id; + sql += QString::number(OTHERS, 10); sql += "','"; sql += public_programs_list[key].name; sql += "','"; @@ -736,6 +742,29 @@ bool SQLiteHelper::update_software() return false; } } + QSqlQuery find(db); + + find.exec("select orig_name,op from kmd_menu;"); + while(find.next()) + { + if(!public_programs_list.contains(find.value("orig_name").toString())) + { + if (find.value("op").toString() == "soft") + { + QSqlQuery del(db); + del.prepare("update kmd_menu set status=0 where orig_name=:orig_name;"); + del.bindValue(":orig_value", find.value("orig_name")); + del.exec(); + } + } + } + find.clear(); + find.exec("select id from kmd_menu where status=0;"); + if(find.size()>=100) + { + QSqlQuery del(db); + del.exec("delete from kmd_menu where status=0;"); + } QSqlQuery commit(db); commit.exec("commit;"); return true; @@ -765,11 +794,30 @@ bool SQLiteHelper::get_software(QList* buttons, ConfigResponse* co { return false; } + QString background_color; + QString title_color; + QString title_cover_color; + if(config_response->succeed) + { + background_color = config_response->basic.backgroud_color; + title_color = config_response->basic.title_color; + title_cover_color = config_response->basic.title_cover_color; + } + else + { + background_color = DEFAULT_BACKGROUND_COLOR; + title_color = DEFAULT_TEXT_COLOR; + title_cover_color = DEFAULT_COVER_COLOR; + } QByteArray* buffer = new QByteArray; + QHash button_map; + for(auto menu : config_response->buttons) + { + + } while (query.next()) { - QNetworkAccessManager manager; - downloadSuccess = true; + QString icon = QApplication::applicationDirPath() + "/images/software/" + query.value("orig_name").toString() + ".svg"; ButtonStruct button_struct; button_struct.path = query.value("path").toString(); button_struct.text = query.value("name").toString(); @@ -780,11 +828,6 @@ bool SQLiteHelper::get_software(QList* buttons, ConfigResponse* co button_struct.initial_position = query.value("initial_position").toString(); QImage* image = new QImage(200, 200, QImage::Format_ARGB32); QImage* image_cover = new QImage(200, 200, QImage::Format_ARGB32); - QString icon = QApplication::applicationDirPath() + query.value("logo").toString(); - if(icon.isEmpty()) - { - icon = QApplication::applicationDirPath() + DEFAULT_IMAGE; - } QFile file(icon); if (file.open(QIODevice::ReadOnly)) { @@ -799,7 +842,7 @@ bool SQLiteHelper::get_software(QList* buttons, ConfigResponse* co //修改颜色 QDomDocument doc; doc.setContent(svg_buffer); - SetSVGBackColor(doc.documentElement(), "path", "fill", config_response->basic.title_cover_color); + SetSVGBackColor(doc.documentElement(), "path", "fill",title_cover_color); QSvgRenderer* render_image_cover = new QSvgRenderer(doc.toByteArray()); QPainter painter_image_cover(image_cover); painter_image_cover.setCompositionMode(QPainter::CompositionMode_Clear); // 清除画布 @@ -811,7 +854,7 @@ bool SQLiteHelper::get_software(QList* buttons, ConfigResponse* co delete render_image_cover; }else { - icon = QApplication::applicationDirPath() + "/images/icon/default.svg"; + icon = QApplication::applicationDirPath() + DEFAULT_IMAGE; QFile file(icon); if (file.open(QIODevice::ReadOnly)) { @@ -826,7 +869,7 @@ bool SQLiteHelper::get_software(QList* buttons, ConfigResponse* co //修改颜色 QDomDocument doc; doc.setContent(svg_buffer); - SetSVGBackColor(doc.documentElement(), "path", "fill", config_response->basic.title_cover_color); + SetSVGBackColor(doc.documentElement(), "path", "fill", title_cover_color); QSvgRenderer* render_image_cover = new QSvgRenderer(doc.toByteArray()); QPainter painter_image_cover(image_cover); painter_image_cover.setCompositionMode(QPainter::CompositionMode_Clear); // 清除画布 @@ -840,11 +883,12 @@ bool SQLiteHelper::get_software(QList* buttons, ConfigResponse* co } button_struct.image = image; button_struct.image_cover = image_cover; - button_struct.background_color = config_response->basic.backgroud_color; - button_struct.text_color = QColor(config_response->basic.title_color); - button_struct.text_cover_color = QColor(config_response->basic.title_cover_color); + button_struct.background_color = background_color; + button_struct.text_color = QColor(title_color); + button_struct.text_cover_color = QColor(title_cover_color); *buttons << button_struct; } + return true; } @@ -915,4 +959,207 @@ bool SQLiteHelper::update_app() } } return true; -} \ No newline at end of file +} + +bool SQLiteHelper::get_buttons(QList &buttons) +{ + QSqlQuery query(db); + if(!query.exec("select * from kmd_menu where type='app_manage'and status=1 order by sort asc")) + { + return false; + } + while(query.next()) + { + ButtonStruct button_struct; + button_struct.text = query.value("name").toString(); + button_struct.op= query.value("op").toString(); + button_struct.func = query.value("func").toString(); + button_struct.path = query.value("path").toString(); + button_struct.url = query.value("url").toString(); + button_struct.text_color = DEFAULT_TEXT_COLOR; + button_struct.background_color = DEFAULT_COVER_COLOR; + buttons << button_struct; + } + return true; +} +bool SQLiteHelper::insert_software(QString name, QString orig_name, QString path, QString sort,bool *categories) { + QSqlQuery query(db); + QString categories_str=""; + for(int i=0;i<8;i++) + { + if(categories[i]) + { + categories_str = categories_str + QString::number(i + 1) + ","; + } + } + QString sql = "insert into kmd_menu " + "(sort, app_id, locked, type, category_id, name, orig_name," + " create_time, op, func, path, url, " + "initial_position,status) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?);"; + query.prepare(sql); + query.addBindValue(sort.toInt()); + query.addBindValue(""); + query.addBindValue(false); + query.addBindValue("app"); + query.addBindValue(categories_str); + query.addBindValue(name); + query.addBindValue(name); + time_t create_time; + time(&create_time); + query.addBindValue(create_time); + query.addBindValue("soft"); + query.addBindValue(""); + query.addBindValue(path); + query.addBindValue(""); + query.addBindValue(""); + query.addBindValue(true); + if(!query.exec()) + { + //QMessageBox::critical(nullptr, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("写入数据库失败")); + return false; + } + return true; +} + +bool SQLiteHelper::set_category(QList& categrories) +{ + QSqlQuery work(db); + work.exec("begin;"); + for(Categrory categrory:categrories) + { + QSqlQuery query(db); + query.prepare("update kmd_category set name=:name,sort=:sort,status=:status where id=:id;"); + query.bindValue(":name", categrory.name); + query.bindValue(":status", categrory.display); + query.bindValue(":sort", categrory.sort); + query.bindValue(":id", categrory.id); + if (!query.exec()) + { + qDebug() << query.lastError(); + work.exec("rollback;"); + return false; + } + } + QSqlQuery work2(db); + work2.exec("commit;"); + qDebug() << work.lastError(); + return true; +} +bool SQLiteHelper::get_category(QList& categrories) +{ + QSqlQuery query(db); + if(!query.exec("select id,name,status,sort from kmd_category")) + { + return false; + } + while(query.next()) + { + if(query.value("name")==QString::fromLocal8Bit("全部")) + { + continue; + } + Categrory categrory; + categrory.name = query.value("name").toString(); + categrory.id = query.value("id").toInt(); + categrory.sort = query.value("sort").toInt(); + categrory.display = query.value("status").toBool(); + categrories << categrory; + } + return true; +} + +bool SQLiteHelper::get_all_software(QList &softwares,int category) +{ + QString sql; + if(category==ALL) + { + sql = "select * from kmd_menu where status=1 and not type='app_manage' and not op='self' order by sort;"; + } + else + { + sql = "select * from kmd_menu where category_id like '%"; + sql += QString::number(category, 10); + sql += "%' and not type='app_manage' and status=1 order by sort;"; + } + QSqlQuery query(db); + if(!query.exec(sql)) + { + return false; + } + while(query.next()) + { + + Record record; + record.id = query.value("id").toInt(); + record.sort = query.value("sort").toInt(); + record.app_id = query.value("app_id").toString(); + record.locked = query.value("locked").toBool(); + record.type = query.value("type").toString(); + record.category_id = query.value("category_id").toString(); + record.name = query.value("name").toString(); + record.orig_name = query.value("orig_name").toString(); + record.version = query.value("version").toString(); + record.dev = query.value("dev").toString(); + record.create_time = query.value("create_time").toLongLong(); + record.use_time = query.value("use_time").toLongLong(); + record.op = query.value("op").toString(); + record.func = query.value("func").toString(); + record.path = query.value("path").toString(); + record.url = query.value("url").toString(); + softwares << record; + } + return true; +} + +bool SQLiteHelper::edit_software(QString name, QString orig_name, QString path, QString sort, bool* categories, QString type) +{ + if (type.isEmpty()) + { + QString sql = "update kmd_menu set name=:name,path=:path,sort=:sort,category_id=:categories where orig_name=:orig_name;"; + QSqlQuery query(db); + query.prepare(sql); + query.bindValue(":name", name); + query.bindValue(":path", path); + query.bindValue(":sort", sort.toInt()); + QString categories_str = ""; + for (int i = 0; i < 8; i++) + { + if (categories[i]) + { + categories_str += QString::number(i + 1) + ","; + } + } + query.bindValue(":categories", categories_str); + query.bindValue(":orig_name", orig_name); + if (!query.exec()) + { + return false; + } + return true; + }else + { + + QString sql = "update kmd_menu set name=:name,path=:path,sort=:sort,category_id=:categories,type=:type where orig_name=:orig_name;"; + QSqlQuery query(db); + query.prepare(sql); + query.bindValue(":name", name); + query.bindValue(":path", path); + query.bindValue(":sort", sort.toInt()); + QString categories_str = ""; + for (int i = 0; i < 8; i++) + { + if (categories[i]) + { + categories_str += QString::number(i + 1) + ","; + } + } + query.bindValue(":type", type); + query.bindValue(":categories", categories_str); + query.bindValue(":orig_name", orig_name); + if (!query.exec()) + { + return false; + } + return true; + } +} diff --git a/OfficeAssistant_msvc/sqlitehelper.h b/OfficeAssistant_msvc/sqlitehelper.h index 87f53e1..40b1aea 100644 --- a/OfficeAssistant_msvc/sqlitehelper.h +++ b/OfficeAssistant_msvc/sqlitehelper.h @@ -31,7 +31,13 @@ typedef struct tagRecord{ bool status; }Record; #include "netio.h" - +struct Categrory +{ + int id; + QString name; + bool display; + int sort; +}; class SQLiteHelper : public QObject { Q_OBJECT @@ -39,8 +45,16 @@ class SQLiteHelper : public QObject public: SQLiteHelper(QObject *parent = nullptr); bool update_software(); + bool insert_software(QString name, QString orig_name, QString path, QString sort, bool* categories); + bool edit_software(QString name, QString orig_name, QString path, QString sort, bool* categories,QString type=""); bool get_software(QList* buttons, ConfigResponse* config_response); bool update_app(); + bool get_buttons(QList &buttons); + bool get_category(QList &categrories); + bool set_category(QList& categrories); + bool get_all_software(QList &softwares,int category); + QSqlDatabase db; + ~SQLiteHelper(); private: @@ -48,6 +62,5 @@ private: QEventLoop eventLoop; bool downloadSuccess; - QSqlDatabase db; void cancelDownload(); }; diff --git a/OfficeAssistant_msvc/wke.h b/OfficeAssistant_msvc/wke.h deleted file mode 100644 index 043dcaf..0000000 --- a/OfficeAssistant_msvc/wke.h +++ /dev/null @@ -1,1548 +0,0 @@ -锘/* -* -* wolar@qq.com -* http://miniblink.net 鏂囨。鍦板潃 -* https://github.com/weolar/miniblink49 -* licence Apache-2.0 -* -*/ - -#ifndef WKE_DEFINE_H -#define WKE_DEFINE_H - -#include - -////////////////////////////////////////////////////////////////////////// -#define WKE_CALL_TYPE __cdecl - -typedef struct _wkeRect { - int x; - int y; - int w; - int h; -} wkeRect; - -typedef struct _wkePoint { - int x; - int y; -} wkePoint; - -typedef struct _wkeSize { - int w; - int h; -} wkeSize; - -typedef enum _wkeMouseFlags { - WKE_LBUTTON = 0x01, - WKE_RBUTTON = 0x02, - WKE_SHIFT = 0x04, - WKE_CONTROL = 0x08, - WKE_MBUTTON = 0x10, -} wkeMouseFlags; - -typedef enum _wkeKeyFlags { - WKE_EXTENDED = 0x0100, - WKE_REPEAT = 0x4000, -} wkeKeyFlags; - -typedef enum _wkeMouseMsg { - WKE_MSG_MOUSEMOVE = 0x0200, - WKE_MSG_LBUTTONDOWN = 0x0201, - WKE_MSG_LBUTTONUP = 0x0202, - WKE_MSG_LBUTTONDBLCLK = 0x0203, - WKE_MSG_RBUTTONDOWN = 0x0204, - WKE_MSG_RBUTTONUP = 0x0205, - WKE_MSG_RBUTTONDBLCLK = 0x0206, - WKE_MSG_MBUTTONDOWN = 0x0207, - WKE_MSG_MBUTTONUP = 0x0208, - WKE_MSG_MBUTTONDBLCLK = 0x0209, - WKE_MSG_MOUSEWHEEL = 0x020A, -} wkeMouseMsg; - -#if !defined(__cplusplus) -#ifndef HAVE_WCHAR_T -typedef unsigned short wchar_t; -#endif - -#define bool _Bool -#define false 0 -#define true 1 - -#endif - -#if defined(__cplusplus) -#define WKE_EXTERN_C extern "C" -#else -#define WKE_EXTERN_C -#endif - -typedef char utf8; -#if !defined(__cplusplus) -typedef void* jsExecState; -#else -struct JsExecStateInfo; -typedef JsExecStateInfo* jsExecState; -#endif -typedef __int64 jsValue; - -#if defined(__cplusplus) -namespace wke { class CWebView; } -typedef wke::CWebView* wkeWebView; - -namespace wke { class CString; } -typedef wke::CString* wkeString; - -#else -struct _tagWkeWebView; -typedef struct _tagWkeWebView* wkeWebView; - -struct _tagWkeString; -typedef struct _tagWkeString* wkeString; -#endif - -#if defined(__cplusplus) -namespace wke { class WkeMediaPlayer; } -typedef wke::WkeMediaPlayer* wkeMediaPlayer; - -namespace wke { class WkeMediaPlayerClient; } -typedef wke::WkeMediaPlayerClient* wkeMediaPlayerClient; - -namespace blink { class WebURLRequest; } -typedef blink::WebURLRequest* blinkWebURLRequestPtr; - -#else -typedef struct _tagWkeMediaPlayer* wkeMediaPlayer; -typedef struct _tagWkeMediaPlayerClient* wkeMediaPlayerClient; -typedef struct _tabblinkWebURLRequestPtr* blinkWebURLRequestPtr; -#endif - -typedef enum _wkeProxyType { - WKE_PROXY_NONE, - WKE_PROXY_HTTP, - WKE_PROXY_SOCKS4, - WKE_PROXY_SOCKS4A, - WKE_PROXY_SOCKS5, - WKE_PROXY_SOCKS5HOSTNAME -} wkeProxyType; - -typedef struct _wkeProxy { - wkeProxyType type; - char hostname[100]; - unsigned short port; - char username[50]; - char password[50]; -} wkeProxy; - -typedef enum _wkeSettingMask { - WKE_SETTING_PROXY = 1, - WKE_SETTING_EXTENSION = 1 << 2, // 娴嬭瘯鍔熻兘锛岃鍕胯皟鐢 -} wkeSettingMask; - -typedef struct _wkeSettings { - wkeProxy proxy; - unsigned int mask; - const char* extension; -} wkeSettings; - -typedef struct _wkeViewSettings { - int size; - unsigned int bgColor; -} wkeViewSettings; - -typedef void* wkeWebFrameHandle; - -typedef struct _wkeGeolocationPosition{ - double timestamp; - double latitude; - double longitude; - double accuracy; - bool providesAltitude; - double altitude; - bool providesAltitudeAccuracy; - double altitudeAccuracy; - bool providesHeading; - double heading; - bool providesSpeed; - double speed; - -#if defined(__cplusplus) - _wkeGeolocationPosition(const _wkeGeolocationPosition& other); -#endif -} wkeGeolocationPosition; - -#if defined(__cplusplus) - -inline _wkeGeolocationPosition::_wkeGeolocationPosition(const _wkeGeolocationPosition& other) -{ - timestamp = other.timestamp; - latitude = other.latitude; - longitude = other.longitude; - accuracy = other.accuracy; - providesAltitude = other.providesAltitude; - altitude = other.altitude; - providesAltitudeAccuracy = other.providesAltitudeAccuracy; - altitudeAccuracy = other.altitudeAccuracy; - providesHeading = other.providesHeading; - heading = other.heading; - providesSpeed = other.providesSpeed; - speed = other.speed; -} - -#endif - -typedef enum _wkeMenuItemId { - kWkeMenuSelectedAllId = 1 << 1, - kWkeMenuSelectedTextId = 1 << 2, - kWkeMenuUndoId = 1 << 3, - kWkeMenuCopyImageId = 1 << 4, - kWkeMenuInspectElementAtId = 1 << 5, - kWkeMenuCutId = 1 << 6, - kWkeMenuPasteId = 1 << 7, - kWkeMenuPrintId = 1 << 8, - kWkeMenuGoForwardId = 1 << 9, - kWkeMenuGoBackId = 1 << 10, - kWkeMenuReloadId = 1 << 11, - kWkeMenuSaveImageId = 1 << 12, -} wkeMenuItemId; - -typedef void* (WKE_CALL_TYPE *FILE_OPEN_) (const char* path); -typedef void(WKE_CALL_TYPE *FILE_CLOSE_) (void* handle); -typedef size_t(WKE_CALL_TYPE *FILE_SIZE) (void* handle); -typedef int(WKE_CALL_TYPE *FILE_READ) (void* handle, void* buffer, size_t size); -typedef int(WKE_CALL_TYPE *FILE_SEEK) (void* handle, int offset, int origin); - -typedef FILE_OPEN_ WKE_FILE_OPEN; -typedef FILE_CLOSE_ WKE_FILE_CLOSE; -typedef FILE_SIZE WKE_FILE_SIZE; -typedef FILE_READ WKE_FILE_READ; -typedef FILE_SEEK WKE_FILE_SEEK; -typedef bool(WKE_CALL_TYPE *WKE_EXISTS_FILE)(const char * path); - -struct _wkeClientHandler; // declare warning fix -typedef void(WKE_CALL_TYPE *ON_TITLE_CHANGED) (const struct _wkeClientHandler* clientHandler, const wkeString title); -typedef void(WKE_CALL_TYPE *ON_URL_CHANGED) (const struct _wkeClientHandler* clientHandler, const wkeString url); - -typedef struct _wkeClientHandler { - ON_TITLE_CHANGED onTitleChanged; - ON_URL_CHANGED onURLChanged; -} wkeClientHandler; - -typedef bool(WKE_CALL_TYPE * wkeCookieVisitor)( - void* params, - const char* name, - const char* value, - const char* domain, - const char* path, // If |path| is non-empty only URLs at or below the path will get the cookie value. - int secure, // If |secure| is true the cookie will only be sent for HTTPS requests. - int httpOnly, // If |httponly| is true the cookie will only be sent for HTTP requests. - int* expires // The cookie expiration date is only valid if |has_expires| is true. - ); - -typedef enum _wkeCookieCommand { - wkeCookieCommandClearAllCookies, - wkeCookieCommandClearSessionCookies, - wkeCookieCommandFlushCookiesToFile, - wkeCookieCommandReloadCookiesFromFile, -} wkeCookieCommand; - -typedef enum _wkeNavigationType { - WKE_NAVIGATION_TYPE_LINKCLICK, - WKE_NAVIGATION_TYPE_FORMSUBMITTE, - WKE_NAVIGATION_TYPE_BACKFORWARD, - WKE_NAVIGATION_TYPE_RELOAD, - WKE_NAVIGATION_TYPE_FORMRESUBMITT, - WKE_NAVIGATION_TYPE_OTHER -} wkeNavigationType; - -typedef enum _WkeCursorInfoType { - WkeCursorInfoPointer, - WkeCursorInfoCross, - WkeCursorInfoHand, - WkeCursorInfoIBeam, - WkeCursorInfoWait, - WkeCursorInfoHelp, - WkeCursorInfoEastResize, - WkeCursorInfoNorthResize, - WkeCursorInfoNorthEastResize, - WkeCursorInfoNorthWestResize, - WkeCursorInfoSouthResize, - WkeCursorInfoSouthEastResize, - WkeCursorInfoSouthWestResize, - WkeCursorInfoWestResize, - WkeCursorInfoNorthSouthResize, - WkeCursorInfoEastWestResize, - WkeCursorInfoNorthEastSouthWestResize, - WkeCursorInfoNorthWestSouthEastResize, - WkeCursorInfoColumnResize, - WkeCursorInfoRowResize, - WkeCursorInfoMiddlePanning, - WkeCursorInfoEastPanning, - WkeCursorInfoNorthPanning, - WkeCursorInfoNorthEastPanning, - WkeCursorInfoNorthWestPanning, - WkeCursorInfoSouthPanning, - WkeCursorInfoSouthEastPanning, - WkeCursorInfoSouthWestPanning, - WkeCursorInfoWestPanning, - WkeCursorInfoMove, - WkeCursorInfoVerticalText, - WkeCursorInfoCell, - WkeCursorInfoContextMenu, - WkeCursorInfoAlias, - WkeCursorInfoProgress, - WkeCursorInfoNoDrop, - WkeCursorInfoCopy, - WkeCursorInfoNone, - WkeCursorInfoNotAllowed, - WkeCursorInfoZoomIn, - WkeCursorInfoZoomOut, - WkeCursorInfoGrab, - WkeCursorInfoGrabbing, - WkeCursorInfoCustom -} WkeCursorInfoType; - -typedef struct _wkeWindowFeatures { - int x; - int y; - int width; - int height; - - bool menuBarVisible; - bool statusBarVisible; - bool toolBarVisible; - bool locationBarVisible; - bool scrollbarsVisible; - bool resizable; - bool fullscreen; -} wkeWindowFeatures; - -typedef struct _wkeMemBuf { - int unuse; - void* data; - size_t length; -} wkeMemBuf; - -typedef struct _wkeWebDragData { - struct Item { - enum wkeStorageType { - // String data with an associated MIME type. Depending on the MIME type, there may be - // optional metadata attributes as well. - StorageTypeString, - // Stores the name of one file being dragged into the renderer. - StorageTypeFilename, - // An image being dragged out of the renderer. Contains a buffer holding the image data - // as well as the suggested name for saving the image to. - StorageTypeBinaryData, - // Stores the filesystem URL of one file being dragged into the renderer. - StorageTypeFileSystemFile, - } storageType; - - // Only valid when storageType == StorageTypeString. - wkeMemBuf* stringType; - wkeMemBuf* stringData; - - // Only valid when storageType == StorageTypeFilename. - wkeMemBuf* filenameData; - wkeMemBuf* displayNameData; - - // Only valid when storageType == StorageTypeBinaryData. - wkeMemBuf* binaryData; - - // Title associated with a link when stringType == "text/uri-list". - // Filename when storageType == StorageTypeBinaryData. - wkeMemBuf* title; - - // Only valid when storageType == StorageTypeFileSystemFile. - wkeMemBuf* fileSystemURL; - __int64 fileSystemFileSize; - - // Only valid when stringType == "text/html". - wkeMemBuf* baseURL; - }; - - struct Item* m_itemList; - int m_itemListLength; - - int m_modifierKeyState; // State of Shift/Ctrl/Alt/Meta keys. - wkeMemBuf* m_filesystemId; -} wkeWebDragData; - -typedef enum _wkeWebDragOperation { - wkeWebDragOperationNone = 0, - wkeWebDragOperationCopy = 1, - wkeWebDragOperationLink = 2, - wkeWebDragOperationGeneric = 4, - wkeWebDragOperationPrivate = 8, - wkeWebDragOperationMove = 16, - wkeWebDragOperationDelete = 32, - wkeWebDragOperationEvery = 0xffffffff -} wkeWebDragOperation; - -typedef wkeWebDragOperation wkeWebDragOperationsMask; - -typedef enum _wkeResourceType { - WKE_RESOURCE_TYPE_MAIN_FRAME = 0, // top level page - WKE_RESOURCE_TYPE_SUB_FRAME = 1, // frame or iframe - WKE_RESOURCE_TYPE_STYLESHEET = 2, // a CSS stylesheet - WKE_RESOURCE_TYPE_SCRIPT = 3, // an external script - WKE_RESOURCE_TYPE_IMAGE = 4, // an image (jpg/gif/png/etc) - WKE_RESOURCE_TYPE_FONT_RESOURCE = 5, // a font - WKE_RESOURCE_TYPE_SUB_RESOURCE = 6, // an "other" subresource. - WKE_RESOURCE_TYPE_OBJECT = 7, // an object (or embed) tag for a plugin, - // or a resource that a plugin requested. - WKE_RESOURCE_TYPE_MEDIA = 8, // a media resource. - WKE_RESOURCE_TYPE_WORKER = 9, // the main resource of a dedicated - // worker. - WKE_RESOURCE_TYPE_SHARED_WORKER = 10, // the main resource of a shared worker. - WKE_RESOURCE_TYPE_PREFETCH = 11, // an explicitly requested prefetch - WKE_RESOURCE_TYPE_FAVICON = 12, // a favicon - WKE_RESOURCE_TYPE_XHR = 13, // a XMLHttpRequest - WKE_RESOURCE_TYPE_PING = 14, // a ping request for - WKE_RESOURCE_TYPE_SERVICE_WORKER = 15, // the main resource of a service worker. - WKE_RESOURCE_TYPE_LAST_TYPE -} wkeResourceType; - -typedef struct _wkeWillSendRequestInfo { - wkeString url; - wkeString newUrl; - wkeResourceType resourceType; - int httpResponseCode; - wkeString method; - wkeString referrer; - void* headers; -} wkeWillSendRequestInfo; - -typedef enum _wkeHttBodyElementType { - wkeHttBodyElementTypeData, - wkeHttBodyElementTypeFile, -} wkeHttBodyElementType; - -typedef struct _wkePostBodyElement { - int size; - wkeHttBodyElementType type; - wkeMemBuf* data; - wkeString filePath; - __int64 fileStart; - __int64 fileLength; // -1 means to the end of the file. -} wkePostBodyElement; - -typedef struct _wkePostBodyElements { - int size; - wkePostBodyElement** element; - size_t elementSize; - bool isDirty; -} wkePostBodyElements; - -typedef void* wkeNetJob; - -typedef struct _wkeSlist { - char* data; - struct _wkeSlist* next; -} wkeSlist; - -typedef struct _wkeTempCallbackInfo { - int size; - wkeWebFrameHandle frame; - wkeWillSendRequestInfo* willSendRequestInfo; - const char* url; - wkePostBodyElements* postBody; - wkeNetJob job; -} wkeTempCallbackInfo; - -typedef enum _wkeRequestType { - kWkeRequestTypeInvalidation, - kWkeRequestTypeGet, - kWkeRequestTypePost, - kWkeRequestTypePut, -} wkeRequestType; - -typedef struct _wkePdfDatas { - int count; - size_t* sizes; - const void** datas; -} wkePdfDatas; - -typedef struct _wkePrintSettings { - int structSize; - int dpi; - int width; // in px - int height; - int marginTop; - int marginBottom; - int marginLeft; - int marginRight; - BOOL isPrintPageHeadAndFooter; - BOOL isPrintBackgroud; - BOOL isLandscape; - BOOL isPrintToMultiPage; -} wkePrintSettings; - -typedef struct _wkeScreenshotSettings { - int structSize; - int width; - int height; -} wkeScreenshotSettings; - -typedef void(WKE_CALL_TYPE*wkeCaretChangedCallback)(wkeWebView webView, void* param, const wkeRect* r); -typedef void(WKE_CALL_TYPE*wkeTitleChangedCallback)(wkeWebView webView, void* param, const wkeString title); -typedef void(WKE_CALL_TYPE*wkeURLChangedCallback)(wkeWebView webView, void* param, const wkeString url); -typedef void(WKE_CALL_TYPE*wkeURLChangedCallback2)(wkeWebView webView, void* param, wkeWebFrameHandle frameId, const wkeString url); -typedef void(WKE_CALL_TYPE*wkePaintUpdatedCallback)(wkeWebView webView, void* param, const HDC hdc, int x, int y, int cx, int cy); -typedef void(WKE_CALL_TYPE*wkePaintBitUpdatedCallback)(wkeWebView webView, void* param, const void* buffer, const wkeRect* r, int width, int height); -typedef void(WKE_CALL_TYPE*wkeAlertBoxCallback)(wkeWebView webView, void* param, const wkeString msg); -typedef bool(WKE_CALL_TYPE*wkeConfirmBoxCallback)(wkeWebView webView, void* param, const wkeString msg); -typedef bool(WKE_CALL_TYPE*wkePromptBoxCallback)(wkeWebView webView, void* param, const wkeString msg, const wkeString defaultResult, wkeString result); -typedef bool(WKE_CALL_TYPE*wkeNavigationCallback)(wkeWebView webView, void* param, wkeNavigationType navigationType, wkeString url); -typedef wkeWebView(WKE_CALL_TYPE*wkeCreateViewCallback)(wkeWebView webView, void* param, wkeNavigationType navigationType, const wkeString url, const wkeWindowFeatures* windowFeatures); -typedef void(WKE_CALL_TYPE*wkeDocumentReadyCallback)(wkeWebView webView, void* param); -typedef void(WKE_CALL_TYPE*wkeDocumentReady2Callback)(wkeWebView webView, void* param, wkeWebFrameHandle frameId); - -typedef void(WKE_CALL_TYPE*wkeOnShowDevtoolsCallback)(wkeWebView webView, void* param); - -typedef void(__stdcall *wkeNodeOnCreateProcessCallback)(wkeWebView webView, void* param, const WCHAR* applicationPath, const WCHAR* arguments, STARTUPINFOW* startup); -typedef void(WKE_CALL_TYPE*wkeOnPluginFindCallback)(wkeWebView webView, void* param, const utf8* mime, void* initializeFunc, void* getEntryPointsFunc, void* shutdownFunc); - -typedef void(WKE_CALL_TYPE*wkeOnPrintCallback)(wkeWebView webView, void* param, wkeWebFrameHandle frameId, void* printParams); -typedef void(WKE_CALL_TYPE*wkeOnScreenshot)(wkeWebView webView, void* param, const char* data, size_t size); - -typedef wkeString(WKE_CALL_TYPE*wkeImageBufferToDataURL)(wkeWebView webView, void* param, const char* data, size_t size); - -typedef struct _wkeMediaLoadInfo { - int size; - int width; - int height; - double duration; -} wkeMediaLoadInfo; -typedef void(WKE_CALL_TYPE*wkeWillMediaLoadCallback)(wkeWebView webView, void* param, const char* url, wkeMediaLoadInfo* info); - -typedef void(WKE_CALL_TYPE*wkeStartDraggingCallback)( - wkeWebView webView, - void* param, - wkeWebFrameHandle frame, - const wkeWebDragData* data, - wkeWebDragOperationsMask mask, - const void* image, - const wkePoint* dragImageOffset - ); - -typedef void(WKE_CALL_TYPE*wkeUiThreadRunCallback)(HWND hWnd, void* param); -typedef int(WKE_CALL_TYPE*wkeUiThreadPostTaskCallback)(HWND hWnd, wkeUiThreadRunCallback callback, void* param); - -typedef enum _wkeOtherLoadType { - WKE_DID_START_LOADING, - WKE_DID_STOP_LOADING, - WKE_DID_NAVIGATE, - WKE_DID_NAVIGATE_IN_PAGE, - WKE_DID_GET_RESPONSE_DETAILS, - WKE_DID_GET_REDIRECT_REQUEST, - WKE_DID_POST_REQUEST, -} wkeOtherLoadType; -typedef void(WKE_CALL_TYPE*wkeOnOtherLoadCallback)(wkeWebView webView, void* param, wkeOtherLoadType type, wkeTempCallbackInfo* info); - -typedef enum _wkeOnContextMenuItemClickType { - kWkeContextMenuItemClickTypePrint = 0x01, -} wkeOnContextMenuItemClickType; - -typedef enum _wkeOnContextMenuItemClickStep { - kWkeContextMenuItemClickStepShow = 0x01, - kWkeContextMenuItemClickStepClick = 0x02, -} wkeOnContextMenuItemClickStep; - -typedef bool(WKE_CALL_TYPE* wkeOnContextMenuItemClickCallback)( - wkeWebView webView, - void* param, - wkeOnContextMenuItemClickType type, - wkeOnContextMenuItemClickStep step, - wkeWebFrameHandle frameId, - void* info - ); - -typedef enum _wkeLoadingResult { - WKE_LOADING_SUCCEEDED, - WKE_LOADING_FAILED, - WKE_LOADING_CANCELED -} wkeLoadingResult; - -typedef enum _wkeDownloadOpt { - kWkeDownloadOptCancel, - kWkeDownloadOptCacheData, -} wkeDownloadOpt; - -typedef void(WKE_CALL_TYPE*wkeNetJobDataRecvCallback)(void* ptr, wkeNetJob job, const char* data, int length); -typedef void(WKE_CALL_TYPE*wkeNetJobDataFinishCallback)(void* ptr, wkeNetJob job, wkeLoadingResult result); - -typedef struct _wkeNetJobDataBind { - void* param; - wkeNetJobDataRecvCallback recvCallback; - wkeNetJobDataFinishCallback finishCallback; -} wkeNetJobDataBind; - -typedef void(WKE_CALL_TYPE* wkePopupDialogSaveNameCallback)(void* ptr, const wchar_t* filePath); - -typedef struct _wkeDownloadBind { - void* param; - wkeNetJobDataRecvCallback recvCallback; - wkeNetJobDataFinishCallback finishCallback; - wkePopupDialogSaveNameCallback saveNameCallback; -} wkeDownloadBind; - -enum wkeDialogProperties { - kWkeDialogPropertiesOpenFile = 1 << 1, // 鍏佽閫夋嫨鏂囦欢 - kWkeDialogPropertiesOpenDirectory = 1 << 2, // 鍏佽閫夋嫨鏂囦欢澶 - kWkeDialogPropertiesMultiSelections = 1 << 3, // 鍏佽澶氶夈 - kWkeDialogPropertiesShowHiddenFiles = 1 << 4, // 鏄剧ず瀵硅瘽妗嗕腑鐨勯殣钘忔枃浠躲 - kWkeDialogPropertiesCreateDirectory = 1 << 5, // macOS - 鍏佽浣犻氳繃瀵硅瘽妗嗙殑褰㈠紡鍒涘缓鏂扮殑鐩綍銆 - kWkeDialogPropertiesPromptToCreate = 1 << 6, // Windows - 濡傛灉杈撳叆鐨勬枃浠惰矾寰勫湪瀵硅瘽妗嗕腑涓嶅瓨鍦, 鍒欐彁绀哄垱寤恒 杩欏苟涓嶆槸鐪熺殑鍦ㄨ矾寰勪笂鍒涘缓涓涓枃浠讹紝鑰屾槸鍏佽杩斿洖涓浜涗笉瀛樺湪鐨勫湴鍧浜ょ敱搴旂敤绋嬪簭鍘诲垱寤恒 - kWkeDialogPropertiesNoResolveAliases = 1 << 7, // macOS - 绂佺敤鑷姩鐨勫埆鍚嶈矾寰(绗﹀彿閾炬帴) 瑙f瀽銆 鎵閫夊埆鍚嶇幇鍦ㄥ皢浼氳繑鍥炲埆鍚嶈矾寰勮岄潪鍏剁洰鏍囪矾寰勩 - kWkeDialogPropertiesTreatPackageAsDirectory = 1 << 8, // macOS - 灏嗗寘(濡.app 鏂囦欢澶) 瑙嗕负鐩綍鑰屼笉鏄枃浠躲 - kWkeDialogPropertiesDontAddToRecent = 1 << 9, // Windows - 涓嶈灏嗘鍦ㄦ墦寮鐨勯」鐩坊鍔犲埌鏈杩戠殑鏂囨。鍒楄〃涓 -}; - -typedef struct _wkeFileFilter { - const utf8* name; // 渚嬪"image"銆"Movies" - const utf8* extensions; // 渚嬪"jpg|png|gif" -} wkeFileFilter; - -typedef struct _wkeDialogOptions { - int magic; // 'mbdo' - utf8* title; - utf8* defaultPath; - utf8* buttonLabel; - wkeFileFilter* filters; - int filtersCount; - wkeDialogProperties prop; - utf8* message; - BOOL securityScopedBookmarks; -} wkeDialogOptions; - -typedef wkeDownloadOpt(WKE_CALL_TYPE* wkeDownloadInBlinkThreadCallback)( - wkeWebView webView, - void* param, - size_t expectedContentLength, - const char* url, - const char* mime, - const char* disposition, - wkeNetJob job, - wkeNetJobDataBind* dataBind - ); - -typedef void(WKE_CALL_TYPE*wkeLoadingFinishCallback)(wkeWebView webView, void* param, const wkeString url, wkeLoadingResult result, const wkeString failedReason); -typedef bool(WKE_CALL_TYPE*wkeDownloadCallback)(wkeWebView webView, void* param, const char* url); -typedef wkeDownloadOpt(WKE_CALL_TYPE*wkeDownload2Callback)( - wkeWebView webView, - void* param, - size_t expectedContentLength, - const char* url, - const char* mime, - const char* disposition, - wkeNetJob job, - wkeNetJobDataBind* dataBind); - -typedef enum _wkeConsoleLevel { - wkeLevelDebug = 4, - wkeLevelLog = 1, - wkeLevelInfo = 5, - wkeLevelWarning = 2, - wkeLevelError = 3, - wkeLevelRevokedError = 6, - wkeLevelLast = wkeLevelInfo -} wkeConsoleLevel; -typedef void(WKE_CALL_TYPE*wkeConsoleCallback)(wkeWebView webView, void* param, wkeConsoleLevel level, const wkeString message, const wkeString sourceName, unsigned sourceLine, const wkeString stackTrace); - -typedef void(WKE_CALL_TYPE*wkeOnCallUiThread)(wkeWebView webView, void* paramOnInThread); -typedef void(WKE_CALL_TYPE*wkeCallUiThread)(wkeWebView webView, wkeOnCallUiThread func, void* param); - -typedef wkeMediaPlayer(WKE_CALL_TYPE* wkeMediaPlayerFactory)(wkeWebView webView, wkeMediaPlayerClient client, void* npBrowserFuncs, void* npPluginFuncs); -typedef bool(WKE_CALL_TYPE* wkeOnIsMediaPlayerSupportsMIMEType)(const utf8* mime); - -//wkeNet-------------------------------------------------------------------------------------- - -typedef struct wkeWebUrlRequest* wkeWebUrlRequestPtr; -typedef struct wkeWebUrlResponse* wkeWebUrlResponsePtr; - -typedef void(WKE_CALL_TYPE* wkeOnUrlRequestWillRedirectCallback)(wkeWebView webView, void* param, wkeWebUrlRequestPtr oldRequest, wkeWebUrlRequestPtr request, wkeWebUrlResponsePtr redirectResponse); -typedef void(WKE_CALL_TYPE* wkeOnUrlRequestDidReceiveResponseCallback)(wkeWebView webView, void* param, wkeWebUrlRequestPtr request, wkeWebUrlResponsePtr response); -typedef void(WKE_CALL_TYPE* wkeOnUrlRequestDidReceiveDataCallback)(wkeWebView webView, void* param, wkeWebUrlRequestPtr request, const char* data, int dataLength); -typedef void(WKE_CALL_TYPE* wkeOnUrlRequestDidFailCallback)(wkeWebView webView, void* param, wkeWebUrlRequestPtr request, const utf8* error); -typedef void(WKE_CALL_TYPE* wkeOnUrlRequestDidFinishLoadingCallback)(wkeWebView webView, void* param, wkeWebUrlRequestPtr request, double finishTime); - -typedef struct _wkeUrlRequestCallbacks { - wkeOnUrlRequestWillRedirectCallback willRedirectCallback; - wkeOnUrlRequestDidReceiveResponseCallback didReceiveResponseCallback; - wkeOnUrlRequestDidReceiveDataCallback didReceiveDataCallback; - wkeOnUrlRequestDidFailCallback didFailCallback; - wkeOnUrlRequestDidFinishLoadingCallback didFinishLoadingCallback; -} wkeUrlRequestCallbacks; - -typedef bool(WKE_CALL_TYPE*wkeLoadUrlBeginCallback)(wkeWebView webView, void* param, const utf8* url, wkeNetJob job); -typedef void(WKE_CALL_TYPE*wkeLoadUrlEndCallback)(wkeWebView webView, void* param, const utf8* url, wkeNetJob job, void* buf, int len); -typedef void(WKE_CALL_TYPE*wkeLoadUrlFailCallback)(wkeWebView webView, void* param, const utf8* url, wkeNetJob job); -typedef void(WKE_CALL_TYPE*wkeLoadUrlHeadersReceivedCallback)(wkeWebView webView, void* param, const utf8* url, wkeNetJob job); -typedef void(WKE_CALL_TYPE*wkeLoadUrlFinishCallback)(wkeWebView webView, void* param, const utf8* url, wkeNetJob job, int len); - -typedef void(WKE_CALL_TYPE*wkeDidCreateScriptContextCallback)(wkeWebView webView, void* param, wkeWebFrameHandle frameId, void* context, int extensionGroup, int worldId); -typedef void(WKE_CALL_TYPE*wkeWillReleaseScriptContextCallback)(wkeWebView webView, void* param, wkeWebFrameHandle frameId, void* context, int worldId); -typedef bool(WKE_CALL_TYPE*wkeNetResponseCallback)(wkeWebView webView, void* param, const utf8* url, wkeNetJob job); -typedef void(WKE_CALL_TYPE*wkeOnNetGetFaviconCallback)(wkeWebView webView, void* param, const utf8* url, wkeMemBuf* buf); - -typedef void* v8ContextPtr; -typedef void* v8Isolate; - -//wke window----------------------------------------------------------------------------------- -typedef enum _wkeWindowType { - WKE_WINDOW_TYPE_POPUP, - WKE_WINDOW_TYPE_TRANSPARENT, - WKE_WINDOW_TYPE_CONTROL -} wkeWindowType; - -typedef struct _wkeWindowCreateInfo { - int size; - HWND parent; - DWORD style; - DWORD styleEx; - int x; - int y; - int width; - int height; - COLORREF color; -} wkeWindowCreateInfo; - -typedef struct _wkeDefaultPrinterSettings { - int structSize; // 榛樿鏄4 * 10 - BOOL isLandscape; // 鏄惁涓烘í鍚戞墦鍗版牸寮 - BOOL isPrintHeadFooter; // - BOOL isPrintBackgroud; // 鏄惁鎵撳嵃鑳屾櫙 - int edgeDistanceLeft; // 涓婅竟璺濆崟浣嶏細姣背 - int edgeDistanceTop; - int edgeDistanceRight; - int edgeDistanceBottom; - int copies; // 榛樿鎵撳嵃浠芥暟 - int paperType; // DMPAPER_A4绛 -#if defined(__cplusplus) - inline _wkeDefaultPrinterSettings(); -#endif -} wkeDefaultPrinterSettings; - -typedef bool(WKE_CALL_TYPE*wkeWindowClosingCallback)(wkeWebView webWindow, void* param); -typedef void(WKE_CALL_TYPE*wkeWindowDestroyCallback)(wkeWebView webWindow, void* param); - -typedef struct { - RECT bounds; - bool draggable; -} wkeDraggableRegion; -typedef void(WKE_CALL_TYPE*wkeDraggableRegionsChangedCallback)(wkeWebView webView, void* param, const wkeDraggableRegion* rects, int rectCount); - -//JavaScript Bind----------------------------------------------------------------------------------- -#define JS_CALL __fastcall -typedef jsValue(JS_CALL* jsNativeFunction) (jsExecState es); - -typedef jsValue(WKE_CALL_TYPE* wkeJsNativeFunction) (jsExecState es, void* param); - -typedef enum _jsType { - JSTYPE_NUMBER, - JSTYPE_STRING, - JSTYPE_BOOLEAN, - JSTYPE_OBJECT, - JSTYPE_FUNCTION, - JSTYPE_UNDEFINED, - JSTYPE_ARRAY, - JSTYPE_NULL, -} jsType; - -// cexer JS瀵硅薄銆佸嚱鏁扮粦瀹氭敮鎸 -typedef jsValue(WKE_CALL_TYPE*jsGetPropertyCallback)(jsExecState es, jsValue object, const char* propertyName); -typedef bool(WKE_CALL_TYPE*jsSetPropertyCallback)(jsExecState es, jsValue object, const char* propertyName, jsValue value); -typedef jsValue(WKE_CALL_TYPE*jsCallAsFunctionCallback)(jsExecState es, jsValue object, jsValue* args, int argCount); -struct tagjsData; // declare warning fix -typedef void(WKE_CALL_TYPE*jsFinalizeCallback)(struct tagjsData* data); - -typedef struct tagjsData { - char typeName[100]; - jsGetPropertyCallback propertyGet; - jsSetPropertyCallback propertySet; - jsFinalizeCallback finalize; - jsCallAsFunctionCallback callAsFunction; -} jsData; - -typedef struct _jsExceptionInfo { - const utf8* message; // Returns the exception message. - const utf8* sourceLine; // Returns the line of source code that the exception occurred within. - const utf8* scriptResourceName; // Returns the resource name for the script from where the function causing the error originates. - int lineNumber; // Returns the 1-based number of the line where the error occurred or 0 if the line number is unknown. - int startPosition; // Returns the index within the script of the first character where the error occurred. - int endPosition; // Returns the index within the script of the last character where the error occurred. - int startColumn; // Returns the index within the line of the first character where the error occurred. - int endColumn; // Returns the index within the line of the last character where the error occurred. - const utf8* callstackString; -} jsExceptionInfo; - -typedef struct _jsKeys { - unsigned int length; - const char** keys; - -#if defined(__cplusplus) - ~_jsKeys(); -#endif -} jsKeys; - - -#if defined(__cplusplus) -namespace wke { - -class IWebView { -public: - virtual void destroy() = 0; - - virtual const char* name() const = 0; - virtual void setName(const char* name) = 0; - - virtual bool isTransparent() const = 0; - virtual void setTransparent(bool transparent) = 0; - - virtual void loadURL(const utf8* url) = 0; - virtual void loadURL(const wchar_t* url) = 0; - - virtual void loadHTML(const utf8* html) = 0; - virtual void loadHTML(const wchar_t* html) = 0; - - virtual void loadFile(const utf8* filename) = 0; - virtual void loadFile(const wchar_t* filename) = 0; - - virtual const utf8* url() const = 0; - - virtual bool isLoading() const = 0; /*document load sucessed*/ - virtual bool isLoadingFailed() const = 0; /*document load failed*/ - virtual bool isLoadingSucceeded() const = 0; /*document load complete*/ - virtual bool isDocumentReady() const = 0; /*document ready*/ - virtual void stopLoading() = 0; - virtual void reload() = 0; - - virtual const utf8* title() = 0; - virtual const wchar_t* titleW() = 0; - - virtual void resize(int w, int h) = 0; - virtual int width() const = 0; /*viewport width*/ - virtual int height() const = 0; /*viewport height*/ - - virtual int contentsWidth() const = 0; /*contents width*/ - virtual int contentsHeight() const = 0; /*contents height*/ - - virtual void setDirty(bool dirty) = 0; - virtual bool isDirty() const = 0; - virtual void addDirtyArea(int x, int y, int w, int h) = 0; - - virtual void layoutIfNeeded() = 0; - virtual void paint(void* bits, int pitch) = 0; - - virtual bool canGoBack() const = 0; - virtual bool goBack() = 0; - virtual bool canGoForward() const = 0; - virtual bool goForward() = 0; - - virtual void editorSelectAll() = 0; - virtual void editorUnSelect() = 0; - virtual void editorCopy() = 0; - virtual void editorCut() = 0; - virtual void editorPaste() = 0; - virtual void editorDelete() = 0; - virtual void editorUndo() = 0; - virtual void editorRedo() = 0; - - virtual void setCookieEnabled(bool enable) = 0; - virtual bool isCookieEnabled() const = 0; - - virtual void setMediaVolume(float volume) = 0; - virtual float mediaVolume() const = 0; - - virtual bool fireMouseEvent(unsigned int message, int x, int y, unsigned int flags) = 0; - virtual bool fireContextMenuEvent(int x, int y, unsigned int flags) = 0; - virtual bool fireMouseWheelEvent(int x, int y, int delta, unsigned int flags) = 0; - virtual bool fireKeyUpEvent(unsigned int virtualKeyCode, unsigned int flags, bool systemKey) = 0; - virtual bool fireKeyDownEvent(unsigned int virtualKeyCode, unsigned int flags, bool systemKey) = 0; - virtual bool fireKeyPressEvent(unsigned int virtualKeyCode, unsigned int flags, bool systemKey) = 0; - - virtual void setFocus() = 0; - virtual void killFocus() = 0; - - virtual wkeRect getCaret() = 0; - - virtual jsValue runJS(const utf8* script) = 0; - virtual jsValue runJS(const wchar_t* script) = 0; - virtual jsExecState globalExec() = 0; - - virtual void sleep() = 0; //moveOffscreen - virtual void wake() = 0; //moveOnscreen - virtual bool isAwake() const = 0; - - virtual void setZoomFactor(float factor) = 0; - virtual float zoomFactor() const = 0; - - virtual void setEditable(bool editable) = 0; - - virtual void setClientHandler(const wkeClientHandler* handler) = 0; - virtual const wkeClientHandler* getClientHandler() const = 0; -}; - -} -#endif - -////////////////////////////////////////////////////////////////////////// - -#define WKE_DEFINE_ITERATOR0(returnVal, name, description) \ - typedef returnVal(WKE_CALL_TYPE* FN_##name)(); \ - __declspec(selectany) FN_##name name = ((FN_##name)0); - -#define WKE_DEFINE_ITERATOR1(returnVal, name, p1, description) \ - typedef returnVal(WKE_CALL_TYPE* FN_##name)(p1); \ - __declspec(selectany) FN_##name name = ((FN_##name)0); - -#define WKE_DEFINE_ITERATOR2(returnVal, name, p1, p2, description) \ - typedef returnVal(WKE_CALL_TYPE* FN_##name)(p1, p2); \ - __declspec(selectany) FN_##name name = ((FN_##name)0); - -#define WKE_DEFINE_ITERATOR3(returnVal, name, p1, p2, p3, description) \ - typedef returnVal(WKE_CALL_TYPE* FN_##name)(p1, p2, p3); \ - __declspec(selectany) FN_##name name = ((FN_##name)0); - -#define WKE_DEFINE_ITERATOR4(returnVal, name, p1, p2, p3, p4, description) \ - typedef returnVal(WKE_CALL_TYPE* FN_##name)(p1, p2, p3, p4); \ - __declspec(selectany) FN_##name name = ((FN_##name)0); - -#define WKE_DEFINE_ITERATOR5(returnVal, name, p1, p2, p3, p4, p5, description) \ - typedef returnVal(WKE_CALL_TYPE* FN_##name)(p1, p2, p3, p4, p5); \ - __declspec(selectany) FN_##name name = ((FN_##name)0); - -#define WKE_DEFINE_ITERATOR6(returnVal, name, p1, p2, p3, p4, p5, p6, description) \ - typedef returnVal(WKE_CALL_TYPE* FN_##name)(p1, p2, p3, p4, p5, p6); \ - __declspec(selectany) FN_##name name = ((FN_##name)0); - -#define WKE_DEFINE_ITERATOR9(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, description) \ - typedef returnVal(WKE_CALL_TYPE* FN_##name)(p1, p2, p3, p4, p5, p6, p7, p8, p9); \ - __declspec(selectany) FN_##name name = ((FN_##name)0); - -#define WKE_DEFINE_ITERATOR10(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, description) \ - typedef returnVal(WKE_CALL_TYPE* FN_##name)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \ - __declspec(selectany) FN_##name name = ((FN_##name)0); - -#define WKE_DEFINE_ITERATOR11(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, description) \ - typedef returnVal(WKE_CALL_TYPE* FN_##name)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \ - __declspec(selectany) FN_##name name = ((FN_##name)0); - -// --- - -#define WKE_DECLARE_ITERATOR0(returnVal, name, description) \ - WKE_EXTERN_C __declspec(dllexport) returnVal WKE_CALL_TYPE name(); - -#define WKE_DECLARE_ITERATOR1(returnVal, name, p1, description) \ - WKE_EXTERN_C __declspec(dllexport) returnVal WKE_CALL_TYPE name(p1); - -#define WKE_DECLARE_ITERATOR2(returnVal, name, p1, p2, description) \ - WKE_EXTERN_C __declspec(dllexport) returnVal WKE_CALL_TYPE name(p1, p2); - -#define WKE_DECLARE_ITERATOR3(returnVal, name, p1, p2, p3, description) \ - WKE_EXTERN_C __declspec(dllexport) returnVal WKE_CALL_TYPE name(p1, p2, p3); - -#define WKE_DECLARE_ITERATOR4(returnVal, name, p1, p2, p3, p4, description) \ - WKE_EXTERN_C __declspec(dllexport) returnVal WKE_CALL_TYPE name(p1, p2, p3, p4); - -#define WKE_DECLARE_ITERATOR5(returnVal, name, p1, p2, p3, p4, p5, description) \ - WKE_EXTERN_C __declspec(dllexport) returnVal WKE_CALL_TYPE name(p1, p2, p3, p4, p5); - -#define WKE_DECLARE_ITERATOR6(returnVal, name, p1, p2, p3, p4, p5, p6, description) \ - WKE_EXTERN_C __declspec(dllexport) returnVal WKE_CALL_TYPE name(p1, p2, p3, p4, p5, p6); - -#define WKE_DECLARE_ITERATOR9(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, description) \ - WKE_EXTERN_C __declspec(dllexport) returnVal WKE_CALL_TYPE name(p1, p2, p3, p4, p5, p6, p7, p8, p9); - -#define WKE_DECLARE_ITERATOR10(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, description) \ - WKE_EXTERN_C __declspec(dllexport) returnVal WKE_CALL_TYPE name(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); - -#define WKE_DECLARE_ITERATOR11(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, description) \ - WKE_EXTERN_C __declspec(dllexport) returnVal WKE_CALL_TYPE name(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); - -// --- - -#define WKE_GET_PTR_ITERATOR(name) \ - name = (FN_##name)GetProcAddress(hMod, #name); \ - if (!name) \ - MessageBoxA(((HWND)0), "wke api not found", #name, 0); - -#define WKE_GET_PTR_ITERATOR0(returnVal, name, description) \ - WKE_GET_PTR_ITERATOR(name); - -#define WKE_GET_PTR_ITERATOR1(returnVal, name, p1, description) \ - WKE_GET_PTR_ITERATOR(name); - -#define WKE_GET_PTR_ITERATOR2(returnVal, name, p1, p2, description) \ - WKE_GET_PTR_ITERATOR(name); - -#define WKE_GET_PTR_ITERATOR3(returnVal, name, p1, p2, p3, description) \ - WKE_GET_PTR_ITERATOR(name); - -#define WKE_GET_PTR_ITERATOR4(returnVal, name, p1, p2, p3, p4, description) \ - WKE_GET_PTR_ITERATOR(name); - -#define WKE_GET_PTR_ITERATOR5(returnVal, name, p1, p2, p3, p4, p5, description) \ - WKE_GET_PTR_ITERATOR(name); - -#define WKE_GET_PTR_ITERATOR6(returnVal, name, p1, p2, p3, p4, p5, p6, description) \ - WKE_GET_PTR_ITERATOR(name); - -#define WKE_GET_PTR_ITERATOR9(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, description) \ - WKE_GET_PTR_ITERATOR(name); - -#define WKE_GET_PTR_ITERATOR10(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, description) \ - WKE_GET_PTR_ITERATOR(name); - -#define WKE_GET_PTR_ITERATOR11(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, description) \ - WKE_GET_PTR_ITERATOR(name); - -// 浠ヤ笅鏄痺ke鐨勫鍑哄嚱鏁般傛牸寮忔寜鐓с愯繑鍥炵被鍨嬨戙愬嚱鏁板悕銆戙愬弬鏁般戞潵鎺掑垪 - -#define WKE_FOR_EACH_DEFINE_FUNCTION(ITERATOR0, ITERATOR1, ITERATOR2, ITERATOR3, ITERATOR4, ITERATOR5, ITERATOR6, ITERATOR9, ITERATOR10, ITERATOR11) \ - ITERATOR0(void, wkeShutdown, "") \ - ITERATOR0(void, wkeShutdownForDebug, "娴嬭瘯浣跨敤锛屼笉浜嗚В鍗冧竾鍒敤锛") \ - \ - ITERATOR0(unsigned int, wkeVersion, "") \ - ITERATOR0(const utf8*, wkeVersionString, "") \ - ITERATOR2(void, wkeGC, wkeWebView webView, long intervalSec, "") \ - ITERATOR2(void, wkeSetResourceGc, wkeWebView webView, long intervalSec, "") \ - \ - ITERATOR5(void, wkeSetFileSystem, WKE_FILE_OPEN pfnOpen, WKE_FILE_CLOSE pfnClose, WKE_FILE_SIZE pfnSize, WKE_FILE_READ pfnRead, WKE_FILE_SEEK pfnSeek, "") \ - \ - ITERATOR1(const char*, wkeWebViewName, wkeWebView webView, "") \ - ITERATOR2(void, wkeSetWebViewName, wkeWebView webView, const char* name, "") \ - \ - ITERATOR1(BOOL, wkeIsLoaded, wkeWebView webView, "") \ - ITERATOR1(BOOL, wkeIsLoadFailed, wkeWebView webView, "") \ - ITERATOR1(BOOL, wkeIsLoadComplete, wkeWebView webView, "") \ - \ - ITERATOR1(const utf8*, wkeGetSource, wkeWebView webView, "") \ - ITERATOR1(const utf8*, wkeTitle, wkeWebView webView, "") \ - ITERATOR1(const wchar_t*, wkeTitleW, wkeWebView webView, "") \ - ITERATOR1(int, wkeWidth, wkeWebView webView, "") \ - ITERATOR1(int, wkeHeight, wkeWebView webView, "") \ - ITERATOR1(int, wkeContentsWidth, wkeWebView webView, "") \ - ITERATOR1(int, wkeContentsHeight, wkeWebView webView, "") \ - \ - ITERATOR1(void, wkeSelectAll, wkeWebView webView, "") \ - ITERATOR1(void, wkeCopy, wkeWebView webView, "") \ - ITERATOR1(void, wkeCut, wkeWebView webView, "") \ - ITERATOR1(void, wkePaste, wkeWebView webView, "") \ - ITERATOR1(void, wkeDelete, wkeWebView webView, "") \ - \ - ITERATOR1(BOOL, wkeCookieEnabled, wkeWebView webView, "") \ - ITERATOR1(float, wkeMediaVolume, wkeWebView webView, "") \ - \ - ITERATOR5(BOOL, wkeMouseEvent, wkeWebView webView, unsigned int message, int x, int y, unsigned int flags, "") \ - ITERATOR4(BOOL, wkeContextMenuEvent, wkeWebView webView, int x, int y, unsigned int flags, "") \ - ITERATOR5(BOOL, wkeMouseWheel, wkeWebView webView, int x, int y, int delta, unsigned int flags, "") \ - ITERATOR4(BOOL, wkeKeyUp, wkeWebView webView, unsigned int virtualKeyCode, unsigned int flags, bool systemKey, "") \ - ITERATOR4(BOOL, wkeKeyDown, wkeWebView webView, unsigned int virtualKeyCode, unsigned int flags, bool systemKey, "") \ - ITERATOR4(BOOL, wkeKeyPress, wkeWebView webView, unsigned int virtualKeyCode, unsigned int flags, bool systemKey, "") \ - \ - ITERATOR1(void, wkeFocus, wkeWebView webView, "") \ - ITERATOR1(void, wkeUnfocus, wkeWebView webView, "") \ - \ - ITERATOR1(wkeRect, wkeGetCaret, wkeWebView webView, "") \ - \ - ITERATOR1(void, wkeAwaken, wkeWebView webView, "") \ - \ - ITERATOR1(float, wkeZoomFactor, wkeWebView webView, "") \ - \ - ITERATOR2(void, wkeSetClientHandler, wkeWebView webView, const wkeClientHandler* handler, "") \ - ITERATOR1(const wkeClientHandler*, wkeGetClientHandler, wkeWebView webView, "") \ - \ - ITERATOR1(const utf8*, wkeToString, const wkeString string, "") \ - ITERATOR1(const wchar_t*, wkeToStringW, const wkeString string, "") \ - \ - ITERATOR2(const utf8*, jsToString, jsExecState es, jsValue v, "") \ - ITERATOR2(const wchar_t*, jsToStringW, jsExecState es, jsValue v, "") \ - \ - ITERATOR1(void, wkeConfigure, const wkeSettings* settings, "") \ - ITERATOR0(BOOL, wkeIsInitialize, "") \ - \ - ITERATOR2(void, wkeSetViewSettings, wkeWebView webView, const wkeViewSettings* settings, "") \ - ITERATOR3(void, wkeSetDebugConfig, wkeWebView webView, const char* debugString, const char* param, "") \ - ITERATOR2(void *, wkeGetDebugConfig, wkeWebView webView, const char* debugString, "") \ - \ - ITERATOR0(void, wkeFinalize, "") \ - ITERATOR0(void, wkeUpdate, "") \ - ITERATOR0(unsigned int, wkeGetVersion, "") \ - ITERATOR0(const utf8*, wkeGetVersionString, "") \ - \ - ITERATOR0(wkeWebView, wkeCreateWebView, "") \ - ITERATOR1(void, wkeDestroyWebView, wkeWebView webView, "") \ - \ - ITERATOR2(void, wkeSetMemoryCacheEnable, wkeWebView webView, bool b, "") \ - ITERATOR2(void, wkeSetMouseEnabled, wkeWebView webView, bool b, "") \ - ITERATOR2(void, wkeSetTouchEnabled, wkeWebView webView, bool b, "") \ - ITERATOR2(void, wkeSetSystemTouchEnabled, wkeWebView webView, bool b, "") \ - ITERATOR2(void, wkeSetContextMenuEnabled, wkeWebView webView, bool b, "") \ - ITERATOR2(void, wkeSetNavigationToNewWindowEnable, wkeWebView webView, bool b, "") \ - ITERATOR2(void, wkeSetCspCheckEnable, wkeWebView webView, bool b, "") \ - ITERATOR2(void, wkeSetNpapiPluginsEnabled, wkeWebView webView, bool b, "") \ - ITERATOR2(void, wkeSetHeadlessEnabled, wkeWebView webView, bool b, "鍙互鍏抽棴娓叉煋") \ - ITERATOR2(void, wkeSetDragEnable, wkeWebView webView, bool b, "鍙叧闂嫋鎷芥枃浠跺姞杞界綉椤") \ - ITERATOR2(void, wkeSetDragDropEnable, wkeWebView webView, bool b, "鍙叧闂嫋鎷藉埌鍏朵粬杩涚▼") \ - ITERATOR3(void, wkeSetContextMenuItemShow, wkeWebView webView, wkeMenuItemId item, bool isShow, "璁剧疆鏌愰」menu鏄惁鏄剧ず") \ - ITERATOR2(void, wkeSetLanguage, wkeWebView webView, const char* language, "") \ - \ - ITERATOR2(void, wkeSetViewNetInterface, wkeWebView webView, const char* netInterface, "") \ - \ - ITERATOR1(void, wkeSetProxy, const wkeProxy* proxy, "") \ - ITERATOR2(void, wkeSetViewProxy, wkeWebView webView, wkeProxy *proxy, "") \ - \ - ITERATOR1(const char*, wkeGetName, wkeWebView webView, "") \ - ITERATOR2(void, wkeSetName, wkeWebView webView, const char* name, "") \ - \ - ITERATOR2(void, wkeSetHandle, wkeWebView webView, HWND wnd, "") \ - ITERATOR3(void, wkeSetHandleOffset, wkeWebView webView, int x, int y, "") \ - \ - ITERATOR1(BOOL, wkeIsTransparent, wkeWebView webView, "") \ - ITERATOR2(void, wkeSetTransparent, wkeWebView webView, bool transparent, "") \ - \ - ITERATOR2(void, wkeSetUserAgent, wkeWebView webView, const utf8* userAgent, "") \ - ITERATOR1(const char*, wkeGetUserAgent, wkeWebView webView, "") \ - ITERATOR2(void, wkeSetUserAgentW, wkeWebView webView, const wchar_t* userAgent, "") \ - \ - ITERATOR4(void, wkeShowDevtools, wkeWebView webView, const wchar_t* path, wkeOnShowDevtoolsCallback callback, void* param, "") \ - \ - ITERATOR2(void, wkeLoadW, wkeWebView webView, const wchar_t* url, "") \ - ITERATOR2(void, wkeLoadURL, wkeWebView webView, const utf8* url, "") \ - ITERATOR2(void, wkeLoadURLW, wkeWebView webView, const wchar_t* url, "") \ - ITERATOR4(void, wkePostURL, wkeWebView wkeView, const utf8* url, const char* postData, int postLen, "") \ - ITERATOR4(void, wkePostURLW, wkeWebView wkeView, const wchar_t* url, const char* postData, int postLen, "") \ - \ - ITERATOR2(void, wkeLoadHTML, wkeWebView webView, const utf8* html, "") \ - ITERATOR3(void, wkeLoadHtmlWithBaseUrl, wkeWebView webView, const utf8* html, const utf8* baseUrl, "") \ - ITERATOR2(void, wkeLoadHTMLW, wkeWebView webView, const wchar_t* html, "") \ - \ - ITERATOR2(void, wkeLoadFile, wkeWebView webView, const utf8* filename, "") \ - ITERATOR2(void, wkeLoadFileW, wkeWebView webView, const wchar_t* filename, "") \ - \ - ITERATOR1(const utf8*, wkeGetURL, wkeWebView webView, "") \ - ITERATOR2(const utf8*, wkeGetFrameUrl, wkeWebView webView, wkeWebFrameHandle frameId, "") \ - \ - ITERATOR1(BOOL, wkeIsLoading, wkeWebView webView, "") \ - ITERATOR1(BOOL, wkeIsLoadingSucceeded, wkeWebView webView, "") \ - ITERATOR1(BOOL, wkeIsLoadingFailed, wkeWebView webView, "") \ - ITERATOR1(BOOL, wkeIsLoadingCompleted, wkeWebView webView, "") \ - ITERATOR1(BOOL, wkeIsDocumentReady, wkeWebView webView, "") \ - ITERATOR1(void, wkeStopLoading, wkeWebView webView, "") \ - ITERATOR1(void, wkeReload, wkeWebView webView, "") \ - ITERATOR2(void, wkeGoToOffset, wkeWebView webView, int offset, "") \ - ITERATOR2(void, wkeGoToIndex, wkeWebView webView, int index, "") \ - \ - ITERATOR1(int, wkeGetWebviewId, wkeWebView webView, "") \ - ITERATOR1(BOOL, wkeIsWebviewAlive, int id, "") \ - ITERATOR1(BOOL, wkeIsWebviewValid, wkeWebView webView, "") \ - \ - ITERATOR3(const utf8*, wkeGetDocumentCompleteURL, wkeWebView webView, wkeWebFrameHandle frameId, const utf8* partialURL, "") \ - \ - ITERATOR3(wkeMemBuf*, wkeCreateMemBuf, wkeWebView webView, void* buf, size_t length, "") \ - ITERATOR1(void, wkeFreeMemBuf, wkeMemBuf* buf, "") \ - \ - ITERATOR1(const utf8*, wkeGetTitle, wkeWebView webView, "") \ - ITERATOR1(const wchar_t*, wkeGetTitleW, wkeWebView webView, "") \ - \ - ITERATOR3(void, wkeResize, wkeWebView webView, int w, int h, "") \ - ITERATOR1(int, wkeGetWidth, wkeWebView webView, "") \ - ITERATOR1(int, wkeGetHeight, wkeWebView webView, "") \ - ITERATOR1(int, wkeGetContentWidth, wkeWebView webView, "") \ - ITERATOR1(int, wkeGetContentHeight, wkeWebView webView, "") \ - \ - ITERATOR2(void, wkeSetDirty, wkeWebView webView, bool dirty, "") \ - ITERATOR1(BOOL, wkeIsDirty, wkeWebView webView, "") \ - ITERATOR5(void, wkeAddDirtyArea, wkeWebView webView, int x, int y, int w, int h, "") \ - ITERATOR1(void, wkeLayoutIfNeeded, wkeWebView webView, "") \ - ITERATOR11(void, wkePaint2, wkeWebView webView, void* bits, int bufWid, int bufHei, int xDst, int yDst, int w, int h, int xSrc, int ySrc, bool bCopyAlpha, "") \ - ITERATOR3(void, wkePaint, wkeWebView webView, void* bits, int pitch, "") \ - ITERATOR1(void, wkeRepaintIfNeeded, wkeWebView webView, "") \ - ITERATOR1(HDC, wkeGetViewDC, wkeWebView webView, "") \ - ITERATOR1(void, wkeUnlockViewDC, wkeWebView webView, "") \ - ITERATOR1(HWND, wkeGetHostHWND, wkeWebView webView, "") \ - \ - ITERATOR1(BOOL, wkeCanGoBack, wkeWebView webView, "") \ - ITERATOR1(BOOL, wkeGoBack, wkeWebView webView, "") \ - ITERATOR1(BOOL, wkeCanGoForward, wkeWebView webView, "") \ - ITERATOR1(BOOL, wkeGoForward, wkeWebView webView, "") \ - ITERATOR2(BOOL, wkeNavigateAtIndex, wkeWebView webView, int index, "") \ - ITERATOR1(int, wkeGetNavigateIndex, wkeWebView webView, "") \ - \ - ITERATOR1(void, wkeEditorSelectAll, wkeWebView webView, "") \ - ITERATOR1(void, wkeEditorUnSelect, wkeWebView webView, "") \ - ITERATOR1(void, wkeEditorCopy, wkeWebView webView, "") \ - ITERATOR1(void, wkeEditorCut, wkeWebView webView, "") \ - ITERATOR1(void, wkeEditorPaste, wkeWebView webView, "") \ - ITERATOR1(void, wkeEditorDelete, wkeWebView webView, "") \ - ITERATOR1(void, wkeEditorUndo, wkeWebView webView, "") \ - ITERATOR1(void, wkeEditorRedo, wkeWebView webView, "") \ - \ - ITERATOR1(const wchar_t*, wkeGetCookieW, wkeWebView webView, "") \ - ITERATOR1(const utf8*, wkeGetCookie, wkeWebView webView, "") \ - ITERATOR3(void, wkeSetCookie, wkeWebView webView, const utf8* url, const utf8* cookie, "cookie鏍煎紡蹇呴』鏄被浼:cna=4UvTFE12fEECAXFKf4SFW5eo; expires=Tue, 23-Jan-2029 13:17:21 GMT; path=/; domain=.youku.com") \ - ITERATOR3(void, wkeVisitAllCookie, wkeWebView webView, void* params, wkeCookieVisitor visitor, "") \ - ITERATOR2(void, wkePerformCookieCommand, wkeWebView webView, wkeCookieCommand command, "") \ - ITERATOR2(void, wkeSetCookieEnabled, wkeWebView webView, bool enable, "") \ - ITERATOR1(BOOL, wkeIsCookieEnabled, wkeWebView webView, "") \ - ITERATOR2(void, wkeSetCookieJarPath, wkeWebView webView, const WCHAR* path, "") \ - ITERATOR2(void, wkeSetCookieJarFullPath, wkeWebView webView, const WCHAR* path, "") \ - ITERATOR1(void, wkeClearCookie, wkeWebView webView, "") \ - ITERATOR2(void, wkeSetLocalStorageFullPath, wkeWebView webView, const WCHAR* path, "") \ - ITERATOR2(void, wkeAddPluginDirectory, wkeWebView webView, const WCHAR* path, "") \ - \ - ITERATOR2(void, wkeSetMediaVolume, wkeWebView webView, float volume, "") \ - ITERATOR1(float, wkeGetMediaVolume, wkeWebView webView, "") \ - \ - ITERATOR5(BOOL, wkeFireMouseEvent, wkeWebView webView, unsigned int message, int x, int y, unsigned int flags, "") \ - ITERATOR4(BOOL, wkeFireContextMenuEvent, wkeWebView webView, int x, int y, unsigned int flags, "") \ - ITERATOR5(BOOL, wkeFireMouseWheelEvent, wkeWebView webView, int x, int y, int delta, unsigned int flags, "") \ - ITERATOR4(BOOL, wkeFireKeyUpEvent, wkeWebView webView, unsigned int virtualKeyCode, unsigned int flags, bool systemKey, "") \ - ITERATOR4(BOOL, wkeFireKeyDownEvent, wkeWebView webView, unsigned int virtualKeyCode, unsigned int flags, bool systemKey, "") \ - ITERATOR4(BOOL, wkeFireKeyPressEvent, wkeWebView webView, unsigned int charCode, unsigned int flags, bool systemKey, "") \ - ITERATOR6(BOOL, wkeFireWindowsMessage, wkeWebView webView, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT* result, "") \ - \ - ITERATOR1(void, wkeSetFocus, wkeWebView webView, "") \ - ITERATOR1(void, wkeKillFocus, wkeWebView webView, "") \ - \ - ITERATOR1(wkeRect, wkeGetCaretRect, wkeWebView webView, "") \ - ITERATOR1(wkeRect*, wkeGetCaretRect2, wkeWebView webView, "缁欎竴浜涗笉鏂逛究鑾峰彇杩斿洖缁撴瀯浣撶殑璇█璋冪敤") \ - \ - ITERATOR2(jsValue, wkeRunJS, wkeWebView webView, const utf8* script, "") \ - ITERATOR2(jsValue, wkeRunJSW, wkeWebView webView, const wchar_t* script, "") \ - \ - ITERATOR1(jsExecState, wkeGlobalExec, wkeWebView webView, "") \ - ITERATOR2(jsExecState, wkeGetGlobalExecByFrame, wkeWebView webView, wkeWebFrameHandle frameId, "") \ - \ - ITERATOR1(void, wkeSleep, wkeWebView webView, "") \ - ITERATOR1(void, wkeWake, wkeWebView webView, "") \ - ITERATOR1(BOOL, wkeIsAwake, wkeWebView webView, "") \ - \ - ITERATOR2(void, wkeSetZoomFactor, wkeWebView webView, float factor, "") \ - ITERATOR1(float, wkeGetZoomFactor, wkeWebView webView, "") \ - ITERATOR0(void, wkeEnableHighDPISupport, "") \ - \ - ITERATOR2(void, wkeSetEditable, wkeWebView webView, bool editable, "") \ - \ - ITERATOR1(const utf8*, wkeGetString, const wkeString string, "") \ - ITERATOR1(const wchar_t*, wkeGetStringW, const wkeString string, "") \ - \ - ITERATOR3(void, wkeSetString, wkeString string, const utf8* str, size_t len, "") \ - ITERATOR3(void, wkeSetStringWithoutNullTermination, wkeString string, const utf8* str, size_t len, "") \ - ITERATOR3(void, wkeSetStringW, wkeString string, const wchar_t* str, size_t len, "") \ - \ - ITERATOR2(wkeString, wkeCreateString, const utf8* str, size_t len, "") \ - ITERATOR2(wkeString, wkeCreateStringW, const wchar_t* str, size_t len, "") \ - ITERATOR2(wkeString, wkeCreateStringWithoutNullTermination, const utf8* str, size_t len, "") \ - ITERATOR1(size_t, wkeGetStringLen, wkeString str, "") \ - ITERATOR1(void, wkeDeleteString, wkeString str, "") \ - \ - ITERATOR0(wkeWebView, wkeGetWebViewForCurrentContext, "") \ - ITERATOR3(void, wkeSetUserKeyValue, wkeWebView webView, const char* key, void* value, "") \ - ITERATOR2(void*, wkeGetUserKeyValue, wkeWebView webView, const char* key, "") \ - \ - ITERATOR1(int, wkeGetCursorInfoType, wkeWebView webView, "") \ - ITERATOR2(void, wkeSetCursorInfoType, wkeWebView webView, int type, "") \ - ITERATOR5(void, wkeSetDragFiles, wkeWebView webView, const POINT* clintPos, const POINT* screenPos, wkeString* files, int filesCount, "") \ - \ - ITERATOR5(void, wkeSetDeviceParameter, wkeWebView webView, const char* device, const char* paramStr, int paramInt, float paramFloat, "") \ - ITERATOR1(wkeTempCallbackInfo*, wkeGetTempCallbackInfo, wkeWebView webView, "") \ - \ - ITERATOR3(void, wkeOnCaretChanged, wkeWebView webView, wkeCaretChangedCallback callback, void* callbackParam, "") \ - ITERATOR3(void, wkeOnMouseOverUrlChanged, wkeWebView webView, wkeTitleChangedCallback callback, void* callbackParam, "") \ - ITERATOR3(void, wkeOnTitleChanged, wkeWebView webView, wkeTitleChangedCallback callback, void* callbackParam, "") \ - ITERATOR3(void, wkeOnURLChanged, wkeWebView webView, wkeURLChangedCallback callback, void* callbackParam, "") \ - ITERATOR3(void, wkeOnURLChanged2, wkeWebView webView, wkeURLChangedCallback2 callback, void* callbackParam, "") \ - ITERATOR3(void, wkeOnPaintUpdated, wkeWebView webView, wkePaintUpdatedCallback callback, void* callbackParam, "") \ - ITERATOR3(void, wkeOnPaintBitUpdated, wkeWebView webView, wkePaintBitUpdatedCallback callback, void* callbackParam, "") \ - ITERATOR3(void, wkeOnAlertBox, wkeWebView webView, wkeAlertBoxCallback callback, void* callbackParam, "") \ - ITERATOR3(void, wkeOnConfirmBox, wkeWebView webView, wkeConfirmBoxCallback callback, void* callbackParam, "") \ - ITERATOR3(void, wkeOnPromptBox, wkeWebView webView, wkePromptBoxCallback callback, void* callbackParam, "") \ - ITERATOR3(void, wkeOnNavigation, wkeWebView webView, wkeNavigationCallback callback, void* param, "") \ - ITERATOR3(void, wkeOnCreateView, wkeWebView webView, wkeCreateViewCallback callback, void* param, "") \ - ITERATOR3(void, wkeOnDocumentReady, wkeWebView webView, wkeDocumentReadyCallback callback, void* param, "") \ - ITERATOR3(void, wkeOnDocumentReady2, wkeWebView webView, wkeDocumentReady2Callback callback, void* param, "") \ - ITERATOR3(void, wkeOnLoadingFinish, wkeWebView webView, wkeLoadingFinishCallback callback, void* param, "") \ - ITERATOR3(void, wkeOnDownload, wkeWebView webView, wkeDownloadCallback callback, void* param, "") \ - ITERATOR3(void, wkeOnDownload2, wkeWebView webView, wkeDownload2Callback callback, void* param, "") \ - ITERATOR3(void, wkeOnConsole, wkeWebView webView, wkeConsoleCallback callback, void* param, "") \ - ITERATOR3(void, wkeSetUIThreadCallback, wkeWebView webView, wkeCallUiThread callback, void* param, "") \ - ITERATOR3(void, wkeOnLoadUrlBegin, wkeWebView webView, wkeLoadUrlBeginCallback callback, void* callbackParam, "") \ - ITERATOR3(void, wkeOnLoadUrlEnd, wkeWebView webView, wkeLoadUrlEndCallback callback, void* callbackParam, "") \ - ITERATOR3(void, wkeOnLoadUrlHeadersReceived, wkeWebView webView, wkeLoadUrlHeadersReceivedCallback callback, void* callbackParam, "") \ - ITERATOR3(void, wkeOnLoadUrlFinish, wkeWebView webView, wkeLoadUrlFinishCallback callback, void* callbackParam, "") \ - ITERATOR3(void, wkeOnLoadUrlFail, wkeWebView webView, wkeLoadUrlFailCallback callback, void* callbackParam, "") \ - ITERATOR3(void, wkeOnDidCreateScriptContext, wkeWebView webView, wkeDidCreateScriptContextCallback callback, void* callbackParam, "") \ - ITERATOR3(void, wkeOnWillReleaseScriptContext, wkeWebView webView, wkeWillReleaseScriptContextCallback callback, void* callbackParam, "") \ - ITERATOR3(void, wkeOnWindowClosing, wkeWebView webWindow, wkeWindowClosingCallback callback, void* param, "") \ - ITERATOR3(void, wkeOnWindowDestroy, wkeWebView webWindow, wkeWindowDestroyCallback callback, void* param, "") \ - ITERATOR3(void, wkeOnDraggableRegionsChanged, wkeWebView webView, wkeDraggableRegionsChangedCallback callback, void* param, "") \ - ITERATOR3(void, wkeOnWillMediaLoad, wkeWebView webView, wkeWillMediaLoadCallback callback, void* param, "") \ - ITERATOR3(void, wkeOnStartDragging, wkeWebView webView, wkeStartDraggingCallback callback, void* param, "") \ - ITERATOR3(void, wkeOnPrint, wkeWebView webView, wkeOnPrintCallback callback, void* param, "") \ - ITERATOR4(void, wkeScreenshot, wkeWebView webView, const wkeScreenshotSettings* settings, wkeOnScreenshot callback, void* param, "") \ - \ - ITERATOR3(void, wkeOnOtherLoad, wkeWebView webView, wkeOnOtherLoadCallback callback, void* param, "") \ - ITERATOR3(void, wkeOnContextMenuItemClick, wkeWebView webView, wkeOnContextMenuItemClickCallback callback, void* param, "") \ - \ - ITERATOR1(BOOL, wkeIsProcessingUserGesture, wkeWebView webView, "") \ - \ - ITERATOR2(void, wkeNetSetMIMEType, wkeNetJob jobPtr, const char* type, "璁剧疆response鐨刴ime") \ - ITERATOR2(const char*, wkeNetGetMIMEType, wkeNetJob jobPtr, wkeString mime, "鑾峰彇response鐨刴ime") \ - ITERATOR1(const char*, wkeNetGetReferrer, wkeNetJob jobPtr, "鑾峰彇request鐨剅eferrer") \ - ITERATOR4(void, wkeNetSetHTTPHeaderField, wkeNetJob jobPtr, const wchar_t* key, const wchar_t* value, bool response, "") \ - ITERATOR2(const char*, wkeNetGetHTTPHeaderField, wkeNetJob jobPtr, const char* key, "") \ - ITERATOR2(const char*, wkeNetGetHTTPHeaderFieldFromResponse, wkeNetJob jobPtr, const char* key, "") \ - ITERATOR3(void, wkeNetSetData, wkeNetJob jobPtr, void* buf, int len, "璋冪敤姝ゅ嚱鏁板悗,缃戠粶灞傛敹鍒版暟鎹細瀛樺偍鍦ㄤ竴buf鍐,鎺ユ敹鏁版嵁瀹屾垚鍚庡搷搴擮nLoadUrlEnd浜嬩欢.#姝よ皟鐢ㄤ弗閲嶅奖鍝嶆ц兘,鎱庣敤" \ - "姝ゅ嚱鏁板拰wkeNetSetData鐨勫尯鍒槸锛寃keNetHookRequest浼氬湪鎺ュ彈鍒扮湡姝g綉缁滄暟鎹悗鍐嶈皟鐢ㄥ洖璋冿紝骞跺厑璁稿洖璋冧慨鏀圭綉缁滄暟鎹"\ - "鑰寃keNetSetData鏄湪缃戠粶鏁版嵁杩樻病鍙戦佺殑鏃跺欎慨鏀") \ - ITERATOR1(void, wkeNetHookRequest, wkeNetJob jobPtr, "") \ - ITERATOR3(void, wkeNetOnResponse, wkeWebView webView, wkeNetResponseCallback callback, void* param, "") \ - ITERATOR1(wkeRequestType, wkeNetGetRequestMethod, wkeNetJob jobPtr, "") \ - ITERATOR3(int, wkeNetGetFavicon, wkeWebView webView, wkeOnNetGetFaviconCallback callback, void* param, "") \ - \ - ITERATOR1(void, wkeNetContinueJob, wkeNetJob jobPtr, "")\ - ITERATOR1(const char*, wkeNetGetUrlByJob, wkeNetJob jobPtr, "")\ - ITERATOR1(const wkeSlist*, wkeNetGetRawHttpHead, wkeNetJob jobPtr, "")\ - ITERATOR1(const wkeSlist*, wkeNetGetRawResponseHead, wkeNetJob jobPtr, "")\ - \ - ITERATOR1(void, wkeNetCancelRequest, wkeNetJob jobPtr, "")\ - ITERATOR1(BOOL, wkeNetHoldJobToAsynCommit, wkeNetJob jobPtr, "")\ - ITERATOR2(void, wkeNetChangeRequestUrl, wkeNetJob jobPtr, const char* url, "")\ - \ - ITERATOR3(wkeWebUrlRequestPtr, wkeNetCreateWebUrlRequest, const utf8* url, const utf8* method, const utf8* mime, "")\ - ITERATOR1(wkeWebUrlRequestPtr, wkeNetCreateWebUrlRequest2, const blinkWebURLRequestPtr request, "")\ - ITERATOR2(blinkWebURLRequestPtr, wkeNetCopyWebUrlRequest, wkeNetJob jobPtr, bool needExtraData, "")\ - ITERATOR1(void, wkeNetDeleteBlinkWebURLRequestPtr, blinkWebURLRequestPtr request, "")\ - ITERATOR3(void, wkeNetAddHTTPHeaderFieldToUrlRequest, wkeWebUrlRequestPtr request, const utf8* name, const utf8* value, "")\ - ITERATOR4(int, wkeNetStartUrlRequest, wkeWebView webView, wkeWebUrlRequestPtr request, void* param, const wkeUrlRequestCallbacks* callbacks, "")\ - ITERATOR1(int, wkeNetGetHttpStatusCode, wkeWebUrlResponsePtr response, "")\ - ITERATOR1(__int64, wkeNetGetExpectedContentLength, wkeWebUrlResponsePtr response, "")\ - ITERATOR1(const utf8*, wkeNetGetResponseUrl, wkeWebUrlResponsePtr response, "")\ - ITERATOR1(void, wkeNetCancelWebUrlRequest, int requestId, "")\ - \ - ITERATOR1(wkePostBodyElements*, wkeNetGetPostBody, wkeNetJob jobPtr, "") \ - ITERATOR2(wkePostBodyElements*, wkeNetCreatePostBodyElements, wkeWebView webView, size_t length, "") \ - ITERATOR1(void, wkeNetFreePostBodyElements, wkePostBodyElements* elements, "") \ - ITERATOR1(wkePostBodyElement*, wkeNetCreatePostBodyElement, wkeWebView webView, "") \ - ITERATOR1(void, wkeNetFreePostBodyElement, wkePostBodyElement* element, "") \ - \ - ITERATOR9(wkeDownloadOpt, wkePopupDialogAndDownload, wkeWebView webviewHandle, const wkeDialogOptions* dialogOpt, \ - size_t expectedContentLength, const char* url, const char* mime, const char* disposition, wkeNetJob job,wkeNetJobDataBind* dataBind, wkeDownloadBind* callbackBind, "") \ - ITERATOR10(wkeDownloadOpt, wkeDownloadByPath, wkeWebView webviewHandle, const wkeDialogOptions* dialogOpt, const WCHAR* path, size_t expectedContentLength,const char* url, \ - const char* mime, const char* disposition, wkeNetJob job, wkeNetJobDataBind* dataBind, wkeDownloadBind* callbackBind, "") \ - \ - ITERATOR2(BOOL, wkeIsMainFrame, wkeWebView webView, wkeWebFrameHandle frameId, "") \ - ITERATOR2(BOOL, wkeIsWebRemoteFrame, wkeWebView webView, wkeWebFrameHandle frameId, "") \ - ITERATOR1(wkeWebFrameHandle, wkeWebFrameGetMainFrame, wkeWebView webView, "") \ - ITERATOR4(jsValue, wkeRunJsByFrame, wkeWebView webView, wkeWebFrameHandle frameId, const utf8* script, bool isInClosure, "") \ - ITERATOR3(void, wkeInsertCSSByFrame, wkeWebView webView, wkeWebFrameHandle frameId, const utf8* cssText, "") \ - \ - ITERATOR3(void, wkeWebFrameGetMainWorldScriptContext, wkeWebView webView, wkeWebFrameHandle webFrameId, v8ContextPtr contextOut, "") \ - \ - ITERATOR0(v8Isolate, wkeGetBlinkMainThreadIsolate, "") \ - \ - ITERATOR6(wkeWebView, wkeCreateWebWindow, wkeWindowType type, HWND parent, int x, int y, int width, int height, "") \ - ITERATOR1(wkeWebView, wkeCreateWebCustomWindow, const wkeWindowCreateInfo* info, "") \ - ITERATOR1(void, wkeDestroyWebWindow, wkeWebView webWindow, "") \ - ITERATOR1(HWND, wkeGetWindowHandle, wkeWebView webWindow, "") \ - \ - ITERATOR2(void, wkeShowWindow, wkeWebView webWindow, bool show, "") \ - ITERATOR2(void, wkeEnableWindow, wkeWebView webWindow, bool enable, "") \ - \ - ITERATOR5(void, wkeMoveWindow, wkeWebView webWindow, int x, int y, int width, int height, "") \ - ITERATOR1(void, wkeMoveToCenter, wkeWebView webWindow, "") \ - ITERATOR3(void, wkeResizeWindow, wkeWebView webWindow, int width, int height, "") \ - \ - ITERATOR6(wkeWebDragOperation, wkeDragTargetDragEnter, wkeWebView webView, const wkeWebDragData* webDragData, const POINT* clientPoint, const POINT* screenPoint, wkeWebDragOperationsMask operationsAllowed, int modifiers, "") \ - ITERATOR5(wkeWebDragOperation, wkeDragTargetDragOver, wkeWebView webView, const POINT* clientPoint, const POINT* screenPoint, wkeWebDragOperationsMask operationsAllowed, int modifiers, "") \ - ITERATOR1(void, wkeDragTargetDragLeave, wkeWebView webView, "") \ - ITERATOR4(void, wkeDragTargetDrop, wkeWebView webView, const POINT* clientPoint, const POINT* screenPoint, int modifiers, "") \ - ITERATOR4(void, wkeDragTargetEnd, wkeWebView webView, const POINT* clientPoint, const POINT* screenPoint, wkeWebDragOperation operation, "") \ - \ - ITERATOR1(void, wkeUtilSetUiCallback, wkeUiThreadPostTaskCallback callback, "") \ - ITERATOR1(const utf8*, wkeUtilSerializeToMHTML, wkeWebView webView, "") \ - ITERATOR3(const wkePdfDatas*, wkeUtilPrintToPdf, wkeWebView webView, wkeWebFrameHandle frameId, const wkePrintSettings* settings,"") \ - ITERATOR3(const wkeMemBuf*, wkePrintToBitmap, wkeWebView webView, wkeWebFrameHandle frameId, const wkeScreenshotSettings* settings,"") \ - ITERATOR1(void, wkeUtilRelasePrintPdfDatas, const wkePdfDatas* datas,"") \ - \ - ITERATOR2(void, wkeSetWindowTitle, wkeWebView webWindow, const utf8* title, "") \ - ITERATOR2(void, wkeSetWindowTitleW, wkeWebView webWindow, const wchar_t* title, "") \ - \ - ITERATOR3(void, wkeNodeOnCreateProcess, wkeWebView webView, wkeNodeOnCreateProcessCallback callback, void* param, "") \ - \ - ITERATOR4(void, wkeOnPluginFind, wkeWebView webView, const char* mime, wkeOnPluginFindCallback callback, void* param, "") \ - ITERATOR4(void, wkeAddNpapiPlugin, wkeWebView webView, void* initializeFunc, void* getEntryPointsFunc, void* shutdownFunc, "") \ - \ - ITERATOR4(void, wkePluginListBuilderAddPlugin, void* builder, const utf8* name, const utf8* description, const utf8* fileName, "") \ - ITERATOR3(void, wkePluginListBuilderAddMediaTypeToLastPlugin, void* builder, const utf8* name, const utf8* description, "") \ - ITERATOR2(void, wkePluginListBuilderAddFileExtensionToLastMediaType, void* builder, const utf8* fileExtension, "") \ - \ - ITERATOR1(wkeWebView, wkeGetWebViewByNData, void* ndata, "") \ - \ - ITERATOR5(BOOL, wkeRegisterEmbedderCustomElement, wkeWebView webView, wkeWebFrameHandle frameId, const char* name, void* options, void* outResult, "") \ - \ - ITERATOR3(void, wkeSetMediaPlayerFactory, wkeWebView webView, wkeMediaPlayerFactory factory, wkeOnIsMediaPlayerSupportsMIMEType callback, "") \ - \ - ITERATOR3(const utf8* , wkeGetContentAsMarkup, wkeWebView webView, wkeWebFrameHandle frame, size_t* size, "") \ - \ - ITERATOR1(const utf8*, wkeUtilDecodeURLEscape, const utf8* url, "") \ - ITERATOR1(const utf8*, wkeUtilEncodeURLEscape, const utf8* url, "") \ - ITERATOR1(const utf8*, wkeUtilBase64Encode, const utf8* str, "") \ - ITERATOR1(const utf8*, wkeUtilBase64Decode, const utf8* str, "") \ - ITERATOR1(const wkeMemBuf*, wkeUtilCreateV8Snapshot, const utf8* str, "") \ - \ - ITERATOR0(void, wkeRunMessageLoop, "") \ - \ - ITERATOR1(void, wkeSaveMemoryCache, wkeWebView webView, "") \ - \ - ITERATOR3(void, jsBindFunction, const char* name, jsNativeFunction fn, unsigned int argCount, "") \ - ITERATOR2(void, jsBindGetter, const char* name, jsNativeFunction fn, "") \ - ITERATOR2(void, jsBindSetter, const char* name, jsNativeFunction fn, "") \ - \ - ITERATOR4(void, wkeJsBindFunction, const char* name, wkeJsNativeFunction fn, void* param, unsigned int argCount, "") \ - ITERATOR3(void, wkeJsBindGetter, const char* name, wkeJsNativeFunction fn, void* param, "") \ - ITERATOR3(void, wkeJsBindSetter, const char* name, wkeJsNativeFunction fn, void* param, "") \ - \ - ITERATOR1(int, jsArgCount, jsExecState es, "") \ - ITERATOR2(jsType, jsArgType, jsExecState es, int argIdx, "") \ - ITERATOR2(jsValue, jsArg, jsExecState es, int argIdx, "") \ - \ - ITERATOR1(jsType, jsTypeOf, jsValue v, "") \ - ITERATOR1(BOOL, jsIsNumber, jsValue v, "") \ - ITERATOR1(BOOL, jsIsString, jsValue v, "") \ - ITERATOR1(BOOL, jsIsBoolean, jsValue v, "") \ - ITERATOR1(BOOL, jsIsObject, jsValue v, "") \ - ITERATOR1(BOOL, jsIsFunction, jsValue v, "") \ - ITERATOR1(BOOL, jsIsUndefined, jsValue v, "") \ - ITERATOR1(BOOL, jsIsNull, jsValue v, "") \ - ITERATOR1(BOOL, jsIsArray, jsValue v, "") \ - ITERATOR1(BOOL, jsIsTrue, jsValue v, "") \ - ITERATOR1(BOOL, jsIsFalse, jsValue v, "") \ - \ - ITERATOR2(int, jsToInt, jsExecState es, jsValue v, "") \ - ITERATOR2(float, jsToFloat, jsExecState es, jsValue v, "") \ - ITERATOR2(double, jsToDouble, jsExecState es, jsValue v, "") \ - ITERATOR2(const char*, jsToDoubleString, jsExecState es, jsValue v, "") \ - ITERATOR2(BOOL, jsToBoolean, jsExecState es, jsValue v, "") \ - ITERATOR3(jsValue, jsArrayBuffer, jsExecState es, const char* buffer, size_t size, "") \ - ITERATOR2(wkeMemBuf*, jsGetArrayBuffer, jsExecState es, jsValue value, "") \ - ITERATOR2(const utf8*, jsToTempString, jsExecState es, jsValue v, "") \ - ITERATOR2(const wchar_t*, jsToTempStringW, jsExecState es, jsValue v, "") \ - ITERATOR2(void*, jsToV8Value, jsExecState es, jsValue v, "return v8::Persistent*") \ - \ - ITERATOR1(jsValue, jsInt, int n, "") \ - ITERATOR1(jsValue, jsFloat, float f, "") \ - ITERATOR1(jsValue, jsDouble, double d, "") \ - ITERATOR1(jsValue, jsDoubleString, const char* str, "") \ - ITERATOR1(jsValue, jsBoolean, bool b, "") \ - \ - ITERATOR0(jsValue, jsUndefined, "") \ - ITERATOR0(jsValue, jsNull, "") \ - ITERATOR0(jsValue, jsTrue, "") \ - ITERATOR0(jsValue, jsFalse, "") \ - \ - ITERATOR2(jsValue, jsString, jsExecState es, const utf8* str, "") \ - ITERATOR2(jsValue, jsStringW, jsExecState es, const wchar_t* str, "") \ - ITERATOR1(jsValue, jsEmptyObject, jsExecState es, "") \ - ITERATOR1(jsValue, jsEmptyArray, jsExecState es, "") \ - \ - ITERATOR2(jsValue, jsObject, jsExecState es, jsData* obj, "") \ - ITERATOR2(jsValue, jsFunction, jsExecState es, jsData* obj, "") \ - ITERATOR2(jsData*, jsGetData, jsExecState es, jsValue object, "") \ - \ - ITERATOR3(jsValue, jsGet, jsExecState es, jsValue object, const char* prop, "") \ - ITERATOR4(void, jsSet, jsExecState es, jsValue object, const char* prop, jsValue v, "") \ - \ - ITERATOR3(jsValue, jsGetAt, jsExecState es, jsValue object, int index, "") \ - ITERATOR4(void, jsSetAt, jsExecState es, jsValue object, int index, jsValue v, "") \ - ITERATOR2(jsKeys*, jsGetKeys, jsExecState es, jsValue object, "") \ - ITERATOR2(BOOL, jsIsJsValueValid, jsExecState es, jsValue object, "") \ - ITERATOR1(BOOL, jsIsValidExecState, jsExecState es, "") \ - ITERATOR3(void, jsDeleteObjectProp, jsExecState es, jsValue object, const char* prop, "") \ - \ - ITERATOR2(int, jsGetLength, jsExecState es, jsValue object, "") \ - ITERATOR3(void, jsSetLength, jsExecState es, jsValue object, int length, "") \ - \ - ITERATOR1(jsValue, jsGlobalObject, jsExecState es, "") \ - ITERATOR1(wkeWebView, jsGetWebView, jsExecState es, "") \ - \ - ITERATOR2(jsValue, jsEval, jsExecState es, const utf8* str, "") \ - ITERATOR2(jsValue, jsEvalW, jsExecState es, const wchar_t* str, "") \ - ITERATOR3(jsValue, jsEvalExW, jsExecState es, const wchar_t* str, bool isInClosure, "") \ - \ - ITERATOR5(jsValue, jsCall, jsExecState es, jsValue func, jsValue thisObject, jsValue* args, int argCount, "") \ - ITERATOR4(jsValue, jsCallGlobal, jsExecState es, jsValue func, jsValue* args, int argCount, "") \ - \ - ITERATOR2(jsValue, jsGetGlobal, jsExecState es, const char* prop, "") \ - ITERATOR3(void, jsSetGlobal, jsExecState es, const char* prop, jsValue v, "") \ - \ - ITERATOR0(void, jsGC, "") \ - ITERATOR2(BOOL, jsAddRef, jsExecState es, jsValue val, "") \ - ITERATOR2(BOOL, jsReleaseRef, jsExecState es, jsValue val, "") \ - ITERATOR1(jsExceptionInfo*, jsGetLastErrorIfException, jsExecState es, "") \ - ITERATOR2(jsValue, jsThrowException, jsExecState es, const utf8* exception, "") \ - ITERATOR1(const utf8*, jsGetCallstack, jsExecState es, "") - -#if ENABLE_WKE == 1 - -WKE_EXTERN_C __declspec(dllexport) void WKE_CALL_TYPE wkeInit(); -WKE_EXTERN_C __declspec(dllexport) void WKE_CALL_TYPE wkeInitialize(); -WKE_EXTERN_C __declspec(dllexport) void WKE_CALL_TYPE wkeInitializeEx(const wkeSettings* settings); - -WKE_FOR_EACH_DEFINE_FUNCTION(WKE_DECLARE_ITERATOR0, WKE_DECLARE_ITERATOR1, WKE_DECLARE_ITERATOR2, \ - WKE_DECLARE_ITERATOR3, WKE_DECLARE_ITERATOR4, WKE_DECLARE_ITERATOR5, WKE_DECLARE_ITERATOR6, WKE_DECLARE_ITERATOR9, WKE_DECLARE_ITERATOR10, WKE_DECLARE_ITERATOR11) - -#else - -WKE_FOR_EACH_DEFINE_FUNCTION(WKE_DEFINE_ITERATOR0, WKE_DEFINE_ITERATOR1, WKE_DEFINE_ITERATOR2, \ - WKE_DEFINE_ITERATOR3, WKE_DEFINE_ITERATOR4, WKE_DEFINE_ITERATOR5, WKE_DEFINE_ITERATOR6, WKE_DEFINE_ITERATOR9, WKE_DEFINE_ITERATOR10, WKE_DEFINE_ITERATOR11) - -typedef void (WKE_CALL_TYPE *FN_wkeInitializeEx)(const wkeSettings* settings); - -__declspec(selectany) const wchar_t* s_wkeDllPath = L"node.dll"; -__declspec(selectany) HMODULE s_wkeMainDllHandle = NULL; - -inline void wkeSetWkeDllHandle(const HMODULE mainDllHandle) -{ - s_wkeMainDllHandle = mainDllHandle; -} - -inline void wkeSetWkeDllPath(const wchar_t* dllPath) -{ - s_wkeDllPath = dllPath; -} - -inline int wkeInitializeEx(const wkeSettings* settings) -{ - HMODULE hMod = s_wkeMainDllHandle; - if (!hMod) - hMod = LoadLibraryW(s_wkeDllPath); - if (hMod) { - FN_wkeInitializeEx wkeInitializeExFunc = (FN_wkeInitializeEx)GetProcAddress(hMod, "wkeInitializeEx"); - wkeInitializeExFunc(settings); - - WKE_FOR_EACH_DEFINE_FUNCTION(WKE_GET_PTR_ITERATOR0, WKE_GET_PTR_ITERATOR1, WKE_GET_PTR_ITERATOR2, WKE_GET_PTR_ITERATOR3, \ - WKE_GET_PTR_ITERATOR4, WKE_GET_PTR_ITERATOR5, WKE_GET_PTR_ITERATOR6, WKE_GET_PTR_ITERATOR9, WKE_GET_PTR_ITERATOR10, WKE_GET_PTR_ITERATOR11); - return 1; - } - return 0; -} - -inline int wkeInit() -{ - return wkeInitializeEx(((const wkeSettings*)0)); -} - -inline int wkeInitialize() -{ - return wkeInitializeEx(((const wkeSettings*)0)); -} - -#endif - - - -#endif // WKE_DEFINE_H - diff --git a/identifier.sqlite b/identifier.sqlite index 0cc5f638f0812bb51d3b02ac292060edc9d9e54e..9a7b6ee546d065c24991b2566b0257e220a5fa8f 100644 GIT binary patch literal 28672 zcmeI4`%fF$701Vzhiw=pk#UKOXa*`Pp*RNHgs{nWv&3-{5+DK0W>K6tW6#CRGM;f} z#w4VwDw>jHD`j6=ZPcpOcKgfHs!H1Kb{|2T{*?aER@#+TT7IikDF!N4Rn_(n=(+R4 zHjsqus+E#E^5B_s?|jd>pL6GWY-aA*$e^Ghc2ZVyoW@3}ZIr`7JV-LP~vhM93m@1Hnnll z3{q4@*^z-GN8*jY3oJX&WkQ;>+inDBJKh5i-X4X;kv-YdJ|6}GOf zIU04$XYDF>_W5i|%jI#b6{fnfus5jS+3jIr5qSI;FIF2QS!1PwDC)(yAg>5HPMKw= z(JadqG+B_K2SAWoP_KgfC$7e_xJ8Cd~t6>gnB`Q zZ_AL~3k4))P{ppZte005?#4YV2uF6z)m7^mo*S{xAQ*G`i=3io+uE)!Q`0kS6@7K5 zyZy1stT2CK-e-QwTxCRNlsRA*kPSkB5Fi8y0YZQfAOr{jLVyq;1PB2_;OQpdb9pE) z<9EB=E(iSfwx>A%!TrUz_#JiFywf(@KOZqWYBwoq^wm^IU7cU~xh$ zH1iLtnz>6ce`P*n{>9v7ZZbEY?zEED69R+)AwUQa0)zk|KnM^5ga9Ex2oM7QGXn69 z-0vv8-y>z*TjOe|aklCO_`aO@wpwSPteT5)Is-0zpmnc6eU-D7!UlYw5X4_yrZ7h1 zCT-K(h41qx3n4%V5CVh%AwUQa0)zk|KnM^5ga9Ex2t0uVX!k#`GsfL{h#XJJOAxG@&qCvP5OTjm<=^i4%+Rfckc9h zt0}K9?v2w_MB--BoU(fBot0ZRi$7X`XRQ=1!-<)2s2hI7;y?drC)~aw=aJL}?_GBB z+Exf%Lg7es(_(cdJ2%*deY^bh(2#Gaw$?{~7k&m~Oy4n)Q>XBR80=|5;^m7fyYlk& z<)8eD?G8oYwQr;Hxo;iP6}@z4XV+1zDC>$4WAVl-_dmL`{JU3I-@OhEs@M%jd&AH4 zfv&Z2tiWAF0-HdYDM^OM2?eCGF*y`u2Q@xKz58p53T%@cuJ3;aIopAM(u?g+o>Jtj z!sXZ_f{4_lp^!YJKnuiF z{Lhf%OEz=9f^h_n-)ZS_CqQYPF_#4Nml2o|C|b#&1Gul%YrC!FoY>+QoaP#dwbZ+Q+r~=9YdQJ^@QORg7OQ)hHk*?#Zwgd zXrYUu-PJIlg@ch`G}s&57wijW^o3vI{(x~D-rqGQ7ZiAiv+LyKq>w@Vsw%)hA!%KQ zQM!;V|3sP6w7j~%t1Hb3d?A#Pb7xQJF8zMnB@He;#>ZDra4-0LNxc9se(9`#>;6t3 zHROE^W3~v(!!xA#)3FB{6N&I&{Q14D3)kPHs$U#4aJ80+y8u@-h(qrSN)o@spWeFq z#Ap-chViJaOxex@&cgIGNPD*~eQv}Ex~&YjvrKzNU-+d=)zKL%U9X|Q$r@5GWr#C()t1? z*v!_OaBgs;^j6s(Fd#0Sffv7YKEHMS#thX6>p6_6wX6{y@L~1)FLTPy9>*=HxS(}E z?1FabOc4Bk$qU+J1K^r+wNZfpzLfX1Q7{g=p9SGmj+3}7TK;gc_`{zW_lcKo!!!kx zxK=?Qq~Wsp)GPoFfV3kTnW>lnUf|ONDrEFUy3Ln7M|Nrq8SqK3_fDj-A2mwNX z5Fi8y0YZQfAOr{jLf{D`fWQB{n0QUu{C{Vd_!HPv(j-EF5Fi8y0YZQfAOr{jLVyq; z1PB2_;IRla;Ryg~m{iZ+FlGWYCjxB569Li;o(K@%myl+f@%(?ZJu{#^F<@h36Q2JM iE13eu^nY{{p8s#nY)=2z(1hpzTQi%}|2^LPfByxjo)%32 literal 24576 zcmeI4UrZax8NhA+8!(%bYZ01IHr#Q+1r~d4{;bP>@A`Jv z1QJ!P+ap{~;*zUQ7p3BQjZ`)0bb@Q|dP##WeW=uzzErxZFI68ZVVk`4srTNQ-5rCC zog>k;r>0|J@9g*O%zWQ(zWF>hJDv!S2pXX0WF^6CwAXUPVzpYnP16>OWe`4V;1fR_ zuuz3h;L*CTT&_51VWL)hW0R%YwpvM@u>XZpZL1A$mAjnC2?0WY5Fi8y0YZQf_`f0W zT5WZ0b8D-0mDl)L5iBHPGYKH2@Uc2D9vq4U>B!L8ks#fU#qD%weY+5Ar)fdbz&uds zvGL*1(D*ccF*r>RO-3#akHVUv;An&%y#$|=BO~4Q?W(M3dv&0IPbO#dW)^uR8t0Wx z4?F0Ba#4;h0Mz`fEQ^4bph#Oz0w};2vVHyN!YB{BmzCwhR!pVDCrVV26=8m+v}zG3 zsvt}Iy7B0}#K7WynPFp80kHEKP0%|T9*qPq1jnICDYb-9PVQ^KG;b~?MGs1oycXXt zb^CN8DMc)n=E>G~)1o{t=h=ANtk2aAhepr@UYtqFDlEuSUeD@n(yGR5DHS7jU9Hgr zAw8TA1XZ5X(1@dB&A~uGVm%P@qi8}nTrikJ5D9)KQtyI``ahyDyf&ThorK|DwEu5} zq3g#lSJpOnbXZ@T%8w$RpeT-Tx#D0fVbxw@d7@Y{lLLw+ls))afMyFirOyS=4^56l z=#xDsp=w{y6={sw0BhlnaYZ+*Ca5zi5J41WuVTH&(1VyzPOHfpkL)R~iCQ*O;sI5? zYpkNCxvR@+ObGQ=5q?^RM!cE=QWO-ORu%v)Qg$MryJ1aNy0%Imo^&`rJTT|RF7t|> z_i?$Zpfx?`W7U^8-7R+b7F$Q1vQRndPt?cMyVNyGq{g9uJO}|ofDj-A2mwNX5Fi8y z0YZQfAOr{jLI4qP*40}aREy1KtFyxI-g+`CpX_YE6FXXq#BF);?&|xQ&7bZ3?mBg} zri`Y^SzXlBwUykbn|5bap*Z)^c5eH7`+}j%sU$21TW@L{Q*#pp571=j8 zcGqsUR5V+m&Y|mUP{)g6W@Y2iPc|s@`M;X_&_ex_`UmxA>LDzW2O&TR5CVh%AwUQa z0)zk|KnM^5ga9Ex2zg=15g#hkk}{+^C}}D?93t9^Wg_P*K@x!M6_` zu@+yCKL5j;{?VgCeHxheu)+P?0y@(eML?JsTUr5 z^Xk141D1e?^_Equi}UG`6R7XH7JDe<4As;)?LUCifHM0Ih`bs{KZrq32~teHtkSvb zuV>dkpxq1${|3HDk1qS7Ypiv@uvpfQNY?3FOA!B2w1+S7EpAMa=M_FdpBF@+at9hY zC_&Cz(-(T2$Q_6M^y#i1t)z-axXj3Kj`aY z%;Vl=Dx)wmbJg~nq_y`m4cU#Jrrnb&+_A~MG{p@iljqC8_a<^8pTR+|XbZck(lgFr7 z5957|8r%N3c|dnA4feaZi@chIQMRy5kMOhm&W0pS=y^p@;1*ic8OJXsQ-a}5n@gYO z4!hs)^doNoc4ku46n=Q(5+l*T;GX`aSHi1iG3SQi6V+t+Dr@d#ImY^L>aM{@t4sY#$YpgMkj_RIP{|1 zw(z29+H=o!d5~#muxVi}tQF;rNF2~%jSk3(Brn0}(_&?^U|8cqFx6^6;^E%V2;4Gn zfSBkoC)Lo9nbbVEyL^U3={W=va0`8@tX7~YGH(V}^@mDrMQw3&Mt3^%rbf$Y zV`8ox`51+v2~fXH+Swo$o}@m?%mhnDzfO*+vgqh z`@M{Ld@03W1_B)c(YPeTUvLnB3THdhjix$t7^^v>1@5c@SBpR~Pt7yK)aTpwOx2eH zDQs%qS7-pAP>W8BCi|W?AS+2((V3JCyABAT&T~LmJdx8?-!M7+r+O&43exT3270atNhTUkSigVF zw8G(VI*^~!*v|`s2LD)?ir}Hx`jTzK>$q|FqXfJPMr94COk7Kd*7S?5W*1&>^Caqm z$6e65yB|JUUCY6bI5)2ucl4JK>8UCAs~eenKhJEWv$r>mr54Ol+4Zfb%rH|xn2&2- vHwVKV7W6TPR^k8uqY`-#0)zk|KnM^5ga9Ex2oM5<03kpK5CVk2Gf3dyHZs)j