Skip to content

Commit

Permalink
doc: explanation of how libraries depend on one another (#3469)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanGriffiths authored Jul 12, 2024
2 parents 85dc56f + d8136e1 commit 3965486
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/sphinx/explanation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
These pages provide additional detail about a number of aspects related to using Mir.

- [Architecture](architecture): an overview of Mir's architecture for contributors
- [Libraries](libraries): an overview of Mir's libraries and how they depend on one another
- [Graphics support](mir-graphics-support): what's required to run Mir compositors
- [What is Wayland anyway?](ok-so-what-is-this-wayland-thing-anyway): so what is it?
- [Windowing paradigms](window-positions-under-wayland): how are windows managed?
Expand All @@ -11,6 +12,7 @@ These pages provide additional detail about a number of aspects related to using
:hidden:
architecture
libraries
mir-graphics-support
ok-so-what-is-this-wayland-thing-anyway
window-positions-under-wayland
Expand Down
52 changes: 52 additions & 0 deletions doc/sphinx/explanation/libraries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Libraries
The Mir project is a collection of C++ libraries for writing Wayland
compositors. This document describes what those libraries are and how they
depend on one another.

## Public Libraries
The following libraries are intended for published for public consumption:

- `miral`
- `mircommon`
- `mircore`
- `miroil`
- `mirplatform`
- `mirserver`
- `mirserverlttng`
- `mirwayland`

When you build the project, these libraries are found in
`<build_directory>/lib`.

Additionally, Mir publishes libraries that add support for different platforms.
These can be found in `<build_directory>/lib/server-modules`. These libraries
are loaded at runtime by Mir and provide access to the underlying graphics and
input hardware of that platform. The libraries that Mir provides are:

- `graphics-gbm-kms`
- `graphics-eglstream-kms`
- `graphics-wayland`
- `graphics-dummy`
- `server-x11`
- `server-virtual`
- `renderer-egl-generic`
- `input-evdev`
- `input-stub`

## Dependency Graph
In the following diagram, each arrow denotes that the library at the start of
the arrow depends on the library at the end of the arrow.

```{mermaid} libraries.mmd
```

There are a few things of note in this diagram:

- `miral` and `mircore` are intended to be the primary user-facing libraries
- `miroil` is a special compatibility layer for the Lomiri project is not
intended for general consumption
- `mirserver` depends on the most libraries as it is the brains of the operation
- `mircommon` provide common functionalities for every other library in the
system
- The input and graphics platforms (represented as `input_X` and `graphics_X` in
the diagram) are dynamically loaded by `mirserver` when the engine starts up.
19 changes: 19 additions & 0 deletions doc/sphinx/explanation/libraries.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
flowchart
miral ---> mirserver
miral ---> mircommon
miral ---> mircore
miroil ---> mirserver
miroil --> mircommon
mirserver --> mirplatform
mirserver --> mircommon
mirserver --> mirserverlttng
mirserver --> mircore
mirserver --->|dynamically loads|graphics_X
mirserver --->|dynamically loads|input_X
mirwayland --> mircore
graphics_X --> mirplatform
graphics_X --> mircommon
graphics_X --> mircore
input_X --> mirplatform
input_X --> mircommon
input_X --> mircore

0 comments on commit 3965486

Please sign in to comment.