File:  [NeXTSTEP 3.3 examples] / Examples / AppKit / Yap / YapWrap.psw
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:48:40 2018 UTC (8 years, 1 month ago) by root
Branches: NeXT, MAIN
CVS tags: NeXTSTEP33, HEAD
Sample Programs from NeXSTEP 3.3

/*
 *  The following pswrap functions are used by YapOutput in the Yap program...
 *  By: Ali Ozer
 *
 *  You may freely copy, distribute and reuse the code in this example.
 *  NeXT disclaims any warranty of any kind, expressed or implied,
 *  as to its fitness for any particular use.
 */

defineps GetUserTime (| int *utime)
  yaptime utime
endps

/*
 * GetFocus gets the bbox of the current clippath, the ctm, and 
 * current win number. ReFocus focuses given these values.
 */

defineps GetFocus(|float *llx; float *lly, *urx, *ury, ctm[6]; int *win)
    gsave clippath pathbbox ury urx lly llx grestore
    matrix currentmatrix {ctm} forall
    currentwindow win
endps

defineps ReFocus(int win; float ctm[6]; float llx, lly, urx, ury)
    win windowdeviceround	% focus on this window
    ctm setmatrix		% set up the matrix
    newpath			% reestablish the clip path
	llx lly moveto
	llx ury lineto
	urx ury lineto
	urx lly lineto
    closepath clip
    newpath
endps


unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.