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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
/*
* Copyright © 2016 Quentin "Sardem FF7" Glidic
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef WESTON_DESKTOP_H
#define WESTON_DESKTOP_H
#include "compositor.h"
#include <pixman.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
enum weston_desktop_surface_edge {
WESTON_DESKTOP_SURFACE_EDGE_NONE = 0,
WESTON_DESKTOP_SURFACE_EDGE_TOP = 1,
WESTON_DESKTOP_SURFACE_EDGE_BOTTOM = 2,
WESTON_DESKTOP_SURFACE_EDGE_LEFT = 4,
WESTON_DESKTOP_SURFACE_EDGE_TOP_LEFT = 5,
WESTON_DESKTOP_SURFACE_EDGE_BOTTOM_LEFT = 6,
WESTON_DESKTOP_SURFACE_EDGE_RIGHT = 8,
WESTON_DESKTOP_SURFACE_EDGE_TOP_RIGHT = 9,
WESTON_DESKTOP_SURFACE_EDGE_BOTTOM_RIGHT = 10,
};
struct weston_desktop;
struct weston_desktop_client;
struct weston_desktop_surface;
struct weston_desktop_api {
size_t struct_size;
void (*ping_timeout)(struct weston_desktop_client *client,
void *user_data);
void (*pong)(struct weston_desktop_client *client,
void *user_data);
void (*surface_added)(struct weston_desktop_surface *surface,
void *user_data);
void (*surface_removed)(struct weston_desktop_surface *surface,
void *user_data);
void (*committed)(struct weston_desktop_surface *surface,
int32_t sx, int32_t sy, void *user_data);
void (*show_window_menu)(struct weston_desktop_surface *surface,
struct weston_seat *seat, int32_t x, int32_t y,
void *user_data);
void (*set_parent)(struct weston_desktop_surface *surface,
struct weston_desktop_surface *parent,
void *user_data);
void (*move)(struct weston_desktop_surface *surface,
struct weston_seat *seat, uint32_t serial, void *user_data);
void (*resize)(struct weston_desktop_surface *surface,
struct weston_seat *seat, uint32_t serial,
enum weston_desktop_surface_edge edges, void *user_data);
void (*fullscreen_requested)(struct weston_desktop_surface *surface,
bool fullscreen,
struct weston_output *output,
void *user_data);
void (*maximized_requested)(struct weston_desktop_surface *surface,
bool maximized, void *user_data);
void (*minimized_requested)(struct weston_desktop_surface *surface,
void *user_data);
};
void
weston_seat_break_desktop_grabs(struct weston_seat *seat);
struct weston_desktop *
weston_desktop_create(struct weston_compositor *compositor,
const struct weston_desktop_api *api, void *user_data);
void
weston_desktop_destroy(struct weston_desktop *desktop);
struct wl_client *
weston_desktop_client_get_client(struct weston_desktop_client *client);
void
weston_desktop_client_for_each_surface(struct weston_desktop_client *client,
void (*callback)(struct weston_desktop_surface *surface, void *user_data),
void *user_data);
int
weston_desktop_client_ping(struct weston_desktop_client *client);
bool
weston_surface_is_desktop_surface(struct weston_surface *surface);
struct weston_desktop_surface *
weston_surface_get_desktop_surface(struct weston_surface *surface);
void
weston_desktop_surface_set_user_data(struct weston_desktop_surface *self,
void *user_data);
struct weston_view *
weston_desktop_surface_create_view(struct weston_desktop_surface *surface);
void
weston_desktop_surface_unlink_view(struct weston_view *view);
void
weston_desktop_surface_propagate_layer(struct weston_desktop_surface *surface);
void
weston_desktop_surface_set_activated(struct weston_desktop_surface *surface,
bool activated);
void
weston_desktop_surface_set_fullscreen(struct weston_desktop_surface *surface,
bool fullscreen);
void
weston_desktop_surface_set_maximized(struct weston_desktop_surface *surface,
bool maximized);
void
weston_desktop_surface_set_resizing(struct weston_desktop_surface *surface,
bool resized);
void
weston_desktop_surface_set_size(struct weston_desktop_surface *surface,
int32_t width, int32_t height);
void
weston_desktop_surface_close(struct weston_desktop_surface *surface);
void *
weston_desktop_surface_get_user_data(struct weston_desktop_surface *surface);
struct weston_desktop_client *
weston_desktop_surface_get_client(struct weston_desktop_surface *surface);
struct weston_surface *
weston_desktop_surface_get_surface(struct weston_desktop_surface *surface);
const char *
weston_desktop_surface_get_title(struct weston_desktop_surface *surface);
const char *
weston_desktop_surface_get_app_id(struct weston_desktop_surface *surface);
pid_t
weston_desktop_surface_get_pid(struct weston_desktop_surface *surface);
bool
weston_desktop_surface_get_activated(struct weston_desktop_surface *surface);
bool
weston_desktop_surface_get_maximized(struct weston_desktop_surface *surface);
bool
weston_desktop_surface_get_fullscreen(struct weston_desktop_surface *surface);
bool
weston_desktop_surface_get_resizing(struct weston_desktop_surface *surface);
struct weston_geometry
weston_desktop_surface_get_geometry(struct weston_desktop_surface *surface);
struct weston_size
weston_desktop_surface_get_max_size(struct weston_desktop_surface *surface);
struct weston_size
weston_desktop_surface_get_min_size(struct weston_desktop_surface *surface);
#ifdef __cplusplus
}
#endif
#endif /* WESTON_DESKTOP_H */
|