1ADDRDSRECWINDOW(3) RDS PHYSICAL FUNCTIONS ADDRDSRECWINDOW(3)
2
3
4
6 addrdsrecwindow - adds a rectangle in the windowing of rds structure.
7
9 #include "rwinnn.h"
10 void addrdsrecwindow( Rectangle, RdsWindow )
11 rdsrec_list ∗Rectangle;
12 rdswindow ∗RdsWindow;
13
15 Rectangle The rectangle to add to the windowing.
16
17 RdsWindow The head of the windowing which has to contain the
18 rectangle.
19
21 The addrdsrecwindow function inserts a rdsrec_list rectangle structure
22 in the windowing of the rds structure. The rectangle is added in one or
23 many windows of the table (it depends on his dimensions). The field
24 ´USER´ of the rectangle is used to point to the list of windows which
25 contains the rectangle. So, the field ´USER´ has to be saved in an
26 added structure to the rdsrec_list structure if librfm functions are
27 used because some use the field ´USER´ to link rectangles (see librds
28 about field ´USER´).
29
30 Note If the rectangle is contained in only one window, then the field
31 ´USER´ points to a "rdswin_list" window structure.
32 If the rectangle is contained in many windows, the field ´USER´
33 points to a "rdsrecwin_list" structure which is a list which
34 contains windows.
35
36 To know if a rectangle belongs to one or many windows, use the macro
37 IsRdsOneWindow defined in librwi.
38
40 none
41
43 "Rds202: rdsalloc error, can't continue !"
44 it's impossible to allocate the memory size desired
45
47 #include "mutnnn.h"
48 #include "rdsnnn.h"
49 #include "rwinnn.h"
50 #include "rtlnnn.h"
51 # define POINTER_LINKREC(R) \
52 \
53 (((UserStruct ∗)((char ∗)(R)+sizeof(rdsrec_list)))->LINKREC )
54 typedef struct UserStruct
55 {
56 void ∗LINKREC;
57 } UserStruct;
58 main()
59 {
60 rdsfig_list ∗Figure;
61 rdsrec_list ∗Rectangle;
62 rdswindow ∗RdsWindow;
63 rdswin_list ∗ScanWin;
64 rdsrecwin_list ∗ScanRecWin;
65 mbkenv();
66 rdsenv();
67 loadrdsparam();
68 Figure = addrdsfig( "core",sizeof ( UserStruct ) );
69 Rectangle =
70 addrdsfigrec(Figure,"Alu1",RDS_ALU1,2,4,5,1);
71 /∗ Using the field ´USER´ ∗/
72 Rectangle->USER = Rectangle;
73 . . . .
74 RdsWindow = allocrdswindow();
75 RdsWindow->XMIN = -200;
76 RdsWindow->YMIN = -200;
77 RdsWindow->XMAX = 200;
78 RdsWindow->YMAX = 200;
79 RdsWindow->DX = 4;
80 RdsWindow->DY = 4;
81 RdsWindow->SIDE = 100;
82 RdsWindow->SIZE = RdsWindow->DX ∗ RdsWindow->DY ;
83 RdsWindow->WINTAB = allocrdswin( RdsWindow->SIZE );
84 /∗ Save the field ´USER´ of the rectangle ∗/
85 POINTER_LINKREC(Rectangle) = Rectangle->USER;
86 /∗ ∗/ addrdsrecwindow( Rectangle, RdsWindow );
87 /∗ windows associated to a rectangle are pointed by the
88 field ´USER´ of the rectangle ∗/
89 /∗ getting windows (pointer ∗ScanWin) of a rectangle ∗/
90 if ( IsRdsOneWindow(Rectangle) )
91 {
92 ScanWin = (rdswin_list ∗) Rectangle->USER;
93 }
94 else
95 {
96 ScanRecWin = Rectangle->USER;
97 while ( ScanRecWin != NULL )
98 {
99 ScanWin = (rdswin_list ∗) (ScanRecWin)->WINDOW;
100 ScanRecWin = ScanRecWin->NEXT;
101 }
102 }
103 . . .
104 }
105
107 librwi, delrdsrecwindow
108
109
110
111
112
113
114ASIM/LIP6 October 1, 1997 ADDRDSRECWINDOW(3)