Windows...
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -4,6 +4,7 @@
|
|||||||
ffi/unsafe/define
|
ffi/unsafe/define
|
||||||
ffi/unsafe/atomic
|
ffi/unsafe/atomic
|
||||||
ffi/unsafe/os-thread
|
ffi/unsafe/os-thread
|
||||||
|
ffi/unsafe/cvector
|
||||||
racket/async-channel
|
racket/async-channel
|
||||||
racket/runtime-path
|
racket/runtime-path
|
||||||
racket/port
|
racket/port
|
||||||
@@ -131,35 +132,6 @@
|
|||||||
"QtWebEngineProcess.exe"
|
"QtWebEngineProcess.exe"
|
||||||
"QtWebEngineProcess"))
|
"QtWebEngineProcess"))
|
||||||
|
|
||||||
(set! quiet-call
|
|
||||||
(when (or (eq? os 'windows) (eq? os 'linux))
|
|
||||||
(putenv "QT_PLUGIN_PATH"
|
|
||||||
(path->string (build-path os-lib-dir)))
|
|
||||||
(putenv "QTWEBENGINEPROCESS_PATH"
|
|
||||||
(path->string (build-path os-lib-dir webengine-process)))
|
|
||||||
(putenv "QTWEBENGINE_RESOURCES_PATH"
|
|
||||||
(path->string (build-path os-lib-dir "resources")))
|
|
||||||
(putenv "QTWEBENGINE_LOCALES_PATH"
|
|
||||||
(path->string (build-path os-lib-dir "translations" "qtwebengine_locales")))
|
|
||||||
(putenv "RKT_WEBVIEW_PRG"
|
|
||||||
(let ((p
|
|
||||||
(path->string (build-path os-lib-dir rktwebview-prg)))
|
|
||||||
)
|
|
||||||
(displayln p)
|
|
||||||
p
|
|
||||||
))
|
|
||||||
(when (eq? os 'linux)
|
|
||||||
(putenv "QT_QPA_PLATFORM" "xcb")
|
|
||||||
(putenv "LD_LIBRARY_PATH"
|
|
||||||
(string-append
|
|
||||||
(path->string (build-path os-lib-dir)) ":"
|
|
||||||
(path->string (build-path os-lib-dir "platforms"))
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
;;; Preload libraries
|
;;; Preload libraries
|
||||||
|
|
||||||
#|
|
#|
|
||||||
@@ -209,6 +181,8 @@
|
|||||||
|
|
||||||
(define-ffi-definer define-rktwebview webview-lib)
|
(define-ffi-definer define-rktwebview webview-lib)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; Callbacks from the OS library
|
;;; Callbacks from the OS library
|
||||||
|
|
||||||
;(define callback-box (box '()))
|
;(define callback-box (box '()))
|
||||||
@@ -300,6 +274,9 @@
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
;RKTWEBVIEW_EXPORT void rkt_webview_env(const char *env_cmds[]);
|
||||||
|
(define-rktwebview rkt_webview_env
|
||||||
|
(_fun _cvector -> _void))
|
||||||
|
|
||||||
;RKTWEBVIEW_QT_EXPORT void rkt_webview_init(int &argc, char **argv);
|
;RKTWEBVIEW_QT_EXPORT void rkt_webview_init(int &argc, char **argv);
|
||||||
(define-rktwebview rkt_webview_init
|
(define-rktwebview rkt_webview_init
|
||||||
@@ -458,6 +435,34 @@
|
|||||||
; 'done)))))
|
; 'done)))))
|
||||||
; (f)))))
|
; (f)))))
|
||||||
|
|
||||||
|
(define rkt_env
|
||||||
|
(when (or (eq? os 'windows) (eq? os 'linux))
|
||||||
|
(let ((env (list (string-append "QT_PLUGIN_PATH=" (path->string (build-path os-lib-dir)))
|
||||||
|
(string-append "QTWEBENGINEPROCESS_PATH=" (path->string (build-path os-lib-dir webengine-process)))
|
||||||
|
(string-append "QTWEBENGINE_RESOURCES_PATH=" (path->string (build-path os-lib-dir "resources")))
|
||||||
|
(string-append "QTWEBENGINE_LOCALES_PATH=" (path->string (build-path os-lib-dir "translations" "qtwebengine_locales")))
|
||||||
|
(string-append "RKT_WEBVIEW_PRG=" (path->string (build-path os-lib-dir rktwebview-prg))))))
|
||||||
|
(when (eq? os 'linux)
|
||||||
|
(set! env (append
|
||||||
|
env
|
||||||
|
(list
|
||||||
|
(string-append "QT_QPA_PLATFORM=" "xcb")
|
||||||
|
(string-append "LD_LIBRARY_PATH="
|
||||||
|
(string-append
|
||||||
|
(path->string (build-path os-lib-dir)) ":"
|
||||||
|
(path->string (build-path os-lib-dir "platforms"))
|
||||||
|
)))))
|
||||||
|
)
|
||||||
|
(append env (list #f)))))
|
||||||
|
|
||||||
|
;(define env_array (_array _string/utf-8 (length rkt_env)))
|
||||||
|
|
||||||
|
;(let ((i 0))
|
||||||
|
; (while (< i (length rkt_env))
|
||||||
|
; (array-set! env_array i (list-ref rkt_env i))
|
||||||
|
; (set! i (+ i 1))))
|
||||||
|
|
||||||
|
(rkt_webview_env (list->cvector rkt_env _string/utf-8))
|
||||||
(rkt_webview_init)
|
(rkt_webview_init)
|
||||||
|
|
||||||
|
|
||||||
@@ -493,7 +498,7 @@
|
|||||||
(set! waiting (- waiting 1))
|
(set! waiting (- waiting 1))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
(sleep 0.001)
|
(sleep 0.005)
|
||||||
(f))
|
(f))
|
||||||
))
|
))
|
||||||
(f)))
|
(f)))
|
||||||
|
|||||||
@@ -526,3 +526,15 @@ rkt_data_t *rkt_webview_get_event()
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void rkt_webview_env(const char *env_cmds[])
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for(i = 0; env_cmds[i] != nullptr && strcmp(env_cmds[i], "") != 0; i++) {
|
||||||
|
#ifdef WIN32
|
||||||
|
_putenv(env_cmds[i]);
|
||||||
|
#else
|
||||||
|
putenv(env_cmds[i]);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
|
RKTWEBVIEW_EXPORT void rkt_webview_env(const char *env_cmds[]);
|
||||||
RKTWEBVIEW_EXPORT void rkt_webview_init();
|
RKTWEBVIEW_EXPORT void rkt_webview_init();
|
||||||
RKTWEBVIEW_EXPORT void rkt_webview_cleanup();
|
RKTWEBVIEW_EXPORT void rkt_webview_cleanup();
|
||||||
//RKTWEBVIEW_EXPORT void rkt_webview_process_events(int for_ms);
|
//RKTWEBVIEW_EXPORT void rkt_webview_process_events(int for_ms);
|
||||||
|
|||||||
Reference in New Issue
Block a user