home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Examples / AppKit / SortingInAction / SortWraps.psw < prev   
Encoding:
Text File  |  1990-10-09  |  81.4 MB  |  148 lines

Text Truncated. Only the first 1MB is shown below. Download the file for the complete contents.
  1.  
  2. /* Collection of PSwrap functions for animating sorting activity.
  3.  * 
  4.  * Author: Julie Zelenski, NeXT Developer Support
  5.  * You may freely copy, distribute and reuse the code in this example.  
  6.  * NeXT disclaims any warranty of any kind, expressed or implied, as to 
  7.  * its fitness for any particular use.
  8.  */
  9.  
  10.  
  11.  
  12. /* PSWswapRects sets the gray to wV, fills the white rectangle, sets the 
  13.  * gray to black, fills the black rectangle, and flushes the drawing to 
  14.  * the screen immediately.
  15.  */
  16. defineps PSWswapRects (float x1, y1, x2, y2, width, height)
  17.     0.0 setgray
  18.     x1 y1 width height rectfill
  19.     1.0 setgray
  20.     x2 y2 width height rectfill
  21.     flushgraphics
  22. endps
  23.  
  24.  
  25. /* PSWmoveRects sets the gray appropriately (gray value is passed as parameter)
  26.  * fills the rectangle and flushes the drawing to the screen immediately.
  27.  */
  28. defineps PSWmoveRect (float x, y, width, height, gray)
  29.     gray setgray
  30.     x y width height rectfill
  31.     flushgraphics
  32. endps
  33.  
  34.  
  35. /* PSWcompareRects turns on instance drawing, sets the gray to light gray,
  36.  * fills the two rectangles being compared and turns off instance drawing.
  37.  */
  38. defineps PSWcompareRects (float x1,y1,width,height1,x2,y2,height2)   
  39.     true setinstance
  40.     .667 setgray    
  41.     x1 y1 width height1 rectfill
  42.     x2 y2 width height2 rectfill    
  43.     false setinstance
  44. endps
  45.  
  46.  
  47. /* PSWfade simply sovers a semi-transparent white rectangle onto the view to
  48.  * "fade" the background. 
  49.  */
  50. defineps PSWfade(float width, height)
  51.     1.0 setgray
  52.     .75 setalpha
  53.     0 0 width height Sover compositerect
  54. endps
  55.     
  56.     
  57. /* PSWdrawBorder strokes the rectangle border in black.
  58.  */
  59. defineps PSWdrawBorder(float width, height)    
  60.     0.0 setgray
  61.     1.0 setalpha
  62.     1.0 setlinewidth
  63.     0.0 0.0 width height rectstroke
  64. endps
  65.  
  66.  
  67. /* PSWdrawName shows the sort name at the specified location.
  68.  */
  69. defineps PSWdrawName(float x, y; char *name)
  70.     0.0 setgray
  71.     1.0 setalpha
  72.     x y moveto
  73.    (name) show
  74. endps
  75.  
  76.  
  77. /* PSWdrawStrings is used to draw four right-aligned strings at a 
  78.  * specific height.
  79.  */
  80. defineps PSWdrawStrings (char *s1, *s2, *s3, *s4; float height)
  81.     /rightShow {dup stringwidth pop neg 0 rmoveto show} def
  82.     0.0 setgray
  83.     1.0 setalpha
  84.     140.0 height moveto
  85.     (s1) rightShow
  86.     270.0 height moveto
  87.     (s2) rightShow
  88.     370.0 height moveto
  89.     (s3) rightShow
  90.     480.0 height moveto
  91.     (s4) rightShow
  92. endps
  93.  
  94.     
  95. V#
  96. # Generated by the NeXT Project Builder.
  97. #
  98. # NOTE: Do NOT change this file -- Project Builder maintains it.
  99. #
  100. # Put all of your customizations in files called Makefile.preamble
  101. # and Makefile.postamble (both optional), and Makefile will include them.
  102. #
  103.  
  104. NAME = SortingInAction
  105.  
  106. PROJECTVERSION = 1.1
  107. LANGUAGE = English
  108.  
  109. APPICON = SortApp.tiff
  110. LOCAL_RESOURCES = HelpPanel.nib InfoPanel.nib Sort.nib
  111.  
  112. CLASSES = BubbleSort.m GenericSort.m InsertionSort.m MergeSort.m \
  113.           QuickSort.m SelectionSort.m ShellSort.m SortApp.m \
  114.           SortController.m SortView.m
  115.  
  116. HFILES = BubbleSort.h GenericSort.h InsertionSort.h MergeSort.h \
  117.          QuickSort.h SelectionSort.h ShellSort.h SortApp.h \
  118.          SortController.h SortView.h
  119.  
  120. MFILES = SortingInAction_main.m
  121.  
  122. PSWFILES = SortWraps.psw
  123.  
  124. OTHERSRCS = README.rtf
  125.  
  126.  
  127. MAKEFILEDIR = /NextDeveloper/Makefiles/app
  128. INSTALLDIR = /Apps
  129. INSTALLFLAGS = -c -s -m 755
  130. SOURCEMODE = 444
  131.  
  132. ICONSECTIONS =    -sectcreate __ICVpp SortApp.tiff
  133.  
  134. LIBS = -lMedia_s -lNeXT_s
  135. DEBUG_LIBS = $(LIBS)
  136. PROF_LIBS = $(LIBS)
  137.  
  138.  
  139. -include Makefile.preamble
  140.  
  141. include $(MAKEFILEDIR)/app.make
  142.  
  143. -include Makefile.postamble
  144.  
  145. -include Makefile.dependencies
  146. F    SortingInAction.app    SortingInAction    app
  147. F    SortingInAction    SortingInAction    app
  148. V