This commit is contained in:
2026-03-25 01:27:39 +01:00
parent eb4e15c66b
commit 8fe7e726a4
26 changed files with 1896 additions and 517 deletions

View File

@@ -1,9 +1,8 @@
#ifndef RKTWEBVIEW_QT_H
#define RKTWEBVIEW_QT_H
#include "rktwebview_qt_global.h"
#include "rktwebview_internal.h"
#include "rktutils.h"
#include "rktwebview_types.h"
#include <QApplication>
#include <QWebEngineView>
@@ -21,7 +20,7 @@ class WebviewWindow;
class Command;
class CommandEvent;
class RKTWEBVIEW_QT_EXPORT Rktwebview_qt : public QObject
class Rktwebview_qt : public QObject
{
Q_OBJECT
private:
@@ -39,7 +38,7 @@ private:
QTimer _evt_loop_timer;
int _argc;
char *_argv[1];
char **_argv;
private:
void runJs(rktwebview_t wv, const char *js);
@@ -71,7 +70,7 @@ public:
int nextHandle();
public:
rkt_wv_context_t newContext(const char *boilerplate_js, const char *optional_server_cert_pem);
rkt_wv_context_t newContext(const QString &boilerplate_js, bool has_pem, const QString &optional_server_cert_pem);
int rktWebViewCreate(rkt_wv_context_t context, rktwebview_t parent, event_cb_t js_evt_cb);
void rktWebViewClose(int wv);
void rktSetOUToken(rktwebview_t wv, const char *ou_token);
@@ -79,7 +78,7 @@ public:
result_t rktOpenDevtools(rktwebview_t wv);
result_t rktSetUrl(rktwebview_t wv, const char *url);
result_t rktSetHtml(rktwebview_t wv, const char *html);
result_t rktRunJs(rktwebview_t wv, const char *js);
result_t rktRunJs(rktwebview_t wv, const QString &js);
rkt_data_t *rktCallJs(rktwebview_t wv, const char *js);
result_t rktMove(rktwebview_t wv, int x, int y);
@@ -92,6 +91,8 @@ public:
result_t rktShowNormalWindow(rktwebview_t w);
window_state_t rktWindowState(rktwebview_t w);
void rktQuit();
result_t rktChooseDir(rktwebview_t w, const char *title, const char *base_dir);
result_t rktFileOpen(rktwebview_t w, const char *title, const char *base_dir, const char *permitted_exts);
result_t rktFileSave(rktwebview_t w, const char *title, const char *base_dir, const char *permitted_exts);
@@ -117,7 +118,7 @@ public:
void runCommandThread();
public:
Rktwebview_qt();
Rktwebview_qt(int argc, char *argv[]);
~Rktwebview_qt();
};