fpwebview: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: fpwebview
| Old | New | Line | |
|---|---|---|---|
| 1 | + | ## About | |
| 2 | + | ||
| 3 | + | **fpwebview** is Free Pascal binding for [webview](https://github.com/webview/webview), the cross-platform library that links with gtk-webkit2 on Linux, Cocoa/WebKit on macOS and Edge on Windows 10 for building desktop hybrid GUI+web applications. | |
| 4 | + | ||
| 5 | + | Supporting shared library, dylib, DLL and import library files for x86_64 (Linux, macOS, Windows), i386 (Windows) and aarch64 (macOS) are bundled. | |
| 6 | + | ||
| 7 | + | ## Getting started | |
| 8 | + | ||
| 9 | + | **Linux** | |
| 10 | + | ||
| 11 | + | `% git clone `[`https://github.com/PierceNg/fpwebview`](https://github.com/PierceNg/fpwebview)\ | |
| 12 | + | `% cd fpwebview/demo/browser_cli`\ | |
| 13 | + | `% ./linbuild.sh`\ | |
| 14 | + | `<output>`\ | |
| 15 | + | `% ./linrun.sh` | |
| 16 | + | ||
| 17 | + | **macOS** | |
| 18 | + | ||
| 19 | + | `% git clone `[`https://github.com/PierceNg/fpwebview`](https://github.com/PierceNg/fpwebview)\ | |
| 20 | + | `% cd fpwebview/demo/browser_cli`\ | |
| 21 | + | `% ./macbuild.sh`\ | |
| 22 | + | `<output>`\ | |
| 23 | + | `% ./macrun.sh` | |
| 24 | + | ||
| 25 | + | **Windows** | |
| 26 | + | ||
| 27 | + | `C:\> git clone `[`https://github.com/PierceNg/fpwebview`](https://github.com/PierceNg/fpwebview)\ | |
| 28 | + | `C:\> cd fpwebview\demo\browser_cli`\ | |
| 29 | + | `C:\fpwebview\demo\browser_cli> winbuild.bat`\ | |
| 30 | + | `<output>`\ | |
| 31 | + | `C:\fpwebview\demo\browser_cli> winrun.bat` | |
| 32 | + | ||
| 33 | + | ## Demo program | |
| 34 | + | ||
| 35 | + | Here's a simple Pascal program that uses fpwebview to implement a web browser. | |
| 36 | + | ||
| 37 | + | ``` pascal | |
| 38 | + | program browser_cli; | |
| 39 | + | ||
| 40 | + | {$linklib libwebview} | |
| 41 | + | ||
| 42 | + | uses | |
| 43 | + | {$ifdef unix}cthreads,{$endif} | |
| 44 | + | math, | |
| 45 | + | webview; | |
| 46 | + | ||
| 47 | + | var | |
| 48 | + | w: PWebView; | |
| 49 | + | ||
| 50 | + | begin | |
| 51 | + | { Set math masks. libwebview throws at least one of these from somewhere deep inside. } | |
| 52 | + | SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, exOverflow, exUnderflow, exPrecision]); | |
| 53 | + | ||
| 54 | + | writeln('Hello, webview, from Pascal!'); | |
| 55 | + | w := webview_create(WebView_DevTools, nil); | |
| 56 | + | webview_set_size(w, 1024, 768, WebView_Hint_None); | |
| 57 | + | webview_set_title(w, PAnsiChar('WebView Free Pascal')); | |
| 58 | + | webview_navigate(w, PAnsiChar('https://www.freepascal.org/')); | |
| 59 | + | webview_run(w); | |
| 60 | + | webview_destroy(w); | |
| 61 | + | writeln('Goodbye, webview.'); | |
| 62 | + | end. | |
| 63 | + | ``` | |
| 64 | + | ||
| 65 | + | ## License | |
| 66 | + | ||
| 67 | + | The code is under MIT license, with following exception: | |
| 68 | + | ||
| 69 | + | - Microsoft's WebView2Loader.dll is distributed as per LICENSE.Microsoft. | |
| 70 | + | ||
| 71 | + | ## Download | |
| 72 | + | ||
| 73 | + | [GitHub repo](https://github.com/PierceNg/fpwebview/) | |
| 74 | + | ||
| 75 | + | --- | |
| 76 | + | *From the Free Pascal wiki, page "fpwebview", as it stood on 2024-04-06 after a change by PierceNg, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
