X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fresize.h;h=72dffc0f55a5d66c68d376938945832dea936d9e;hb=ce7e1b9177ec6d2313eb97be5a7a7d558930f741;hp=aefbb0059e1a5e5323762afd787defd67f39bb23;hpb=5b4f10eacaf27db8ff9fd88f2a77134cdd0f09cf;p=i3%2Fi3 diff --git a/include/resize.h b/include/resize.h index aefbb005..72dffc0f 100644 --- a/include/resize.h +++ b/include/resize.h @@ -1,27 +1,39 @@ /* - * vim:ts=8:expandtab + * vim:ts=4:sw=4:expandtab * * i3 - an improved dynamic tiling window manager + * © 2009 Michael Stapelberg and contributors (see also: LICENSE) * - * (c) 2009 Michael Stapelberg and contributors - * - * See file LICENSE for license information. + * resize.c: Interactive resizing. * */ +#pragma once + +#include -#ifndef _RESIZE_H -#define _RESIZE_H +bool resize_find_tiling_participants(Con **current, Con **other, direction_t direction, bool both_sides); -#include +void resize_graphical_handler(Con *first, Con *second, orientation_t orientation, const xcb_button_press_event_t *event); -typedef enum { O_HORIZONTAL, O_VERTICAL } resize_orientation_t; +/** + * Resize the two given containers using the given amount of pixels or + * percentage points. One of the two needs to be 0. A positive amount means + * growing the first container while a negative means shrinking it. + * Returns false when the resize would result in one of the two containers + * having less than 1 pixel of size. + * + */ +bool resize_neighboring_cons(Con *first, Con *second, int px, int ppt); /** - * Renders the resize window between the first/second container and resizes - * the table column/row. + * Calculate the minimum percent needed for the given container to be at least 1 + * pixel. * */ -int resize_graphical_handler(xcb_connection_t *conn, Container *first, Container *second, - resize_orientation_t orientation, xcb_button_press_event_t *event); +double percent_for_1px(Con *con); -#endif +/** + * Calculate the given container's new percent given a change in pixels. + * + */ +double px_resize_to_percent(Con *con, int px_diff);