mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
	
		
			846 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
	
		
			846 B
		
	
	
	
		
			C
		
	
	
	
	
	
/* SPDX-License-Identifier: GPL-2.0-only */
 | 
						|
#ifndef LABWC_BOX_H
 | 
						|
#define LABWC_BOX_H
 | 
						|
 | 
						|
#include <wlr/util/box.h>
 | 
						|
 | 
						|
bool box_contains(struct wlr_box *box_super, struct wlr_box *box_sub);
 | 
						|
 | 
						|
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 *bounding_box);
 | 
						|
 | 
						|
struct wlr_fbox box_to_fbox(struct wlr_box *box);
 | 
						|
 | 
						|
#endif /* LABWC_BOX_H */
 |