{"id":16870646,"url":"https://github.com/bung87/crowngui","last_synced_at":"2025-03-18T19:47:46.429Z","repository":{"id":52292991,"uuid":"258672145","full_name":"bung87/crowngui","owner":"bung87","description":"Web Technologies based Crossplatform GUI Framework, WebView in Nim ","archived":false,"fork":false,"pushed_at":"2024-10-10T03:48:18.000Z","size":763,"stargazers_count":29,"open_issues_count":5,"forks_count":3,"subscribers_count":4,"default_branch":"devel","last_synced_at":"2024-10-14T15:04:54.707Z","etag":null,"topics":["webgui","webview"],"latest_commit_sha":null,"homepage":"https://bung87.github.io/crowngui/","language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bung87.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"bung321902","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-04-25T02:43:18.000Z","updated_at":"2024-10-10T03:48:22.000Z","dependencies_parsed_at":"2024-08-07T08:57:12.482Z","dependency_job_id":"5d99733a-eeb4-4d6c-9dbc-2ac146586561","html_url":"https://github.com/bung87/crowngui","commit_stats":{"total_commits":240,"total_committers":1,"mean_commits":240.0,"dds":0.0,"last_synced_commit":"c4766fae329d857d3c26d75334e2ef94070f836d"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bung87%2Fcrowngui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bung87%2Fcrowngui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bung87%2Fcrowngui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bung87%2Fcrowngui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bung87","download_url":"https://codeload.github.com/bung87/crowngui/tar.gz/refs/heads/devel","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244294221,"owners_count":20429961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["webgui","webview"],"created_at":"2024-10-13T15:04:59.581Z","updated_at":"2025-03-18T19:47:46.397Z","avatar_url":"https://github.com/bung87.png","language":"Nim","funding_links":["https://ko-fi.com/bung321902"],"categories":[],"sub_categories":[],"readme":"# crowngui  ![Build Status](https://github.com/bung87/crowngui/workflows/build/badge.svg)  \n\nWeb Technologies based Crossplatform GUI Framework  \n\nIt uses Cocoa/WebKit on macOS, gtk-webkit2 on Linux and webview2 on Windows  \n\ncrowngui contains managed code only, no native code.\n\ncrowngui uses [nimpacker](https://github.com/nimpacker/nimpacker) for bundling application easier.\n\n\n## Architecture\n\n### how bindProcs works?  \n\nfigure generated via asciiflow  \n\n```\n\n┌─────────────┐         ┌──────────────────────────────┐       ┌─────────────────────────┐\n│             │         │                              │       │                         │\n│             │         │store hook function in `eps`  │       │when trigger js function │\n│             │         │hook accept one string param  │       │internally it use browser│\n│  bindProcs  ├────────►│and returns string that wraps ├──────►│`postMessage` api send   │\n│             │         │nim proc call.                │       │json string with scope,  │\n│             │         │And generate js function and  │       │name, argument.          │\n│             │         │dispatch to main queue.       │       │                         │\n└─────────────┘         └──────────────────────────────┘       └────────────┬────────────┘\n                                                                            │\n                                                                            ▼\n                        ┌────────────────────────────────────────────────────┐\n                        │browser add callback when received message          │\n                        │it calls Webview's `invokeCb` which implements      │\n                        │as `generalExternalInvokeCallback`                  │\n                        │it parse argument as json retrieve scope,           │\n                        │name, argument,then call the hook stored.           │\n                        │                                                    │\n                        └────────────────────────────────────────────────────┘\n\n```\n\n## Usage  \nfile: yourexecutable.nim  \n``` nim\nimport crowngui\n\nwhen isMainModule:\n  const   \n    cssDark = staticRead\"assets/dark.css\".strip.unindent.cstring\n    cssLight = staticRead\"assets/light.css\".strip.unindent.cstring\n\n  let app = newApplication( staticRead(\"assets/demo.html\") )\n  let theme = if \"--light-theme\" in commandLineParams(): cssLight else: cssDark\n  app.css(theme)\n  app.run()\n  app.exit()\n```\nYour project `.nimble` file  \n``` nim\nbin           = @[\"yourexecutable\"]\n```\n\n`nimpacker` will bundle your executable to `exe` on windows, `.app` on mac  \n\nYour project root can have `\"logo.png\"` which will generate as icon of application.  \n\n### CLI usage  \n`nimpacker [build,run] --help`  \n\n```\nUsage:\n  [build,run] [required\u0026optional-params] [flags: string...]\nOptions:\n  -h, --help                         print this cligen-erated help\n  --help-syntax                      advanced: prepend,plurals,..\n  -t=, --target=   string  REQUIRED  set target\n  -r, --release    bool    false     set release\n\n```\n\n## Examples  \n\n[crown_excel](https://github.com/bung87/crown_excel) excel viewer  \n\n[gamode](https://github.com/bung87/gamode) windows optimization tool for game  \n\n## Development  \n\nrun  \n`nimpacker run --target macos`  \n\nbuild  \n`nimpacker build --target macos`\n\n\n## Cross compilation for Windows  \n\nTo cross compile for Windows from Linux or macOS using the MinGW-w64 toolchain:  \n\n`nim c -d:mingw myproject.nim`  \n\nUse `--cpu:i386` or `--cpu:amd64` to switch the CPU architecture.\n\nThe MinGW-w64 toolchain can be installed as follows:  \n\n```\nUbuntu: apt install mingw-w64\nCentOS: yum install mingw32-gcc | mingw64-gcc - requires EPEL\nOSX: brew install mingw-w64\n```\n\n## References  \n\n[Distribute your app and the WebView2 Runtime](https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution)\n\n[WebView2 Win32 Reference](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/)  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbung87%2Fcrowngui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbung87%2Fcrowngui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbung87%2Fcrowngui/lists"}