X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fresize.h;h=72dffc0f55a5d66c68d376938945832dea936d9e;hb=5720ba65ab073fff40cdf89f598d560e40741967;hp=7b33de907fb397d8348bb70d1ee23558c9781271;hpb=f354f534357798eb3ba497b7143132f41ff090f6;p=i3%2Fi3 diff --git a/include/resize.h b/include/resize.h index 7b33de90..72dffc0f 100644 --- a/include/resize.h +++ b/include/resize.h @@ -11,6 +11,29 @@ #include -bool resize_find_tiling_participants(Con **current, Con **other, direction_t direction); +bool resize_find_tiling_participants(Con **current, Con **other, direction_t direction, bool both_sides); -int resize_graphical_handler(Con *first, Con *second, orientation_t orientation, const xcb_button_press_event_t *event); +void resize_graphical_handler(Con *first, Con *second, orientation_t orientation, const xcb_button_press_event_t *event); + +/** + * 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); + +/** + * Calculate the minimum percent needed for the given container to be at least 1 + * pixel. + * + */ +double percent_for_1px(Con *con); + +/** + * Calculate the given container's new percent given a change in pixels. + * + */ +double px_resize_to_percent(Con *con, int px_diff);