r_area_list.h revision b18c2d1e
1/*
2 * Copyright notice...
3 */
4
5#ifndef _CTWM_R_AREA_LIST_H
6#define _CTWM_R_AREA_LIST_H
7
8#include "r_structs.h"
9
10
11RAreaList *RAreaListNew(int cap, ...);
12
13void RAreaListFree(RAreaList *self);
14
15RAreaList *RAreaListCopyCropped(const RAreaList *self, int left_margin,
16                                int right_margin,
17                                int top_margin, int bottom_margin);
18
19void RAreaListAdd(RAreaList *self, const RArea *area);
20
21RAreaList *RAreaListHorizontalUnion(const RAreaList *self);
22RAreaList *RAreaListVerticalUnion(const RAreaList *self);
23
24RAreaList *RAreaListIntersect(const RAreaList *self, const RArea *area);
25void RAreaListForeach(const RAreaList *self,
26                      bool (*func)(const RArea *area, void *data),
27                      void *data);
28
29RArea RAreaListBigArea(const RAreaList *self);
30RArea RAreaListBestTarget(const RAreaList *self, const RArea *area);
31
32int RAreaListMaxX(const RAreaList *self);
33int RAreaListMaxY(const RAreaList *self);
34int RAreaListMinX2(const RAreaList *self);
35int RAreaListMinY2(const RAreaList *self);
36
37void RAreaListPrint(const RAreaList *self);
38
39
40/*
41 * Simple accessors to avoid unnecessary layering violations.
42 */
43/// How many RArea's are in the list?
44static inline int RAreaListLen(const RAreaList *self)
45{
46	return self->len;
47}
48
49
50#endif  /* _CTWM_R_AREA_LIST_H */
51