File: rectangle.h

package info (click to toggle)
notion 4.0.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,656 kB
  • sloc: ansic: 47,365; sh: 2,093; makefile: 594; perl: 270
file content (39 lines) | stat: -rw-r--r-- 1,020 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * ion/ioncore/rectangle.h
 *
 * Copyright (c) Tuomo Valkonen 1999-2007.
 *
 * See the included file LICENSE for details.
 */

#ifndef ION_IONCORE_RECTANGLE_H
#define ION_IONCORE_RECTANGLE_H

#include <stdio.h>
#include "common.h"
#include <libextl/extl.h>

INTRSTRUCT(WRectangle);

DECLSTRUCT(WRectangle){
    int x, y;
    int w, h;
};

#define RECTANGLE_SAME   0x00
#define RECTANGLE_X_DIFF 0x01
#define RECTANGLE_Y_DIFF 0x02
#define RECTANGLE_POS_DIFF (RECTANGLE_X_DIFF|RECTANGLE_Y_DIFF)
#define RECTANGLE_W_DIFF 0x04
#define RECTANGLE_H_DIFF 0x08
#define RECTANGLE_SZ_DIFF (RECTANGLE_W_DIFF|RECTANGLE_H_DIFF)

extern int rectangle_compare(const WRectangle *g, const WRectangle *h);
extern bool rectangle_contains(const WRectangle *g, int x, int y);
extern void rectangle_constrain(WRectangle *g, const WRectangle *bounds);
extern void rectangle_clamp_or_center(WRectangle *g, const WRectangle *bounds);

extern void rectange_debugprint(const WRectangle *g, const char *n);

#endif /* ION_IONCORE_RECTANGLE_H */