| 27 | = Source Tree = |
| 28 | --------- |
| 29 | |
| 30 | * Tools/ |
| 31 | * HaikuLauncher/ - Test browser for WebKitLegacy |
| 32 | * MiniBrowser/haiku/ - Test browser for WebKit2 |
| 33 | * Scripts/check-webkit-style - Checks coding style |
| 34 | * Source/ |
| 35 | * cmake/ - The core files of the build system |
| 36 | * OptionsHaiku.cmake |
| 37 | * JavaScriptCore/ - Runs JavaScript |
| 38 | * WTF/ - A kind of standard library. Contains string utilities, random number generators, etc. |
| 39 | * wtf/haiku/ |
| 40 | * RunLoopHaiku.cpp - Contains our implementation of the run loop |
| 41 | * WebCore/ - The back-end for almost everything web-related |
| 42 | * PlatformHaiku.cmake - The index to everything Haiku-specific in this directory |
| 43 | * platform/haiku/ |
| 44 | * DragDataHaiku.cpp |
| 45 | * MainThreadSharedTimerHaiku.cpp |
| 46 | * PlatformKeyboardEventHaiku.cpp |
| 47 | * PlatformMouseEventHaiku.cpp |
| 48 | * SoundHaiku.cpp |
| 49 | * platform/graphics/haiku/ |
| 50 | * BitmapImageHaiku.cpp |
| 51 | * FloatPointHaiku.cpp |
| 52 | * FontHaiku.cpp |
| 53 | * ShareableBitmapHaiku.cpp |
| 54 | * GraphicsLayerHaiku.cpp |
| 55 | * WebKit/ - The new API that splits the engine across multiple processes. |
| 56 | * PlatformHaiku.cmake - The index to everything Haiku-specific in this directory |
| 57 | * UIProcess/ - Everything related to the ui process. |
| 58 | * API/haiku/ - Home of WebKit2's API |
| 59 | * WebView.cpp |
| 60 | * misc. support classes |
| 61 | * haiku/ |
| 62 | * BackingStoreHaiku.cpp - Holds the rendered web page |
| 63 | * WebProcess/ - Everything related to the web process. The web page runs inside of this process. |
| 64 | * haiku/ |
| 65 | * WebProcessMainHaiku.cpp - This contains is the entry-point for WebProcess. |
| 66 | * WebProcessHaiku.cpp |
| 67 | * NetworkProcess/ - Everything related to the network process. This does the networking. |
| 68 | * Shared/ - Code shared across the three processes |
| 69 | * CoordinatedGraphics/ - Allows WebProcess to draw and UIProcess to display |
| 70 | * haiku/ |
| 71 | * NativeWebMouseEventHaiku.cpp |
| 72 | * ProcessExecutablePathHaiku.cpp |
| 73 | * Platform/ - Also code shared across the three processes? |
| 74 | * IPC/ - Allows the three processes to communicate with each other |
| 75 | * haiku/ |
| 76 | * unix/ - Yes, we use UNIX sockets for IPC. |
| 77 | * WebKitLegacy/ - The old API. It runs everything in a single process. |
| 78 | |
| 79 | [What is WebKit?](https://github.com/WebKit/WebKit/blob/main/Introduction.md#what-is-webkit) also has a nice explanation for some of the folders. |
| 80 | |
| 81 | |
| 82 | =Other ports = |
| 83 | |
| 84 | As you browse the directory tree, you'll see several folders over and over again in different directories. These contain technology-specific code. They can contain inspiration for how to implement unimplemented functions on Haiku. |
| 85 | |
| 86 | Some of the folders you'll find repeated across WebKit relate to the ports of WebKit. They are |
| 87 | |
| 88 | * haiku - that's us! |
| 89 | * gtk - https://www.webkitgtk.org/ |
| 90 | * wpe - https://wpewebkit.org/ |
| 91 | * playstation |
| 92 | * win - Windows |
| 93 | * ios |
| 94 | * mac |
| 95 | |
| 96 | Here are some of the other folders. They don't relate directly with any of the ports, but are used in some of them: |
| 97 | |
| 98 | * glib - Contains implementations of functions using the [GLib](https://docs.gtk.org/glib/index.html) library. |
| 99 | * unix - Contains implementations of functions using things available on UNIX. |
| 100 | * cocoa - Contains implementations of functions using the [cocoa](https://en.wikipedia.org/wiki/Cocoa_\(API\)) API. |
| 101 | * soup - Uses [libsoup](https://libsoup.org/libsoup-3.0/) |
| 102 | * curl - Uses curl |
| 103 | * skia - Uses [skia](https://skia.org/) |
| 104 | * cairo - Uses [cairo](https://www.cairographics.org/) |
| 105 | * and several others |
| 106 | |
| 107 | **See also:** |
| 108 | * https://docs.webkit.org/Ports/Introduction.html |
| 109 | |
| 110 | |
| 111 | = Other Notes= |
| 112 | |
| 113 | PLATFORM vs HAVE vs USE vs OS |
| 114 | ----------------------------- |
| 115 | |
| 116 | Quite often in the code, you'll see `#if PLATFORM(HAIKU)` or `#if OS(HAIKU)`. They're all quite similar, but there is a way to use them properly. Source/WTF/wtf/Platform.h's comments explain when to use these quite nicely. |
| 117 | |
| 118 | |
| 119 | |
| 120 | Rendering |
| 121 | --------- |
| 122 | |
| 123 | ### Coordinated graphics |
| 124 | |
| 125 | As far as I've been able to figure out, coordinated graphics refers to WebProcess and UIProcess coordinating graphics with each other. The UI process has to tell the web process about resizing, scrolling, etc. and the web process has to do the actual painting and then tell the UI process to update what has been displayed. |
| 126 | |
| 127 | A nice overview of coordinated graphics (and how rendering is done in general) is given at https://www.chromium.org/developers/design-documents/gpu-accelerated-compositing-in-chrome/. Yes, it's for chromium, but it matches what happens in WebKit *very* closely. Also see https://trac.webkit.org/wiki/CoordinatedGraphicsSystem |
| 128 | |