Skip to content

Odin binding for a tiny cross-platform webview library to build modern cross-platform GUIs.

License

Notifications You must be signed in to change notification settings

thechampagne/webview-odin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webview-odin

Odin binding for a tiny cross-platform webview library to build modern cross-platform GUIs.

API

VERSION_MAJOR :: 0
VERSION_MINOR :: 12
VERSION_PATCH :: 0
VERSION_NUMBER :: "0.12.0"

Version :: struct {
    major : c.uint,
    minor : c.uint,
    patch : c.uint,
}

Version_Info :: struct {
    version : Version,
    version_number : [32]c.char,
    pre_release : [48]c.char,
    build_metadata : [48]c.char,
}

Hint :: enum c.int {
  None,
  Min,
  Max,
  Fixed
}

Native_Handle_Kind :: enum c.int {
   UI_Window,
   UI_Widget,
   Browser_Controller
}

Error :: enum c.int {
  Missing_Dependency = -5,
  Canceled = -4,
  Invalid_State = -3,
  Invalid_Argument = -2,
  Unspecified = -1,
  Ok = 0,
  Duplicate = 1,
  Not_Found = 2
}

webview :: rawptr

create :: proc(debug: bool, window : rawptr) -> webview

destroy :: proc(w : webview) -> Error

run :: proc(w : webview) -> Error

terminate :: proc(w : webview) -> Error

dispatch :: proc(w : webview, fn: #type proc(w : webview, arg : rawptr), arg : rawptr) -> Error

get_window :: proc(w : webview) -> rawptr

get_native_handle :: proc(w : webview, kind: Native_Handle_Kind) -> rawptr

set_title :: proc(w : webview, title : cstring) -> Error

set_size :: proc(w : webview, width : c.int, height : c.int, hints : Hint) -> Error

navigate :: proc(w : webview, url : cstring) -> Error

set_html :: proc(w : webview, html : cstring) -> Error

init :: proc(w : webview, js : cstring) -> Error

eval :: proc(w : webview, js : cstring) -> Error

bind :: proc(w : webview, name : cstring, fn : #type proc(seq : cstring, req : cstring, arg : rawptr), arg : rawptr) -> Error

unbind :: proc(w : webview, name : cstring) -> Error

ret :: proc(w : webview, seq : cstring, status : c.int, result : cstring) -> Error

version :: proc() -> ^Version_Info

References

License

This repo is released under the MIT License.

About

Odin binding for a tiny cross-platform webview library to build modern cross-platform GUIs.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages