|
|
1.1 ! root 1: .TH PT 3L "630 MTG" ! 2: .XE "Pt()" ! 3: .XE "Rpt()" ! 4: .XE "Rect()" ! 5: .SH NAME ! 6: pt: Pt, Rpt, Rect \- create a Point or Rectangle from arguments ! 7: .SH SYNOPSIS ! 8: .ft B ! 9: #include <dmd.h> ! 10: .sp ! 11: Point Pt (x, y) ! 12: .br ! 13: int x, y; ! 14: .sp ! 15: Rectangle Rpt (p, q) ! 16: .br ! 17: Point p, q; ! 18: .sp ! 19: Rectangle Rect (a, b, c, d) ! 20: .br ! 21: int a, b, c, d; ! 22: .SH DESCRIPTION ! 23: These functions ! 24: are special macros that are ! 25: to be used ! 26: .B only ! 27: in an argument list to a function. ! 28: They are functionally equivalent to the ones in \fIfpt(3L)\fR but are ! 29: faster for the above situation. ! 30: .PP ! 31: The ! 32: .I Pt ! 33: argument ! 34: passes a coordinate pair as a Point to a function. ! 35: .PP ! 36: The ! 37: .I Rpt ! 38: argument ! 39: passes two Points as a Rectangle to a function. ! 40: .PP ! 41: The ! 42: .I Rect ! 43: argument ! 44: passes four coordinates (two coordinate pairs) as a Rectangle to a function. ! 45: .SH EXAMPLE ! 46: The following subroutine draws two boxes in the upper ! 47: left corner of the window. ! 48: .sp ! 49: .nf ! 50: .ft CM ! 51: #include <dmd.h> ! 52: ! 53: drawboxes() ! 54: { ! 55: Point add(); ! 56: Rectangle raddp(); ! 57: ! 58: box(&display, ! 59: Rpt(Drect.origin, add(Drect.origin, Pt(100,100))), ! 60: F_STORE); ! 61: ! 62: box(&display, ! 63: raddp(Rect(0,0,200,200), Drect.origin), ! 64: F_STORE); ! 65: } ! 66: .fi ! 67: .ft 1 ! 68: .PP ! 69: .SH SEE ALSO ! 70: fpt(3L).
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.