23 | 25 | All of these (maybe except JavascriptCore) have some amount of platform-specific code. In WTF, for obvious reasons. In WebCore, for all the HTTP request (soup, curl, haiku, ...), rendering (cairo, freetype, ...), and any other platform specific things at this level. In WebKitLegacy and WebKit, for the APIs exposed to application willing to embed an HTML view or the like. |
24 | 26 | |
25 | 27 | So, the main directories for the Haiku-specific sources are: Source/WebCore/platform/graphics/haiku ; Source/WebCore/platform/network/haiku ; Source/WebKitLegacy/haiku . There are a few additional files and in some cases specific code in files shared between platforms. |
26 | 28 | |
27 | | = Source Tree = |
28 | | --------- |
| 29 | Some of the other ports can be used for inspiration. The names of the folders relating to other ports are |
| 30 | |
| 31 | * gtk - https://www.webkitgtk.org/ |
| 32 | * wpe - https://wpewebkit.org/ |
| 33 | * playstation |
| 34 | * win - Windows |
| 35 | * ios |
| 36 | * mac |
| 37 | |
| 38 | Here are some of the other folders containing implementation-specific code. They don't relate directly with any of the ports, but are used in some of them, including ours: |
| 39 | |
| 40 | * glib - Contains implementations of functions using the [https://docs.gtk.org/glib/index.html GLib] library. |
| 41 | * unix - Contains implementations of functions using things available on UNIX. |
| 42 | * cocoa - Contains implementations of functions using the [https://en.wikipedia.org/wiki/Cocoa_(API) cocoa] API. |
| 43 | * soup - Uses [https://libsoup.org/libsoup-3.0/ libsoup] |
| 44 | * curl - Uses curl |
| 45 | * skia - Uses [https://skia.org/ skia] |
| 46 | * cairo - Uses [https://www.cairographics.org/ cairo] |
| 47 | * and several others |
| 48 | |
| 49 | **See also:** |
| 50 | * https://docs.webkit.org/Ports/Introduction.html |
| 51 | |
| 52 | == Source Tree == |
| 53 | |
| 54 | Here's a quick overview of some of the files and directories in WebKit: |
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 |
| 105 | [https://github.com/WebKit/WebKit/blob/main/Introduction.md#what-is-webkit What is WebKit?] also has a nice explanation for some of the folders. |
148 | | * [Introduction.md in WebKit's source](https://github.com/WebKit/WebKit/blob/main/Introduction.md) |
| 122 | = Other Notes = |
| 123 | |
| 124 | === PLATFORM vs HAVE vs USE vs OS === |
| 125 | |
| 126 | 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. |
| 127 | |
| 128 | === What is coordinated graphics? === |
| 129 | |
| 130 | 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. |
| 131 | |
| 132 | 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 |
| 133 | |
| 134 | = Further reading = |
| 135 | |
| 136 | * [https://github.com/WebKit/WebKit/blob/main/Introduction.md Introduction.md in WebKit's source] |