PatchworkOS
c9fea19
A non-POSIX operating system.
Theme:
Default
Round
Robot
Loading...
Searching...
No Matches
surface.h
Go to the documentation of this file.
1
#ifndef PATCHWORK_SURFACE_H
2
#define PATCHWORK_SURFACE_H 1
3
4
#include "
rect.h
"
5
6
#include <
assert.h
>
7
#include <
stdbool.h
>
8
#include <
stdint.h
>
9
#include <
sys/io.h
>
10
11
#if defined(__cplusplus)
12
extern
"C"
13
{
14
#endif
15
16
/**
17
* @brief Desktop Window Manager Surface.
18
* @defgroup libpatchwork_surface Surface
19
* @ingroup libpatchwork
20
*
21
* A surface represents a rectangular area on the screen that can display content and receive user input, this includes
22
* panels, cursors, wallpapers and normal application windows. It can be considered to be the server side implementation
23
* of the client side windows.
24
*
25
* @{
26
*/
27
28
/**
29
* @brief Surface types.
30
* @enum surface_type_t
31
*/
32
typedef
enum
33
{
34
SURFACE_NONE
= 0,
35
SURFACE_WINDOW
,
36
SURFACE_PANEL
,
37
SURFACE_CURSOR
,
38
SURFACE_WALL
,
39
SURFACE_FULLSCREEN
,
40
SURFACE_TYPE_AMOUNT
41
}
surface_type_t
;
42
43
/**
44
* @brief Surface flags.
45
* @enum surface_flags_t
46
*/
47
typedef
enum
48
{
49
SURFACE_VISIBLE
= 1 << 0,
50
SURFACE_FOCUSED
= 1 << 1,
51
}
surface_flags_t
;
52
53
typedef
uint64_t
surface_id_t
;
54
#define SURFACE_ID_NONE (UINT64_MAX)
55
56
typedef
struct
57
{
58
surface_type_t
type
;
59
surface_id_t
id
;
60
rect_t
rect
;
61
surface_flags_t
flags
;
62
char
name[
MAX_NAME
];
63
uint8_t
reserved[35];
64
}
surface_info_t
;
65
66
#ifdef static_assert
67
static_assert
(
sizeof
(
surface_info_t
) == 104,
"invalid surface_info_t size"
);
68
#endif
69
70
/** @} */
71
72
#if defined(__cplusplus)
73
}
74
#endif
75
76
#endif
MAX_NAME
#define MAX_NAME
Maximum length of names.
Definition
MAX_NAME.h:11
assert.h
surface_type_t
surface_type_t
Surface types.
Definition
surface.h:33
surface_id_t
uint64_t surface_id_t
Definition
surface.h:53
surface_flags_t
surface_flags_t
Surface flags.
Definition
surface.h:48
SURFACE_WALL
@ SURFACE_WALL
Definition
surface.h:38
SURFACE_WINDOW
@ SURFACE_WINDOW
Definition
surface.h:35
SURFACE_NONE
@ SURFACE_NONE
Definition
surface.h:34
SURFACE_PANEL
@ SURFACE_PANEL
Definition
surface.h:36
SURFACE_CURSOR
@ SURFACE_CURSOR
Definition
surface.h:37
SURFACE_FULLSCREEN
@ SURFACE_FULLSCREEN
Definition
surface.h:39
SURFACE_TYPE_AMOUNT
@ SURFACE_TYPE_AMOUNT
Definition
surface.h:40
SURFACE_VISIBLE
@ SURFACE_VISIBLE
Definition
surface.h:49
SURFACE_FOCUSED
@ SURFACE_FOCUSED
Definition
surface.h:50
io.h
rect.h
stdbool.h
stdint.h
uint64_t
__UINT64_TYPE__ uint64_t
Definition
stdint.h:17
uint8_t
__UINT8_TYPE__ uint8_t
Definition
stdint.h:11
rect_t
Definition
rect.h:13
surface_info_t
Definition
surface.h:57
surface_info_t::flags
surface_flags_t flags
Definition
surface.h:61
surface_info_t::id
surface_id_t id
Definition
surface.h:59
surface_info_t::rect
rect_t rect
Definition
surface.h:60
surface_info_t::type
surface_type_t type
Definition
surface.h:58
include
libpatchwork
surface.h
Generated on Mon Dec 15 2025 05:10:34 for PatchworkOS by
1.9.8