This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
/
packet.h
149 lines (111 loc) · 2.33 KB
/
packet.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/*
This file is part of duckOS.
duckOS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
duckOS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with duckOS. If not, see <https://www.gnu.org/licenses/>.
Copyright (c) Byteduck 2016-2021. All rights reserved.
*/
#pragma once
#include <cstdint>
#include <libgraphics/Geometry.h>
#include <libriver/SerializedString.hpp>
namespace Pond {
struct OpenWindowPkt {
int parent;
bool hidden;
Gfx::Rect rect;
};
struct WindowOpenedPkt {
int window_id;
int shm_id;
Gfx::Rect rect;
};
struct WindowDestroyPkt {
int window_id;
int shm_id;
};
struct WindowMovePkt {
int window_id;
Gfx::Point pos;
};
struct WindowResizePkt {
int window_id;
Gfx::Dimensions dims;
};
struct WindowResizedPkt {
int window_id;
int shm_id;
Gfx::Rect rect;
};
struct WindowInvalidatePkt {
int window_id;
Gfx::Rect area;
};
struct MouseMovePkt {
int window_id;
Gfx::Point delta;
Gfx::Point relative;
Gfx::Point absolute;
};
struct MouseButtonPkt {
int window_id;
uint8_t buttons;
};
struct MouseScrollPkt {
int window_id;
int scroll;
};
struct MouseLeavePkt {
int window_id;
};
struct KeyEventPkt {
int window_id;
uint16_t scancode;
uint8_t key;
uint8_t character;
uint8_t modifiers;
};
struct GetFontPkt {
SerializedString<256> font_name;
};
struct FontResponsePkt {
int font_shm_id;
};
struct SetTitlePkt {
int window_id;
SerializedString<256> title;
};
struct WindowReparentPkt {
int window_id;
int parent_id;
};
struct SetHintPkt {
int window_id;
int hint;
int value;
};
struct WindowToFrontPkt {
int window_id;
};
struct GetDisplayInfoPkt {
int display; ///< Unused
};
struct DisplayInfoPkt {
Gfx::Dimensions dimensions;
};
struct WindowFocusPkt {
int window_id;
bool focused;
};
struct WindowMinSizePkt {
int window_id;
Gfx::Dimensions minimum_size;
};
}