CTWM
Loading...
Searching...
No Matches
/usr/src/RPM/BUILD/ctwm-4.1.0/r_area_list.h File Reference
#include "r_structs.h"
Include dependency graph for r_area_list.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

RAreaListRAreaListNew (int cap,...)
 Create an RAreaList from a set of RArea's.
void RAreaListFree (RAreaList *self)
 Clean up and free an RAreaList.
RAreaListRAreaListCopyCropped (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 RAreaListAdd (RAreaList *self, const RArea *area)
 Add an RArea onto an RAreaList.
RAreaListRAreaListHorizontalUnion (const RAreaList *self)
 Create an RAreaList whose RArea's are the horizontal union of our RArea's.
RAreaListRAreaListVerticalUnion (const RAreaList *self)
 Create an RAreaList whose RArea's are the vertical union of our RArea's.
RAreaListRAreaListIntersect (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 *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 int RAreaListLen (const RAreaList *self)
 How many RArea's are in the list?

Function Documentation

◆ RAreaListAdd()

◆ RAreaListBestTarget()

RArea RAreaListBestTarget ( const RAreaList * self,
const RArea * area )

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().

◆ RAreaListBigArea()

RArea RAreaListBigArea ( const RAreaList * self)

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().

◆ RAreaListCopyCropped()

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().

◆ RAreaListForeach()

void RAreaListForeach ( const RAreaList * self,
bool(* func )(const RArea *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().

◆ RAreaListFree()

◆ RAreaListHorizontalUnion()

RAreaList * RAreaListHorizontalUnion ( const RAreaList * self)

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().

◆ RAreaListIntersect()

RAreaList * RAreaListIntersect ( const RAreaList * self,
const RArea * area )

◆ RAreaListLen()

int RAreaListLen ( const RAreaList * self)
inlinestatic

How many RArea's are in the list?

Definition at line 44 of file r_area_list.h.

References RAreaList::len.

Referenced by proc_layout_override().

◆ RAreaListMaxX()

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().

◆ RAreaListMaxY()

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().

◆ RAreaListMinX2()

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().

◆ RAreaListMinY2()

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().

◆ RAreaListNew()

RAreaList * RAreaListNew ( int cap,
... )

Create an RAreaList from a set of RArea's.

Parameters
capHint 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().

◆ RAreaListPrint()

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().

◆ RAreaListVerticalUnion()

RAreaList * RAreaListVerticalUnion ( const RAreaList * self)

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().