|
CTWM
|
#include "ctwm.h"#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <string.h>#include "r_area_list.h"#include "r_area.h"Go to the source code of this file.
Functions | |
| static RAreaList * | RAreaListCopy (const RAreaList *self) |
| Create a copy of a given RAreaList. | |
| static void | RAreaListDelete (RAreaList *self, int index) |
| Delete an RArea from inside an RAreaList. | |
| static void | RAreaListAddList (RAreaList *self, const RAreaList *other) |
| Add the RArea's from one RAreaList onto another. | |
| static RAreaList * | RAreaListIntersectCrop (const RAreaList *self, const RArea *area) |
| Create an RAreaList from another, cropped to a certain area defined by an RArea. | |
| static int | _cmpX (const void *av, const void *bv) |
| qsort comparison function to sort by RArea.x | |
| static void | RAreaListSortX (const RAreaList *self) |
| Sort the RArea's in an RAreaList by their x coordinate. | |
| static int | _cmpY (const void *av, const void *bv) |
| qsort comparison function to sort by RArea.t | |
| static void | RAreaListSortY (const RAreaList *self) |
| Sort the RArea's in an RAreaList by their y coordinate. | |
| RAreaList * | RAreaListNew (int cap,...) |
| Create an RAreaList from a set of RArea's. | |
| RAreaList * | RAreaListCopyCropped (const RAreaList *self, int left_margin, int right_margin, int top_margin, int bottom_margin) |
| Create a copy of an RAreaList with given amounts cropped off the sides. | |
| void | RAreaListFree (RAreaList *self) |
| Clean up and free an RAreaList. | |
| void | RAreaListAdd (RAreaList *self, const RArea *area) |
| Add an RArea onto an RAreaList. | |
| RAreaList * | RAreaListHorizontalUnion (const RAreaList *self) |
| Create an RAreaList whose RArea's are the horizontal union of our RArea's. | |
| RAreaList * | RAreaListVerticalUnion (const RAreaList *self) |
| Create an RAreaList whose RArea's are the vertical union of our RArea's. | |
| RAreaList * | RAreaListIntersect (const RAreaList *self, const RArea *area) |
| Create an RAreaList of all the areas in an RAreaList that a given RArea intersects with. | |
| void | RAreaListForeach (const RAreaList *self, bool(*func)(const RArea *cur_area, void *data), void *data) |
| Run a function over each RArea in an RAreaList until one returns true, allowing them a place to stash other internal data. | |
| RArea | RAreaListBigArea (const RAreaList *self) |
| Create a maximal RArea describing the union of an RAreaList. | |
| RArea | RAreaListBestTarget (const RAreaList *self, const RArea *area) |
| Find the RArea in an RAreaList that has the largest intersection with a given RArea. | |
| int | RAreaListMaxX (const RAreaList *self) |
| Find the x coordinate of the right-most RArea in an RAreaList. | |
| int | RAreaListMaxY (const RAreaList *self) |
| Find the y coordinate of the bottom-most RArea in an RAreaList. | |
| int | RAreaListMinX2 (const RAreaList *self) |
| Find the x coordinate of the right edge of the left-most RArea in an RAreaList. | |
| int | RAreaListMinY2 (const RAreaList *self) |
| Find the y coordinate of the bottom edge of the top-most RArea in an RAreaList. | |
| void | RAreaListPrint (const RAreaList *self) |
| Pretty-print an RAreaList. | |
|
static |
qsort comparison function to sort by RArea.x
Definition at line 219 of file r_area_list.c.
References RArea::x, and RArea::y.
Referenced by RAreaListSortX().
|
static |
qsort comparison function to sort by RArea.t
Definition at line 253 of file r_area_list.c.
References RArea::x, and RArea::y.
Referenced by RAreaListSortY().
Add an RArea onto an RAreaList.
Definition at line 176 of file r_area_list.c.
References RAreaList::areas, RAreaList::cap, and RAreaList::len.
Referenced by add_layout_override_entry(), RAreaHorizontalUnion(), RAreaListIntersect(), RAreaListIntersectCrop(), RAreaListNew(), RAreaVerticalUnion(), and XrandrNewLayout().
Add the RArea's from one RAreaList onto another.
Definition at line 196 of file r_area_list.c.
References RAreaList::areas, RAreaList::cap, and RAreaList::len.
Referenced by RAreaListCopy(), RAreaListHorizontalUnion(), and RAreaListVerticalUnion().
Find the RArea in an RAreaList that has the largest intersection with a given RArea.
Colloquially, which area in an RAreaList does our RArea mostly fit into? This is used to resize a window to fill one monitor, by finding which monitor it's on.
Definition at line 460 of file r_area_list.c.
References RAreaList::areas, RAreaList::len, RAreaArea(), RAreaIntersect(), RAreaInvalid(), and RAreaIsValid().
Referenced by RLayoutFull1().
Create a maximal RArea describing the union of an RAreaList.
This is used to construct a giant square that contains all our monitors (and the dead area necessary to cover them). It winds up being the equivalent of a spanning pseudo-Root window, and is used when we need to figure some sort of "overall" positioning, like when figuring "real" x/y coordinates.
Definition at line 421 of file r_area_list.c.
References RAreaList::areas, RAreaList::len, RAreaInvalid(), RAreaNew(), RAreaX2(), RAreaY2(), RArea::x, x, RArea::y, and y.
Referenced by _RLayoutRecenterHorizontally(), _RLayoutRecenterVertically(), RAreaListCopyCropped(), and RLayoutBigArea().
Create a copy of a given RAreaList.
Definition at line 77 of file r_area_list.c.
References RAreaList::cap, RAreaListAddList(), and RAreaListNew().
Referenced by RAreaListHorizontalUnion(), and RAreaListVerticalUnion().
| RAreaList * RAreaListCopyCropped | ( | const RAreaList * | self, |
| int | left_margin, | ||
| int | right_margin, | ||
| int | top_margin, | ||
| int | bottom_margin ) |
Create a copy of an RAreaList with given amounts cropped off the sides.
This is used principally during startup, to handle the BorderBottom/Top/Left/Right config params.
Definition at line 93 of file r_area_list.c.
References RArea::height, RAreaListBigArea(), RAreaListIntersectCrop(), RAreaListNew(), RArea::width, RArea::x, and RArea::y.
Referenced by RLayoutCopyCropped().
|
static |
Delete an RArea from inside an RAreaList.
Definition at line 155 of file r_area_list.c.
References RAreaList::areas, and RAreaList::len.
Referenced by RAreaListHorizontalUnion(), and RAreaListVerticalUnion().
| void RAreaListForeach | ( | const RAreaList * | self, |
| bool(* | func )(const RArea *cur_area, void *data), | ||
| void * | data ) |
Run a function over each RArea in an RAreaList until one returns true, allowing them a place to stash other internal data.
Definition at line 378 of file r_area_list.c.
References RAreaList::areas, and RAreaList::len.
Referenced by RLayoutFindMonitorBottomEdge(), RLayoutFindMonitorLeftEdge(), RLayoutFindMonitorRightEdge(), RLayoutFindMonitorTopEdge(), RLayoutGetAreaAtXY(), and TryToPack().
| void RAreaListFree | ( | RAreaList * | self | ) |
Clean up and free an RAreaList.
Definition at line 141 of file r_area_list.c.
References RAreaList::areas.
Referenced by _RLayoutHorizontalIntersect(), _RLayoutVerticalIntersect(), proc_layout_override(), RAreaListHorizontalUnion(), RAreaListVerticalUnion(), RLayoutFindLeftRightEdges(), RLayoutFindTopBottomEdges(), RLayoutFree(), and RLayoutFull1().
Create an RAreaList whose RArea's are the horizontal union of our RArea's.
Definition at line 288 of file r_area_list.c.
References RAreaList::areas, RAreaList::len, RAreaHorizontalUnion(), RAreaListAddList(), RAreaListCopy(), RAreaListDelete(), RAreaListFree(), and RAreaListSortX().
Referenced by RLayoutNew().
Create an RAreaList of all the areas in an RAreaList that a given RArea intersects with.
Definition at line 359 of file r_area_list.c.
References RAreaList::areas, RAreaList::len, RAreaIsIntersect(), RAreaListAdd(), and RAreaListNew().
Referenced by _RLayoutHorizontalIntersect(), _RLayoutRecenterHorizontally(), _RLayoutRecenterVertically(), _RLayoutVerticalIntersect(), and RLayoutFull1().
Create an RAreaList from another, cropped to a certain area defined by an RArea.
Definition at line 396 of file r_area_list.c.
References RAreaList::areas, RAreaList::len, RAreaIntersect(), RAreaIsValid(), RAreaListAdd(), and RAreaListNew().
Referenced by RAreaListCopyCropped().
| int RAreaListMaxX | ( | const RAreaList * | self | ) |
Find the x coordinate of the right-most RArea in an RAreaList.
Definition at line 481 of file r_area_list.c.
References RAreaList::areas, RAreaList::len, and RArea::x.
Referenced by RLayoutFindLeftRightEdges().
| int RAreaListMaxY | ( | const RAreaList * | self | ) |
Find the y coordinate of the bottom-most RArea in an RAreaList.
Definition at line 503 of file r_area_list.c.
References RAreaList::areas, RAreaList::len, and RArea::y.
Referenced by RLayoutFindTopBottomEdges().
| int RAreaListMinX2 | ( | const RAreaList * | self | ) |
Find the x coordinate of the right edge of the left-most RArea in an RAreaList.
Definition at line 523 of file r_area_list.c.
References RAreaList::areas, RAreaList::len, and RAreaX2().
Referenced by RLayoutFindLeftRightEdges().
| int RAreaListMinY2 | ( | const RAreaList * | self | ) |
Find the y coordinate of the bottom edge of the top-most RArea in an RAreaList.
Definition at line 543 of file r_area_list.c.
References RAreaList::areas, RAreaList::len, and RAreaY2().
Referenced by RLayoutFindTopBottomEdges().
| RAreaList * RAreaListNew | ( | int | cap, |
| ... ) |
Create an RAreaList from a set of RArea's.
| cap | Hint as to the number of RArea's being passed |
| ... | Sequence of RArea * to put in it. Don't forget a trailing NULL. |
Definition at line 40 of file r_area_list.c.
References RAreaList::areas, cap, RAreaList::cap, RAreaList::len, and RAreaListAdd().
Referenced by ctwm_main(), fullzoom(), init_layout_override(), RAreaHorizontalUnion(), RAreaListCopy(), RAreaListCopyCropped(), RAreaListIntersect(), RAreaListIntersectCrop(), RAreaVerticalUnion(), and XrandrNewLayout().
| void RAreaListPrint | ( | const RAreaList * | self | ) |
Pretty-print an RAreaList.
Used for dev/debug.
Definition at line 564 of file r_area_list.c.
References RAreaList::areas, RAreaList::cap, RAreaList::len, and RAreaPrint().
Referenced by RLayoutPrint().
|
static |
Sort the RArea's in an RAreaList by their x coordinate.
Definition at line 239 of file r_area_list.c.
References _cmpX(), RAreaList::areas, and RAreaList::len.
Referenced by RAreaListHorizontalUnion().
|
static |
Sort the RArea's in an RAreaList by their y coordinate.
Definition at line 273 of file r_area_list.c.
References _cmpY(), RAreaList::areas, and RAreaList::len.
Referenced by RAreaListVerticalUnion().
Create an RAreaList whose RArea's are the vertical union of our RArea's.
Definition at line 326 of file r_area_list.c.
References RAreaList::areas, RAreaList::len, RAreaListAddList(), RAreaListCopy(), RAreaListDelete(), RAreaListFree(), RAreaListSortY(), and RAreaVerticalUnion().
Referenced by RLayoutNew().