| 1 |
|
| 2 |
. |
| 3 |
hl |
| 4 |
h |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
#ifndef LIBDECOR_H |
| 29 |
#define LIBDECOR_H |
| 30 |
|
| 31 |
#include <stdbool.h> |
| 32 |
#include <wayland-client.h> |
| 33 |
|
| 34 |
#ifdef __cplusplus |
| 35 |
extern "C" { |
| 36 |
#endif |
| 37 |
|
| 38 |
#if defined(__GNUC__) && __GNUC__ >= 4 |
| 39 |
#define LIBDECOR_EXPORT __attribute__ ((visibility("default"))) |
| 40 |
#else |
| 41 |
#define LIBDECOR_EXPORT |
| 42 |
#endif |
| 43 |
|
| 44 |
struct xdg_toplevel; |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
struct libdecor; |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
struct libdecor_frame; |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
struct libdecor_configuration; |
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
struct libdecor_state; |
| 69 |
|
| 70 |
enum libdecor_error { |
| 71 |
LIBDECOR_ERROR_COMPOSITOR_INCOMPATIBLE, |
| 72 |
LIBDECOR_ERROR_INVALID_FRAME_CONFIGURATION, |
| 73 |
}; |
| 74 |
|
| 75 |
enum libdecor_window_state { |
| 76 |
LIBDECOR_WINDOW_STATE_NONE = 0, |
| 77 |
LIBDECOR_WINDOW_STATE_ACTIVE = 1 << 0, |
| 78 |
LIBDECOR_WINDOW_STATE_MAXIMIZED = 1 << 1, |
| 79 |
LIBDECOR_WINDOW_STATE_FULLSCREEN = 1 << 2, |
| 80 |
LIBDECOR_WINDOW_STATE_TILED_LEFT = 1 << 3, |
| 81 |
LIBDECOR_WINDOW_STATE_TILED_RIGHT = 1 << 4, |
| 82 |
LIBDECOR_WINDOW_STATE_TILED_TOP = 1 << 5, |
| 83 |
LIBDECOR_WINDOW_STATE_TILED_BOTTOM = 1 << 6, |
| 84 |
LIBDECOR_WINDOW_STATE_SUSPENDED = 1 << 7, |
| 85 |
}; |
| 86 |
|
| 87 |
enum libdecor_resize_edge { |
| 88 |
LIBDECOR_RESIZE_EDGE_NONE, |
| 89 |
LIBDECOR_RESIZE_EDGE_TOP, |
| 90 |
LIBDECOR_RESIZE_EDGE_BOTTOM, |
| 91 |
LIBDECOR_RESIZE_EDGE_LEFT, |
| 92 |
LIBDECOR_RESIZE_EDGE_TOP_LEFT, |
| 93 |
LIBDECOR_RESIZE_EDGE_BOTTOM_LEFT, |
| 94 |
LIBDECOR_RESIZE_EDGE_RIGHT, |
| 95 |
LIBDECOR_RESIZE_EDGE_TOP_RIGHT, |
| 96 |
LIBDECOR_RESIZE_EDGE_BOTTOM_RIGHT, |
| 97 |
}; |
| 98 |
|
| 99 |
enum libdecor_capabilities { |
| 100 |
LIBDECOR_ACTION_MOVE = 1 << 0, |
| 101 |
LIBDECOR_ACTION_RESIZE = 1 << 1, |
| 102 |
LIBDECOR_ACTION_MINIMIZE = 1 << 2, |
| 103 |
LIBDECOR_ACTION_FULLSCREEN = 1 << 3, |
| 104 |
LIBDECOR_ACTION_CLOSE = 1 << 4, |
| 105 |
}; |
| 106 |
|
| 107 |
struct libdecor_interface { |
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
void (* error)(struct libdecor *context, |
| 112 |
enum libdecor_error error, |
| 113 |
const char *message); |
| 114 |
|
| 115 |
|
| 116 |
void (* reserved0)(void); |
| 117 |
void (* reserved1)(void); |
| 118 |
void (* reserved2)(void); |
| 119 |
void (* reserved3)(void); |
| 120 |
void (* reserved4)(void); |
| 121 |
void (* reserved5)(void); |
| 122 |
void (* reserved6)(void); |
| 123 |
void (* reserved7)(void); |
| 124 |
void (* reserved8)(void); |
| 125 |
void (* reserved9)(void); |
| 126 |
}; |
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
struct libdecor_frame_interface { |
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
void (* configure)(struct libdecor_frame *frame, |
| 138 |
struct libdecor_configuration *configuration, |
| 139 |
void *user_data); |
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
void (* close)(struct libdecor_frame *frame, |
| 145 |
void *user_data); |
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
void (* commit)(struct libdecor_frame *frame, |
| 153 |
void *user_data); |
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
void (* dismiss_popup)(struct libdecor_frame *frame, |
| 160 |
const char *seat_name, |
| 161 |
void *user_data); |
| 162 |
|
| 163 |
|
| 164 |
void (* reserved0)(void); |
| 165 |
void (* reserved1)(void); |
| 166 |
void (* reserved2)(void); |
| 167 |
void (* reserved3)(void); |
| 168 |
void (* reserved4)(void); |
| 169 |
void (* reserved5)(void); |
| 170 |
void (* reserved6)(void); |
| 171 |
void (* reserved7)(void); |
| 172 |
void (* reserved8)(void); |
| 173 |
void (* reserved9)(void); |
| 174 |
}; |
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
void |
| 181 |
libdecor_unref(struct libdecor *context); |
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
struct libdecor * |
| 187 |
libdecor_new(struct wl_display *display, |
| 188 |
struct libdecor_interface *iface); |
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
int |
| 196 |
libdecor_get_fd(struct libdecor *context); |
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
int |
| 204 |
libdecor_dispatch(struct libdecor *context, |
| 205 |
int timeout); |
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
struct libdecor_frame * |
| 219 |
libdecor_decorate(struct libdecor *context, |
| 220 |
struct wl_surface *surface, |
| 221 |
struct libdecor_frame_interface *iface, |
| 222 |
void *user_data); |
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
void |
| 228 |
libdecor_frame_ref(struct libdecor_frame *frame); |
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
void |
| 235 |
libdecor_frame_unref(struct libdecor_frame *frame); |
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
void |
| 244 |
libdecor_frame_set_visibility(struct libdecor_frame *frame, |
| 245 |
bool visible); |
| 246 |
|
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
bool |
| 251 |
libdecor_frame_is_visible(struct libdecor_frame *frame); |
| 252 |
|
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
void |
| 261 |
libdecor_frame_set_parent(struct libdecor_frame *frame, |
| 262 |
struct libdecor_frame *parent); |
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
void |
| 268 |
libdecor_frame_set_title(struct libdecor_frame *frame, |
| 269 |
const char *title); |
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
const char * |
| 275 |
libdecor_frame_get_title(struct libdecor_frame *frame); |
| 276 |
|
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
void |
| 281 |
libdecor_frame_set_app_id(struct libdecor_frame *frame, |
| 282 |
const char *app_id); |
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
void |
| 293 |
libdecor_frame_set_capabilities(struct libdecor_frame *frame, |
| 294 |
enum libdecor_capabilities capabilities); |
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
|
| 300 |
|
| 301 |
void |
| 302 |
libdecor_frame_unset_capabilities(struct libdecor_frame *frame, |
| 303 |
enum libdecor_capabilities capabilities); |
| 304 |
|
| 305 |
|
| 306 |
|
| 307 |
|
| 308 |
bool |
| 309 |
libdecor_frame_has_capability(struct libdecor_frame *frame, |
| 310 |
enum libdecor_capabilities capability); |
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
|
| 315 |
void |
| 316 |
libdecor_frame_show_window_menu(struct libdecor_frame *frame, |
| 317 |
struct wl_seat *wl_seat, |
| 318 |
uint32_t serial, |
| 319 |
int x, |
| 320 |
int y); |
| 321 |
|
| 322 |
|
| 323 |
|
| 324 |
|
| 325 |
|
| 326 |
void |
| 327 |
libdecor_frame_popup_grab(struct libdecor_frame *frame, |
| 328 |
const char *seat_name); |
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
void |
| 334 |
libdecor_frame_popup_ungrab(struct libdecor_frame *frame, |
| 335 |
const char *seat_name); |
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
|
| 343 |
|
| 344 |
void |
| 345 |
libdecor_frame_translate_coordinate(struct libdecor_frame *frame, |
| 346 |
int surface_x, |
| 347 |
int surface_y, |
| 348 |
int *frame_x, |
| 349 |
int *frame_y); |
| 350 |
|
| 351 |
|
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
void |
| 357 |
libdecor_frame_set_min_content_size(struct libdecor_frame *frame, |
| 358 |
int content_width, |
| 359 |
int content_height); |
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
|
| 364 |
|
| 365 |
|
| 366 |
void |
| 367 |
libdecor_frame_set_max_content_size(struct libdecor_frame *frame, |
| 368 |
int content_width, |
| 369 |
int content_height); |
| 370 |
|
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
void |
| 375 |
libdecor_frame_get_min_content_size(const struct libdecor_frame *frame, |
| 376 |
int *content_width, |
| 377 |
int *content_height); |
| 378 |
|
| 379 |
|
| 380 |
|
| 381 |
|
| 382 |
void |
| 383 |
libdecor_frame_get_max_content_size(const struct libdecor_frame *frame, |
| 384 |
int *content_width, |
| 385 |
int *content_height); |
| 386 |
|
| 387 |
|
| 388 |
|
| 389 |
|
| 390 |
|
| 391 |
|
| 392 |
void |
| 393 |
libdecor_frame_resize(struct libdecor_frame *frame, |
| 394 |
struct wl_seat *wl_seat, |
| 395 |
uint32_t serial, |
| 396 |
enum libdecor_resize_edge edge); |
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
|
| 403 |
void |
| 404 |
libdecor_frame_move(struct libdecor_frame *frame, |
| 405 |
struct wl_seat *wl_seat, |
| 406 |
uint32_t serial); |
| 407 |
|
| 408 |
|
| 409 |
|
| 410 |
|
| 411 |
|
| 412 |
|
| 413 |
void |
| 414 |
libdecor_frame_commit(struct libdecor_frame *frame, |
| 415 |
struct libdecor_state *state, |
| 416 |
struct libdecor_configuration *configuration); |
| 417 |
|
| 418 |
|
| 419 |
|
| 420 |
|
| 421 |
|
| 422 |
|
| 423 |
void |
| 424 |
libdecor_frame_set_minimized(struct libdecor_frame *frame); |
| 425 |
|
| 426 |
|
| 427 |
|
| 428 |
|
| 429 |
|
| 430 |
|
| 431 |
void |
| 432 |
libdecor_frame_set_maximized(struct libdecor_frame *frame); |
| 433 |
|
| 434 |
|
| 435 |
|
| 436 |
|
| 437 |
|
| 438 |
|
| 439 |
void |
| 440 |
libdecor_frame_unset_maximized(struct libdecor_frame *frame); |
| 441 |
|
| 442 |
|
| 443 |
|
| 444 |
|
| 445 |
|
| 446 |
|
| 447 |
void |
| 448 |
libdecor_frame_set_fullscreen(struct libdecor_frame *frame, |
| 449 |
struct wl_output *output); |
| 450 |
|
| 451 |
|
| 452 |
|
| 453 |
|
| 454 |
|
| 455 |
|
| 456 |
void |
| 457 |
libdecor_frame_unset_fullscreen(struct libdecor_frame *frame); |
| 458 |
|
| 459 |
|
| 460 |
|
| 461 |
|
| 462 |
|
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
bool |
| 470 |
libdecor_frame_is_floating(struct libdecor_frame *frame); |
| 471 |
|
| 472 |
|
| 473 |
|
| 474 |
|
| 475 |
|
| 476 |
|
| 477 |
void |
| 478 |
libdecor_frame_close(struct libdecor_frame *frame); |
| 479 |
|
| 480 |
|
| 481 |
|
| 482 |
|
| 483 |
|
| 484 |
|
| 485 |
void |
| 486 |
libdecor_frame_map(struct libdecor_frame *frame); |
| 487 |
|
| 488 |
|
| 489 |
|
| 490 |
|
| 491 |
struct xdg_surface * |
| 492 |
libdecor_frame_get_xdg_surface(struct libdecor_frame *frame); |
| 493 |
|
| 494 |
|
| 495 |
|
| 496 |
|
| 497 |
struct xdg_toplevel * |
| 498 |
libdecor_frame_get_xdg_toplevel(struct libdecor_frame *frame); |
| 499 |
|
| 500 |
|
| 501 |
|
| 502 |
|
| 503 |
struct libdecor_state * |
| 504 |
libdecor_state_new(int width, |
| 505 |
int height); |
| 506 |
|
| 507 |
|
| 508 |
|
| 509 |
|
| 510 |
void |
| 511 |
libdecor_state_free(struct libdecor_state *state); |
| 512 |
|
| 513 |
|
| 514 |
|
| 515 |
|
| 516 |
|
| 517 |
|
| 518 |
bool |
| 519 |
libdecor_configuration_get_content_size(struct libdecor_configuration *configuration, |
| 520 |
struct libdecor_frame *frame, |
| 521 |
int *width, |
| 522 |
int *height); |
| 523 |
|
| 524 |
|
| 525 |
|
| 526 |
|
| 527 |
|
| 528 |
|
| 529 |
|
| 530 |
|
| 531 |
bool |
| 532 |
libdecor_configuration_get_window_state(struct libdecor_configuration *configuration, |
| 533 |
enum libdecor_window_state *window_state); |
| 534 |
|
| 535 |
#ifdef __cplusplus |
| 536 |
} |
| 537 |
#endif |
| 538 |
|
| 539 |
#endif |