File: box.h

package info (click to toggle)
labwc 0.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,980 kB
  • sloc: ansic: 34,416; perl: 5,836; xml: 875; sh: 162; python: 131; makefile: 12
file content (25 lines) | stat: -rw-r--r-- 767 bytes parent folder | download
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
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef LABWC_BOX_H
#define LABWC_BOX_H

#include <wlr/util/box.h>

bool box_intersects(struct wlr_box *box_a, struct wlr_box *box_b);

/* Returns the bounding box of 2 boxes */
void box_union(struct wlr_box *box_dest, struct wlr_box *box_a,
	struct wlr_box *box_b);

/*
 * Fits and centers a content box (width & height) within a bounding box.
 * The content box is downscaled if necessary (preserving aspect ratio) but
 * not upscaled.
 *
 * The returned x & y coordinates are the centered content position
 * relative to the top-left corner of the bounding box.
 */
struct wlr_box box_fit_within(int width, int height, struct wlr_box *bound);

struct wlr_fbox box_to_fbox(struct wlr_box *box);

#endif /* LABWC_BOX_H */