├── .github └── workflows │ └── main.yml ├── .gitignore ├── LICENSE ├── README.md ├── examples └── create-react-app │ ├── .gitignore │ ├── README.md │ ├── b0x.yml │ ├── go.mod │ ├── main.go │ └── public │ ├── .gitignore │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt │ └── src │ ├── App.css │ ├── App.js │ ├── App.test.js │ ├── index.css │ ├── index.js │ ├── logo.svg │ ├── reportWebVitals.js │ └── setupTests.js ├── getting-started.md ├── go.mod ├── include ├── AppCore │ └── CAPI.h ├── JavaScriptCore │ ├── JSBase.h │ ├── JSContextRef.h │ ├── JSObjectRef.h │ ├── JSObjectRefPrivate.h │ ├── JSRetainPtr.h │ ├── JSStringRef.h │ ├── JSTypedArray.h │ ├── JSValueRef.h │ ├── JavaScript.h │ └── WebKitAvailability.h └── Ultralight │ └── CAPI.h ├── logo.svg ├── muon.go ├── muon_test.go ├── ultralight.yml └── ultralight ├── cgo_helpers.c ├── cgo_helpers.go ├── cgo_helpers.h ├── const.go ├── doc.go ├── libs ├── EULA.txt ├── LICENSE.txt ├── NOTICES.txt ├── darwin │ └── x64 │ │ ├── libAppCore.dylib │ │ ├── libUltralight.dylib │ │ ├── libUltralightCore.dylib │ │ └── libWebCore.dylib ├── linux │ └── x64 │ │ ├── libAppCore.so │ │ ├── libUltralight.so │ │ ├── libUltralightCore.so │ │ └── libWebCore.so └── windows │ ├── x32 │ ├── AppCore.dll │ ├── Ultralight.dll │ ├── UltralightCore.dll │ └── WebCore.dll │ └── x64 │ ├── AppCore.dll │ ├── Ultralight.dll │ ├── UltralightCore.dll │ └── WebCore.dll ├── types.go └── ultralight.go /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | on: [push, pull_request] 2 | name: Test 3 | jobs: 4 | Windows_x64: 5 | runs-on: windows-latest 6 | steps: 7 | - name: Install Go 8 | uses: actions/setup-go@v1 9 | with: 10 | go-version: 1.13.x 11 | - name: Checkout code 12 | uses: actions/checkout@v1 13 | - name: Install Deps 14 | shell: pwsh 15 | run: | 16 | Invoke-WebRequest -OutFile ultralight.7z https://ultralight-sdk.sfo2.cdn.digitaloceanspaces.com/ultralight-sdk-latest-win-x64.7z 17 | 7z e ultralight.7z *.dll -r 18 | - name: Test 19 | run: go test 20 | # One day I'll get this working 21 | # Windows_x32: 22 | # runs-on: windows-latest 23 | # steps: 24 | # - name: Install Go 25 | # uses: actions/setup-go@v1 26 | # with: 27 | # go-version: 1.13.x 28 | # - name: Checkout code 29 | # uses: actions/checkout@v1 30 | # - name: Install Deps 31 | # shell: pwsh 32 | # run: | 33 | # choco install mingw --x86 --force 34 | # Invoke-WebRequest -OutFile ultralight.7z https://ultralight-sdk.sfo2.cdn.digitaloceanspaces.com/ultralight-sdk-latest-win-x86.7z 35 | # 7z e ultralight.7z *.dll -r 36 | # - name: Test 37 | # env: 38 | # GOARCH: 386 39 | # CGO_ENABLED: 1 40 | # run: | 41 | # go test 42 | Linux_x64: 43 | runs-on: ubuntu-latest 44 | steps: 45 | - name: Install Go 46 | uses: actions/setup-go@v1 47 | with: 48 | go-version: 1.13.x 49 | - name: Checkout code 50 | uses: actions/checkout@v1 51 | - name: Install Deps 52 | run: | 53 | wget -O ultralight.7z https://ultralight-sdk.sfo2.cdn.digitaloceanspaces.com/ultralight-sdk-latest-linux-x64.7z 54 | 7z e ultralight.7z *.so -r 55 | sudo apt update && sudo apt install -y xorg openbox 56 | sudo nohup Xorg :0 & 57 | - name: Test 58 | env: 59 | LD_LIBRARY_PATH: . 60 | DISPLAY: :0 61 | run: go test -ldflags "-r ." 62 | Mac_x64: 63 | runs-on: macOS-latest 64 | steps: 65 | - name: Install Go 66 | uses: actions/setup-go@v1 67 | with: 68 | go-version: 1.13.x 69 | - name: Checkout code 70 | uses: actions/checkout@v1 71 | - name: Install Deps 72 | run: | 73 | brew install p7zip 74 | wget -O ultralight.7z https://ultralight-sdk.sfo2.cdn.digitaloceanspaces.com/ultralight-sdk-latest-mac-x64.7z 75 | 7z e ultralight.7z *.dylib -r 76 | - name: Test 77 | run: go test -ldflags "-r ." 78 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | go.sum 2 | webfiles/ab0x.go 3 | .vscode/ 4 | /*.dll -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 V-X 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
9 | 10 | ---- 11 | 12 | `Muon` is a lightweight alternative to Electron written in Golang in about ~300 LoC, using Ultralight instead of Chromium. [Ultralight](https://ultralig.ht/) is a cross-platform WebKit rewrite using the GPU to target embedded desktop applications that resulted in a fast, lightweight, and low-memory HTML UI solution that blends the power of Chromium with the small footprint of Native UI. 13 | 14 | 15 | # Features 16 | 17 | - Full JS to Go interop 18 | - GPU based rendering 19 | - Cross-platform 20 | - Hot-reloading 21 | - Superior disk size + memory & cpu usage 22 | 23 | Comparison with a "Hello, World!" React App 24 | 25 | | | Muon | Electron | 26 | |:----:|---------|----------| 27 | | CPU | 0.0% | 1.2% | 28 | | MEM | 26.0 MB | 201.7 MB | 29 | | DISK | 42 MB | 136 MB | 30 | 31 | # Example 32 | 33 | From `examples/create-react-app/main.go`: 34 | ```go 35 | package main 36 | 37 | import ( 38 | "github.com/ImVexed/muon" 39 | 40 | "cra-go/webfiles" 41 | "net/http" 42 | ) 43 | 44 | func main() { 45 | // Any static asset packer of your liking (ex. fileb0x) 46 | fileHandler := http.FileServer(webfiles.HTTP) 47 | 48 | cfg := &muon.Config{ 49 | Title: "Hello, World!", 50 | Height: 500, 51 | Width: 500, 52 | Titled: true, 53 | Resizeable: true, 54 | } 55 | 56 | m := muon.New(cfg, fileHandler) 57 | 58 | // Expose our `add` function to the JS runtime 59 | m.Bind("add", add) 60 | 61 | // Show the Window and start the Runtime 62 | if err := m.Start(); err != nil { 63 | panic(err) 64 | } 65 | } 66 | 67 | // Muon automatically handles interop to and from the JS runtime 68 | func add(a float64, b float64) float64 { 69 | return a + b 70 | } 71 | ``` 72 | 73 | # FAQ 74 | 75 | ## Q: *How are JS types translated to Go types?* 76 | - JS: `Boolean` Go: `bool` 77 | - JS: `Number` Go: `float64` 78 | - JS: `String` Go: `string` 79 | - JS: `Object` Go: `struct` via JSON 80 | 81 | ## Q: *How do I setup Ultralight?* 82 | - See our [getting started guide](https://github.com/ImVexed/muon/blob/master/getting-started.md) 83 | 84 | ## Q: *Is there perfect Chrome or Firefox feature parity?* 85 | - No, see [Missing Ultralight Features](https://github.com/ultralight-ux/Ultralight/issues/178) 86 | 87 | ## Q: *How do I get rid of the Console on Windows?* 88 | - Add `-ldflags -H=windowsgui` to either your `go build` or `go run` to get rid of the window. 89 | 90 | ## Q: *I get `exit status 3221225781`* 91 | - Your program likely can't find the Ultralight libraries. Ensure they're either installed on the system, or, in the same folder as your program. Currently, Muon uses the 1.1 Ultralight pre-release that hasn't yet propagated to their main site and can only be downloaded from the [Ultralight](https://github.com/ultralight-ux/Ultralight#getting-the-latest-sdk) github repo. 92 | 93 | ## Q: *I get ` libWebCore.so: cannot open shared object file`* 94 | - If you're attempting to load the libraries out of the same directory as your program add `-ldflags "-r ."` to your `go build` to set `rpath` to the local directory for library resolution. 95 | 96 | ## Q: *I get `symbol not found: ulCreateSettings`* 97 | - This likely means you're not using the 1.1 Ultralight pre-release which can be downloaded only from their [GitHub Repo](https://github.com/ultralight-ux/Ultralight#getting-the-latest-sdk) for now 98 | ## Q: *How do I compile for x86?* 99 | - Currently, Ultralight only supports Windows for x86. Ensure you have a 32-bit `gcc` in your path, and ensure you have `CGO_ENABLED=1` and `GOARCH=386` environment variables set. 100 | 101 | # Licensing 102 | While muon itself is MIT licensed, [Ultralight](https://ultralig.ht/) is not. 103 | ``` 104 | Ultralight is free for non-commercial use, educational use, 105 | and also free for commercial use by small indie developers making 106 | less than US$100,000 a year. You can find full terms in the SDK. 107 | Pricing plans for larger commercial projects will be announced later. 108 | ``` 109 | Their specific license terms can be found [here](https://github.com/ultralight-ux/Ultralight/tree/master/license). 110 | -------------------------------------------------------------------------------- /examples/create-react-app/.gitignore: -------------------------------------------------------------------------------- 1 | go.sum 2 | webfiles/ 3 | .vscode/ 4 | cra-go* 5 | *.dll 6 | cookies.dat -------------------------------------------------------------------------------- /examples/create-react-app/README.md: -------------------------------------------------------------------------------- 1 | # Create-React-App Example 2 | 3 | - Run `yarn && yarn build` inside of `public/` 4 | - Run `go generate && go build` inside this directory. 5 | - Ensure Ultralight libraries are installed -------------------------------------------------------------------------------- /examples/create-react-app/b0x.yml: -------------------------------------------------------------------------------- 1 | # all folders and files are relative to the path 2 | # where fileb0x was run at! 3 | 4 | # default: main 5 | pkg: webfiles 6 | 7 | # destination 8 | dest: "./webfiles/" 9 | 10 | # gofmt 11 | # type: bool 12 | # default: false 13 | fmt: true 14 | 15 | # compress files 16 | # at the moment, only supports gzip 17 | # 18 | # type: object 19 | compression: 20 | # activates the compression 21 | # 22 | # type: bool 23 | # default: false 24 | compress: true 25 | 26 | # valid values are: 27 | # -> "NoCompression" 28 | # -> "BestSpeed" 29 | # -> "BestCompression" 30 | # -> "DefaultCompression" or "" 31 | # 32 | # type: string 33 | # default: "DefaultCompression" # when: Compress == true && Method == "" 34 | method: "BestCompression" 35 | 36 | # true = do it yourself (the file is written as gzip compressed file into the memory file system) 37 | # false = decompress files at run time (while writing file into memory file system) 38 | # 39 | # type: bool 40 | # default: false 41 | keep: false 42 | 43 | # --------------- 44 | # -- DANGEROUS -- 45 | # --------------- 46 | # 47 | # cleans the destination folder (only b0xfiles) 48 | # you should use this when using the spread function 49 | # type: bool 50 | # default: false 51 | clean: false 52 | 53 | # default: ab0x.go 54 | output: "ab0x.go" 55 | 56 | # [unexporTed] builds non-exporTed functions, variables and types... 57 | # type: bool 58 | # default: false 59 | unexporTed: false 60 | 61 | # [spread] means it will make a file to hold all fileb0x data 62 | # and each file into a separaTed .go file 63 | # 64 | # example: 65 | # theres 2 files in the folder assets, they're: hello.json and world.txt 66 | # when spread is activaTed, fileb0x will make a file: 67 | # b0x.go or [output]'s data, assets_hello.json.go and assets_world.txt.go 68 | # 69 | # 70 | # type: bool 71 | # default: false 72 | spread: false 73 | 74 | # [lcf] log changed files when spread is active 75 | lcf: true 76 | 77 | custom: 78 | - files: 79 | - "./public/build/" 80 | base: "public/build/" -------------------------------------------------------------------------------- /examples/create-react-app/go.mod: -------------------------------------------------------------------------------- 1 | module cra-go 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/ImVexed/muon v0.0.0-20191017043257-ae2a6637f296 7 | golang.org/x/net v0.0.0-20190930134127-c5a3c61f89f3 8 | ) 9 | -------------------------------------------------------------------------------- /examples/create-react-app/main.go: -------------------------------------------------------------------------------- 1 | //go:generate fileb0x b0x.yml 2 | package main 3 | 4 | import ( 5 | "github.com/ImVexed/muon" 6 | 7 | "cra-go/webfiles" 8 | "net/http" 9 | ) 10 | 11 | func main() { 12 | fileHandler := http.FileServer(webfiles.HTTP) 13 | 14 | cfg := &muon.Config{ 15 | Title: "Hello, World!", 16 | Height: 500, 17 | Width: 500, 18 | Titled: true, 19 | Resizeable: true, 20 | } 21 | 22 | m := muon.New(cfg, fileHandler) 23 | 24 | m.Bind("add", add) 25 | 26 | if err := m.Start(); err != nil { 27 | panic(err) 28 | } 29 | } 30 | 31 | func add(a float64, b float64) float64 { 32 | return a + b 33 | } 34 | -------------------------------------------------------------------------------- /examples/create-react-app/public/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /examples/create-react-app/public/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `npm start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in your browser. 13 | 14 | The page will reload when you make changes.\ 15 | You may also see any lint errors in the console. 16 | 17 | ### `npm test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `npm run build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `npm run eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can't go back!** 35 | 36 | If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. 39 | 40 | You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `npm run build` fails to minify 69 | 70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 71 | -------------------------------------------------------------------------------- /examples/create-react-app/public/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "public", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.16.5", 7 | "@testing-library/react": "^13.4.0", 8 | "@testing-library/user-event": "^13.5.0", 9 | "react": "^18.2.0", 10 | "react-dom": "^18.2.0", 11 | "react-scripts": "5.0.1", 12 | "web-vitals": "^2.1.4" 13 | }, 14 | "scripts": { 15 | "start": "react-scripts start", 16 | "build": "react-scripts build", 17 | "test": "react-scripts test", 18 | "eject": "react-scripts eject" 19 | }, 20 | "eslintConfig": { 21 | "extends": [ 22 | "react-app", 23 | "react-app/jest" 24 | ] 25 | }, 26 | "browserslist": { 27 | "production": [ 28 | ">0.2%", 29 | "not dead", 30 | "not op_mini all" 31 | ], 32 | "development": [ 33 | "last 1 chrome version", 34 | "last 1 firefox version", 35 | "last 1 safari version" 36 | ] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /examples/create-react-app/public/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImVexed/muon/63fb5c0bb88207f6a9d76138097354b8bf7b7a69/examples/create-react-app/public/public/favicon.ico -------------------------------------------------------------------------------- /examples/create-react-app/public/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 |10 | Go: add(1 + 2) = {window.add(1,2)} 11 |
12 | 18 | Learn React 19 | 20 | and
213 | /// (Default = Courier New).
214 | ///
215 | ULExport void ulConfigSetFontFamilyFixed(ULConfig config, ULString font_name);
216 |
217 | ///
218 | /// Set default font-family to use for serif fonts (Default = Times New Roman).
219 | ///
220 | ULExport void ulConfigSetFontFamilySerif(ULConfig config, ULString font_name);
221 |
222 | ///
223 | /// Set default font-family to use for sans-serif fonts (Default = Arial).
224 | ///
225 | ULExport void ulConfigSetFontFamilySansSerif(ULConfig config,
226 | ULString font_name);
227 |
228 | ///
229 | /// Set user agent string (See for the default).
230 | ///
231 | ULExport void ulConfigSetUserAgent(ULConfig config, ULString agent_string);
232 |
233 | ///
234 | /// Set user stylesheet (CSS) (Default = Empty).
235 | ///
236 | ULExport void ulConfigSetUserStylesheet(ULConfig config, ULString css_string);
237 |
238 | ///
239 | /// Set whether or not we should continuously repaint any Views or compositor
240 | /// layers, regardless if they are dirty or not. This is mainly used to
241 | /// diagnose painting/shader issues. (Default = False)
242 | ///
243 | ULExport void ulConfigSetForceRepaint(ULConfig config, bool enabled);
244 |
245 | ///
246 | /// Set the amount of time to wait before triggering another repaint when a
247 | /// CSS animation is active. (Default = 1.0 / 60.0)
248 | ///
249 | ULExport void ulConfigSetAnimationTimerDelay(ULConfig config, double delay);
250 |
251 | ///
252 | /// Set the size of WebCore's memory cache for decoded images, scripts, and
253 | /// other assets in bytes. (Default = 64 * 1024 * 1024)
254 | ///
255 | ULExport void ulConfigSetMemoryCacheSize(ULConfig config, unsigned int size);
256 |
257 | ///
258 | /// Set the number of pages to keep in the cache. (Default = 0)
259 | ///
260 | ULExport void ulConfigSetPageCacheSize(ULConfig config, unsigned int size);
261 |
262 | /******************************************************************************
263 | * Renderer
264 | *****************************************************************************/
265 |
266 | ///
267 | /// Create renderer (create this only once per application lifetime).
268 | ///
269 | ULExport ULRenderer ulCreateRenderer(ULConfig config);
270 |
271 | ///
272 | /// Destroy renderer.
273 | ///
274 | ULExport void ulDestroyRenderer(ULRenderer renderer);
275 |
276 | ///
277 | /// Update timers and dispatch internal callbacks (JavaScript and network).
278 | ///
279 | ULExport void ulUpdate(ULRenderer renderer);
280 |
281 | ///
282 | /// Render all active Views to their respective bitmaps.
283 | ///
284 | ULExport void ulRender(ULRenderer renderer);
285 |
286 | /******************************************************************************
287 | * View
288 | *****************************************************************************/
289 |
290 | ///
291 | /// Create a View with certain size (in device coordinates).
292 | ///
293 | ULExport ULView ulCreateView(ULRenderer renderer, unsigned int width,
294 | unsigned int height, bool transparent);
295 |
296 | ///
297 | /// Destroy a View.
298 | ///
299 | ULExport void ulDestroyView(ULView view);
300 |
301 | ///
302 | /// Get current URL.
303 | ///
304 | /// @note Don't destroy the returned string, it is owned by the View.
305 | ///
306 | ULExport ULString ulViewGetURL(ULView view);
307 |
308 | ///
309 | /// Get current title.
310 | ///
311 | /// @note Don't destroy the returned string, it is owned by the View.
312 | ///
313 | ULExport ULString ulViewGetTitle(ULView view);
314 |
315 | ///
316 | /// Check if main frame is loading.
317 | ///
318 | ULExport bool ulViewIsLoading(ULView view);
319 |
320 | ///
321 | /// Check if bitmap is dirty (has changed since last call to ulViewGetBitmap).
322 | ///
323 | ULExport bool ulViewIsBitmapDirty(ULView view);
324 |
325 | ///
326 | /// Get bitmap (will reset the dirty flag).
327 | ///
328 | /// @note Don't destroy the returned bitmap, it is owned by the View.
329 | ///
330 | ULExport ULBitmap ulViewGetBitmap(ULView view);
331 |
332 | ///
333 | /// Load a raw string of HTML.
334 | ///
335 | ULExport void ulViewLoadHTML(ULView view, ULString html_string);
336 |
337 | ///
338 | /// Load a URL into main frame.
339 | ///
340 | ULExport void ulViewLoadURL(ULView view, ULString url_string);
341 |
342 | ///
343 | /// Resize view to a certain width and height (in device coordinates).
344 | ///
345 | ULExport void ulViewResize(ULView view, unsigned int width,
346 | unsigned int height);
347 |
348 | ///
349 | /// Get the page's JSContext for use with JavaScriptCore API.
350 | ///
351 | ULExport JSContextRef ulViewGetJSContext(ULView view);
352 |
353 | ///
354 | /// Evaluate a raw string of JavaScript and return result.
355 | ///
356 | ULExport JSValueRef ulViewEvaluateScript(ULView view, ULString js_string);
357 |
358 | ///
359 | /// Check if can navigate backwards in history.
360 | ///
361 | ULExport bool ulViewCanGoBack(ULView view);
362 |
363 | ///
364 | /// Check if can navigate forwards in history.
365 | ///
366 | ULExport bool ulViewCanGoForward(ULView view);
367 |
368 | ///
369 | /// Navigate backwards in history.
370 | ///
371 | ULExport void ulViewGoBack(ULView view);
372 |
373 | ///
374 | /// Navigate forwards in history.
375 | ///
376 | ULExport void ulViewGoForward(ULView view);
377 |
378 | ///
379 | /// Navigate to arbitrary offset in history.
380 | ///
381 | ULExport void ulViewGoToHistoryOffset(ULView view, int offset);
382 |
383 | ///
384 | /// Reload current page.
385 | ///
386 | ULExport void ulViewReload(ULView view);
387 |
388 | ///
389 | /// Stop all page loads.
390 | ///
391 | ULExport void ulViewStop(ULView view);
392 |
393 | ///
394 | /// Fire a keyboard event.
395 | ///
396 | ULExport void ulViewFireKeyEvent(ULView view, ULKeyEvent key_event);
397 |
398 | ///
399 | /// Fire a mouse event.
400 | ///
401 | ULExport void ulViewFireMouseEvent(ULView view, ULMouseEvent mouse_event);
402 |
403 | ///
404 | /// Fire a scroll event.
405 | ///
406 | ULExport void ulViewFireScrollEvent(ULView view, ULScrollEvent scroll_event);
407 |
408 | typedef void
409 | (*ULChangeTitleCallback) (void* user_data, ULView caller, ULString title);
410 |
411 | ///
412 | /// Set callback for when the page title changes.
413 | ///
414 | ULExport void ulViewSetChangeTitleCallback(ULView view,
415 | ULChangeTitleCallback callback,
416 | void* user_data);
417 |
418 | typedef void
419 | (*ULChangeURLCallback) (void* user_data, ULView caller, ULString url);
420 |
421 | ///
422 | /// Set callback for when the page URL changes.
423 | ///
424 | ULExport void ulViewSetChangeURLCallback(ULView view,
425 | ULChangeURLCallback callback,
426 | void* user_data);
427 |
428 | typedef void
429 | (*ULChangeTooltipCallback) (void* user_data, ULView caller, ULString tooltip);
430 |
431 | ///
432 | /// Set callback for when the tooltip changes (usually result of a mouse hover).
433 | ///
434 | ULExport void ulViewSetChangeTooltipCallback(ULView view,
435 | ULChangeTooltipCallback callback,
436 | void* user_data);
437 |
438 | typedef void
439 | (*ULChangeCursorCallback) (void* user_data, ULView caller, ULCursor cursor);
440 |
441 | ///
442 | /// Set callback for when the mouse cursor changes.
443 | ///
444 | ULExport void ulViewSetChangeCursorCallback(ULView view,
445 | ULChangeCursorCallback callback,
446 | void* user_data);
447 |
448 | typedef void
449 | (*ULAddConsoleMessageCallback) (void* user_data, ULView caller,
450 | ULMessageSource source, ULMessageLevel level,
451 | ULString message, unsigned int line_number,
452 | unsigned int column_number,
453 | ULString source_id);
454 |
455 | ///
456 | /// Set callback for when a message is added to the console (useful for
457 | /// JavaScript / network errors and debugging).
458 | ///
459 | ULExport void ulViewSetAddConsoleMessageCallback(ULView view,
460 | ULAddConsoleMessageCallback callback,
461 | void* user_data);
462 |
463 | typedef void
464 | (*ULBeginLoadingCallback) (void* user_data, ULView caller);
465 |
466 | ///
467 | /// Set callback for when the page begins loading new URL into main frame.
468 | ///
469 | ULExport void ulViewSetBeginLoadingCallback(ULView view,
470 | ULBeginLoadingCallback callback,
471 | void* user_data);
472 |
473 | typedef void
474 | (*ULFinishLoadingCallback) (void* user_data, ULView caller);
475 |
476 | ///
477 | /// Set callback for when the page finishes loading URL into main frame.
478 | ///
479 | ULExport void ulViewSetFinishLoadingCallback(ULView view,
480 | ULFinishLoadingCallback callback,
481 | void* user_data);
482 |
483 | typedef void
484 | (*ULUpdateHistoryCallback) (void* user_data, ULView caller);
485 |
486 | ///
487 | /// Set callback for when the history (back/forward state) is modified.
488 | ///
489 | ULExport void ulViewSetUpdateHistoryCallback(ULView view,
490 | ULUpdateHistoryCallback callback,
491 | void* user_data);
492 |
493 | typedef void
494 | (*ULDOMReadyCallback) (void* user_data, ULView caller);
495 |
496 | ///
497 | /// Set callback for when all JavaScript has been parsed and the document is
498 | /// ready. This is the best time to make initial JavaScript calls to your page.
499 | ///
500 | ULExport void ulViewSetDOMReadyCallback(ULView view,
501 | ULDOMReadyCallback callback,
502 | void* user_data);
503 |
504 | ///
505 | /// Set whether or not a view should be repainted during the next call to
506 | /// ulRender.
507 | ///
508 | /// @note This flag is automatically set whenever the page content changes
509 | /// but you can set it directly in case you need to force a repaint.
510 | ///
511 | ULExport void ulViewSetNeedsPaint(ULView view, bool needs_paint);
512 |
513 | ///
514 | /// Whether or not a view should be painted during the next call to ulRender.
515 | ///
516 | ULExport bool ulViewGetNeedsPaint(ULView view);
517 |
518 | ///
519 | /// Create an inspector for this View, this is useful for debugging and
520 | /// inspecting pages locally. This will only succeed if you have the
521 | /// inspector assets in your filesystem-- the inspector will look for
522 | /// file:///inspector/Main.html when it loads.
523 | ///
524 | /// @note The initial dimensions of the returned View are 10x10, you should
525 | /// call ulViewResize on the returned View to resize it to your desired
526 | /// dimensions.
527 | ///
528 | /// @note You will need to call ulDestroyView on the returned instance
529 | /// when you're done using it.
530 | ///
531 | ULExport ULView ulViewCreateInspectorView(ULView view);
532 |
533 | /******************************************************************************
534 | * String
535 | *****************************************************************************/
536 |
537 | ///
538 | /// Create string from null-terminated ASCII C-string.
539 | ///
540 | ULExport ULString ulCreateString(const char* str);
541 |
542 | ///
543 | /// Create string from UTF-8 buffer.
544 | ///
545 | ULExport ULString ulCreateStringUTF8(const char* str, size_t len);
546 |
547 | ///
548 | /// Create string from UTF-16 buffer.
549 | ///
550 | ULExport ULString ulCreateStringUTF16(ULChar16* str, size_t len);
551 |
552 | ///
553 | /// Destroy string (you should destroy any strings you explicitly Create).
554 | ///
555 | ULExport void ulDestroyString(ULString str);
556 |
557 | ///
558 | /// Get internal UTF-16 buffer data.
559 | ///
560 | ULExport ULChar16* ulStringGetData(ULString str);
561 |
562 | ///
563 | /// Get length in UTF-16 characters.
564 | ///
565 | ULExport size_t ulStringGetLength(ULString str);
566 |
567 | ///
568 | /// Whether this string is empty or not.
569 | ///
570 | ULExport bool ulStringIsEmpty(ULString str);
571 |
572 | /******************************************************************************
573 | * Bitmap
574 | *****************************************************************************/
575 |
576 | ///
577 | /// Create empty bitmap.
578 | ///
579 | ULExport ULBitmap ulCreateEmptyBitmap();
580 |
581 | ///
582 | /// Create bitmap with certain dimensions and pixel format.
583 | ///
584 | ULExport ULBitmap ulCreateBitmap(unsigned int width, unsigned int height,
585 | ULBitmapFormat format);
586 |
587 | ///
588 | /// Create bitmap from existing pixel buffer. @see Bitmap for help using
589 | /// this function.
590 | ///
591 | ULExport ULBitmap ulCreateBitmapFromPixels(unsigned int width,
592 | unsigned int height,
593 | ULBitmapFormat format,
594 | unsigned int row_bytes,
595 | const void* pixels, size_t size,
596 | bool should_copy);
597 |
598 | ///
599 | /// Create bitmap from copy.
600 | ///
601 | ULExport ULBitmap ulCreateBitmapFromCopy(ULBitmap existing_bitmap);
602 |
603 | ///
604 | /// Destroy a bitmap (you should only destroy Bitmaps you have explicitly
605 | /// created via one of the creation functions above.
606 | ///
607 | ULExport void ulDestroyBitmap(ULBitmap bitmap);
608 |
609 | ///
610 | /// Get the width in pixels.
611 | ///
612 | ULExport unsigned int ulBitmapGetWidth(ULBitmap bitmap);
613 |
614 | ///
615 | /// Get the height in pixels.
616 | ///
617 | ULExport unsigned int ulBitmapGetHeight(ULBitmap bitmap);
618 |
619 | ///
620 | /// Get the pixel format.
621 | ///
622 | ULExport ULBitmapFormat ulBitmapGetFormat(ULBitmap bitmap);
623 |
624 | ///
625 | /// Get the bytes per pixel.
626 | ///
627 | ULExport unsigned int ulBitmapGetBpp(ULBitmap bitmap);
628 |
629 | ///
630 | /// Get the number of bytes per row.
631 | ///
632 | ULExport unsigned int ulBitmapGetRowBytes(ULBitmap bitmap);
633 |
634 | ///
635 | /// Get the size in bytes of the underlying pixel buffer.
636 | ///
637 | ULExport size_t ulBitmapGetSize(ULBitmap bitmap);
638 |
639 | ///
640 | /// Whether or not this bitmap owns its own pixel buffer.
641 | ///
642 | ULExport bool ulBitmapOwnsPixels(ULBitmap bitmap);
643 |
644 | ///
645 | /// Lock pixels for reading/writing, returns pointer to pixel buffer.
646 | ///
647 | ULExport void* ulBitmapLockPixels(ULBitmap bitmap);
648 |
649 | ///
650 | /// Unlock pixels after locking.
651 | ///
652 | ULExport void ulBitmapUnlockPixels(ULBitmap bitmap);
653 |
654 | ///
655 | /// Get raw pixel buffer-- you should only call this if Bitmap is already
656 | /// locked.
657 | ///
658 | ULExport void* ulBitmapRawPixels(ULBitmap bitmap);
659 |
660 | ///
661 | /// Whether or not this bitmap is empty.
662 | ///
663 | ULExport bool ulBitmapIsEmpty(ULBitmap bitmap);
664 |
665 | ///
666 | /// Reset bitmap pixels to 0.
667 | ///
668 | ULExport void ulBitmapErase(ULBitmap bitmap);
669 |
670 | ///
671 | /// Write bitmap to a PNG on disk.
672 | ///
673 | ULExport bool ulBitmapWritePNG(ULBitmap bitmap, const char* path);
674 |
675 | /******************************************************************************
676 | * Key Event
677 | ******************************************************************************/
678 |
679 | ///
680 | /// Create a key event, @see KeyEvent for help with the following parameters.
681 | ///
682 | ULExport ULKeyEvent ulCreateKeyEvent(ULKeyEventType type,
683 | unsigned int modifiers,
684 | int virtual_key_code, int native_key_code,
685 | ULString text, ULString unmodified_text,
686 | bool is_keypad, bool is_auto_repeat,
687 | bool is_system_key);
688 |
689 | #ifdef _WIN32
690 | ///
691 | /// Create a key event from native Windows event.
692 | ///
693 | ULExport ULKeyEvent ulCreateKeyEventWindows(ULKeyEventType type,
694 | uintptr_t wparam, intptr_t lparam,
695 | bool is_system_key);
696 | #endif
697 |
698 | #ifdef __OBJC__
699 | ///
700 | /// Create a key event from native macOS event.
701 | ///
702 | ULExport ULKeyEvent ulCreateKeyEventMacOS(NSEvent* evt);
703 | #endif
704 |
705 | ///
706 | /// Destroy a key event.
707 | ///
708 | ULExport void ulDestroyKeyEvent(ULKeyEvent evt);
709 |
710 | /******************************************************************************
711 | * Mouse Event
712 | *****************************************************************************/
713 |
714 | ///
715 | /// Create a mouse event, @see MouseEvent for help using this function.
716 | ///
717 | ULExport ULMouseEvent ulCreateMouseEvent(ULMouseEventType type, int x, int y,
718 | ULMouseButton button);
719 |
720 | ///
721 | /// Destroy a mouse event.
722 | ///
723 | ULExport void ulDestroyMouseEvent(ULMouseEvent evt);
724 |
725 | /******************************************************************************
726 | * Scroll Event
727 | *****************************************************************************/
728 |
729 | ///
730 | /// Create a scroll event, @see ScrollEvent for help using this function.
731 | ///
732 | ULExport ULScrollEvent ulCreateScrollEvent(ULScrollEventType type, int delta_x,
733 | int delta_y);
734 |
735 | ///
736 | /// Destroy a scroll event.
737 | ///
738 | ULExport void ulDestroyScrollEvent(ULScrollEvent evt);
739 |
740 | #ifdef __cplusplus
741 | }
742 | #endif
743 |
744 | #endif // ULTRALIGHT_CAPI_H
745 |
--------------------------------------------------------------------------------
/logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/muon.go:
--------------------------------------------------------------------------------
1 | package muon
2 |
3 | import (
4 | "encoding/json"
5 | "errors"
6 | "net"
7 | "net/http"
8 | "reflect"
9 | "unsafe"
10 |
11 | . "github.com/ImVexed/muon/ultralight"
12 | )
13 |
14 | // Window represents a single Ultralight instance
15 | type Window struct {
16 | wnd ULWindow
17 | ov ULOverlay
18 | view ULView
19 | app ULApp
20 | handler http.Handler
21 | cfg *Config
22 | callbacks map[string]*ipf
23 | }
24 |
25 | type ipf struct {
26 | Function reflect.Value
27 | ParamTypes []reflect.Type
28 | }
29 |
30 | // Config contains configurable controls for the Ultralight engine
31 | type Config struct {
32 | Title string
33 | Height uint32
34 | Width uint32
35 | X int32
36 | Y int32
37 |
38 | Resizeable bool
39 | Borderless bool
40 | Titled bool
41 | Maximizable bool
42 | }
43 |
44 | // New creates a Ultralight Window
45 | func New(cfg *Config, handler http.Handler) *Window {
46 | w := &Window{
47 | cfg: cfg,
48 | handler: handler,
49 | callbacks: make(map[string]*ipf),
50 | }
51 |
52 | ufg := UlCreateConfig()
53 | std := UlCreateSettings()
54 | w.app = UlCreateApp(std, ufg)
55 | mm := UlAppGetMainMonitor(w.app)
56 |
57 | var hint uint32
58 |
59 | if cfg.Resizeable {
60 | hint |= 4
61 | }
62 |
63 | if cfg.Borderless {
64 | hint |= 1
65 | }
66 |
67 | if cfg.Titled {
68 | hint |= 2
69 | } else {
70 | w.cfg.Title = ""
71 | }
72 |
73 | if cfg.Maximizable {
74 | hint |= 8
75 | }
76 |
77 | w.wnd = UlCreateWindow(mm, w.cfg.Width, w.cfg.Height, false, hint)
78 |
79 | UlWindowSetTitle(w.wnd, w.cfg.Title)
80 | UlAppSetWindow(w.app, w.wnd)
81 |
82 | w.ov = UlCreateOverlay(w.wnd, w.cfg.Width, w.cfg.Height, w.cfg.X, w.cfg.Y)
83 |
84 | UlWindowSetResizeCallback(w.wnd, resizeCallback(w.ov), nil)
85 |
86 | w.view = UlOverlayGetView(w.ov)
87 |
88 | return w
89 | }
90 |
91 | // Start sets up the Ultralight runtime and begins showing the Window
92 | func (w *Window) Start() error {
93 |
94 | addr, err := serveHandler(w.handler)
95 |
96 | if err != nil {
97 | return err
98 | }
99 |
100 | url := UlCreateString(addr)
101 | defer UlDestroyString(url)
102 |
103 | UlViewLoadURL(w.view, url)
104 |
105 | UlAppRun(w.app)
106 |
107 | return nil
108 | }
109 |
110 | var registerCount int
111 |
112 | // Bind registers the given function to the given name in the Window's JS global object
113 | func (w *Window) Bind(name string, function interface{}) {
114 | f := &ipf{
115 | Function: reflect.ValueOf(function),
116 | }
117 |
118 | t := f.Function.Type()
119 |
120 | f.ParamTypes = make([]reflect.Type, t.NumIn())
121 |
122 | for i := 0; i < t.NumIn(); i++ {
123 | f.ParamTypes[i] = t.In(i)
124 | }
125 |
126 | if t.NumOut() > 1 {
127 | panic("Too many return values!")
128 | }
129 |
130 | w.callbacks[name] = f
131 |
132 | w.addFunction(name)
133 | }
134 |
135 | // Eval evaluates a given JavaScript string in the given Window view. `ret` is necessary for JSON serialization if an object is returned.
136 | func (w *Window) Eval(js string, ret reflect.Type) (interface{}, error) {
137 | us := UlCreateString(js)
138 | defer UlDestroyString(us)
139 |
140 | ref := UlViewEvaluateScript(w.view, us)
141 | ctx := UlViewGetJSContext(w.view)
142 |
143 | val, err := fromJSValue(ctx, ref, ret)
144 |
145 | if err != nil {
146 | return nil, err
147 | }
148 |
149 | return val.Interface(), nil
150 | }
151 |
152 | // Resize changes the given Window's size
153 | func (w *Window) Resize(width int, height int) {
154 | UlOverlayResize(w.ov, uint32(width), uint32(height))
155 | }
156 |
157 | // Move sets the Window's position to the given coordinates
158 | func (w *Window) Move(x int, y int) {
159 | UlOverlayMoveTo(w.ov, int32(x), int32(y))
160 | }
161 |
162 | func (w *Window) ipcCallback(ctx JSContextRef, functin JSObjectRef, thisObject JSObjectRef, argumentCount uint, arguments []JSValueRef, exception []JSValueRef) JSValueRef {
163 | jsName := JSStringCreateWithUTF8CString("name")
164 | defer JSStringRelease(jsName)
165 |
166 | prop := JSObjectGetProperty(ctx, functin, jsName, nil)
167 | jsProp := JSValueToStringCopy(ctx, prop, nil)
168 | defer JSStringRelease(jsProp)
169 |
170 | name := fromJSString(jsProp)
171 |
172 | f, ok := w.callbacks[name]
173 |
174 | if !ok {
175 | return JSValueMakeNull(ctx)
176 | }
177 |
178 | params := make([]reflect.Value, argumentCount)
179 |
180 | for i := uint(0); i < argumentCount; i++ {
181 | val, err := fromJSValue(ctx, arguments[i], f.ParamTypes[i])
182 |
183 | if err != nil {
184 | panic(err)
185 | }
186 |
187 | params[i] = val
188 | }
189 |
190 | val := f.Function.Call(params)
191 |
192 | if len(val) > 1 {
193 | panic("Javascript does not support more than 1 return value!")
194 | }
195 |
196 | if len(val) == 0 {
197 | return JSValueMakeNull(ctx)
198 | }
199 |
200 | return toJSValue(ctx, val[0])
201 | }
202 |
203 | func fromJSValue(ctx JSContextRef, value JSValueRef, rtype reflect.Type) (reflect.Value, error) {
204 | if rtype == nil {
205 | rtype = reflect.TypeOf(struct{}{})
206 | }
207 |
208 | var rv reflect.Value
209 | var err error
210 |
211 | if JSValueIsArray(ctx, value) {
212 | l := JSStringCreateWithUTF8CString("length")
213 | defer JSStringRelease(l)
214 |
215 | obj := *(*JSObjectRef)(unsafe.Pointer(&value))
216 |
217 | prop := JSObjectGetProperty(ctx, obj, l, nil)
218 | length := int(JSValueToNumber(ctx, prop, nil))
219 |
220 | if rtype.Kind() != reflect.Slice {
221 | return reflect.Zero(rtype), errors.New("JS return is of type Array while Go type target is not")
222 | }
223 |
224 | values := reflect.MakeSlice(rtype, length, length)
225 |
226 | for i := 0; i < length; i++ {
227 | ref := JSObjectGetPropertyAtIndex(ctx, obj, uint32(i), nil)
228 |
229 | val, err := fromJSValue(ctx, ref, rtype.Elem())
230 |
231 | if err != nil {
232 | return reflect.Zero(rtype), err
233 | }
234 |
235 | values.Index(i).Set(val)
236 | }
237 |
238 | return values, nil
239 | }
240 |
241 | switch JSValueGetType(ctx, value) {
242 | case KJSTypeBoolean:
243 | rv = reflect.ValueOf(JSValueToBoolean(ctx, value))
244 | case KJSTypeNumber:
245 | rv = reflect.ValueOf(JSValueToNumber(ctx, value, nil))
246 | case KJSTypeString:
247 | ref := JSValueToStringCopy(ctx, value, nil)
248 | rv = reflect.ValueOf(fromJSString(ref))
249 | JSStringRelease(ref)
250 | case KJSTypeObject:
251 | ref := JSValueCreateJSONString(ctx, value, 0, nil)
252 | obj := reflect.New(rtype).Interface()
253 |
254 | if err = json.Unmarshal([]byte(fromJSString(ref)), &obj); err == nil {
255 | rv = reflect.Indirect(reflect.ValueOf(obj))
256 | }
257 |
258 | JSStringRelease(ref)
259 | case KJSTypeUndefined, KJSTypeNull:
260 | rv = reflect.Zero(rtype)
261 | }
262 |
263 | return rv, err
264 | }
265 |
266 | func fromJSString(str JSStringRef) string {
267 | len := JSStringGetMaximumUTF8CStringSize(str)
268 | data := make([]byte, len)
269 | written := JSStringGetUTF8CString(str, data, len)
270 |
271 | return string(data[:written-1])
272 | }
273 |
274 | func toJSValue(ctx JSContextRef, value reflect.Value) JSValueRef {
275 | var jsv JSValueRef
276 | var err error
277 |
278 | switch value.Kind() {
279 | case reflect.Float64:
280 | jsv = JSValueMakeNumber(ctx, value.Float())
281 | case reflect.Bool:
282 | jsv = JSValueMakeBoolean(ctx, value.Bool())
283 | case reflect.String:
284 | str := JSStringCreateWithUTF8CString(value.String())
285 | jsv = JSValueMakeString(ctx, str)
286 | JSStringRelease(str)
287 | case reflect.Ptr:
288 | return toJSValue(ctx, reflect.Indirect(value))
289 | case reflect.Struct:
290 | if json, err := json.Marshal(value.Interface()); err == nil {
291 | str := JSStringCreateWithUTF8CString(string(json))
292 | jsv = JSValueMakeFromJSONString(ctx, str)
293 | JSStringRelease(str)
294 | }
295 | case reflect.Slice, reflect.Array:
296 | rets := make([]JSValueRef, value.Len())
297 |
298 | for i := 0; i < value.Len(); i++ {
299 | rets[i] = toJSValue(ctx, value.Index(i))
300 | }
301 | arr := JSObjectMakeArray(ctx, uint(len(rets)), rets, nil)
302 | jsv = *(*JSValueRef)(unsafe.Pointer(&arr))
303 | default:
304 | panic("Not implemented!")
305 | }
306 |
307 | if err != nil {
308 | return JSValueMakeNull(ctx)
309 | }
310 |
311 | return jsv
312 | }
313 |
314 | func (w *Window) addFunction(name string) {
315 | ctx := UlViewGetJSContext(w.view)
316 | gobj := JSContextGetGlobalObject(ctx)
317 |
318 | fn := JSStringCreateWithUTF8CString(name)
319 | defer JSStringRelease(fn)
320 |
321 | fname := JSStringCreateWithUTF8CString("name")
322 | defer JSStringRelease(fname)
323 |
324 | fob := JSObjectMakeFunctionWithCallback(ctx, fn, w.ipcCallback)
325 | JSObjectSetProperty(ctx, fob, fname, JSValueMakeString(ctx, fname), KJSPropertyAttributeNone, []JSValueRef{})
326 |
327 | val := *(*JSValueRef)(unsafe.Pointer(&fob))
328 |
329 | JSObjectSetProperty(ctx, gobj, fn, val, KJSPropertyAttributeNone, []JSValueRef{})
330 | }
331 |
332 | func resizeCallback(ov ULOverlay) func(userData unsafe.Pointer, width uint32, height uint32) {
333 | return func(userData unsafe.Pointer, width uint32, height uint32) {
334 | if height > 0 && width > 0 {
335 | UlOverlayResize(ov, width, height)
336 | }
337 | }
338 | }
339 |
340 | func serveHandler(handler http.Handler) (string, error) {
341 | ln, err := net.Listen("tcp", "127.0.0.1:0")
342 | if err != nil {
343 | return "", err
344 | }
345 |
346 | go func() {
347 | if err := http.Serve(ln, handler); err != nil {
348 | panic(err)
349 | }
350 | }()
351 |
352 | return "http://" + ln.Addr().String(), nil
353 | }
354 |
--------------------------------------------------------------------------------
/muon_test.go:
--------------------------------------------------------------------------------
1 | package muon
2 |
3 | import (
4 | "net/http"
5 | "os"
6 | "reflect"
7 | "testing"
8 | )
9 |
10 | var w *Window
11 |
12 | func TestMain(m *testing.M) {
13 | cfg := &Config{
14 | Height: 1,
15 | Width: 1,
16 | }
17 |
18 | w = New(cfg, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}))
19 |
20 | go func() {
21 | w.Start()
22 | }()
23 |
24 | os.Exit(m.Run())
25 | }
26 |
27 | type testObject struct {
28 | S1 string
29 | F1 float64
30 | B1 bool
31 | }
32 |
33 | func TestComplexType(t *testing.T) {
34 |
35 | w.Bind("complexTest", func(to *testObject) *testObject {
36 | return &testObject{
37 | S1: to.S1 + " World!",
38 | F1: to.F1 + 1,
39 | B1: !to.B1,
40 | }
41 | })
42 |
43 | res, err := w.Eval(`complexTest({S1: "Hello,", F1: 9000, B1: false})`, reflect.TypeOf(&testObject{}))
44 |
45 | if err != nil {
46 | t.Error(err)
47 | }
48 |
49 | to := res.(*testObject)
50 |
51 | if to.S1 != "Hello, World!" {
52 | t.Errorf("to.S1 was not correct, got %s", to.S1)
53 | }
54 |
55 | if to.F1 != 9001 {
56 | t.Errorf("to.F1 was under 9000, got %f", to.F1)
57 | }
58 |
59 | if !to.B1 {
60 | t.Errorf("to.B1 was not True, got false")
61 | }
62 | }
63 |
64 | func t2(to *testObject) *testObject {
65 | return &testObject{
66 | S1: to.S1 + " World!",
67 | F1: to.F1 + 1,
68 | B1: !to.B1,
69 | }
70 | }
71 |
72 | func TestArrayType(t *testing.T) {
73 |
74 | w.Bind("arrayTest", func(strings []string) []float64 {
75 | if strings[0] != "Hello" {
76 | t.Errorf("strings[0] was not Hello, got %s", strings[0])
77 | }
78 | if strings[1] != "World!" {
79 | t.Errorf("strings[1] was not World!, got %s", strings[1])
80 | }
81 | return []float64{1, 2, 3}
82 | })
83 |
84 | res, err := w.Eval(`arrayTest(["Hello","World!"])`, reflect.TypeOf([]float64{}))
85 |
86 | if err != nil {
87 | t.Error(err)
88 | }
89 |
90 | nums := res.([]float64)
91 |
92 | if nums[0] != 1 {
93 | t.Errorf("nums[0] was not 1, got %f", nums[0])
94 | }
95 |
96 | if nums[1] != 2 {
97 | t.Errorf("nums[1] was not 2, got %f", nums[1])
98 | }
99 |
100 | if nums[2] != 3 {
101 | t.Errorf("nums[2] was not 3, got %f", nums[2])
102 | }
103 | }
104 |
105 | func TestEmptyType(t *testing.T) {
106 |
107 | w.Bind("emptyTypeTest", func(nullValue string, undefinedValue string) {
108 | if nullValue != "" {
109 | t.Errorf("nullType was not empty!")
110 | }
111 | if undefinedValue != "" {
112 | t.Errorf("undefinedType was not empty!")
113 | }
114 | })
115 |
116 | _, err := w.Eval(`emptyTypeTest(null, undefined)`, nil)
117 |
118 | if err != nil {
119 | t.Error(err)
120 | }
121 | }
122 |
123 | func TestMultipleFuncs(t *testing.T) {
124 | w.Bind("multiple1Test", func(value1 string) {})
125 | w.Bind("multiple2Test", func(value2 bool) {})
126 |
127 | _, err := w.Eval(`multiple1Test("Hello, World1")`, nil)
128 |
129 | if err != nil {
130 | t.Error(err)
131 | }
132 |
133 | _, err = w.Eval(`multiple2Test(true)`, nil)
134 |
135 | if err != nil {
136 | t.Error(err)
137 | }
138 | }
139 |
--------------------------------------------------------------------------------
/ultralight.yml:
--------------------------------------------------------------------------------
1 | GENERATOR:
2 | PackageName: ultralight
3 | PackageDescription: "Ultralight bindings for golang"
4 | PackageLicense: "THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS."
5 | FlagGroups:
6 | - {name: CFLAGS, flags: [-I../include]}
7 | - {name: LDFLAGS, flags: ["-L${SRCDIR}/libs -lUltralightCore -lWebCore -lUltralight -lAppCore"]}
8 | Includes: ["AppCore/CAPI.h"]
9 | Options:
10 | SafeStrings: true
11 |
12 | PARSER:
13 | Arch: x86_64
14 | IncludePaths:
15 | - include
16 | - /usr/include
17 | - /usr/lib/gcc/x86_64-linux-gnu/7/include
18 | SourcesPaths:
19 | - AppCore/CAPI.h
20 |
21 | TRANSLATOR:
22 | ConstRules:
23 | defines: eval
24 | Rules:
25 | global:
26 | - {action: accept, from: "^ul"}
27 | - {action: accept, from: "^UL"}
28 | - {action: accept, from: "^JS"}
29 | - {action: accept, from: "^k"}
30 | - {action: accept, from: "^B"}
31 | - {action: ignore, from: __size_t__}
32 | - {action: ignore, from: __SIZE_T__}
33 | - {action: ignore, from: _BSD_SIZE_T_DEFINED_}
34 | - {action: ignore, from: _SIZE_T_DECLARED}
35 | - {action: ignore, from: __wchar_t__}
36 | - {action: ignore, from: __WCHAR_T__}
37 | - {transform: export}
38 | function:
39 | - {action: ignore, from: __GO__}
40 | # - {action: ignore, from: JSObjectGetArrayBufferByteLength}
41 | # - {action: ignore, from: JSObjectGetArrayBufferBytesPtr}
42 | # - {action: ignore, from: JSObjectGetTypedArrayBuffer}
43 | # - {action: ignore, from: JSObjectGetTypedArrayByteLength}
44 | # - {action: ignore, from: JSObjectGetTypedArrayByteOffset}
45 | # - {action: ignore, from: JSObjectGetTypedArrayBytesPtr}
46 | # - {action: ignore, from: JSObjectGetTypedArrayLength}
47 | # - {action: ignore, from: JSObjectMakeArrayBufferWithBytesNoCopy}
48 | # - {action: ignore, from: JSObjectMakeTypedArray}
49 | # - {action: ignore, from: JSObjectMakeTypedArrayWithArrayBuffer}
50 | # - {action: ignore, from: JSObjectMakeTypedArrayWithArrayBufferAndOffset}
51 | # - {action: ignore, from: JSObjectMakeTypedArrayWithBytesNoCopy}
52 | # - {action: ignore, from: JSValueGetTypedArrayType}
53 | private:
54 | - {transform: unexport}
--------------------------------------------------------------------------------
/ultralight/cgo_helpers.c:
--------------------------------------------------------------------------------
1 | // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS.
2 |
3 | // WARNING: This file has automatically been generated on Mon, 07 Oct 2019 13:59:36 CDT.
4 | // Code generated by https://git.io/c-for-go. DO NOT EDIT.
5 |
6 | #include "_cgo_export.h"
7 | #include "cgo_helpers.h"
8 |
9 | void ULUpdateCallback_7e1c6355(void* user_data) {
10 | uLUpdateCallback7E1C6355(user_data);
11 | }
12 |
13 | void ULCloseCallback_195b2f9(void* user_data) {
14 | uLCloseCallback195B2F9(user_data);
15 | }
16 |
17 | void ULResizeCallback_6e7309d9(void* user_data, unsigned int width, unsigned int height) {
18 | uLResizeCallback6E7309D9(user_data, width, height);
19 | }
20 |
21 | void ULChangeTitleCallback_bd58034c(void* user_data, ULView caller, ULString title) {
22 | uLChangeTitleCallbackBD58034C(user_data, caller, title);
23 | }
24 |
25 | void ULChangeURLCallback_4ec32b80(void* user_data, ULView caller, ULString url) {
26 | uLChangeURLCallback4EC32B80(user_data, caller, url);
27 | }
28 |
29 | void ULChangeTooltipCallback_12ca407(void* user_data, ULView caller, ULString tooltip) {
30 | uLChangeTooltipCallback12CA407(user_data, caller, tooltip);
31 | }
32 |
33 | void ULChangeCursorCallback_1a7011df(void* user_data, ULView caller, ULCursor cursor) {
34 | uLChangeCursorCallback1A7011DF(user_data, caller, cursor);
35 | }
36 |
37 | void ULAddConsoleMessageCallback_44b8dd01(void* user_data, ULView caller, ULMessageSource source, ULMessageLevel level, ULString message, unsigned int line_number, unsigned int column_number, ULString source_id) {
38 | uLAddConsoleMessageCallback44B8DD01(user_data, caller, source, level, message, line_number, column_number, source_id);
39 | }
40 |
41 | void ULBeginLoadingCallback_70d8c0ad(void* user_data, ULView caller) {
42 | uLBeginLoadingCallback70D8C0AD(user_data, caller);
43 | }
44 |
45 | void ULFinishLoadingCallback_1ed4ecae(void* user_data, ULView caller) {
46 | uLFinishLoadingCallback1ED4ECAE(user_data, caller);
47 | }
48 |
49 | void ULUpdateHistoryCallback_6e105364(void* user_data, ULView caller) {
50 | uLUpdateHistoryCallback6E105364(user_data, caller);
51 | }
52 |
53 | void ULDOMReadyCallback_6432c207(void* user_data, ULView caller) {
54 | uLDOMReadyCallback6432C207(user_data, caller);
55 | }
56 |
57 | void JSTypedArrayBytesDeallocator_68d51f83(void* bytes, void* deallocatorContext) {
58 | jSTypedArrayBytesDeallocator68D51F83(bytes, deallocatorContext);
59 | }
60 |
61 | void JSObjectInitializeCallback_5793b16(JSContextRef ctx, JSObjectRef object) {
62 | jSObjectInitializeCallback5793B16(ctx, object);
63 | }
64 |
65 | void JSObjectFinalizeCallback_93da0aea(JSObjectRef object) {
66 | jSObjectFinalizeCallback93DA0AEA(object);
67 | }
68 |
69 | _Bool JSObjectHasPropertyCallback_340bfa95(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) {
70 | return jSObjectHasPropertyCallback340BFA95(ctx, object, propertyName);
71 | }
72 |
73 | JSValueRef JSObjectGetPropertyCallback_5caec716(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) {
74 | return jSObjectGetPropertyCallback5CAEC716(ctx, object, propertyName, exception);
75 | }
76 |
77 | _Bool JSObjectSetPropertyCallback_a684f1fe(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) {
78 | return jSObjectSetPropertyCallbackA684F1FE(ctx, object, propertyName, value, exception);
79 | }
80 |
81 | _Bool JSObjectDeletePropertyCallback_b0108ebe(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) {
82 | return jSObjectDeletePropertyCallbackB0108EBE(ctx, object, propertyName, exception);
83 | }
84 |
85 | void JSObjectGetPropertyNamesCallback_e77d2329(JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames) {
86 | jSObjectGetPropertyNamesCallbackE77D2329(ctx, object, propertyNames);
87 | }
88 |
89 | JSValueRef JSObjectCallAsFunctionCallback_89f9469b(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, unsigned long int argumentCount, JSValueRef* arguments, JSValueRef* exception) {
90 | return jSObjectCallAsFunctionCallback89F9469B(ctx, function, thisObject, argumentCount, arguments, exception);
91 | }
92 |
93 | JSObjectRef JSObjectCallAsConstructorCallback_45f4b71f(JSContextRef ctx, JSObjectRef constructor, unsigned long int argumentCount, JSValueRef* arguments, JSValueRef* exception) {
94 | return jSObjectCallAsConstructorCallback45F4B71F(ctx, constructor, argumentCount, arguments, exception);
95 | }
96 |
97 | _Bool JSObjectHasInstanceCallback_aa527d2e(JSContextRef ctx, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception) {
98 | return jSObjectHasInstanceCallbackAA527D2E(ctx, constructor, possibleInstance, exception);
99 | }
100 |
101 | JSValueRef JSObjectConvertToTypeCallback_d379d61c(JSContextRef ctx, JSObjectRef object, JSType _type, JSValueRef* exception) {
102 | return jSObjectConvertToTypeCallbackD379D61C(ctx, object, _type, exception);
103 | }
104 |
105 |
--------------------------------------------------------------------------------
/ultralight/cgo_helpers.h:
--------------------------------------------------------------------------------
1 | // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS.
2 |
3 | // WARNING: This file has automatically been generated on Mon, 07 Oct 2019 13:59:36 CDT.
4 | // Code generated by https://git.io/c-for-go. DO NOT EDIT.
5 |
6 | #include "AppCore/CAPI.h"
7 | #include
8 | #pragma once
9 |
10 | #define __CGOGEN 1
11 |
12 | // ULUpdateCallback_7e1c6355 is a proxy for callback ULUpdateCallback.
13 | void ULUpdateCallback_7e1c6355(void* user_data);
14 |
15 | // ULCloseCallback_195b2f9 is a proxy for callback ULCloseCallback.
16 | void ULCloseCallback_195b2f9(void* user_data);
17 |
18 | // ULResizeCallback_6e7309d9 is a proxy for callback ULResizeCallback.
19 | void ULResizeCallback_6e7309d9(void* user_data, unsigned int width, unsigned int height);
20 |
21 | // ULChangeTitleCallback_bd58034c is a proxy for callback ULChangeTitleCallback.
22 | void ULChangeTitleCallback_bd58034c(void* user_data, ULView caller, ULString title);
23 |
24 | // ULChangeURLCallback_4ec32b80 is a proxy for callback ULChangeURLCallback.
25 | void ULChangeURLCallback_4ec32b80(void* user_data, ULView caller, ULString url);
26 |
27 | // ULChangeTooltipCallback_12ca407 is a proxy for callback ULChangeTooltipCallback.
28 | void ULChangeTooltipCallback_12ca407(void* user_data, ULView caller, ULString tooltip);
29 |
30 | // ULChangeCursorCallback_1a7011df is a proxy for callback ULChangeCursorCallback.
31 | void ULChangeCursorCallback_1a7011df(void* user_data, ULView caller, ULCursor cursor);
32 |
33 | // ULAddConsoleMessageCallback_44b8dd01 is a proxy for callback ULAddConsoleMessageCallback.
34 | void ULAddConsoleMessageCallback_44b8dd01(void* user_data, ULView caller, ULMessageSource source, ULMessageLevel level, ULString message, unsigned int line_number, unsigned int column_number, ULString source_id);
35 |
36 | // ULBeginLoadingCallback_70d8c0ad is a proxy for callback ULBeginLoadingCallback.
37 | void ULBeginLoadingCallback_70d8c0ad(void* user_data, ULView caller);
38 |
39 | // ULFinishLoadingCallback_1ed4ecae is a proxy for callback ULFinishLoadingCallback.
40 | void ULFinishLoadingCallback_1ed4ecae(void* user_data, ULView caller);
41 |
42 | // ULUpdateHistoryCallback_6e105364 is a proxy for callback ULUpdateHistoryCallback.
43 | void ULUpdateHistoryCallback_6e105364(void* user_data, ULView caller);
44 |
45 | // ULDOMReadyCallback_6432c207 is a proxy for callback ULDOMReadyCallback.
46 | void ULDOMReadyCallback_6432c207(void* user_data, ULView caller);
47 |
48 | // JSTypedArrayBytesDeallocator_68d51f83 is a proxy for callback JSTypedArrayBytesDeallocator.
49 | void JSTypedArrayBytesDeallocator_68d51f83(void* bytes, void* deallocatorContext);
50 |
51 | // JSObjectInitializeCallback_5793b16 is a proxy for callback JSObjectInitializeCallback.
52 | void JSObjectInitializeCallback_5793b16(JSContextRef ctx, JSObjectRef object);
53 |
54 | // JSObjectFinalizeCallback_93da0aea is a proxy for callback JSObjectFinalizeCallback.
55 | void JSObjectFinalizeCallback_93da0aea(JSObjectRef object);
56 |
57 | // JSObjectHasPropertyCallback_340bfa95 is a proxy for callback JSObjectHasPropertyCallback.
58 | _Bool JSObjectHasPropertyCallback_340bfa95(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName);
59 |
60 | // JSObjectGetPropertyCallback_5caec716 is a proxy for callback JSObjectGetPropertyCallback.
61 | JSValueRef JSObjectGetPropertyCallback_5caec716(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
62 |
63 | // JSObjectSetPropertyCallback_a684f1fe is a proxy for callback JSObjectSetPropertyCallback.
64 | _Bool JSObjectSetPropertyCallback_a684f1fe(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception);
65 |
66 | // JSObjectDeletePropertyCallback_b0108ebe is a proxy for callback JSObjectDeletePropertyCallback.
67 | _Bool JSObjectDeletePropertyCallback_b0108ebe(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
68 |
69 | // JSObjectGetPropertyNamesCallback_e77d2329 is a proxy for callback JSObjectGetPropertyNamesCallback.
70 | void JSObjectGetPropertyNamesCallback_e77d2329(JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames);
71 |
72 | // JSObjectCallAsFunctionCallback_89f9469b is a proxy for callback JSObjectCallAsFunctionCallback.
73 | JSValueRef JSObjectCallAsFunctionCallback_89f9469b(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, unsigned long int argumentCount, JSValueRef* arguments, JSValueRef* exception);
74 |
75 | // JSObjectCallAsConstructorCallback_45f4b71f is a proxy for callback JSObjectCallAsConstructorCallback.
76 | JSObjectRef JSObjectCallAsConstructorCallback_45f4b71f(JSContextRef ctx, JSObjectRef constructor, unsigned long int argumentCount, JSValueRef* arguments, JSValueRef* exception);
77 |
78 | // JSObjectHasInstanceCallback_aa527d2e is a proxy for callback JSObjectHasInstanceCallback.
79 | _Bool JSObjectHasInstanceCallback_aa527d2e(JSContextRef ctx, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception);
80 |
81 | // JSObjectConvertToTypeCallback_d379d61c is a proxy for callback JSObjectConvertToTypeCallback.
82 | JSValueRef JSObjectConvertToTypeCallback_d379d61c(JSContextRef ctx, JSObjectRef object, JSType _type, JSValueRef* exception);
83 |
84 |
--------------------------------------------------------------------------------
/ultralight/const.go:
--------------------------------------------------------------------------------
1 | // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS.
2 |
3 | // WARNING: This file has automatically been generated on Mon, 07 Oct 2019 13:59:36 CDT.
4 | // Code generated by https://git.io/c-for-go. DO NOT EDIT.
5 |
6 | package ultralight
7 |
8 | /*
9 | #cgo CFLAGS: -I../include
10 | #cgo windows,386 LDFLAGS: -L${SRCDIR}/libs/windows/x32
11 | #cgo windows,amd64 LDFLAGS: -L${SRCDIR}/libs/windows/x64
12 | #cgo darwin,amd64 LDFLAGS: -L${SRCDIR}/libs/darwin/x64
13 | #cgo linux,amd64 LDFLAGS: -L${SRCDIR}/libs/linux/x64
14 | #cgo LDFLAGS: -lUltralightCore -lWebCore -lUltralight -lAppCore
15 | #include "AppCore/CAPI.h"
16 | #include
17 | #include "cgo_helpers.h"
18 | */
19 | import "C"
20 |
21 | const (
22 | // JSC_OBJC_API_ENABLED as defined in JavaScriptCore/JSBase.h:141
23 | JSC_OBJC_API_ENABLED = 0
24 | )
25 |
26 | // ULWindowFlags as declared in AppCore/CAPI.h:47
27 | type ULWindowFlags int32
28 |
29 | // ULWindowFlags enumeration from AppCore/CAPI.h:47
30 | const (
31 | KWindowFlags_Borderless ULWindowFlags = 1
32 | KWindowFlags_Titled ULWindowFlags = 2
33 | KWindowFlags_Resizable ULWindowFlags = 4
34 | KWindowFlags_Maximizable ULWindowFlags = 8
35 | )
36 |
37 | // ULMessageSource as declared in Ultralight/CAPI.h:73
38 | type ULMessageSource int32
39 |
40 | // ULMessageSource enumeration from Ultralight/CAPI.h:73
41 | const (
42 | KMessageSource_XML ULMessageSource = iota
43 | KMessageSource_JS ULMessageSource = 1
44 | KMessageSource_Network ULMessageSource = 2
45 | KMessageSource_ConsoleAPI ULMessageSource = 3
46 | KMessageSource_Storage ULMessageSource = 4
47 | KMessageSource_AppCache ULMessageSource = 5
48 | KMessageSource_Rendering ULMessageSource = 6
49 | KMessageSource_CSS ULMessageSource = 7
50 | KMessageSource_Security ULMessageSource = 8
51 | KMessageSource_ContentBlocker ULMessageSource = 9
52 | KMessageSource_Other ULMessageSource = 10
53 | )
54 |
55 | // ULMessageLevel as declared in Ultralight/CAPI.h:81
56 | type ULMessageLevel int32
57 |
58 | // ULMessageLevel enumeration from Ultralight/CAPI.h:81
59 | const (
60 | KMessageLevel_Log ULMessageLevel = 1
61 | KMessageLevel_Warning ULMessageLevel = 2
62 | KMessageLevel_Error ULMessageLevel = 3
63 | KMessageLevel_Debug ULMessageLevel = 4
64 | KMessageLevel_Info ULMessageLevel = 5
65 | )
66 |
67 | // ULCursor as declared in Ultralight/CAPI.h:128
68 | type ULCursor int32
69 |
70 | // ULCursor enumeration from Ultralight/CAPI.h:128
71 | const (
72 | KCursor_Pointer ULCursor = iota
73 | KCursor_Cross ULCursor = 1
74 | KCursor_Hand ULCursor = 2
75 | KCursor_IBeam ULCursor = 3
76 | KCursor_Wait ULCursor = 4
77 | KCursor_Help ULCursor = 5
78 | KCursor_EastResize ULCursor = 6
79 | KCursor_NorthResize ULCursor = 7
80 | KCursor_NorthEastResize ULCursor = 8
81 | KCursor_NorthWestResize ULCursor = 9
82 | KCursor_SouthResize ULCursor = 10
83 | KCursor_SouthEastResize ULCursor = 11
84 | KCursor_SouthWestResize ULCursor = 12
85 | KCursor_WestResize ULCursor = 13
86 | KCursor_NorthSouthResize ULCursor = 14
87 | KCursor_EastWestResize ULCursor = 15
88 | KCursor_NorthEastSouthWestResize ULCursor = 16
89 | KCursor_NorthWestSouthEastResize ULCursor = 17
90 | KCursor_ColumnResize ULCursor = 18
91 | KCursor_RowResize ULCursor = 19
92 | KCursor_MiddlePanning ULCursor = 20
93 | KCursor_EastPanning ULCursor = 21
94 | KCursor_NorthPanning ULCursor = 22
95 | KCursor_NorthEastPanning ULCursor = 23
96 | KCursor_NorthWestPanning ULCursor = 24
97 | KCursor_SouthPanning ULCursor = 25
98 | KCursor_SouthEastPanning ULCursor = 26
99 | KCursor_SouthWestPanning ULCursor = 27
100 | KCursor_WestPanning ULCursor = 28
101 | KCursor_Move ULCursor = 29
102 | KCursor_VerticalText ULCursor = 30
103 | KCursor_Cell ULCursor = 31
104 | KCursor_ContextMenu ULCursor = 32
105 | KCursor_Alias ULCursor = 33
106 | KCursor_Progress ULCursor = 34
107 | KCursor_NoDrop ULCursor = 35
108 | KCursor_Copy ULCursor = 36
109 | KCursor_None ULCursor = 37
110 | KCursor_NotAllowed ULCursor = 38
111 | KCursor_ZoomIn ULCursor = 39
112 | KCursor_ZoomOut ULCursor = 40
113 | KCursor_Grab ULCursor = 41
114 | KCursor_Grabbing ULCursor = 42
115 | KCursor_Custom ULCursor = 43
116 | )
117 |
118 | // ULBitmapFormat as declared in Ultralight/CAPI.h:133
119 | type ULBitmapFormat int32
120 |
121 | // ULBitmapFormat enumeration from Ultralight/CAPI.h:133
122 | const (
123 | KBitmapFormat_A8 ULBitmapFormat = iota
124 | KBitmapFormat_RGBA8 ULBitmapFormat = 1
125 | )
126 |
127 | // ULKeyEventType as declared in Ultralight/CAPI.h:140
128 | type ULKeyEventType int32
129 |
130 | // ULKeyEventType enumeration from Ultralight/CAPI.h:140
131 | const (
132 | KKeyEventType_KeyDown ULKeyEventType = iota
133 | KKeyEventType_KeyUp ULKeyEventType = 1
134 | KKeyEventType_RawKeyDown ULKeyEventType = 2
135 | KKeyEventType_Char ULKeyEventType = 3
136 | )
137 |
138 | // ULMouseEventType as declared in Ultralight/CAPI.h:146
139 | type ULMouseEventType int32
140 |
141 | // ULMouseEventType enumeration from Ultralight/CAPI.h:146
142 | const (
143 | KMouseEventType_MouseMoved ULMouseEventType = iota
144 | KMouseEventType_MouseDown ULMouseEventType = 1
145 | KMouseEventType_MouseUp ULMouseEventType = 2
146 | )
147 |
148 | // ULMouseButton as declared in Ultralight/CAPI.h:153
149 | type ULMouseButton int32
150 |
151 | // ULMouseButton enumeration from Ultralight/CAPI.h:153
152 | const (
153 | KMouseButton_None ULMouseButton = iota
154 | KMouseButton_Left ULMouseButton = 1
155 | KMouseButton_Middle ULMouseButton = 2
156 | KMouseButton_Right ULMouseButton = 3
157 | )
158 |
159 | // ULScrollEventType as declared in Ultralight/CAPI.h:158
160 | type ULScrollEventType int32
161 |
162 | // ULScrollEventType enumeration from Ultralight/CAPI.h:158
163 | const (
164 | KScrollEventType_ScrollByPixel ULScrollEventType = iota
165 | KScrollEventType_ScrollByPage ULScrollEventType = 1
166 | )
167 |
168 | // JSType as declared in JavaScriptCore/JSValueRef.h:53
169 | type JSType int32
170 |
171 | // JSType enumeration from JavaScriptCore/JSValueRef.h:53
172 | const (
173 | KJSTypeUndefined JSType = iota
174 | KJSTypeNull JSType = 1
175 | KJSTypeBoolean JSType = 2
176 | KJSTypeNumber JSType = 3
177 | KJSTypeString JSType = 4
178 | KJSTypeObject JSType = 5
179 | )
180 |
181 | // JSTypedArrayType as declared in JavaScriptCore/JSValueRef.h:83
182 | type JSTypedArrayType int32
183 |
184 | // JSTypedArrayType enumeration from JavaScriptCore/JSValueRef.h:83
185 | const (
186 | KJSTypedArrayTypeInt8Array JSTypedArrayType = iota
187 | KJSTypedArrayTypeInt16Array JSTypedArrayType = 1
188 | KJSTypedArrayTypeInt32Array JSTypedArrayType = 2
189 | KJSTypedArrayTypeUint8Array JSTypedArrayType = 3
190 | KJSTypedArrayTypeUint8ClampedArray JSTypedArrayType = 4
191 | KJSTypedArrayTypeUint16Array JSTypedArrayType = 5
192 | KJSTypedArrayTypeUint32Array JSTypedArrayType = 6
193 | KJSTypedArrayTypeFloat32Array JSTypedArrayType = 7
194 | KJSTypedArrayTypeFloat64Array JSTypedArrayType = 8
195 | KJSTypedArrayTypeArrayBuffer JSTypedArrayType = 9
196 | KJSTypedArrayTypeNone JSTypedArrayType = 10
197 | )
198 |
199 | const (
200 | // KJSPropertyAttributeNone as declared in JavaScriptCore/JSObjectRef.h:51
201 | KJSPropertyAttributeNone = iota
202 | // KJSPropertyAttributeReadOnly as declared in JavaScriptCore/JSObjectRef.h:52
203 | KJSPropertyAttributeReadOnly = 2
204 | // KJSPropertyAttributeDontEnum as declared in JavaScriptCore/JSObjectRef.h:53
205 | KJSPropertyAttributeDontEnum = 4
206 | // KJSPropertyAttributeDontDelete as declared in JavaScriptCore/JSObjectRef.h:54
207 | KJSPropertyAttributeDontDelete = 8
208 | )
209 |
210 | const (
211 | // KJSClassAttributeNone as declared in JavaScriptCore/JSObjectRef.h:69
212 | KJSClassAttributeNone = iota
213 | // KJSClassAttributeNoAutomaticPrototype as declared in JavaScriptCore/JSObjectRef.h:70
214 | KJSClassAttributeNoAutomaticPrototype = 2
215 | )
216 |
--------------------------------------------------------------------------------
/ultralight/doc.go:
--------------------------------------------------------------------------------
1 | // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS.
2 |
3 | // WARNING: This file has automatically been generated on Mon, 07 Oct 2019 13:59:36 CDT.
4 | // Code generated by https://git.io/c-for-go. DO NOT EDIT.
5 |
6 | /*
7 | Ultralight bindings for golang
8 | */
9 | package ultralight
10 |
--------------------------------------------------------------------------------
/ultralight/libs/EULA.txt:
--------------------------------------------------------------------------------
1 | EXHIBIT A
2 |
3 | END USER LICENSE AGREEMENT
4 |
5 | This End User License Agreement ("EULA"), effective today, is made by and between you and Ultralight, Inc., having an address at 15822 Jamie Lee Drive, Houston, Texas 77095 ("Ultralight Inc"), and concerns certain software known as "Ultralight." The Ultralight software includes a library that makes it easy for developers to embed HTML UI in their applications. Ultralight software provides developers the ability to embed and manipulate an instance of a web page and render it using a virtual GPU device driver.
6 | License Grant. A limited, non-exclusive, nontransferable, and revocable license is granted to you to install, access, and use the Ultralight software solely in conjunction with and through third-party software separately licensed to you (the "Licensed Product") and subject to the terms and conditions of the third-party's license with Ultralight Inc. By using the Ultralight software (through the Licensed Product), you accept the terms and conditions herein. You may print and save a copy of this EULA for your records.
7 | Permitted Use and Restrictions. You agree to use and access the Ultralight Software solely in conjunction with and through the Licensed Product separately licensed to you. You agree not to reverse engineer, decompile, disassemble, modify, translate, make any attempt to discover the source code of the Ultralight software, or modify, or otherwise create derivative works of, the Ultralight software.
8 |
9 | Ownership of Intellectual Property. You acknowledge that Ultralight Inc owns and shall continue to own all intellectual property rights in the Ultralight software, including any documentation. You agree to use reasonable best efforts to protect the contents of the Ultralight software and to prevent unauthorized copying, disclosure, or use by your agents, officers, employees, and consultants.
10 |
11 | Copyright Notice. Ultralight (c) 2018 Ultralight, Inc. All rights reserved. Ultralight is a trademark of Ultralight, Inc.
12 |
13 | Disclaimer of Warranties, "AS IS". THE ULTRALIGHT SOFTWARE, INCLUDING, WITHOUT LIMITATION, ALL SOFTWARE, DOCUMENTS, FUNCTIONS, MATERIALS, AND INFORMATION, IS PROVIDED "AS IS." TO THE FULLEST EXTENT PERMISSIBLY BY LAW, Ultralight Inc MAKES NO OTHER REPRESENTATIONS, EXTENDS NO OTHER WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT (INCLUDING ANY OPEN SOURCE VIOLATIONS), AND ASSUMES NO LIABILITY TO YOU OR ANY OTHER PERSON FOR OR ON ACCOUNT OF ANY INJURY, LOSS OR DAMAGE, OF ANY KIND OR NATURE, SUSTAINED BY, OR ANY DAMAGE ASSESSED OR ASSERTED AGAINST, OR ANY OTHER LIABILITY INCURRED BY OR IMPOSED ON YOU OR ANY OTHER PERSON (INCLUDING DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES, NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)), ARISING OUT OF OR IN CONNECTION WITH OR RESULTING FROM THE USE OF THE ULTRALIGHT SOFTWARE OR THIS EULA, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14 |
15 | Exclusive Remedy; Limitation of Liability. For any breach of warranty, your exclusive remedy shall be to return the Ultralight software to Ultralight Inc. Under this EULA, Ultralight Inc's maximum liability is further limited to one US Dollar (USD$1.00).
16 |
17 | Termination. This EULA is effective until terminated. Your rights under this EULA will terminate automatically without notice from Ultralight Inc if you fail to comply with any term(s) of this EULA. You may terminate this EULA by giving written notice of termination to the Ultralight Inc. Upon termination of this EULA, you shall immediately discontinue all use of the Ultralight Software and destroy the original and all copies, full or partial, including any associated documentation.
18 |
19 | Export Controls. The Ultralight software, including any downloading or use of, may be subject to export controls imposed by U.S. export control laws, including the U.S. Export Administration Act and its associated regulations, and may be subject to export or import regulations in other countries. You agree to comply strictly with all such regulations and acknowledge that you have the responsibility to obtain licenses to export, re-export, or import the Ultralight software.
20 |
21 | Governing Law and General Provisions. This EULA shall be governed by the laws of the State of Texas, excluding the application of its conflicts of law rules. You agree that any dispute regarding or relating to this EULA shall be litigated only in federal or state courts in Harris County, Texas, and hereby waive any objection to the jurisdiction of such courts. This EULA shall not be governed by the United Nations Convention on Contracts for the International Sale of Goods, the application of which is expressly excluded. If any provisions of this EULA are held invalid or unenforceable for any reason, the remaining provisions shall remain in full force and effect. This EULA is binding upon your successors and assigns. This EULA may be modified only by a non-electronic amendment, signed by each party. This EULA may not be assigned or transferred to any other person or entity by you without the express consent of Ultralight Inc. This EULA constitutes the entire agreement between the parties with respect to the use of the Ultralight software licensed hereunder and supersedes all other previous or contemporaneous agreements or understandings between the parties, whether verbal or written, concerning the subject matter.
22 |
23 | For additional information concerning open-source licensing and required copyright notices, please see the included NOTICES.txt.
--------------------------------------------------------------------------------
/ultralight/libs/LICENSE.txt:
--------------------------------------------------------------------------------
1 | ULTRALIGHT FREE LICENSE AGREEMENT - V1
2 |
3 | This LICENSE AGREEMENT ("Agreement"), effective as of Effective Date, by and between Ultralight, Inc., having an address at 15822 Jamie Lee Drive, Houston, Texas 77095 ("Ultralight Inc") and Licensee. Ultralight Inc and Licensee are collectively referred to as the "Parties" and individually referred to as a "Party". A copy of this Agreement may be printed and saved for Licensee's records.
4 | RECITALS
5 | WHEREAS, Ultralight Inc has developed software, known as the Ultralight software ("Ultralight"), which includes a library that makes it easy for developers to embed HTML UI in their applications. Ultralight software provides developers the ability to embed and manipulate an instance of a web page and render it using a virtual GPU device driver.
6 | WHEREAS, Licensee desires to obtain a non-exclusive, free license to use the Ultralight software to develop, distribute, and display applications licensed to third party users ("End Users") or for public display, using Ultralight software to manipulate and render web pages under the terms and conditions of this Agreement.
7 | NOW, THEREFORE, in consideration of the foregoing premises and of the mutual covenants and obligations hereinafter contained, and other good and valuable consideration, the receipt and legal sufficiency of which is hereby acknowledged, the Parties hereto agree as follows:
8 | ARTICLE 1
9 |
10 | DEFINITIONS
11 | 1.1 Definitions. As used herein, the following terms have the meanings set forth below:
12 | 1.1.1 "Affiliates" means, with respect to an entity or person, any entity or person that directly or indirectly through one or more intermediaries Controls, is Controlled by, or is under common Control with such entity or person.
13 | 1.1.2 "Agreement" has the meaning as set forth in the preamble.
14 | 1.1.3 "Ultralight" has the meaning as set forth in the preamble and includes portions of WebKit software. The Ultralight software includes a set of C++ header files, static libraries, dynamically-linked libraries, and documentation. For purposes of this Agreement, Ultralight includes the current version of the Ultralight software as of the Effective Date, and any Maintenance Releases during the Support Period, but does not include future releases made after the Support Period. For purposes of this Agreement, the Ultralight software does NOT include its source code.
15 | 1.1.4 "Commercial" means for profit or in commerce, including marketing and promotions activities, whether or not profit, revenues, or sales are generated by such purpose.
16 | 1.1.5 "Commercial Application" has the meaning as set forth in Section 2.2.
17 | 1.1.6 "Confidential Information" means (a) any information disclosed by either Party to the other Party, either directly or indirectly, in writing, orally or by inspection of tangible objects, including, without limitation, trade secrets, data, know-how, materials, inventions, services, formulas, processes, designs, development, photographs, plans, drawings, models, specifications, samples, reports, pricing information, studies, findings, engineering, finances, financial models, business plans, listings and (concepts to the extent practical, Confidential Information will be disclosed in documentary or tangible form marked "Confidential" (collectively, the "Disclosed Materials")) and (b) any information otherwise obtained, directly or indirectly, by a receiving Party through inspection, review or analysis of the Disclosed Materials. Confidential Information shall not lose its status merely because it was disclosed orally. Confidential Information may also include information of a third party that is in the possession of one of the Parties and is disclosed to the other Party under this Agreement. Confidential Information shall not, however, include any information that (i) was publicly known and made generally available in the public domain prior to the time of disclosure by the disclosing Party; (ii) becomes publicly known and made generally available after disclosure by the disclosing Party to the receiving Party through no action or inaction of the receiving Party; (iii) is already in the possession of the receiving Party at the time of disclosure by the disclosing Party as shown by the receiving Party's files and records immediately prior to the time of disclosure; (iv) is obtained by the receiving Party from a third party lawfully in possession of such information and without a breach of such third party's obligations of confidentiality; or (v) is independently developed by the receiving Party without use of or reference to the disclosing Party's Confidential Information, as shown by documents and other competent evidence in the receiving Party's possession. The burden of proof shall be on the receiving Party to establish the existence of facts giving rise by clear and convincing evidence that any of the foregoing exceptions to the receiving Party's obligation of confidence apply.
18 | 1.1.7 "Control" shall mean the possession, directly or indirectly, of the power to direct or cause the direction of the management, activities or policies of any Person, whether through the ownership of voting securities, by contract, employment or otherwise.
19 | 1.1.8 "Disclosed Material" has the meaning as set forth in Section 1.1.6.
20 | 1.1.9 "End Users" has the meaning as set forth in the preamble.
21 | 1.1.10 "Effective Date" has the meaning as set forth in the preamble and is the date the Licensee enters into the Agreement with Ultralight Inc, by the Licensee agreeing to the terms and conditions of the Agreement by signing the Agreement or by otherwise accepting the terms and conditions, e.g., by Licensee clicking on a button on a computer screen, or by Licensee using or installing the Ultralight software.
22 | 1.1.11 "WebKit" is Open Source software code developed by Apple and licensed under the BSD license and other licenses. See also https://webkit.org/licensing-webkit/
23 | 1.1.12 "Improvement" means any enhancement, conception, suggestion, invention or discovery created or otherwise developed by Ultralight Inc or Licensee during the Term, which constitutes an improvement to the Ultralight software.
24 | 1.1.13 "Indemnified Party" has the meaning as set forth in Section 8.3.
25 | 1.1.14 "Indemnifying Party" has the meaning as set forth in Section 8.3.
26 | 1.1.15 "Infringement" has the meaning as set forth in Section 4.6.
27 | 1.1.16 "Internal" means solely within Licensee and Licensee's Affiliates.
28 | 1.1.17 "Ultralight Inc" has the meaning as set forth in the preamble.
29 | 1.1.18 "Licensed Product" means any application, device, or software developed by the Licensee, the access, copy, distribution, display, manufacture, use, or sale of which would, if not licensed under this Agreement, infringe or misappropriate in any way the Ultralight software.
30 | 1.1.19 "Licensee" refers to the party to the Agreement to whom Ultralight Inc grants license rights to the Ultralight software as described herein.
31 | 1.1.20 "Losses" has the meaning as set forth in Section 8.1.
32 | 1.1.21 "Maintenance Release" has the meaning as set forth in ARTICLE 5.
33 | 1.1.22 "Non-Commercial" has the meaning as set forth in Section 2.2.
34 | 1.1.23 "Open Source" means software in which source code is generally available for modification and distribution, and which may include specific license requirements for other software that accesses, embeds, or uses the open source software.
35 | 1.1.24 "Party" or "Parties" has the meaning as set forth in the preamble.
36 | 1.1.25 "Platform" has the meaning as set forth in Section 2.3.
37 | 1.1.26 "Support Period" has the meaning as set forth in ARTICLE 5.
38 | 1.1.27 "Term" has the meaning as set forth in Section 10.1.
39 | 1.1.28 "Trademarks" means any filed or unfiled, common law, state law and federal law rights, as well as all international trademark rights, Ultralight Inc has in any trademarks for Ultralight software.
40 | 1.1.29 "Web" means the World Wide Web as set forth in the preamble.
41 | ARTICLE 2
42 |
43 | LICENSE GRANT
44 | 2.1 Development License Grant. Ultralight Inc hereby grants to Licensee a limited, non-transferable, non-exclusive, revocable, non-sublicensable, world-wide right and license to the Ultralight software solely to develop applications that access, embed, and use the Ultralight software ("Licensed Products"), including to test and evaluate such Licensed Products Internally by Licensee, under the terms and conditions herein. For purposes of clarity, this development license grant in Section 2.1 does not include any right or license to distribute the Ultralight software or to publically display or publically perform Licensed Products utilizing the Ultralight software.
45 | 2.2 Non-Commercial Distribution License Grant. Ultralight Inc hereby grants to Licensee a limited, non-transferable, non-exclusive, revocable, sublicensable as described herein, world-wide right and license to the Ultralight software to copy, develop, display, distribute, export, import, make, publically perform, test, and use a Licensed Product utilizing the Ultralight software, solely for Internal and Non-Commercial purposes, excluding use within Government agencies. The term "Non-Commercial" as used in this Agreement, means academic or other scholarly research which (a) is not undertaken for profit, or (b) is not intended to produce works, services, or data for Commercial use, or (c) is neither conducted, nor funded, by a person or an entity engaged in the Commercial use, application or exploitation of works similar to the software.
46 | 2.3 Limited Commercial Distribution License Grant. Ultralight Inc hereby grants to Licensee a limited, non-transferable, non-exclusive, revocable, sublicensable as described herein, world-wide right and license to the Ultralight software to copy, develop, display, distribute, evaluate, export, import, make, market, publically perform, sell, test, and use a Licensed Product utilizing the Ultralight software for Commercial purposes, excluding use within Government agencies. This provision is NOT valid if Licensee is a company or incorporated entity that had a turnover in excess of US$100,000 in their last fiscal year. In the event Licensee makes a turnover in excess of US$100,000 in any subsequent fiscal year, all commercial distribution provisions of this Agreement will be revoked and Licensee must negotiate a new license with Ultralight Inc to continue commercial distribution.
47 | 2.4 Trademark License. In the event that Licensee, at its sole discretion, decides to use Ultralight Inc's Trademarks, Ultralight Inc hereby grants Licensee a non-exclusive, royalty-free right and license to use, including the right to sublicense, the Trademarks in conjunction with Licensee's marketing, advertising, manufacturing information, and product packaging activities.
48 | 2.4.1 Non-Assignment. Licensee acknowledges and agrees that the trademark rights granted to Licensee by and obtained by Licensee as a result of or in connection with this Agreement are license rights only, and nothing contained in this Agreement constitutes or shall be construed to be an assignment of any or all of Ultralight Inc's rights in the Trademarks. All goodwill associated with such activities of Licensee shall inure to the benefit of the Ultralight Inc.
49 | 2.4.2 Quality of Product. In the event Licensee decides to use Ultralight Inc's Trademarks, Licensee agrees to maintain a high quality of any Licensed Product provided under the Trademark consistent with the quality of previous versions of Ultralight Inc's products as of the Effective Date and consistent with a standard that ensures the continued protection of the Trademark and the goodwill pertaining to the Trademark. In such an event, Ultralight Inc reserves the right to receive samples of the mark as used in conjunction with the Licensed Product no more than once per year or as reasonably provided by Licensee, to ensure that the quality meets the foregoing standard.
50 | 2.4.3 Trademark Format. Licensee shall only use or display the Trademark in a format approved by Ultralight Inc, such approval not to be unreasonably withheld.
51 | 2.4.4 Proper Notice and Acknowledgment. Every use of the Trademark by Licensee shall incorporate in an appropriate manner a "TM" or once it is registered an "R" enclosed by a circle or the phrase "Reg. U.S. Trademark of Ultralight, Inc.".
52 | 2.4.5 Impairment of Ultralight Inc's Rights. If Licensee decides to use the Trademark, Licensee shall not at any time, whether during or after the Term of this Agreement, do or cause to be done any act or thing challenging, contesting, impairing, invalidating, or tending to impair or invalidate any of Ultralight Inc's rights in the Trademark or any registrations derived from such rights.
53 | 2.4.6 Ultralight Inc's Rights and Remedies. If Licensee decides to use the Trademark, Licensee acknowledges and agrees that Ultralight Inc has, shall retain and may exercise, both during the Term of this Agreement and thereafter, all rights and remedies available to Ultralight Inc, whether derived from this Agreement, from statute, or otherwise, as a result of or in connection with Licensee's breach of the trademark license granted in this Agreement, misuse of the Trademark or any other use of the Trademark by Licensee which is not permitted by this Agreement.
54 | ARTICLE 3
55 |
56 | RESTRICTIONS AND IMPROVEMENTS
57 | 3.1 Restrictions. All rights not expressly granted in this Agreement are reserved by Ultralight Inc. Nothing contained in this Agreement shall be interpreted to give Licensee any rights with respect to any copyrights, patents, trademarks, or other intellectual property, including software by Ultralight Inc other than Ultralight software under the terms described herein.
58 | 3.2 Ownership of Intellectual Property. As between Ultralight Inc and Licensee, Ultralight Inc owns and shall continue to own all intellectual property rights in the Ultralight software. Nothing in this agreement shall be construed to grant Ultralight Inc any rights to Licensee's Licensed Products, except as expressly stated herein.
59 | 3.3 Interest in Improvements. Ultralight Inc shall own all intellectual property rights and all other property rights in new patent applications and Improvements which Ultralight Inc makes to the Ultralight software, including using information received from Licensee or while performing Ultralight Inc's obligations under the terms of this Agreement. Licensee hereby assigns, transfers and conveys to Ultralight Inc, and the Ultralight Inc hereby accepts and assumes, free and clear of and from encumbrances, all right, title and interest, together with all rights of priority, in and to such Improvements and the patent(s) that may issue from such Improvements, and including the subject matter of all claims that may be obtained therefrom, any foreign counterparts or equivalents thereto, existing now or in the future, and any and all divisionals, continuations (in whole or in part), reissues, renewals and extensions of any of the foregoing, any substitutions therefore and any patents that may issue from the foregoing, the same to be held and enjoyed by Ultralight Inc for its own use and benefit, and for the use and benefit of its successors or assigns, to the end of the term or terms for which said patents are or may be granted or reissued, as fully and entirely as the same would have been held and enjoyed by the Licensee if this assignment had not been made. Such assignment includes, without limitation, all income, royalties, damages or payments due or payable after the Effective Date related to any of the foregoing and all claims for damages by reason of past, present or future infringement or other unauthorized use of the foregoing, with the right to sue for and collect the same. Licensee hereby authorizes and requests the Commissioner of Patents of the United States Patent and Trademark Office, or any equivalent body in any foreign jurisdiction, to record this assignment so as to reflect Ultralight Inc's ownership of the Improvements. Licensee hereby covenants and agrees that the Licensee will, at any time, upon request, execute and deliver any and all papers and take any and all other reasonable actions that may be necessary or desirable to implement or perfect this assignment, without further compensation but at the expense of the assignee, its successors or assigns with respect to Licensee's reasonable out-of-pocket costs.
60 | 3.4 Protection of Improvements. Ultralight Inc shall prepare, file, prosecute, obtain, maintain and enforce any or all intellectual property rights in, to, and under the Improvements. Notwithstanding the foregoing, Ultralight Inc shall be under no obligation to prosecute or pursue intellectual property protection, in, to or under any Improvements inside or outside of the United States.
61 | ARTICLE 4
62 |
63 | CERTAIN LICENSEE OBLIGATIONS
64 | 4.1 No Reverse Engineering. Unless otherwise agreed to in writing, Licensee agrees not to reverse engineer, decompile, disassemble, modify, translate, make any attempt to discover the source code of the Ultralight software, or modify, or otherwise create derivative works of, the Ultralight software.
65 | 4.2 No Static Linking. Unless otherwise agreed to in writing, Licensee agrees not to access the Ultralight.dll using static-linking tools or other methods that hide or conceal any of the Ultralight software.
66 | 4.3 Licensing of End Users. Subject to the license grant in ARTICLE 2, Licensee may distribute to End Users the Ultralight software, as part of and in conjunction with Licensed Products, provided that such distribution to End Users is subject to the End User License Agreement in Exhibit A, or a license by Licensee having substantially the same terms and conditions.
67 | 4.4 Marking. Licensee shall ensure that the following legend, or a successor legend as designated by Ultralight Inc from time to time, shall appear in the credit section of any Licensed Product:
68 |
69 | Please see the accompanying NOTICES.txt for full text.
70 |
71 | 4.5 Export Controls. The Ultralight software, including any downloading or use of, may be subject to export controls imposed by U.S. export control laws, including the U.S. Export Administration Act and its associated regulations, and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such regulations and acknowledges that Licensee has the responsibility to obtain licenses to export, re-export, or import the Ultralight software.
72 | 4.6 Infringement. Licensee agrees to promptly notify Ultralight Inc if it becomes aware of any third party that infringes Ultralight Inc's intellectual property rights, including misappropriation of the Ultralight software or violations of an End User license agreement (an "Infringement"). Ultralight Inc, at its discretion, shall have the right, but not the obligation, to enforce intellectual property rights against any Infringement. Ultralight Inc shall solely control any such enforcement action.
73 | 4.7 Update Contact Information. Licensee shall promptly report to Ultralight Inc any change in mailing address, name or company affiliation during the period of this Agreement, and Licensee also shall promptly report when, and if, Licensee discontinues its development and marketing of the Ultralight software, and/or when Licensee discontinues its efforts to bring the Licensed Products to practical application.
74 | ARTICLE 5
75 |
76 | [THIS SECTION INTENTIONALLY RESERVED.]
77 | ARTICLE 6
78 |
79 | PAYMENTS AND ROYALTY
80 | 6.1 Payment. No payment or royalty is required for this Free License Agreement. For Commercial purposes or additional license rights, please contact Ultralight Inc: Ultralight, Inc., 15822 Jamie Lee Drive, Houston, Texas 77095, or through e-mail: sales@ultralig.ht
81 | ARTICLE 7
82 |
83 | REPRESENTATIONS AND WARRANTIES
84 | 7.1 LIMITATION OF WARRANTY; "AS IS". THE ULTRALIGHT SOFTWARE, INCLUDING, WITHOUT LIMITATION, ALL SOFTWARE, DOCUMENTS, FUNCTIONS, MATERIALS, AND INFORMATION, IS PROVIDED "AS IS." TO THE FULLEST EXTENT PERMISSIBLY BY LAW, Ultralight Inc MAKES NO OTHER REPRESENTATIONS, EXTENDS NO OTHER WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT (INCLUDING ANY OPEN SOURCE VIOLATIONS), AND ASSUMES NO LIABILITY TO LICENSEE OR ANY OTHER PERSON FOR OR ON ACCOUNT OF ANY INJURY, LOSS OR DAMAGE, OF ANY KIND OR NATURE, SUSTAINED BY, OR ANY DAMAGE ASSESSED OR ASSERTED AGAINST, OR ANY OTHER LIABILITY INCURRED BY OR IMPOSED ON LICENSEE OR ANY OTHER PERSON (INCLUDING DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES, NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)), ARISING OUT OF OR IN CONNECTION WITH OR RESULTING FROM THE USE OF THE ULTRALIGHT SOFTWARE OR THIS AGREEMENT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
85 | 7.2 Maximum Liability. Regardless of the basis on which a claim is made (including fundamental breach, negligence, misrepresentation, or other contract or tort claim), Ultralight Inc's maximum liability under this Agreement is further limited to the lesser of: the amount paid or due Ultralight Inc under this Agreement, or one US Dollar (USD$1.00). This limitation shall not apply to any claim based on an indemnity in ARTICLE 8 below.
86 | ARTICLE 8
87 |
88 | INDEMNIFICATION
89 | 8.1 Indemnification by Licensee. Provided that Ultralight Inc provides prompt and reasonable notice to Licensee, then Licensee shall defend and indemnify Ultralight Inc from and against any and all claims for damages, losses, liabilities, costs and expenses (including reasonable legal fees and expenses), deficiencies, including interest and penalties imposed or assessed by any judicial or administrative body, including, all amounts paid in investigation, defense or settlement of the foregoing, (collectively, the "Losses") incurred by Ultralight Inc that arise out of:
90 | 8.1.1 any breach of Licensee's obligations in ARTICLE 4; or
91 | 8.1.2 any breach of the confidentiality obligations under ARTICLE 9 by Licensee, its Affiliates, employees, or contractors; or
92 | 8.1.3 any third-party claim of infringement or misappropriation that arises out of the Licensed Product due to use of the Ultralight software in combination with Licensee's software or technology.
93 | 8.2 Indemnification by Ultralight Inc. Provided that Licensee provides prompt and reasonable notice to Ultralight Inc, then Ultralight Inc shall defend and indemnify Licensee from and against all Losses incurred by Licensee that arise out of: any breach of the confidentiality obligations under ARTICLE 9 by Ultralight Inc, its Affiliates, employees, or contractors.
94 | 8.3 Party Seeking Indemnification. (a) If either Party seeks indemnification under the terms of this ARTICLE 8 (the "Indemnified Party") against the other Party (the "Indemnifying Party"), the Indemnified Party shall promptly notify the Indemnifying Party in writing of the third party claim or threatened third party claim it receives notice thereof, shall permit the Indemnifying Party, at the Indemnifying Party's cost and expense, to assume direction and control of the defense of the third party claim, and shall cooperate as requested (at the expense of the Indemnifying Party), in the defense of the claim.
95 | 8.3.1 The obligations of the Indemnifying Party to indemnify the Indemnified Party pursuant to Section 8.1 and Section 8.2 are conditioned upon the delivery of written notice to the Indemnifying Party of any asserted or threatened third party claim promptly after the Indemnified Party becomes aware of such third party claim; provided, that, the failure of the Indemnified Party to give such notice or any delay thereof shall not offset the Indemnified Party's right to indemnification hereunder, except to the extent that such failure or delay impairs the Indemnifying Party's ability to defend or contest any such third party claim.
96 | ARTICLE 9
97 |
98 | CONFIDENTIALITY
99 | 9.1 Non-use and Non-disclosure. Each Party agrees not to use any Confidential Information of the other Party for any purpose except for the purposes set forth in this Agreement. Each Party agrees not to disclose any Confidential Information of the other Party, except that, subject to Section 9.2 below, a receiving Party may disclose the other Party's Confidential Information (except Source Code unless otherwise specified in writing) to those employees of the receiving Party who are required to have the information for the purposes set forth in this Agreement, and relevant consultants, provided that the receiving Party first obtains a signed confidentiality agreement with terms similar to this Agreement from the consultants, such that consultants are under a confidentiality obligation to the receiving Party. If a receiving Party is required by law to make any disclosure that is prohibited or otherwise constrained by this Agreement, the receiving Party will provide the disclosing Party with prompt written notice of such requirement so that the disclosing Party may seek a protective order or other appropriate relief. Subject to the foregoing sentence, such receiving Party may furnish that portion (and only that portion) of the Confidential Information that the receiving Party is legally compelled or is otherwise legally required to disclose; provided, however, that the receiving Party provides such reasonable assistance as the disclosing Party may request in obtaining such order or other relief.
100 | 9.2 Maintenance of Confidentiality. Each Party agrees that it shall take reasonable measures to protect the secrecy of and avoid disclosure and unauthorized use of the Confidential Information of the other Party. Without limiting the foregoing, each Party shall take at least those measures that it takes to protect its own confidential information of a similar nature, but in no case less than reasonable care (including, without limitation, all precautions the receiving Party employs with respect to its confidential materials). Prior to any disclosure of Confidential Information to its employees, each Party shall ensure that such employees who have access to the other Party's Confidential Information have signed a non-disclosure agreement in content similar to the provisions of this Agreement or are otherwise legally obligated not to disclose such Confidential Information. Each Party shall reproduce the other Party's proprietary rights notices on any photo or electronic copies, in the same manner in which such notices were set forth in or on the original. A Party receiving Confidential Information shall promptly notify the Party disclosing such Confidential Information of any use or disclosure of such Confidential Information in violation of this Agreement of which the receiving Party becomes aware.
101 | 9.3 Source Code. For purposes of clarity, any Source Code may not be disclosed by a receiving Party to any third party, including consultants under non-disclosure agreements, without the prior written consent of the disclosing Party.
102 | 9.4 Limitation on Copying. Other than Ultralight Inc's rights in the Improvements, the disclosing Party retains and owns all copyrights, rights in derivative works in the Confidential Information and the receiving Party hereby agrees not to copy the Confidential Information, in whole or in part, except as is necessary to perform its tasks under this Agreement.
103 | 9.5 Return of Materials. All documents and other tangible objects containing or representing Confidential Information that have been disclosed by either Party to the other Party, shall be and remain the property of the disclosing Party and shall be promptly returned to the disclosing Party upon the disclosing Party's written request. Notwithstanding the foregoing, one (1) copy of any written or photographic Confidential Information provided by the other Party may be retained by the receiving Party for archival purposes only.
104 | 9.6 Duration. The confidentiality obligations of each receiving Party under this Agreement shall survive until such time as all Confidential Information of the other Party disclosed hereunder becomes publicly known and made generally available through no action or inaction of the receiving Party. The obligations to hold information in confidence as required by ARTICLE 9 also shall survive any termination of this Agreement.
105 | 9.7 Duty to Notify of Confidentiality Breach. Either Party shall immediately provide written notice to the other Party of any breach of this ARTICLE 9, specifying the specific nature of the breach. The breaching Party shall then have thirty (30) days to reasonably cure the breach. Should such breach not be reasonably cured within sixty (60) days from receipt of such notice, then the non-breaching Party may terminate this Agreement.
106 | 9.8 Availability of Equitable Relief. Each Party understands and agrees that its breach or threatened breach of this Agreement will cause irreparable injury to the other Party and that money damages will not provide an adequate remedy for such breach or threatened breach, and both parties hereby agree that, in the event of such a breach or threatened breach, the non-breaching Party will also be entitled, without the requirement of posting a bond or other security, to equitable relief, including injunctive relief and specific performance. The Parties' rights under this Agreement are cumulative, and a Party's exercise of one right shall not waive the Party's right to assert any other legal remedy.
107 | ARTICLE 10
108 |
109 | TERM AND TERMINATION
110 | 10.1 Term. This Agreement will be for a term beginning on the Effective Date and will continue in effect unless otherwise terminated as provided by under Section 9.7 or as provided for in this ARTICLE 10, including:
111 | 10.1.1 Termination by Licensee. Licensee may terminate this Agreement by providing Ultralight Inc with thirty (30) days prior written notice intent to terminate.
112 | 10.1.2 Termination by Ultralight Inc. Ultralight Inc may terminate this Agreement with notification to Licensee of any breach of Licensee's obligations in ARTICLE 4 if such breach is not reasonably cured within thirty (30) days from receipt of such notice.
113 | 10.2 Effect of Termination. Upon termination or expiration of this Agreement, (1) the licenses granted to Licensee herein shall immediately cease; (2) if Licensee has decided to use the Trademark, Licensee shall immediately cease and desist from using the Trademark in conjunction with any future marketing and advertising activities; and (3) any license fee, consulting fee, or other payment owed by Licensee to Ultralight Inc shall become immediately due and payable.
114 | 10.3 Surviving Provisions. Notwithstanding any provision herein to the contrary, the rights and obligations of the Parties set forth in Articles 3, 7, 8, 9, 10 and 11, as well as any rights or obligations otherwise accrued hereunder, including any accrued payment obligations, shall survive the expiration or termination of the Term.
115 | ARTICLE 11
116 |
117 | GENERAL PROVISIONS
118 | 11.1 Severability. If any provision(s) of this Agreement are deemed to be unenforceable or are or become invalid, or are ruled illegal by any court of appropriate jurisdiction under then current applicable law from time to time in effect during the Term hereof, it is the intention of the Parties that the remainder of this Agreement shall not be affected thereby provided that a Party's rights under this Agreement are not materially affected. The Parties hereto covenant and agree to renegotiate any such term, covenant or application thereof in good faith in order to provide a reasonably acceptable alternative to the term, covenant or condition of this Agreement or the application thereof that is invalid, illegal or unenforceable, it being the intent of the Parties that the basic purposes of this Agreement are to be effectuated.
119 | 11.2 Venue and Jurisdiction. This Agreement shall be governed by and construed in accordance with the internal laws of the State of Texas, without reference to its conflicts of laws and choice of law rules or principles. Any disputes arising hereunder shall be adjudicated in Harris County, Texas, which state or federal courts having appropriate jurisdiction shall have exclusive jurisdiction over such dispute(s) but not including any appeals from decisions therefrom.
120 | 11.3 Notification. All notices, requests and other communications hereunder shall be in writing, shall be addressed to the receiving Party's address set forth below or as otherwise provided by Licensee to Ultralight Inc, or to such other address as a Party may designate by notice hereunder, and shall be either: (a) delivered by hand; (b) made by facsimile transmission (to be followed with written fax confirmation); (c) sent by private courier service providing evidence of receipt; or (d) sent by registered or certified mail, return receipt requested, postage prepaid. The addresses and other contact information for the Parties are as follows:
121 |
122 | If to Ultralight Inc:
123 | Mr. Adam Simmons
124 | 15822 Jamie Lee Drive
125 | Houston, Texas 77095
126 |
127 | All notices, requests and other communications hereunder shall be deemed to have been given either: (a) if by hand, at the time of the delivery thereof to the receiving Party at the address of such Party set forth above; (b) if made by telecopy or facsimile transmission, at the time that receipt thereof has been acknowledged by the recipient; (c) if sent by private courier, on the day such notice is delivered to the recipient; or (d) if sent by registered or certified mail, on the fifth (5th) business day following the day such mailing is made.
128 | 11.4 Entire Agreement. This is the entire Agreement between the Parties with respect to the subject matter hereof and supersedes all prior representations, understandings and agreements between the Parties with respect to the subject matter hereof. No modification shall be effective unless in writing with specific reference to this Agreement and signed by the Parties.
129 | 11.5 Waiver. The terms or conditions of this Agreement may be waived only by a non-electronic written instrument executed by the Party waiving compliance. The failure of either Party at any time or times to require performance of any provision hereof shall in no manner affect its rights at a later time to enforce the same. No waiver by either Party of any condition or term shall be deemed as a continuing waiver of such condition or term or of another condition or term.
130 | 11.6 Headings. Section and subsection headings are inserted for convenience of reference only and do not form part of this Agreement.
131 | 11.7 Assignment. Neither this Agreement nor any right or obligation hereunder may be assigned, delegated or otherwise transferred, in whole or part, by either Party without the prior express written consent of the other provided, provided, however, that either Party may, without the prior written consent of the other Party, assign this Agreement and its rights and delegate its obligations hereunder to its Affiliates, and may assign this Agreement in conjunction with an acquisition, merger, sale of substantially all of its assets, or other business combination. Any permitted assignee shall assume all obligations of its assignor under this Agreement. Any purported assignment in violation of this Section 11.7 shall be void. The terms and conditions of this Agreement shall be binding upon and inure to the benefit of the permitted successors and assigns of the Parties.
132 | 11.8 Force Majeure. Neither Party shall be liable for failure of or delay in performing obligations set forth in this Agreement, and neither shall be deemed in breach of its obligations, if such failure or delay is due to natural disasters, acts of terrorism or any other causes beyond the reasonable control of such Party. In event of such force majeure, the Party affected thereby shall use reasonable efforts to cure or overcome the same and resume performance of its obligations hereunder.
133 | 11.9 Construction. The Parties hereto acknowledge and agree that: (i) each Party and its counsel reviewed and negotiated the terms and provisions of this Agreement and have contributed to its revision; (ii) the rule of construction to the effect that any ambiguities are resolved against the drafting Party shall not be employed in the interpretation of this Agreement; and (iii) the terms and provisions of this Agreement shall be construed fairly as to all Parties hereto and not in favor of or against any Party, regardless of which Party was generally responsible for the preparation of this Agreement.
134 | 11.10 Status. Nothing in this Agreement is intended or shall be deemed to constitute a partner, agency, employer-employee, or joint venture relationship between the Parties.
135 | 11.11 Further Assurances. Each Party agrees to execute, acknowledge and deliver such further instructions, and to do all such other acts, as may be reasonably necessary or appropriate in order to carry out the purposes and intent of this Agreement.
136 | 11.12 Counterparts. This Agreement may be executed simultaneously in one or more counterparts, each of which shall be deemed an original, but all of which together shall constitute one and the same instrument.
137 | 11.13 Negotiation and Mediation. If an issue arises over the subject matter of this Agreement, before initiating litigation, the Parties hereby agree to attempt in good faith to settle any disputes or issues through mediation, including a direct exchange between chief executives, at least thirty (30) days prior to any filing suit.
138 |
139 | /end
--------------------------------------------------------------------------------
/ultralight/libs/darwin/x64/libAppCore.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ImVexed/muon/63fb5c0bb88207f6a9d76138097354b8bf7b7a69/ultralight/libs/darwin/x64/libAppCore.dylib
--------------------------------------------------------------------------------
/ultralight/libs/darwin/x64/libUltralight.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ImVexed/muon/63fb5c0bb88207f6a9d76138097354b8bf7b7a69/ultralight/libs/darwin/x64/libUltralight.dylib
--------------------------------------------------------------------------------
/ultralight/libs/darwin/x64/libUltralightCore.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ImVexed/muon/63fb5c0bb88207f6a9d76138097354b8bf7b7a69/ultralight/libs/darwin/x64/libUltralightCore.dylib
--------------------------------------------------------------------------------
/ultralight/libs/darwin/x64/libWebCore.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ImVexed/muon/63fb5c0bb88207f6a9d76138097354b8bf7b7a69/ultralight/libs/darwin/x64/libWebCore.dylib
--------------------------------------------------------------------------------
/ultralight/libs/linux/x64/libAppCore.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ImVexed/muon/63fb5c0bb88207f6a9d76138097354b8bf7b7a69/ultralight/libs/linux/x64/libAppCore.so
--------------------------------------------------------------------------------
/ultralight/libs/linux/x64/libUltralight.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ImVexed/muon/63fb5c0bb88207f6a9d76138097354b8bf7b7a69/ultralight/libs/linux/x64/libUltralight.so
--------------------------------------------------------------------------------
/ultralight/libs/linux/x64/libUltralightCore.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ImVexed/muon/63fb5c0bb88207f6a9d76138097354b8bf7b7a69/ultralight/libs/linux/x64/libUltralightCore.so
--------------------------------------------------------------------------------
/ultralight/libs/linux/x64/libWebCore.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ImVexed/muon/63fb5c0bb88207f6a9d76138097354b8bf7b7a69/ultralight/libs/linux/x64/libWebCore.so
--------------------------------------------------------------------------------
/ultralight/libs/windows/x32/AppCore.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ImVexed/muon/63fb5c0bb88207f6a9d76138097354b8bf7b7a69/ultralight/libs/windows/x32/AppCore.dll
--------------------------------------------------------------------------------
/ultralight/libs/windows/x32/Ultralight.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ImVexed/muon/63fb5c0bb88207f6a9d76138097354b8bf7b7a69/ultralight/libs/windows/x32/Ultralight.dll
--------------------------------------------------------------------------------
/ultralight/libs/windows/x32/UltralightCore.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ImVexed/muon/63fb5c0bb88207f6a9d76138097354b8bf7b7a69/ultralight/libs/windows/x32/UltralightCore.dll
--------------------------------------------------------------------------------
/ultralight/libs/windows/x32/WebCore.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ImVexed/muon/63fb5c0bb88207f6a9d76138097354b8bf7b7a69/ultralight/libs/windows/x32/WebCore.dll
--------------------------------------------------------------------------------
/ultralight/libs/windows/x64/AppCore.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ImVexed/muon/63fb5c0bb88207f6a9d76138097354b8bf7b7a69/ultralight/libs/windows/x64/AppCore.dll
--------------------------------------------------------------------------------
/ultralight/libs/windows/x64/Ultralight.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ImVexed/muon/63fb5c0bb88207f6a9d76138097354b8bf7b7a69/ultralight/libs/windows/x64/Ultralight.dll
--------------------------------------------------------------------------------
/ultralight/libs/windows/x64/UltralightCore.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ImVexed/muon/63fb5c0bb88207f6a9d76138097354b8bf7b7a69/ultralight/libs/windows/x64/UltralightCore.dll
--------------------------------------------------------------------------------
/ultralight/libs/windows/x64/WebCore.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ImVexed/muon/63fb5c0bb88207f6a9d76138097354b8bf7b7a69/ultralight/libs/windows/x64/WebCore.dll
--------------------------------------------------------------------------------
/ultralight/types.go:
--------------------------------------------------------------------------------
1 | // THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS.
2 |
3 | // WARNING: This file has automatically been generated on Mon, 07 Oct 2019 13:59:36 CDT.
4 | // Code generated by https://git.io/c-for-go. DO NOT EDIT.
5 |
6 | package ultralight
7 |
8 | /*
9 | #cgo CFLAGS: -I../include
10 | #cgo windows,386 LDFLAGS: -L${SRCDIR}/libs/windows/x32
11 | #cgo windows,amd64 LDFLAGS: -L${SRCDIR}/libs/windows/x64
12 | #cgo darwin,amd64 LDFLAGS: -L${SRCDIR}/libs/darwin/x64
13 | #cgo linux,amd64 LDFLAGS: -L${SRCDIR}/libs/linux/x64
14 | #cgo LDFLAGS: -lUltralightCore -lWebCore -lUltralight -lAppCore
15 | #include "AppCore/CAPI.h"
16 | #include
17 | #include "cgo_helpers.h"
18 | */
19 | import "C"
20 | import "unsafe"
21 |
22 | // ULSettings as declared in AppCore/CAPI.h:33
23 | type ULSettings C.ULSettings
24 |
25 | // ULApp as declared in AppCore/CAPI.h:34
26 | type ULApp C.ULApp
27 |
28 | // ULWindow as declared in AppCore/CAPI.h:35
29 | type ULWindow C.ULWindow
30 |
31 | // ULMonitor as declared in AppCore/CAPI.h:36
32 | type ULMonitor C.ULMonitor
33 |
34 | // ULOverlay as declared in AppCore/CAPI.h:37
35 | type ULOverlay C.ULOverlay
36 |
37 | // ULUpdateCallback type as declared in AppCore/CAPI.h:118
38 | type ULUpdateCallback func(user_data unsafe.Pointer)
39 |
40 | // ULCloseCallback type as declared in AppCore/CAPI.h:195
41 | type ULCloseCallback func(user_data unsafe.Pointer)
42 |
43 | // ULResizeCallback type as declared in AppCore/CAPI.h:205
44 | type ULResizeCallback func(user_data unsafe.Pointer, width uint32, height uint32)
45 |
46 | // ULChar16 type as declared in Ultralight/CAPI.h:43
47 | type ULChar16 uint16
48 |
49 | // ULConfig as declared in Ultralight/CAPI.h:50
50 | type ULConfig C.ULConfig
51 |
52 | // ULRenderer as declared in Ultralight/CAPI.h:51
53 | type ULRenderer C.ULRenderer
54 |
55 | // ULView as declared in Ultralight/CAPI.h:52
56 | type ULView C.ULView
57 |
58 | // ULBitmap as declared in Ultralight/CAPI.h:53
59 | type ULBitmap C.ULBitmap
60 |
61 | // ULString as declared in Ultralight/CAPI.h:54
62 | type ULString C.ULString
63 |
64 | // ULBuffer as declared in Ultralight/CAPI.h:55
65 | type ULBuffer C.ULBuffer
66 |
67 | // ULRenderTarget as declared in Ultralight/CAPI.h:56
68 | type ULRenderTarget C.ULRenderTarget
69 |
70 | // ULKeyEvent as declared in Ultralight/CAPI.h:57
71 | type ULKeyEvent C.ULKeyEvent
72 |
73 | // ULMouseEvent as declared in Ultralight/CAPI.h:58
74 | type ULMouseEvent C.ULMouseEvent
75 |
76 | // ULScrollEvent as declared in Ultralight/CAPI.h:59
77 | type ULScrollEvent C.ULScrollEvent
78 |
79 | // ULChangeTitleCallback type as declared in Ultralight/CAPI.h:409
80 | type ULChangeTitleCallback func(user_data unsafe.Pointer, caller ULView, title ULString)
81 |
82 | // ULChangeURLCallback type as declared in Ultralight/CAPI.h:419
83 | type ULChangeURLCallback func(user_data unsafe.Pointer, caller ULView, url ULString)
84 |
85 | // ULChangeTooltipCallback type as declared in Ultralight/CAPI.h:429
86 | type ULChangeTooltipCallback func(user_data unsafe.Pointer, caller ULView, tooltip ULString)
87 |
88 | // ULChangeCursorCallback type as declared in Ultralight/CAPI.h:439
89 | type ULChangeCursorCallback func(user_data unsafe.Pointer, caller ULView, cursor ULCursor)
90 |
91 | // ULAddConsoleMessageCallback type as declared in Ultralight/CAPI.h:449
92 | type ULAddConsoleMessageCallback func(user_data unsafe.Pointer, caller ULView, source ULMessageSource, level ULMessageLevel, message ULString, line_number uint32, column_number uint32, source_id ULString)
93 |
94 | // ULBeginLoadingCallback type as declared in Ultralight/CAPI.h:464
95 | type ULBeginLoadingCallback func(user_data unsafe.Pointer, caller ULView)
96 |
97 | // ULFinishLoadingCallback type as declared in Ultralight/CAPI.h:474
98 | type ULFinishLoadingCallback func(user_data unsafe.Pointer, caller ULView)
99 |
100 | // ULUpdateHistoryCallback type as declared in Ultralight/CAPI.h:484
101 | type ULUpdateHistoryCallback func(user_data unsafe.Pointer, caller ULView)
102 |
103 | // ULDOMReadyCallback type as declared in Ultralight/CAPI.h:494
104 | type ULDOMReadyCallback func(user_data unsafe.Pointer, caller ULView)
105 |
106 | // JSContextGroupRef as declared in JavaScriptCore/JSBase.h:40
107 | type JSContextGroupRef C.JSContextGroupRef
108 |
109 | // JSContextRef as declared in JavaScriptCore/JSBase.h:43
110 | type JSContextRef C.JSContextRef
111 |
112 | // JSGlobalContextRef as declared in JavaScriptCore/JSBase.h:46
113 | type JSGlobalContextRef C.JSGlobalContextRef
114 |
115 | // JSStringRef as declared in JavaScriptCore/JSBase.h:49
116 | type JSStringRef C.JSStringRef
117 |
118 | // JSClassRef as declared in JavaScriptCore/JSBase.h:52
119 | type JSClassRef C.JSClassRef
120 |
121 | // JSPropertyNameArrayRef as declared in JavaScriptCore/JSBase.h:55
122 | type JSPropertyNameArrayRef C.JSPropertyNameArrayRef
123 |
124 | // JSPropertyNameAccumulatorRef as declared in JavaScriptCore/JSBase.h:58
125 | type JSPropertyNameAccumulatorRef C.JSPropertyNameAccumulatorRef
126 |
127 | // JSTypedArrayBytesDeallocator type as declared in JavaScriptCore/JSBase.h:61
128 | type JSTypedArrayBytesDeallocator func(bytes unsafe.Pointer, deallocatorContext unsafe.Pointer)
129 |
130 | // JSValueRef as declared in JavaScriptCore/JSBase.h:66
131 | type JSValueRef C.JSValueRef
132 |
133 | // JSObjectRef as declared in JavaScriptCore/JSBase.h:69
134 | type JSObjectRef C.JSObjectRef
135 |
136 | // JSPropertyAttributes type as declared in JavaScriptCore/JSObjectRef.h:61
137 | type JSPropertyAttributes uint32
138 |
139 | // JSClassAttributes type as declared in JavaScriptCore/JSObjectRef.h:77
140 | type JSClassAttributes uint32
141 |
142 | // JSObjectInitializeCallback type as declared in JavaScriptCore/JSObjectRef.h:92
143 | type JSObjectInitializeCallback func(ctx JSContextRef, object JSObjectRef)
144 |
145 | // JSObjectFinalizeCallback type as declared in JavaScriptCore/JSObjectRef.h:110
146 | type JSObjectFinalizeCallback func(object JSObjectRef)
147 |
148 | // JSObjectHasPropertyCallback type as declared in JavaScriptCore/JSObjectRef.h:130
149 | type JSObjectHasPropertyCallback func(ctx JSContextRef, object JSObjectRef, propertyName JSStringRef) bool
150 |
151 | // JSObjectGetPropertyCallback type as declared in JavaScriptCore/JSObjectRef.h:147
152 | type JSObjectGetPropertyCallback func(ctx JSContextRef, object JSObjectRef, propertyName JSStringRef, exception []JSValueRef) JSValueRef
153 |
154 | // JSObjectSetPropertyCallback type as declared in JavaScriptCore/JSObjectRef.h:165
155 | type JSObjectSetPropertyCallback func(ctx JSContextRef, object JSObjectRef, propertyName JSStringRef, value JSValueRef, exception []JSValueRef) bool
156 |
157 | // JSObjectDeletePropertyCallback type as declared in JavaScriptCore/JSObjectRef.h:182
158 | type JSObjectDeletePropertyCallback func(ctx JSContextRef, object JSObjectRef, propertyName JSStringRef, exception []JSValueRef) bool
159 |
160 | // JSObjectGetPropertyNamesCallback type as declared in JavaScriptCore/JSObjectRef.h:199
161 | type JSObjectGetPropertyNamesCallback func(ctx JSContextRef, object JSObjectRef, propertyNames JSPropertyNameAccumulatorRef)
162 |
163 | // JSObjectCallAsFunctionCallback type as declared in JavaScriptCore/JSObjectRef.h:220
164 | type JSObjectCallAsFunctionCallback func(ctx JSContextRef, function JSObjectRef, thisObject JSObjectRef, argumentCount uint, arguments []JSValueRef, exception []JSValueRef) JSValueRef
165 |
166 | // JSObjectCallAsConstructorCallback type as declared in JavaScriptCore/JSObjectRef.h:240
167 | type JSObjectCallAsConstructorCallback func(ctx JSContextRef, constructor JSObjectRef, argumentCount uint, arguments []JSValueRef, exception []JSValueRef) JSObjectRef
168 |
169 | // JSObjectHasInstanceCallback type as declared in JavaScriptCore/JSObjectRef.h:261
170 | type JSObjectHasInstanceCallback func(ctx JSContextRef, constructor JSObjectRef, possibleInstance JSValueRef, exception []JSValueRef) bool
171 |
172 | // JSObjectConvertToTypeCallback type as declared in JavaScriptCore/JSObjectRef.h:280
173 | type JSObjectConvertToTypeCallback func(ctx JSContextRef, object JSObjectRef, _type JSType, exception []JSValueRef) JSValueRef
174 |
175 | // JSStaticValue as declared in JavaScriptCore/JSObjectRef.h:295
176 | type JSStaticValue struct {
177 | Name string
178 | GetProperty JSObjectGetPropertyCallback
179 | SetProperty JSObjectSetPropertyCallback
180 | Attributes JSPropertyAttributes
181 | ref34655956 *C.JSStaticValue
182 | allocs34655956 interface{}
183 | }
184 |
185 | // JSStaticFunction as declared in JavaScriptCore/JSObjectRef.h:308
186 | type JSStaticFunction struct {
187 | Name string
188 | CallAsFunction JSObjectCallAsFunctionCallback
189 | Attributes JSPropertyAttributes
190 | ref6b5f4953 *C.JSStaticFunction
191 | allocs6b5f4953 interface{}
192 | }
193 |
194 | // JSClassDefinition as declared in JavaScriptCore/JSObjectRef.h:364
195 | type JSClassDefinition struct {
196 | Version int32
197 | Attributes JSClassAttributes
198 | ClassName string
199 | ParentClass JSClassRef
200 | StaticValues []JSStaticValue
201 | StaticFunctions []JSStaticFunction
202 | Initialize JSObjectInitializeCallback
203 | Finalize JSObjectFinalizeCallback
204 | HasProperty JSObjectHasPropertyCallback
205 | GetProperty JSObjectGetPropertyCallback
206 | SetProperty JSObjectSetPropertyCallback
207 | DeleteProperty JSObjectDeletePropertyCallback
208 | GetPropertyNames JSObjectGetPropertyNamesCallback
209 | CallAsFunction JSObjectCallAsFunctionCallback
210 | CallAsConstructor JSObjectCallAsConstructorCallback
211 | HasInstance JSObjectHasInstanceCallback
212 | ConvertToType JSObjectConvertToTypeCallback
213 | ref192c18d5 *C.JSClassDefinition
214 | allocs192c18d5 interface{}
215 | }
216 |
217 | // JSChar type as declared in JavaScriptCore/JSStringRef.h:49
218 | type JSChar uint16
219 |
--------------------------------------------------------------------------------