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