libei/doc/api/mainpage.dox

85 lines
3.1 KiB
Text
Raw Normal View History

/**
@mainpage
2023-05-04 15:33:21 +10:00
This is the libei API reference. For the protocol documentation see
[here](https://libinput.pages.freedesktop.org/libei/).
libei provides two different libraries, `libei` for clients that need to
2023-05-04 15:33:21 +10:00
emulate or capture input events and `libeis` for servers that manage those
input events (read: compositors). A common setup looks like this:
```
2023-05-04 15:33:21 +10:00
+-----------------------+ +----------------+
physical devices - | libinput | compositor | ----- | Wayland client |
+----------+------------+ ^ +----------------+
| libeis | |
+------------+ Wayland events
||
2023-05-04 15:33:21 +10:00
|| <-- EI events
||
+-------------+
| libei |
+-------------+
| application |
+-------------+
```
Notably, the process using `libeis` is **in control of all input devices**. A
`libei` client can send events but it is up to the EIS implementation to
process them.
2023-05-04 15:33:21 +10:00
The two libraries are independently and usually a process uses either `libei` or
`libeis` but not both.
@section sec-ei EI - the client implementation
The `libei` library is the component used by clients that want to emulate
input events. It provides the required methods to connect to an EIS
implementation, query for input devices available to the client, and send
input.
The API documentation for EI is available at @ref libei.
@section sec-eis EIS - the server implementation
The `libeis` library is the component used by processes that handle input
events. It provides the required methods to set up seats and input devices,
accept `libei` client connections, and receive input events from those
clients.
The API documentation for EI is available at @ref libeis.
@section examples Examples
Please see the [demo programs](https://gitlab.freedesktop.org/libinput/libei/-/tree/main/tools)
in the git repository.
The `eis-demo-client` is a minimal client that connects to an EIS
implementation and sends events.
The `eis-demo-server` is a minimal EIS implementation that accepts all
requests and prints them to screen.
@section building_against Building against libei or libeis
libei and libeis provides
[pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) files.
Software that uses libei or libeis should use pkg-config and the
`PKG_CHECK_MODULES` autoconf macro or the `dependency()` function in meson.
Otherwise, the most rudimentary way to compile and link a program against
libei or libeis is:
@verbatim
gcc -o myprogram mylibeiclient.c `pkg-config --cflags --libs libei`
gcc -o myprogram myEISimplementation.c `pkg-config --cflags --libs libeis`
@endverbatim
For further information on using pkgconfig see the pkg-config documentation.
@section About
Documentation generated from git commit [__GIT_VERSION__](https://gitlab.freedesktop.org/libinput/libei/commit/__GIT_VERSION__)
*/