1 // ************************************************************************
2 //
3 // Copyright (c) 1995-2002 Juniper Networks, Inc. All rights reserved.
4 //
5 // Permission is hereby granted, without written agreement and without
6 // license or royalty fees, to use, copy, modify, and distribute this
7 // software and its documentation for any purpose, provided that the
8 // above copyright notice and the following three paragraphs appear in
9 // all copies of this software.
10 //
11 // IN NO EVENT SHALL JUNIPER NETWORKS, INC. BE LIABLE TO ANY PARTY FOR
12 // DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
13 // ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
14 // JUNIPER NETWORKS, INC. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
15 // DAMAGE.
16 //
17 // JUNIPER NETWORKS, INC. SPECIFICALLY DISCLAIMS ANY WARRANTIES,
18 // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
20 // NON-INFRINGEMENT.
21 //
22 // THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND JUNIPER
23 // NETWORKS, INC. HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
24 // UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
25 //
26 // ************************************************************************
27 
28 
29 
30 /*
31  * bplaneInt.h --
32  *
33  * This file defines constants and datastructures used internally by the
34  * bplane module, but not exported to the rest of the world.
35  */
36 #ifndef _BPLANEINT_H
37 #define _BPLANEINT_H
38 
39 /* Tcl linked Parameters */
40 extern int bpMinBAPop;         /* don't sub(bin) when count less than this
41 				*/
42 extern double bpMinAvgBinPop;  /* try to keep average bin pop at or
43 				* below this
44 				*/
45 
46 /* LabeledElement
47  *
48  * Used in this module as elements for test bplanes.
49  */
50 typedef struct labeledelement
51 {
52   struct element *le_links[BP_NUM_LINKS];
53   Rect le_rect;
54   /* client data goes here */
55   char * le_text;
56 } LabeledElement;
57 
58 /* bins */
59 extern void bpBinsUpdate(BPlane *bp);
60 
61 extern void bpBinAdd(BinArray *ba, Element *e);
62 
63 extern BinArray *bpBinArrayBuild(Rect bbox,
64 				 Element *elements, /* initial elements */
65 				 bool subbin); /* subbin as needed */
66 
67 /* dump (for debug) */
68 extern void bpDumpRect(Rect *r);
69 extern void bpDump(BPlane *bp, int flags);
70 /* bpDump flags */
71 /* labeled elements */
72 # define BPD_LABELED 1
73 # define BPD_INTERNAL_UNITS 2
74 
75 /* test */
76 void bpTestSnowGold(int size, bool trace);
77 extern BPlane *bpTestSnow(int size, bool trace);
78 extern Plane *bpTestSnowTile(int size, bool trace);
79 
80 extern int bpRand(int min, int max);
81 
82 #endif /* _BPLANEINT_H */
83