GithubHelp home page GithubHelp logo

as400jplpc / nim_webwsi Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 5.08 MB

webview and socket and interactif

Nim 8.70% CSS 24.38% HTML 38.79% JavaScript 19.68% Shell 0.09% C 8.37%
nim webview socket-io webkit2gtk

nim_webwsi's Introduction

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 Your work inspired me a lot

require
thank-you 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-pie

download in .nimble folder "webwsi-0.1.0"

image :
img : EXEMPLE

source:
src : EXEMPLE

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

nim_webwsi's People

Contributors

as400jplpc avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.