File: ir.h

package info (click to toggle)
oleo 1.6-16
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,640 kB
  • ctags: 3,139
  • sloc: ansic: 39,221; yacc: 1,737; sh: 362; makefile: 88
file content (92 lines) | stat: -rw-r--r-- 2,819 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*	Copyright (C) 1992, 1993 Free Software Foundation, Inc.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this software; see the file COPYING.  If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */


#ifndef IRH
#define IRH

#include "proto.h"
/*  t. lord	Thu Feb 13 00:44:35 1992	*/

#define xx_IRllx(R)  ((R)->x)
#define xx_IRlly(R)  ((R)->y)
#define xx_IRurx(R)  ((R)->x + (R)->w - 1)
#define xx_IRury(R)  ((R)->y + (R)->h - 1)

typedef struct xx_sIntRectangle * xx_IntRectangle;
struct xx_sIntRectangle
{
  int x, y;
  unsigned int w, h;
};

#define xx_IRinit(R,X,Y,W,H)   (void)(((R)->x = (X)), ((R)->y = (Y)), \
				      ((R)->w = (W)), ((R)->h = (H)))
/* extern int xx_IRintersects (xx_IntRectangle, xx_IntRectangle); */
#define xx_IRintersects(R1,R2) \
  (xx_IRllx(R1) <= xx_IRurx(R2) &&\
   xx_IRurx(R1) >= xx_IRllx(R2) &&\
   xx_IRlly(R1) <= xx_IRury(R2) &&\
   xx_IRury(R1) >= xx_IRlly(R2))



#ifdef PRETTY_PRINT_DECLS
extern void xx_pp_intrectangle (xx_IntRectangle, FILE *);
#endif

#define xx_IRx(R) ((R)->x)
#define xx_IRy(R) ((R)->y)
#define xx_IRw(R) ((R)->w)
#define xx_IRh(R) ((R)->h)
#define xx_IRxl(R) xx_IRx(R)
#define xx_IRyl(R) xx_IRy(R)
#define xx_IRxh(R) (xx_IRx(R) + xx_IRw(R) - 1)
#define xx_IRyh(R) (xx_IRy(R) + xx_IRh(R) - 1)

#ifdef PRETTY_PRINT

void
xx_pp_intrectangle (r, stream)
     xx_IntRectangle r;
     FILE * stream;
{
  fprintf (stream, "(xx_IntRectangle x %d, y %d, w %d, h %d)",
	   r->x, r->y, r->w, r->h);
}
#endif

#if PROTOTYPES
extern int xx_IRencloses (xx_IntRectangle r1, xx_IntRectangle r2);
extern int xx_IRencloses_width (xx_IntRectangle r1, xx_IntRectangle r2);
extern int xx_IRequiv (xx_IntRectangle r1, xx_IntRectangle r2);
extern void xx_IRbound (xx_IntRectangle r1, xx_IntRectangle r2);
extern int xx_IRarea (xx_IntRectangle r);
extern int xx_IRhits_point (xx_IntRectangle rect, int x, int y);
extern void xx_IRclip (xx_IntRectangle r1, xx_IntRectangle r2);
extern int xx_IRsubtract (xx_IntRectangle outv, xx_IntRectangle a, xx_IntRectangle b);
#else /* PROTOTYPES */
extern int xx_IRencloses ();
extern int xx_IRencloses_width ();
extern int xx_IRequiv ();
extern void xx_IRbound ();
extern int xx_IRarea ();
extern int xx_IRhits_point ();
extern void xx_IRclip ();
extern int xx_IRsubtract ();
#endif /* PROTOTYPES */

#endif