/usr/include/xview/rectlist.h is in xviewg-dev 3.2p1.4-28.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | /* @(#)rectlist.h 20.16 93/06/28 SMI */
/*
* (c) Copyright 1989 Sun Microsystems, Inc. Sun design patents
* pending in the U.S. and foreign countries. See LEGAL NOTICE
* file for terms of the license.
*/
#ifndef xview_rectlist_DEFINED
#define xview_rectlist_DEFINED
#include <xview/xv_c_types.h>
/*
* Defines the interface to the data structure called
* a rectlist which is a list of rectangles.
*
* A rectlist has an offset (rl_x, rl_y) assoicated with it that is used
* to efficiently pass this data structure from one embedded coordinate
* system to another without changing the offsets of all the rectangles in
* the list.
*
* Rl_bound is the rectangle that bounds all the rectangles in the list
* and is maintained to facilitate efficient rectangle algebra.
*/
/*
***********************************************************************
* Definitions and Macros
***********************************************************************
*/
/*
* PUBLIC #defines
*/
#define RECTNODE_NULL ((Rectnode *)0)
#define RECTLIST_NULL ((Rectlist *)0)
/*
* Rectlist Transformation macros used for passing rectlists up/down embedded
* coordinate systems.
*/
#define rl_passtoparent(x,y,rl) \
{(rl)->rl_x=(rl)->rl_x+(x); (rl)->rl_y=(rl)->rl_y+(y);}
#define rl_passtochild(x,y,rl) \
{(rl)->rl_x=(rl)->rl_x-(x); (rl)->rl_y=(rl)->rl_y-(y);}
/*
* Rectlist Offset Adjustment macros
*/
#define rl_rectoffset(rl,r1,r) \
{*(r)= *(r1); (r)->r_left+=(rl)->rl_x; (r)->r_top+=(rl)->rl_y;}
#define rl_coordoffset(rl,x,y) {*(x)-=(rl)->rl_x;*(y)-=(rl)->rl_y;}
/*
***********************************************************************
* Typedefs, Enumerations, and Structures
***********************************************************************
*/
/*
* PUBLIC structures
*/
typedef struct rectnode {
struct rectnode *rn_next; /* Pointer to next rectnode */
struct rect rn_rect;
} Rectnode;
typedef struct rectlist {
coord rl_x, rl_y; /* Offset to apply to each rect
in list including bound */
struct rectnode *rl_head; /* Pointer to first rectnode */
struct rectnode *rl_tail; /* Pointer to last rectnode */
struct rect rl_bound; /* Describes bounding rect of
all rects in list */
} Rectlist;
/*
***********************************************************************
* Globals
***********************************************************************
*/
/*
* PUBLIC functions
*/
extern struct rectlist rl_null;
EXTERN_FUNCTION (unsigned rl_empty, (Rectlist *rl));
EXTERN_FUNCTION (unsigned rl_equal, (Rectlist *rl1, Rectlist *rl2));
EXTERN_FUNCTION (unsigned rl_boundintersectsrect, (Rect *r, Rectlist *rl));
EXTERN_FUNCTION (unsigned rl_rectintersects, (Rect *r, Rectlist *rl));
EXTERN_FUNCTION (unsigned rl_equalrect, (Rect *r, Rectlist *rl));
EXTERN_FUNCTION (unsigned rl_includespoint, (Rectlist *r, int x, int y));
#ifdef xview_other_rl_funcs
EXTERN_FUNCTION (void rl_rectintersection, (Rect *r, Rectlist *rl1, Rectlist *rl));
EXTERN_FUNCTION (void rl_rectunion, (Rect *r, Rectlist *rl1, Rectlist *rl));
EXTERN_FUNCTION (void rl_rectdifference, (Rect *r, Rectlist *rl1, Rectlist *rl));
EXTERN_FUNCTION (void rl_intersection, (Rectlist *rl1, Rectlist *rl2, Rectlist *rl));
EXTERN_FUNCTION (void rl_sort, (Rectlist *rl1, Rectlist *rl, int sortorder));
EXTERN_FUNCTION (void rl_union, (Rectlist *rl1, Rectlist *rl2, Rectlist *rl));
EXTERN_FUNCTION (void rl_difference, (Rectlist *rl1, Rectlist *rl2, Rectlist *rl));
EXTERN_FUNCTION (void rl_initwithrect, (Rect *r, Rectlist *rl));
EXTERN_FUNCTION (void rl_copy, (Rectlist *rl1, Rectlist *rl));
EXTERN_FUNCTION (void rl_free, (Rectlist *rl));
EXTERN_FUNCTION (void rl_coalesce, (Rectlist *rl));
EXTERN_FUNCTION (void rl_normalize, (Rectlist *rl));
EXTERN_FUNCTION (void rl_print, (Rectlist *rl, char *tag));
#endif /* xview_other_rl_funcs */
#endif /* ~xview_rectlist_DEFINED */
|