## MetaRectangle MetaRectangle — Simple box operations |

## Functions

MetaRectangle * | meta_rectangle_copy ()
void | meta_rectangle_free ()
MetaRectangle | meta_rect ()
int | meta_rectangle_area ()
gboolean | meta_rectangle_intersect ()
gboolean | meta_rectangle_equal ()
void | meta_rectangle_union ()
gboolean | meta_rectangle_overlap ()
gboolean | meta_rectangle_vert_overlap ()
gboolean | meta_rectangle_horiz_overlap ()
gboolean | meta_rectangle_could_fit_rect ()
gboolean | meta_rectangle_contains_rect ()

## Types and Values

struct | MetaRectangle
struct | MetaStrut
enum | MetaEdgeType
struct | MetaEdge

## Object Hierarchy

        GBoxed
        ╰── MetaRectangle

## Description

## Functions

### meta_rectangle_copy ()

    MetaRectangle *
    meta_rectangle_copy (const MetaRectangle *rect);

### meta_rectangle_free ()

    void
    meta_rectangle_free (MetaRectangle *rect);

### meta_rect ()

    MetaRectangle
    meta_rect (int x,
               int y,
               int width,
               int height);

### meta_rectangle_area ()

    int
    meta_rectangle_area (const MetaRectangle *rect);

### meta_rectangle_intersect ()

    gboolean
    meta_rectangle_intersect (const MetaRectangle *src1,
                              const MetaRectangle *src2,
                              MetaRectangle *dest);

#### Parameters

src1 | a MetaRectangle |
src2 | another MetaRectangle |
dest | an empty MetaRectangle, to be filled with the coordinates of the intersection. | [out caller-allocates]

#### Returns

TRUE is some intersection exists and is not degenerate, FALSE otherwise.

### meta_rectangle_equal ()

    gboolean
    meta_rectangle_equal (const MetaRectangle *src1,
                          const MetaRectangle *src2);

### meta_rectangle_union ()

    void
    meta_rectangle_union (const MetaRectangle *rect1,
                          const MetaRectangle *rect2,
                          MetaRectangle *dest);

#### Parameters

rect1 | a MetaRectangle |
rect2 | another MetaRectangle |
dest | an empty MetaRectangle, to be filled with the coordinates of the bounding box. | [out caller-allocates]

### meta_rectangle_overlap ()

    gboolean
    meta_rectangle_overlap (const MetaRectangle *rect1,
                            const MetaRectangle *rect2);

### meta_rectangle_vert_overlap ()

    gboolean
    meta_rectangle_vert_overlap (const MetaRectangle *rect1,
                                 const MetaRectangle *rect2);

### meta_rectangle_horiz_overlap ()

    gboolean
    meta_rectangle_horiz_overlap (const MetaRectangle *rect1,
                                  const MetaRectangle *rect2);

### meta_rectangle_could_fit_rect ()

    gboolean
    meta_rectangle_could_fit_rect (const MetaRectangle *outer_rect,
                                   const MetaRectangle *inner_rect);

### meta_rectangle_contains_rect ()

    gboolean
    meta_rectangle_contains_rect (const MetaRectangle *outer_rect,
                                  const MetaRectangle *inner_rect);

## Types and Values

### struct MetaRectangle

    struct MetaRectangle {
      int x;
      int y;
      int width;
      int height;
    };

#### Members

int `x`; | X coordinate of the top-left corner |
int `y`; | Y coordinate of the top-left corner |
int `width`; | Width of the rectangle |
int `height`; | Height of the rectangle |

### struct MetaStrut

    struct MetaStrut {
      MetaRectangle rect;
      MetaSide side;
    };

#### Members

MetaRectangle `rect`; | MetaRectangle the MetaStrut is on |
MetaSide `side`; | MetaSide the MetaStrut is on |

### enum MetaEdgeType

#### Members

META_EDGE_WINDOW | Whether the edge belongs to a window |
META_EDGE_MONITOR | Whether the edge belongs to a monitor |
META_EDGE_SCREEN | Whether the edge belongs to a screen |

### struct MetaEdge

    struct MetaEdge {
      MetaRectangle rect;      /* width or height should be 1 */
      MetaSide side_type;
      MetaEdgeType  edge_type;
    };

#### Members

MetaRectangle `rect`; | MetaRectangle with the bounds of the edge |
MetaSide `side_type`; | Side |
MetaEdgeType `edge_type`; | To what belongs the edge |