test cases.
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -20,17 +20,17 @@
|
||||
;; FFI Library
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(define lib-type 'debug)
|
||||
|
||||
(define-runtime-path lib-dir "lib")
|
||||
|
||||
(define libname (let ((os (system-type 'os*)))
|
||||
(cond ((eq? os 'windows) "dll/webui-2.dll")
|
||||
(cond ((eq? os 'windows) (format "dll/webui-2-~a.dll" lib-type))
|
||||
(else (error (format "OS ~a not supported" os)))))
|
||||
)
|
||||
|
||||
(define webui-lib-file (build-path lib-dir libname))
|
||||
|
||||
(set! webui-lib-file "C:/devel/racket/racket-webui/webui/build/Debug/webui-2.dll")
|
||||
|
||||
|
||||
(define webui-lib (ffi-lib webui-lib-file))
|
||||
(define-ffi-definer define-webui webui-lib)
|
||||
@@ -280,6 +280,9 @@
|
||||
;WEBUI_EXPORT bool webui_show_browser(size_t window, const char* content, size_t browser);
|
||||
(define-webui webui_show_browser (_fun _size_t _string/utf-8 _size_t -> _int))
|
||||
|
||||
;WEBUI_EXPORT bool webui_show_wv(size_t window, const char* content);
|
||||
(define-webui webui_show_wv (_fun _size_t _string/utf-8 -> _int))
|
||||
|
||||
;WEBUI_EXPORT void webui_exit(void);
|
||||
(define-webui webui_exit (_fun -> _void))
|
||||
|
||||
@@ -327,7 +330,7 @@
|
||||
(define-webui webui_set_logger
|
||||
(_fun
|
||||
(_fun #:async-apply log-applier
|
||||
_size_t _string/utf-8 _pointer -> _void)
|
||||
_size_t _bytes _pointer -> _void)
|
||||
_pointer -> _void))
|
||||
|
||||
;WEBUI_EXPORT const char* webui_start_server(size_t window, const char* content);
|
||||
@@ -406,6 +409,12 @@
|
||||
(run-async-wait)
|
||||
)
|
||||
|
||||
(define (webui-show-wv win html)
|
||||
(webui_show_wv win html)
|
||||
(run-async-wait)
|
||||
)
|
||||
|
||||
|
||||
(define (webui-run win js)
|
||||
(webui_run win js))
|
||||
|
||||
@@ -494,7 +503,7 @@
|
||||
(tm)
|
||||
(webui-set-root-folder win "c:/devel/racket/racket-webui")
|
||||
(tm)
|
||||
;(webui_set_file_handler_window win fh-callback)
|
||||
(webui_set_file_handler_window win fh-callback)
|
||||
(tm)
|
||||
(webui-register-onload-callback
|
||||
win
|
||||
@@ -513,7 +522,8 @@
|
||||
(tm)
|
||||
;(displayln (webui-start-server win "test.html"))
|
||||
(tm)
|
||||
(webui-show-browser win "test.html")
|
||||
;(webui-show-browser win "test.html")
|
||||
(webui-show-wv win "test.html")
|
||||
(tm)
|
||||
)
|
||||
)
|
||||
@@ -521,5 +531,6 @@
|
||||
|
||||
(define (test-close)
|
||||
(webui-close win)
|
||||
(webui-destroy win))
|
||||
;(webui-destroy win) ;;; Hmm. Crashes in debug mode
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user