-
This commit is contained in:
@@ -3,31 +3,16 @@
|
||||
|
||||
#include "rktwebview_qt_global.h"
|
||||
|
||||
#define CONTEXT_QUIT -2
|
||||
#define CONTEXT_NIL -1
|
||||
#define CONTEXT_INVALID 0
|
||||
#define CONTEXT_BOUND_EVENT 1
|
||||
#define CONTEXT_WINDOW_RESIZE 2
|
||||
#define CONTEXT_WINDOW_MOVE 3
|
||||
#define CONTEXT_WINDOW_CAN_CLOSE 4
|
||||
#define CONTEXT_WINDOW_CLOSED 5
|
||||
#define CONTEXT_SET_HTML 6
|
||||
#define CONTEXT_NAVIGATE 7
|
||||
#define CONTEXT_EVAL_JS 8
|
||||
#define CONTEXT_OPEN_DEVTOOLS 9
|
||||
#define CONTEXT_CALL_JS 10
|
||||
#define CONTEXT_CMD_CLOSE 11
|
||||
#define CONTEXT_CMD_CREATE_VIEW 12
|
||||
|
||||
extern "C" {
|
||||
|
||||
typedef int rktwebview_t;
|
||||
|
||||
typedef struct {
|
||||
rktwebview_t wv;
|
||||
int context;
|
||||
char *data;
|
||||
} item_t;
|
||||
char *event;
|
||||
} rkt_event_t;
|
||||
|
||||
typedef void (*event_cb_t)(rkt_event_t *);
|
||||
|
||||
typedef enum {
|
||||
no_result_yet = -1,
|
||||
@@ -42,15 +27,29 @@ typedef enum {
|
||||
webview_invalid_state = 8,
|
||||
webview_invalid_argument = 9,
|
||||
webview_unspecified = 10,
|
||||
webview_dispatch_failed = 11
|
||||
webview_dispatch_failed = 11,
|
||||
move_failed = 12,
|
||||
resize_failed = 13
|
||||
} result_t;
|
||||
|
||||
RKTWEBVIEW_QT_EXPORT void rkt_webview_init();
|
||||
RKTWEBVIEW_QT_EXPORT void rkt_webview_process_events(int for_ms);
|
||||
RKTWEBVIEW_QT_EXPORT int rkt_webview_create(int parent, void (*js_event_cb)(const char *msg));
|
||||
RKTWEBVIEW_QT_EXPORT void rkt_webview_close(int wv);
|
||||
RKTWEBVIEW_QT_EXPORT result_t rkt_webview_set_url(int wv, const char *url);
|
||||
RKTWEBVIEW_QT_EXPORT result_t rkt_webview_set_html(int wv, const char *html);
|
||||
|
||||
RKTWEBVIEW_QT_EXPORT int rkt_webview_create(rktwebview_t parent, event_cb_t js_event_cb);
|
||||
RKTWEBVIEW_QT_EXPORT void rkt_webview_close(rktwebview_t wv);
|
||||
RKTWEBVIEW_QT_EXPORT bool rkt_webview_valid(rktwebview_t wv);
|
||||
|
||||
|
||||
RKTWEBVIEW_QT_EXPORT result_t rkt_webview_set_url(rktwebview_t wv, const char *url);
|
||||
RKTWEBVIEW_QT_EXPORT result_t rkt_webview_set_html(rktwebview_t wv, const char *html);
|
||||
|
||||
RKTWEBVIEW_QT_EXPORT result_t rkt_webview_run_js(rktwebview_t wv, const char *js);
|
||||
RKTWEBVIEW_QT_EXPORT result_t rkt_webview_open_devtools(rktwebview_t wv);
|
||||
|
||||
RKTWEBVIEW_QT_EXPORT result_t rkt_webview_destroy_event(rkt_event_t *e);
|
||||
|
||||
RKTWEBVIEW_QT_EXPORT result_t rkt_webview_move(rktwebview_t w, int x, int y);
|
||||
RKTWEBVIEW_QT_EXPORT result_t rkt_webview_resize(rktwebview_t w, int width, int height);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user