Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/as400jplpc/nim_webwsi
webview and socket and interactif
https://github.com/as400jplpc/nim_webwsi
nim socket-io webkit2gtk webview
Last synced: 10 days ago
JSON representation
webview and socket and interactif
- Host: GitHub
- URL: https://github.com/as400jplpc/nim_webwsi
- Owner: AS400JPLPC
- Created: 2020-12-10T14:08:45.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-21T17:35:09.000Z (over 3 years ago)
- Last Synced: 2024-11-28T10:30:12.050Z (2 months ago)
- Topics: nim, socket-io, webkit2gtk, webview
- Language: HTML
- Homepage:
- Size: 4.97 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nim_websi
**webview and socket and interactif**
Nim bindings for zserge's Webview which is an excellent cross-platform single header webview library for C/C++ using Gtk
thank-you [oskca](https://github.com/oskca/webview) Your work inspired me a lot
require
thank-you [https://github.com/treeform/ws](https://github.com/treeform/ws)
**Linux**→ JavaScriptCore/JavaScript.h
→ gtk/gtk.h
→ webkit2/webkit2.h
→ X11/Xlib.h
→ glib.h
→ {.passL: staticExec"pkg-config --libs gtk+-3.0 webkit2gtk-4.0".}
→ **update** :2021/04/21 version save WEBWSI_Hold.tar.gz in inject_css and set_font
→ **update** :2021/04/21 delete inject_css and set_font
** fonction:
Allows you to process a web page as we practice with ex (Apache) but with the webview principle.
With a web-socket type interaction.the possibility of having 3 distinctive screens (session):
– the base page (new a window)
– a modal page (new a window)
– a dialog page (new a window)
Each of these pages works like a web page processed with a browser.
But nothing is worth an example folder :"NimWeb"
the folder for WScode / CODIUM is present in the NimWeb folder
you have an example of compilation with compil.sh
executable option-> no-piedownload in .nimble folder "webwsi-0.1.0"
image :
img : [EXEMPLE](https://github.com/AS400JPLPC/nim_webwsi/blob/master/exemple.png)source:
src : [EXEMPLE](https://github.com/AS400JPLPC/nim_webwsi/blob/master/NimWeb/ecr00.nim)**Procs**
proc init(w: webwsi): cint {...}
proc loop(w: webwsi; blocking: cint): cint {...}
proc eval(w: webwsi; js: cstring): cint {...}
proc setTitle(w: webwsi; title: cstring) {...}
proc setAltF4(w: webwsi; hint: bool) {...}
proc showInit(w: webwsi) {...}
proc setDestroy(w: webwsi) {...}
proc setDeletable(w: webwsi; hint: bool) {...}
proc setTaskBar(w: webwsi; hint: bool) {...}
proc setResizable(w: webwsi; hint: bool) {...}
proc setFocus(w: webwsi) {...}
proc setFullscreen(w: webwsi) {...}
proc setColor(w: webwsi; r, g, b, a: uint8) {...}
proc terminate(w: webwsi) {...}
proc exit(w: webwsi) {...}
proc debug(format: cstring) {...}
proc printLog(s: cstring) {...}
proc fullscreen(w: webwsi) {...}
proc chgUrl(w: webwsi; url: cstring) {...}
proc setMessage(w: webwsi; flags: cint; title: cstring; arg: cstring) {...}
proc showModal(w: webwsi; url: cstring) {...}
proc hideModal(w: webwsi) {...}
proc showDialog(w: webwsi; url: cstring) {...}
proc hideDialog(w: webwsi) {...}
proc showWindow(w: webwsi; r: webwsi) {...}
proc externalInvokeCB=(w: webwsi; cb: ExternalInvokeCb) {...}
Set external invoke callback for webwsi
proc newwebwsi(title = "webwsi"; url = ""; width = 0; height = 0;
resizable = true; debug = false; cb: ExternalInvokeCb = nil): webwsi {...}newwebwsi creates and opens a new webwsi window using the given settings. This function will do webwsi init
proc dispatch(w: webwsi; fn: DispatchFn) {...}
proc info(w: webwsi; msg: string) {...}
Show one alert box
proc warn(w: webwsi; msg: string) {...}
proc erreur(w: webwsi; msg: string) {...}
proc query(w: webwsi; msg: string) {...}
proc msg(w: webwsi; title, msg: string) {...}
Show one message box
proc run(w: webwsi) {...}
run starts the main UI loop until the user closes the webwsi window or Terminate() is called.
proc bindProc[P, R](w: webwsi; scope, name: string; p: (proc (param: P): R))
proc bindProcNoArg(w: webwsi; scope, name: string; p: proc ()) {...}
ugly hack or macro will fail
proc bindProc[P](w: webwsi; scope, name: string; p: proc (arg: P))
proc endClose(w: var webwsi) {...}
**Macros**
macro bindProcs(w: webwsi; scope: string; n: untyped): untyped
bind procs like:
proc fn[T, U](arg: T): U
proc fn[T](arg: T)
proc fn()to webwsi w, in scope scope then you can invode in js side, like this:
scope.fn(arg)
Made with Nim. Generated: 2021-04-21 10:11:14 UTC