CTWM
|
#include "ctwm.h"
#include <stdlib.h>
#include <stdio.h>
#include "r_area.h"
#include "r_area_list.h"
#include "util.h"
Go to the source code of this file.
Functions | |
RArea | RAreaNew (int x, int y, int width, int height) |
Construct an RArea from given components. | |
RArea * | RAreaNewStatic (int x, int y, int width, int height) |
Return a pointer to a static newly constructed RArea. | |
RArea | RAreaInvalid (void) |
Return a facially-invalid RArea. | |
bool | RAreaIsValid (const RArea *self) |
Is an RArea facially valid? | |
int | RAreaX2 (const RArea *self) |
Return the right edge of an RArea. | |
int | RAreaY2 (const RArea *self) |
Return the bottom edge of an RArea. | |
int | RAreaArea (const RArea *self) |
Return the area of an RArea. | |
RArea | RAreaIntersect (const RArea *self, const RArea *other) |
Return an RArea describing the intersection of two RArea's. | |
bool | RAreaIsIntersect (const RArea *self, const RArea *other) |
Do two areas intersect? | |
bool | RAreaContainsXY (const RArea *self, int x, int y) |
Is a given coordinate inside a RArea? | |
RAreaList * | RAreaHorizontalUnion (const RArea *self, const RArea *other) |
Create a list of maximal horizontal stripes of two RArea's. | |
RAreaList * | RAreaVerticalUnion (const RArea *self, const RArea *other) |
Create a list of maximal vertical stripes of two RArea's. | |
void | RAreaPrint (const RArea *self) |
Pretty-print an RArea. | |
Return the area of an RArea.
Definition at line 93 of file r_area.c.
References PlaceX.
Referenced by RAreaListBestTarget(), and RLayoutFull().
Create a list of maximal horizontal stripes of two RArea's.
This yields a set of RArea's that completely cover (without overlap) the pair of input RArea's (or NULL if the inputs are disjoint). That could be just a single RArea if e.g. they're the same height and touch/overlap horizontally, or they're the same width and touch/overlap vertically. Otherwise it will wind up being multiple rows (2 or 3).
Only used in startup to populate the RLayout.horiz list.
Definition at line 179 of file r_area.c.
References max(), min(), PlaceX, RAreaListAdd(), RAreaListNew(), RAreaNewStatic(), RAreaX2(), RAreaY2(), RArea::width, RArea::x, and RArea::y.
Referenced by RAreaListHorizontalUnion().
Return an RArea describing the intersection of two RArea's.
Definition at line 103 of file r_area.c.
References max(), min(), PlaceX, RAreaInvalid(), RAreaIsIntersect(), RAreaNew(), RAreaX2(), and RAreaY2().
Referenced by RAreaListBestTarget(), and RAreaListIntersectCrop().
Return a facially-invalid RArea.
This is used in places that need a sentinel value.
Definition at line 49 of file r_area.c.
Referenced by fullzoom(), RAreaIntersect(), RAreaListBestTarget(), RAreaListBigArea(), RLayoutGetAreaByName(), and RLayoutGetAreaIndex().
Do two areas intersect?
Definition at line 127 of file r_area.c.
References PlaceX, RAreaX2(), and RAreaY2().
Referenced by _findMonitorBottomEdge(), _findMonitorLeftEdge(), _findMonitorRightEdge(), _findMonitorTopEdge(), RAreaIntersect(), and RAreaListIntersect().
Is an RArea facially valid?
Mostly used to check against sentinel values in places that may or may not have a real value to work with.
Definition at line 63 of file r_area.c.
References PlaceX, and RArea::width.
Referenced by fullzoom(), RAreaListBestTarget(), RAreaListIntersectCrop(), and RLayoutXParseGeometry().
Construct an RArea from given components.
Definition at line 19 of file r_area.c.
Referenced by _RLayoutRecenterHorizontally(), _RLayoutRecenterVertically(), AddWindow(), ConstrainByLayout(), FindConstraint(), fullzoom(), Identify(), RAreaIntersect(), RAreaListBigArea(), RAreaNewStatic(), RLayoutFullHoriz(), RLayoutFullVert(), SetupFrame(), TryToPack(), and XrandrNewLayout().
Return a pointer to a static newly constructed RArea.
This is a thin wrapper around RAreaNew() that returns a static pointer. This is used in places that need to take RArea pointers, but we don't want to futz with making local intermediate vars. Currently exclusively used inline in RAreaListNew() calls.
Definition at line 35 of file r_area.c.
References RAreaNew(), x, and y.
Referenced by add_layout_override_entry(), ctwm_main(), RAreaHorizontalUnion(), and RAreaVerticalUnion().
Pretty-print an RArea.
Used for dev/debug.
Definition at line 411 of file r_area.c.
References PlaceX.
Referenced by RAreaListPrint(), and XrandrNewLayout().
Create a list of maximal vertical stripes of two RArea's.
This yields a set of RArea's that completely cover (without overlap) the pair of input RArea's (or NULL if the inputs are disjoint). This is the equivalent of RAreaHorizontalUnion(), except with vertical stripes.
Only used in startup to populate the RLayout.vert list.
Definition at line 304 of file r_area.c.
References RArea::height, max(), min(), PlaceX, RAreaListAdd(), RAreaListNew(), RAreaNewStatic(), RAreaX2(), RAreaY2(), RArea::x, and RArea::y.
Referenced by RAreaListVerticalUnion().
Return the right edge of an RArea.
Definition at line 73 of file r_area.c.
References PlaceX.
Referenced by _findMonitorRightEdge(), _RLayoutRecenterVertically(), RAreaContainsXY(), RAreaHorizontalUnion(), RAreaIntersect(), RAreaIsIntersect(), RAreaListBigArea(), RAreaListMinX2(), RAreaVerticalUnion(), and RLayoutFullVert1().
Return the bottom edge of an RArea.
Definition at line 83 of file r_area.c.
References PlaceX.
Referenced by _findMonitorBottomEdge(), _RLayoutRecenterHorizontally(), RAreaContainsXY(), RAreaHorizontalUnion(), RAreaIntersect(), RAreaIsIntersect(), RAreaListBigArea(), RAreaListMinY2(), RAreaVerticalUnion(), and RLayoutFullHoriz1().