§1  OUTPUT  OUTPUT ROUTINES 1

1. Output routines. This is the file that contains all the output routines for the pictures ‘X’ enviromment. So all the functions that print the mathematical pictures and skew diagrams are coded in this file. There are also so other displaying functions.

2. All C programs are required to include specific standard header files and ‘X Windows’ programs are no exception. #include #include #include #include

3. There is one general header file that does all the includes needed for the graphical interface compilation units, in a proper order. #include

4. The construction of the file now occurs. It includes all the modules and macros mentioned below. The (d) macro calculates the number of rows in the diagram, d and (d) evaluates the number of columns from the furthest to the left to the furthest to the right (including any empty column between these ). ⟨ 4 ⟩ ≡ #define (d) ((d→bottom) − (d→top)) #define (d) ((d→r[0]→end ) − (d→r[ (d) − 1]→start ))

⟨ Global function declarations 7 ⟩

5. Local functions will precede the globally visible ones (which are defined in unnamed section); this slightly facilitates a top-down presentation of the functions. #define local static

format local static

2  DIAGRAM AND PICTURE DISPLAYING FUNCTIONS  OUTPUT §6

6. Diagram and Picture displaying functions. The following functions display the various representations of skew diagrams, partial pictures and complete picture. The routines that display the comments are also coded in this section.

7. To display a complete picture, the functions to display the complete domain and complete image are called. ⟨ Global function declarations 7 ⟩ ≡

extern void print complete picture (p picture window);

See also sections 9, 12, 14, 16, 19, 22, 24, 26, 29, 31, 33, 35, 37, 39, 42, 44, and 46. This code is used in section 4.

8.

extern void print complete picture (p picture window pw )

{ print complete domain(pw ); print complete image(pw ); }

9. These functions print the complete domain (image). This means that they print both the outline of the domain (image) and their corresponding images coordinates. With the image, to get the coordinates the picture must be inverted, so that the coordinates of an image can be worked out. ⟨ Global function declarations 7 ⟩ +≡

void print complete domain (p picture window);

void print complete image (p picture window);

10.

void print complete domain (p picture window pw )

{ if (pw →f ≠ ⊙)

{ print outline(pw →d.win, pw →f→domain, pw →d.hor →offset , pw →d.vert →offset );

print domain coordinates (pw , 0, 0); }

}

11.

void print complete image (p picture window pw )

{ if (pw →f ≠ ⊙)

{ pict p inv ⇐ inverse pict (pw →f); print outline(pw →i.win, pw →f→image, pw →i.hor →offset , pw →i.vert →offset ); print image coordinates (pw , inv );

§12  OUTPUT  DIAGRAM AND PICTURE DISPLAYING FUNCTIONS 3

} } 12. This function prints a cross at the origin in the picture window. If the domain and image are not empty, prints the outline of the domain in the domain window and the image in the image window. It highlights the square in the domain that has to be entered in the image next and prints the coordinates of the existing images in the domain window. ⟨ Global function declarations 7 ⟩ +≡

void print partial picture (p picture window);

13.

void print partial picture (p picture window pw )

{ if (pw →p ≠ ⊙)

{ int x, y; pict p f ⇐ pw →p→f; print origin cross (pw →i.win, pw →i.hor →offset , pw →i.vert →offset ); if (f ≠ ⊙) { print outline(pw →d.win, f→domain, pw →d.hor →offset , pw →d.vert →offset );

print domain coordinates (pw , pw →p→i, pw →p→j);

if (¬pw →p→complete)

{ window coordinates (&pw →d, pw →p→i, pw →p→j, &x, &y); highlight box (pw →d.win, , x, y, info→scale.box size);

}

print outline(pw →i.win, f→image, pw →i.hor →offset , pw →i.vert →offset ); } }

}

14. Printing the outline of a diagram, be it the domain or image of a picture or a skew diagram. This function prints a cross at the origin runs through the diagram passed, and prints a square at each of the entries. ⟨ Global function declarations 7 ⟩ +≡

void print outline (win p, diag p, int, int);

15.

void print outline (win p win, diag p d, int x offset , int y offset )

{ int i, j; print origin cross (win, x offset , y offset ); if (d ≠ ⊙)

for (i ⇐ 0; i < (d); ^{++}i)

if (d→r[i] ≠ ⊙)

for (j ⇐ d→r[i]→start ; j < d→r[i]→end ; ^{++}j) print box (win, j, i + d→top, x offset , y offset );

} 16. Printing the coordinates in the diagram, displays the coordinates of the image in both the create pict and completed pict modes. It runs round the diagram from the top left and prints the coordinates if the square is below the box being added or on the same line but to the left. (The box being added ispassed as its coordinates.) If all the squares are to have the coordinates displayed, the coordinates passed are set to below and to the right of the whole diagram. Printing the coordinates of the image, is far easier, since all the squares of the image are to be filled, so if the square is in the image, the coordinates are printed in it. ⟨ Global function declarations 7 ⟩ +≡

void print domain coordinates (p picture window, int, int); void print image coordinates (p picture window, pict p);

17.

void print domain coordinates (p picture window pw , int i, int j) { int a, b, x, y; pict p f; diag p d; char coord [20];

if (info→scale.box size < 20) return; if (pw →p ≠ ⊙) f ⇐ pw →p→f; else { i ⇐ pw →f→domain→top − 1; j ⇐ 0; /∗ i and j set so that all coordinates are printed. ∗/

f ⇐ pw →f; } d ⇐ f→domain; for (a ⇐ 0; a < (d); ^{++}a)

if (d→r[a] ≠ ⊙)

for (b ⇐ d→r[a]→start ; b < d→r[a]→end ; ^{++}b) if (a + d→top > i ∨ (a + d→top = i ∧ b < j)) { if (info→scale.box size ≥ 40)

sprintf (coord , , pict point (f, (a + d→top), b).i, pict point (f, (a + d→top), b).j); else sprintf (coord , , pict point (f, (a + d→top), b).j); window coordinates (&pw →d, a + d→top, b, &x, &y); print coord in box (pw →d.win, coord , x, y, 0);

}

}

18. When we come here, f ≠ ⊙.

void print image coordinates (p picture window pw , pict p f) { int a, b, x, y; diag p d ⇐ f→domain; char coord [20];

if (info→scale.box size < 20) return; for (a ⇐ 0; a < (d); ^{++}a) { if (d→r[a] ≠ ⊙)

{ for (b ⇐ d→r[a]→start ; b < d→r[a]→end ; ^{++}b)

{ if (info→scale.box size ≥ 40)

sprintf (coord , , pict point (f, (a + d→top), b).i, pict point (f, (a + d→top), b).j); else sprintf (coord , , pict point (f, (a + d→top), b).j); window coordinates (&pw →i, a + d→top, b, &x, &y); print coord in box (pw →i.win, coord , x, y, 0);

} }

} } 19. To print the comment corresponding to the function called, the window and comment are sent to the display message with the position of where to be printed. ⟨ Global function declarations 7 ⟩ +≡

void print comment (p inner window);

20.

void print comment (p inner window win)

6  VARIOUS OTHER PRINTING ROUTINE  OUTPUT §21

{ XClearWindow (display , win→com→w); display message(win→com, win→comment , 15, bf height ); } 21. Various other printing routine. These printing function display vital individual graphics like displaying a square representing a point in the diagram, or a string of coordinates representing the image of the point, or displaying a cross at the origin, etc. A more full description accompanies each function.

22. This function prints a specified string of coordinates into a square—specified by the coordinates of the top left corner—of a domain or image of the picture. ⟨ Global function declarations 7 ⟩ +≡

void print coord in box (win p, char∗ , int, int, int);

23.

void print coord in box (win p print win, char ∗coord , int x, int y, int highlight )

{ int length; if (XTextWidth(button font , , strlen( )) < info→scale.box size) { length ⇐ XTextWidth(button font , coord , strlen(coord ));

x ⇐ x + ((info→scale.box size − length)/2);

y ⇐ y + info→scale.box size − ((info→scale.box size − bf height )/2) − 8;

XDrawString (display , print win→w, highlight = 0 ? gc_{1} : gc_{2}, x, y, coord , strlen(coord )); } else { length ⇐ XTextWidth(coord font , coord , strlen(coord ));

x ⇐ x + ((info→scale.box size − length)/2);

y ⇐ y + info→scale.box size − ((info→scale.box size − cf height )/2) − 5;

XDrawString (display , print win→w, highlight = 0 ? gc_{3} : gc_{4}, x, y, coord , strlen(coord )); }

}

24. This function prints a square in the window specified at the coordinates passed to it with the offsets added to them. The size of this square is always info→scale.box size. ⟨ Global function declarations 7 ⟩ +≡

void print box (win p, int, int, int, int);

25.

void print box (win p win, int x, int y, int x offset , int y offset )

{ x ⇐ x ∗ info→scale.box size + x offset ; y ⇐ y ∗ info→scale.box size + y offset ;

§26  OUTPUT  VARIOUS OTHER PRINTING ROUTINE 7

XDrawRectangle(display , win→w, gc_{1}, x, y, info→scale.box size, info→scale.box size); } 26. These functions highlight and remove the highlight of a box of any size by drawing a filled rectangle one pixel inside the one passed to it, in the required graphics context to make it a highlight or remove highlight. ⟨ Global function declarations 7 ⟩ +≡

void highlight box (win p, char∗ , int, int, int); void remove highlighted box (win p, char∗ , int, int, int);

27.

void highlight box (win p win, char ∗s, int x, int y, int box size) { XFillRectangle(display , win→w, gc_{1}, x + 1, y + 1, box size − 1, box size − 1);

if (s[0] ≠ ) print coord in box (win, s, x, y, 1); }

28.

void remove highlighted box (win p win, char ∗s, int x, int y, int box size) { XFillRectangle(display , win→w, gc_{2}, x + 1, y + 1, box size − 1, box size − 1);

if (s[0] ≠ ) print coord in box (win, s, x, y, 0); }

29. This function prints a cross at the origin of the pictures domain or image, or diagram. The intersection of the cross displays the exact position of the origin. ⟨ Global function declarations 7 ⟩ +≡

void print origin cross (win p, int, int);

30.

void print origin cross (win p win, int x, int y) { XDrawLine(display , win→w, gc_{1}, x − 5, y − 5, x + 5, y + 5);

XDrawLine(display , win→w, gc_{1}, x − 5, y + 5, x + 5, y − 5); }

31. A string is passed to this function, which is printed in the window passed as an argument at the coordinates x and y. ⟨ Global function declarations 7 ⟩ +≡

void display message (win p, char∗ , int, int);

32.

void display message (win p display win, char ∗string , int x, int y) { XDrawString (display , display win→w, gc_{1}, x, y, string , strlen(string )); } 33. This is a function that displays the standard graphics for the main window. This is basically the titles of the two columns of icons. ⟨ Global function declarations 7 ⟩ +≡

void main expose (win p);

34.

void main expose (win p p) { Window win ⇐ p→w;

XDrawLine(display , win, gc_{1}, 0, (bf height + 12) + 10, window width, (bf height + 12) + 10); XDrawLine(display , win, gc_{1}, 0, (bf height + 12) ∗ 2 + 10, window width, (bf height + 12) ∗ 2 + 10); XDrawLine(display , win, gc_{1}, window width/2, (bf height + 12) + 10, window width/2,

(bf height + 12) ∗ 2 + 10); XDrawString (display , win, gc_{1}, 5, (bf height + 12) ∗ 2 + 3,

␣  , strlen(  )); XDrawString (display , win, gc_{1},
window width/2 + 5, (bf height + 12) ∗ 2 + 3,  ␣  , strlen(  ));

}

35. This function reprints all the windows that are visable at the time of execution. This is commonly executed when the default box size is changed. ⟨ Global function declarations 7 ⟩ +≡

void reprint all windows (void);

36.

void reprint all windows (void) { int i;

for (i ⇐ 0; info→dw [i] ≠ ⊙; i^{++}) { if (info→dw [i]→pane.visibility ≠ removed )

{ XClearWindow (display , info→dw [i]→disp.win→w); print outline(info→dw [i]→disp.win,

info→dw [i]→d, info→dw [i]→disp.hor →offset , info→dw [i]→disp.vert →offset ); }

} for (i ⇐ 0; info→pw [i] ≠ ⊙; i^{++}) { if (info→pw [i]→pane.visibility ≠ removed )

{ XClearWindow (display , info→pw [i]→d.win→w); XClearWindow (display , info→pw [i]→i.win→w); if (info→pw [i]→p ≠ ⊙) print partial picture(info→pw [i]); else print complete picture(info→pw [i]);

} }

} 37. The only online help is displayed in this function but hopefully there will more help available as a postscript file. Also the function for displaying the default settings window is coded here. ⟨ Global function declarations 7 ⟩ +≡

void help expose (win p); void scale expose (win p);

38.

void help expose (win p p) { int i; Window win ⇐ p→w;

static char ∗help[ ] ⇐ {  ␣       ␣   ␣       ␣  ␣    ␣         ␣  , ,

      ␣           ␣          ␣    ␣        ␣   ␣  ,
      ␣    ␣  ␣  ␣   ␣        ␣   ␣ ␣         ␣   ␣  , ␣     ␣  ␣  ␣  ,
      , ␣     ␣          ␣  ␣   ␣        ␣    ␣    ␣  ,
      ␣  ␣    ␣   ␣           ␣   ␣      ␣   ␣  ,
      ␣     ␣  ␣␣␣                   ␣␣␣   ␣  , ⊙ };

static char ∗exit ⇐ {  ␣  ␣      ␣  ␣  };

for (i ⇐ 0; help[i] ≠ ⊙; i^{++}) XDrawString (display , win, gc_{1}, 30, (i + 1) ∗ 20, help[i], strlen(help[i])); XDrawString (display , win, gc_{1}, 300, 220, exit , strlen(exit ));

} void scale expose (win p p)

{ Window win ⇐ p→w; char ∗title_{1} ⇐ {  ␣   ␣   ␣    ␣   ␣   ␣   ␣  };
char ∗title_{2} ⇐ {  ␣  }; char ∗string ⇐ {  ␣   ␣   ␣     ␣  ␣  ␣ ␣ ␣  };
char ∗exit mes ⇐ {  ␣  ␣      ␣  ␣  };

XDrawString (display , win, gc_{1}, 20, 40, title_{1}, strlen(title_{1}));

XDrawString (display , win, gc_{1}, 20, 60, title_{2}, strlen(title_{2}));

XDrawString (display , win, gc_{1}, 20, 90 + bf height , string , strlen(string ));

XDrawString (display , win, gc_{1}, 200, 135, exit mes , strlen(exit mes )); }

39. This function displays the contents of the box size entry window in the default settings window. ⟨ Global function declarations 7 ⟩ +≡

void scale entry expose (win p); void scale entry enter (win p); void scale entry leave (win p);

40.

void scale entry expose (win p p) { size t bs length; int bs width;

bs length ⇐ strlen(info→scale.bs string );

bs width ⇐ XTextWidth(button font , info→scale.bs string , bs length);

XDrawString (display , p→w, gc_{1}, 75 − (bs width + 5), bf height + 2, info→scale.bs string , bs length); } void scale entry enter (win p p) { XDrawRectangle(display , p→w, gc_{1}, 1, 1, 77, bf height + 7); } void scale entry leave (win p p) { XDrawRectangle(display , p→w, gc_{2}, 1, 1, 77, bf height + 7); }

10  ICON WINDOW GRAPHICS FUNCTIONS  OUTPUT §41

41. Icon window graphics functions.

42. This is a function that displays the graphics of a diagram or picture icon displaying whether it is iconised but not whether it is selected. ⟨ Global function declarations 7 ⟩ +≡

void display icon graphics (win p, char∗ , int);

43.

void display icon graphics (win p win, char ∗title, int visibility ) { XRectangle r[2];

r[0].x ⇐ 8; r[0].y ⇐ (bf height + 2)/2; r[0].width ⇐ r[0].height ⇐ 9; r[1].x ⇐ window width/2 − 22; r[1].y ⇐ (bf height + 2)/2; r[1].width ⇐ r[1].height ⇐ 9; XDrawRectangles (display , win→w, gc_{1}, r, 2); XDrawString (display , win→w, gc_{1}, 30, bf height + 2, title, strlen(title)); if (visibility = iconised ) display tick icon(win);

}

44. This function displays an “S” through the select box in the icon, by displaying a sequence of 19 seqments in the correct places. ⟨ Global function declarations 7 ⟩ +≡

void display select icon (win p);

45.

void display select icon (win p win) { XSegment s[19];

s[0].x_{1} ⇐ 11; s[0].x_{2} ⇐ 15; s[0].y_{1} ⇐ s[0].y_{2} ⇐ (bf height + 2)/2 − 4; s[1].x_{1} ⇐ 9; s[1].x_{2} ⇐ 17; s[1].y_{1} ⇐ s[1].y_{2} ⇐ (bf height + 2)/2 − 3; s[2].x_{1} ⇐ 8; s[2].x_{2} ⇐ 18; s[2].y_{1} ⇐ s[2].y_{2} ⇐ (bf height + 2)/2 − 2; s[3].x_{1} ⇐ 7; s[3].x_{2} ⇐ 9; s[3].y_{1} ⇐ s[3].y_{2} ⇐ (bf height + 2)/2 − 1; s[4].x_{1} ⇐ 6; s[4].x_{2} ⇐ 8; s[4].y_{1} ⇐ s[4].y_{2} ⇐ (bf height + 2)/2; s[5].x_{1} ⇐ 6; s[5].x_{2} ⇐ 8; s[5].y_{1} ⇐ s[5].y_{2} ⇐ (bf height + 2)/2 + 1; s[6].x_{1} ⇐ 6; s[6].x_{2} ⇐ 9; s[6].y_{1} ⇐ s[6].y_{2} ⇐ (bf height + 2)/2 + 2; s[7].x_{1} ⇐ 7; s[7].x_{2} ⇐ 13; s[7].y_{1} ⇐ s[7].y_{2} ⇐ (bf height + 2)/2 + 3; s[8].x_{1} ⇐ 8; s[8].x_{2} ⇐ 17; s[8].y_{1} ⇐ s[8].y_{2} ⇐ (bf height + 2)/2 + 4; s[9].x_{1} ⇐ 12; s[9].x_{2} ⇐ 17; s[9].y_{1} ⇐ s[9].y_{2} ⇐ (bf height + 2)/2 + 5; s[10].x_{1} ⇐ 16; s[10].x_{2} ⇐ 18; s[10].y_{1} ⇐ s[10].y_{2} ⇐ (bf height + 2)/2 + 6; s[11].x_{1} ⇐ 17; s[11].x_{2} ⇐ 19; s[11].y_{1} ⇐ s[11].y_{2} ⇐ (bf height + 2)/2 + 7; s[12].x_{1} ⇐ 17; s[12].x_{2} ⇐ 19; s[12].y_{1} ⇐ s[12].y_{2} ⇐ (bf height + 2)/2 + 8; s[13].x_{1} ⇐ 17; s[13].x_{2} ⇐ 19; s[13].y_{1} ⇐ s[13].y_{2} ⇐ (bf height + 2)/2 + 9; s[14].x_{1} ⇐ 16; s[14].x_{2} ⇐ 18; s[14].y_{1} ⇐ s[14].y_{2} ⇐ (bf height + 2)/2 + 10; s[15].x_{1} ⇐ 6; s[15].x_{2} ⇐ 7; s[15].y_{1} ⇐ s[15].y_{2} ⇐ (bf height + 2)/2 + 10; s[16].x_{1} ⇐ 7; s[16].x_{2} ⇐ 17; s[16].y_{1} ⇐ s[16].y_{2} ⇐ (bf height + 2)/2 + 11; s[17].x_{1} ⇐ 8; s[17].x_{2} ⇐ 16; s[17].y_{1} ⇐ s[17].y_{2} ⇐ (bf height + 2)/2 + 12; s[18].x_{1} ⇐ 10; s[18].x_{2} ⇐ 14; s[18].y_{1} ⇐ s[18].y_{2} ⇐ (bf height + 2)/2 + 13; XDrawSegments (display , win→w, gc_{1}, s, 19);

}

§46  OUTPUT  ICON WINDOW GRAPHICS FUNCTIONS 11

46. This function displays an “tick” through the iconised box in the icon, by displaying a sequence of 15 segments in the correct places. ⟨ Global function declarations 7 ⟩ +≡

void display tick icon (win p);

47.

void display tick icon (win p win) { XSegment s[15];

s[0].x_{1} ⇐ s[0].x_{2} ⇐ window width/2 − 8; s[0].y_{1} ⇐ s[0].y_{2} ⇐ (bf height + 2)/2 − 2; s[1].x_{1} ⇐ s[1].x_{2} ⇐ window width/2 − 9; s[1].y_{1} ⇐ s[1].y_{2} ⇐ (bf height + 2)/2 − 1; s[2].x_{1} ⇐ s[2].x_{2} ⇐ window width/2 − 10; s[2].y_{1} ⇐ s[2].y_{2} ⇐ (bf height + 2)/2; s[3].x_{1} ⇐ window width/2 − 11; s[3].x_{2} ⇐ window width/2 − 10; s[3].y_{1} ⇐ s[3].y_{2} ⇐ (bf height + 2)/2 + 1; s[4].x_{1} ⇐ window width/2 − 13; s[4].x_{2} ⇐ window width/2 − 11; s[4].y_{1} ⇐ s[4].y_{2} ⇐ (bf height + 2)/2 + 2; s[5].x_{1} ⇐ window width/2 − 14; s[5].x_{2} ⇐ window width/2 − 12; s[5].y_{1} ⇐ s[5].y_{2} ⇐ (bf height + 2)/2 + 3; s[6].x_{1} ⇐ window width/2 − 15; s[6].x_{2} ⇐ window width/2 − 13; s[6].y_{1} ⇐ s[6].y_{2} ⇐ (bf height + 2)/2 + 4; s[7].x_{1} ⇐ window width/2 − 17; s[7].x_{2} ⇐ window width/2 − 13; s[7].y_{1} ⇐ s[7].y_{2} ⇐ (bf height + 2)/2 + 5; s[8].x_{1} ⇐ window width/2 − 22; s[8].x_{2} ⇐ window width/2 − 13; s[8].y_{1} ⇐ s[8].y_{2} ⇐ (bf height + 2)/2 + 6; s[9].x_{1} ⇐ window width/2 − 22; s[9].x_{2} ⇐ window width/2 − 13; s[9].y_{1} ⇐ s[9].y_{2} ⇐ (bf height + 2)/2 + 7; s[10].x_{1} ⇐ window width/2 − 20; s[10].x_{2} ⇐ window width/2 − 15; s[10].y_{1} ⇐ s[10].y_{2} ⇐ (bf height + 2)/2 + 8; s[11].x_{1} ⇐ window width/2 − 18; s[11].x_{2} ⇐ window width/2 − 17; s[11].y_{1} ⇐ s[11].y_{2} ⇐ (bf height + 2)/2 + 10; s[12].x_{1} ⇐ window width/2 − 23; s[12].x_{2} ⇐ window width/2 − 21; s[12].y_{1} ⇐ s[12].y_{2} ⇐ (bf height + 2)/2 + 5; s[13].x_{1} ⇐ window width/2 − 23; s[13].x_{2} ⇐ window width/2 − 22; s[13].y_{1} ⇐ s[13].y_{2} ⇐ (bf height + 2)/2 + 4; s[14].x_{1} ⇐ window width/2 − 24; s[14].x_{2} ⇐ window width/2 − 22; s[14].y_{1} ⇐ s[14].y_{2} ⇐ (bf height + 2)/2 + 3; XDrawSegments (display , win→w, gc_{1}, s, 15);

}

12  INDEX  OUTPUT §48

48. Index.

a: \underline{17}, \underline{18}. b: \underline{17}, \underline{18}. bf height : 20, 23, 34, 38, 40, 43, 45, 47. bottom: 4. box size: 13, 17, 18, 23, 24, 25, \underline{27}, \underline{28}. bs length: \underline{40}. bs string : 40. bs width: \underline{40}. button font : 23, 40. cf height : 23. com: 20. comment : 20. complete: 13. completed pict : 16. coord : \underline{17}, \underline{18}, \underline{23}. coord font : 23. create pict : 16. d: \underline{15}, \underline{17}, \underline{18}. diag p: 14, 15, 17, 18. : 4, 15, 17, 18. : 4. disp: 36. display : 20, 23, 25, 27, 28, 30, 32, 34, 36, 38,

40, 43, 45, 47. display icon graphics : \underline{42}, \underline{43}. display message: 19, 20, \underline{31}, \underline{32}. display select icon: \underline{44}, \underline{45}. display tick icon: 43, \underline{46}, \underline{47}. display win: \underline{32}. domain: 10, 13, 17, 18. dw : 36. end : 4, 15, 17, 18. exit : \underline{38}. exit mes : \underline{38}. f: \underline{13}, \underline{17}, \underline{18}. gc_{1}: 23, 25, 27, 30, 32, 34, 38, 40, 43, 45, 47. gc_{2}: 23, 28, 40. gc_{3}: 23. gc_{4}: 23. height : 43. help: \underline{38}. help expose: \underline{37}, \underline{38}. highlight : \underline{23}. highlight box : 13, \underline{26}, \underline{27}. hor : 10, 11, 13, 36. i: \underline{15}, \underline{17}, \underline{36}, \underline{38}. iconised : 43. image: 11, 13. info: 13, 17, 18, 23, 24, 25, 36, 40. inv : \underline{11}. inverse pict : 11. j: \underline{15}, \underline{17}. length: \underline{23}. local: \underline{5}. main expose: \underline{33}, \underline{34}. offset : 10, 11, 13, 36. p: \underline{34}, \underline{38}, \underline{40}. p inner window: 19, 20. p picture window: 7, 8, 9, 10, 11, 12, 13,

16, 17, 18. pane: 36. pict p: 11, 13, 16, 17, 18. pict point : 17, 18. print box : 15, \underline{24}, \underline{25}. print comment : \underline{19}, \underline{20}. print complete domain: 8, \underline{9}, \underline{10}. print complete image: 8, \underline{9}, \underline{11}. print complete picture: \underline{7}, \underline{8}, 36. print coord in box : 17, 18, \underline{22}, \underline{23}, 27, 28. print domain coordinates : 10, 13, \underline{16}, \underline{17}. print image coordinates : 11, \underline{16}, \underline{18}. print origin cross : 13, 15, \underline{29}, \underline{30}. print outline: 10, 11, 13, \underline{14}, \underline{15}, 36. print partial picture: \underline{12}, \underline{13}, 36. print win: \underline{23}. pw : \underline{8}, \underline{10}, \underline{11}, \underline{13}, \underline{17}, \underline{18}, 36. r: \underline{43}. remove highlighted box : \underline{26}, \underline{28}. removed : 36. reprint all windows : \underline{35}, \underline{36}. s: \underline{27}, \underline{28}, \underline{45}, \underline{47}. scale: 13, 17, 18, 23, 24, 25, 40. scale entry enter : \underline{39}, \underline{40}. scale entry expose: \underline{39}, \underline{40}. scale entry leave: \underline{39}, \underline{40}. scale expose: \underline{37}, \underline{38}. size t: 40. sprintf : 17, 18. start : 4, 15, 17, 18. string : \underline{32}, \underline{38}. strlen: 23, 32, 34, 38, 40, 43. title: \underline{43}. title_{1}: \underline{38}. title_{2}: \underline{38}. top: 4, 15, 17, 18. vert : 10, 11, 13, 36. visibility : 36, \underline{43}. width: 43. win: 10, 11, 13, \underline{15}, 17, 18, \underline{20}, \underline{25}, \underline{27}, \underline{28}, \underline{30},

\underline{34}, 36, \underline{38}, \underline{43}, \underline{45}, \underline{47}.

win p: 14, 15, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 37, 38, 39, 40, 42, 43, 44, 45, 46, 47.

§48  OUTPUT  INDEX 13

Window: 34, 38. window coordinates : 13, 17, 18. window width: 34, 43, 47. x: \underline{13}, \underline{17}, \underline{18}, \underline{23}, \underline{25}, \underline{27}, \underline{28}, \underline{30}, \underline{32}. x offset : \underline{15}, \underline{25}. XClearWindow : 20, 36. XDrawLine: 30, 34. XDrawRectangle: 25, 40. XDrawRectangles : 43. XDrawSegments : 45, 47. XDrawString : 23, 32, 34, 38, 40, 43. XFillRectangle: 27, 28. XRectangle: 43. XSegment: 45, 47. XTextWidth: 23, 40. x_{1}: 45, 47. x_{2}: 45, 47. y: \underline{13}, \underline{17}, \underline{18}, \underline{23}, \underline{25}, \underline{27}, \underline{28}, \underline{30}, \underline{32}. y offset : \underline{15}, \underline{25}. y_{1}: 45, 47. y_{2}: 45, 47.

⟨ Global function declarations 7, 9, 12, 14, 16, 19, 22, 24, 26, 29, 31, 33, 35, 37, 39, 42, 44, 46 ⟩ Used in section 4.

⟨ 4 ⟩

OUTPUT

Section Page

Output routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 Diagram and Picture displaying functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2 Various other printing routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 6 Icon window graphics functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 10 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 12