The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
heimdall_proto.h File Reference

the messages between heimdalld (the window server) and its clients. More...

#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  heim_msg_t

Macros

#define HEIM_SOCKET   "/run/heimdall"
#define HEIM_PROTOCOL_VERSION   1
#define HEIM_TITLE_MAX   40
#define HEIM_SETTINGS_MAX   48
#define HEIM_SIZE_MAX   8192
#define HEIM_APP_ID_MAX   48
#define HEIM_CLIPBOARD_MAX   (1024 * 1024)
#define HEIM_REQ_HELLO   1
#define HEIM_REQ_CREATE   2
#define HEIM_REQ_ATTACH   3
#define HEIM_REQ_COMMIT   4
#define HEIM_REQ_TITLE   5
#define HEIM_REQ_CURSOR   6
#define HEIM_REQ_DESTROY   7
#define HEIM_REQ_CLIP_SET   8
#define HEIM_REQ_CLIP_GET   9
#define HEIM_REQ_SETTINGS   10
#define HEIM_REQ_PLACE   11
#define HEIM_REQ_APP_ID   12
#define HEIM_REQ_SHELL   13
#define HEIM_REQ_ACT   14
#define HEIM_REQ_QUIT   15
#define HEIM_EV_WELCOME   64
#define HEIM_EV_CONFIGURE   65
#define HEIM_EV_CLOSE   66
#define HEIM_EV_FOCUS   67
#define HEIM_EV_KEY   68
#define HEIM_EV_POINTER   69
#define HEIM_EV_FRAME   70
#define HEIM_EV_CLIPBOARD   71
#define HEIM_EV_SETTINGS   72
#define HEIM_EV_SCREEN   73
#define HEIM_EV_WINDOW   74
#define HEIM_EV_WINDOW_APP   75
#define HEIM_EV_WINDOW_GONE   76
#define HEIM_WINDOW_RESIZABLE   0x01
#define HEIM_WINDOW_ALPHA   0x02
#define HEIM_WINDOW_UNDECORATED   0x04
#define HEIM_WINDOW_POPUP   0x08
#define HEIM_WINDOW_TOOLTIP   0x10
#define HEIM_WINDOW_PANEL   0x20
#define HEIM_SIDE_BELOW   0
#define HEIM_SIDE_ABOVE   1
#define HEIM_SIDE_RIGHT   2
#define HEIM_STATE_MAXIMIZED   0x01
#define HEIM_STATE_MINIMIZED   0x02
#define HEIM_STATE_FOCUSED   0x04
#define HEIM_ACT_ACTIVATE   1
#define HEIM_ACT_MINIMIZE   2
#define HEIM_ACT_CLOSE   3
#define HEIM_CURSOR_ARROW   0
#define HEIM_CURSOR_TEXT   1
#define HEIM_CURSOR_HAND   2
#define HEIM_POINTER_MOTION   1
#define HEIM_POINTER_PRESS   2
#define HEIM_POINTER_RELEASE   3
#define HEIM_POINTER_ENTER   4
#define HEIM_POINTER_LEAVE   5
#define HEIM_POINTER_SCROLL   6
#define HEIM_BUTTON_LEFT   0x01
#define HEIM_BUTTON_RIGHT   0x02
#define HEIM_BUTTON_MIDDLE   0x04
#define HEIM_MOD_SHIFT   0x01
#define HEIM_MOD_CTRL   0x02
#define HEIM_MOD_ALT   0x04
#define HEIM_MOD_ALTGR   0x08
#define HEIM_MOD_META   0x10
#define HEIM_KEY_RELEASE   0
#define HEIM_KEY_PRESS   1
#define HEIM_KEY_REPEAT   2

Detailed Description

the messages between heimdalld (the window server) and its clients.

a client connects to the Unix socket HEIM_SOCKET. every message, in both directions, is one heim_msg_t of 64 bytes. a message that carries an open file (a shared memory buffer) has it in an SCM_RIGHTS control message sent with it.

the start: the client sends HEIM_REQ_HELLO, the server answers with HEIM_EV_WELCOME (the screen size).

a window: the client picks a window number (not 0, its own), sends HEIM_REQ_CREATE, then HEIM_REQ_ATTACH with a shared memory buffer of premultiplied ARGB pixels, draws into it, and sends HEIM_REQ_COMMIT with the part it changed. the window shows after its first commit. after a commit, the server sends HEIM_EV_FRAME when the change is on the screen; a client that draws again before that can be seen half drawn.

the server draws the title bar and the buttons (server-side decorations); the size of a window is the size of its content. a window is placed by the server. HEIM_EV_CONFIGURE asks the client for another size (maximize, a resize with the mouse): the client attaches a buffer of that size and commits it.

a popup (a menu, a select's choices, a popover, a tooltip) is a window with HEIM_WINDOW_POPUP and a parent window. it has no decorations and its pixels can be see-through; the client draws its shadow in a margin around it. HEIM_REQ_PLACE gives a rect in the parent's content to show it next to and a side; the server puts it there, on the other side when there is no room, and inside the screen. a popup is above its parent and gets the keyboard (a tooltip, HEIM_WINDOW_TOOLTIP, gets no input at all). a press outside the open popups closes them: each gets HEIM_EV_CLOSE, and the press goes nowhere else.

a panel (HEIM_WINDOW_PANEL) is a bar of the desktop shell: the server puts it at the bottom of the screen, the full width (it sends HEIM_EV_CONFIGURE for the width), above the windows. its height is not part of the work area: maximized and new windows stay above it. a click on it does not take the keyboard from the window that has it.

the shell: one client can ask to be the shell (HEIM_REQ_SHELL, the first that asks). it then gets HEIM_EV_WINDOW for each normal window when the window shows or changes (title, state), HEIM_EV_WINDOW_APP with the program of the window, and HEIM_EV_WINDOW_GONE; the window field is 0 and info.id is the server's number for the window. the shell can activate, minimize and close any window (HEIM_REQ_ACT) and end the session (HEIM_REQ_QUIT).

Macro Definition Documentation

◆ HEIM_SOCKET

#define HEIM_SOCKET   "/run/heimdall"

◆ HEIM_PROTOCOL_VERSION

#define HEIM_PROTOCOL_VERSION   1

◆ HEIM_TITLE_MAX

#define HEIM_TITLE_MAX   40

◆ HEIM_SETTINGS_MAX

#define HEIM_SETTINGS_MAX   48

◆ HEIM_SIZE_MAX

#define HEIM_SIZE_MAX   8192

◆ HEIM_APP_ID_MAX

#define HEIM_APP_ID_MAX   48

◆ HEIM_CLIPBOARD_MAX

#define HEIM_CLIPBOARD_MAX   (1024 * 1024)

◆ HEIM_REQ_HELLO

#define HEIM_REQ_HELLO   1

◆ HEIM_REQ_CREATE

#define HEIM_REQ_CREATE   2

◆ HEIM_REQ_ATTACH

#define HEIM_REQ_ATTACH   3

◆ HEIM_REQ_COMMIT

#define HEIM_REQ_COMMIT   4

◆ HEIM_REQ_TITLE

#define HEIM_REQ_TITLE   5

◆ HEIM_REQ_CURSOR

#define HEIM_REQ_CURSOR   6

◆ HEIM_REQ_DESTROY

#define HEIM_REQ_DESTROY   7

◆ HEIM_REQ_CLIP_SET

#define HEIM_REQ_CLIP_SET   8

◆ HEIM_REQ_CLIP_GET

#define HEIM_REQ_CLIP_GET   9

◆ HEIM_REQ_SETTINGS

#define HEIM_REQ_SETTINGS   10

◆ HEIM_REQ_PLACE

#define HEIM_REQ_PLACE   11

◆ HEIM_REQ_APP_ID

#define HEIM_REQ_APP_ID   12

◆ HEIM_REQ_SHELL

#define HEIM_REQ_SHELL   13

◆ HEIM_REQ_ACT

#define HEIM_REQ_ACT   14

◆ HEIM_REQ_QUIT

#define HEIM_REQ_QUIT   15

◆ HEIM_EV_WELCOME

#define HEIM_EV_WELCOME   64

◆ HEIM_EV_CONFIGURE

#define HEIM_EV_CONFIGURE   65

◆ HEIM_EV_CLOSE

#define HEIM_EV_CLOSE   66

◆ HEIM_EV_FOCUS

#define HEIM_EV_FOCUS   67

◆ HEIM_EV_KEY

#define HEIM_EV_KEY   68

◆ HEIM_EV_POINTER

#define HEIM_EV_POINTER   69

◆ HEIM_EV_FRAME

#define HEIM_EV_FRAME   70

◆ HEIM_EV_CLIPBOARD

#define HEIM_EV_CLIPBOARD   71

◆ HEIM_EV_SETTINGS

#define HEIM_EV_SETTINGS   72

◆ HEIM_EV_SCREEN

#define HEIM_EV_SCREEN   73

◆ HEIM_EV_WINDOW

#define HEIM_EV_WINDOW   74

◆ HEIM_EV_WINDOW_APP

#define HEIM_EV_WINDOW_APP   75

◆ HEIM_EV_WINDOW_GONE

#define HEIM_EV_WINDOW_GONE   76

◆ HEIM_WINDOW_RESIZABLE

#define HEIM_WINDOW_RESIZABLE   0x01

◆ HEIM_WINDOW_ALPHA

#define HEIM_WINDOW_ALPHA   0x02

◆ HEIM_WINDOW_UNDECORATED

#define HEIM_WINDOW_UNDECORATED   0x04

◆ HEIM_WINDOW_POPUP

#define HEIM_WINDOW_POPUP   0x08

◆ HEIM_WINDOW_TOOLTIP

#define HEIM_WINDOW_TOOLTIP   0x10

◆ HEIM_WINDOW_PANEL

#define HEIM_WINDOW_PANEL   0x20

◆ HEIM_SIDE_BELOW

#define HEIM_SIDE_BELOW   0

◆ HEIM_SIDE_ABOVE

#define HEIM_SIDE_ABOVE   1

◆ HEIM_SIDE_RIGHT

#define HEIM_SIDE_RIGHT   2

◆ HEIM_STATE_MAXIMIZED

#define HEIM_STATE_MAXIMIZED   0x01

◆ HEIM_STATE_MINIMIZED

#define HEIM_STATE_MINIMIZED   0x02

◆ HEIM_STATE_FOCUSED

#define HEIM_STATE_FOCUSED   0x04

◆ HEIM_ACT_ACTIVATE

#define HEIM_ACT_ACTIVATE   1

◆ HEIM_ACT_MINIMIZE

#define HEIM_ACT_MINIMIZE   2

◆ HEIM_ACT_CLOSE

#define HEIM_ACT_CLOSE   3

◆ HEIM_CURSOR_ARROW

#define HEIM_CURSOR_ARROW   0

◆ HEIM_CURSOR_TEXT

#define HEIM_CURSOR_TEXT   1

◆ HEIM_CURSOR_HAND

#define HEIM_CURSOR_HAND   2

◆ HEIM_POINTER_MOTION

#define HEIM_POINTER_MOTION   1

◆ HEIM_POINTER_PRESS

#define HEIM_POINTER_PRESS   2

◆ HEIM_POINTER_RELEASE

#define HEIM_POINTER_RELEASE   3

◆ HEIM_POINTER_ENTER

#define HEIM_POINTER_ENTER   4

◆ HEIM_POINTER_LEAVE

#define HEIM_POINTER_LEAVE   5

◆ HEIM_POINTER_SCROLL

#define HEIM_POINTER_SCROLL   6

◆ HEIM_BUTTON_LEFT

#define HEIM_BUTTON_LEFT   0x01

◆ HEIM_BUTTON_RIGHT

#define HEIM_BUTTON_RIGHT   0x02

◆ HEIM_BUTTON_MIDDLE

#define HEIM_BUTTON_MIDDLE   0x04

◆ HEIM_MOD_SHIFT

#define HEIM_MOD_SHIFT   0x01

◆ HEIM_MOD_CTRL

#define HEIM_MOD_CTRL   0x02

◆ HEIM_MOD_ALT

#define HEIM_MOD_ALT   0x04

◆ HEIM_MOD_ALTGR

#define HEIM_MOD_ALTGR   0x08

◆ HEIM_MOD_META

#define HEIM_MOD_META   0x10

◆ HEIM_KEY_RELEASE

#define HEIM_KEY_RELEASE   0

◆ HEIM_KEY_PRESS

#define HEIM_KEY_PRESS   1

◆ HEIM_KEY_REPEAT

#define HEIM_KEY_REPEAT   2