labwc/include/snap.h
Axel Burri 1d72a08916 Add snap to window edge framework
Adds functions for calculation of distances between window edges, as
well as for window growing and shrinking.

All calculations are based on the "pending" geometry.

Ignored from snapping:

 - views that do not share the same output
 - minimized views
 - maximized views
 - views that are neither:
   - part of the current workspace
   - part of the always-on-top tree
2023-10-19 19:09:42 +01:00

17 lines
597 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef LABWC_SNAP_H
#define LABWC_SNAP_H
#include "common/border.h"
#include "view.h"
struct wlr_box;
struct border snap_get_max_distance(struct view *view);
void snap_vector_to_next_edge(struct view *view, enum view_edge direction, int *dx, int *dy);
int snap_distance_to_next_edge(struct view *view, enum view_edge direction);
void snap_grow_to_next_edge(struct view *view, enum view_edge direction, struct wlr_box *geo);
void snap_shrink_to_next_edge(struct view *view, enum view_edge direction, struct wlr_box *geo);
#endif /* LABWC_SNAP_H */