home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / x / x11p-13.zip / RCS / do_scroll.c,v < prev    next >
Text File  |  1989-05-04  |  2KB  |  167 lines

  1. head     2.2;
  2. access   ;
  3. symbols  pre-merge:2.0;
  4. locks    ; strict;
  5. comment  @ * @;
  6.  
  7.  
  8. 2.2
  9. date     89.05.04.14.27.41;  author joel;  state Exp;
  10. branches ;
  11. next     2.1;
  12.  
  13. 2.1
  14. date     89.05.03.14.17.55;  author joel;  state Exp;
  15. branches ;
  16. next     2.0;
  17.  
  18. 2.0
  19. date     89.01.31.17.05.42;  author erik;  state Exp;
  20. branches ;
  21. next     1.2;
  22.  
  23. 1.2
  24. date     89.01.31.17.05.42;  author joel;  state Exp;
  25. branches ;
  26. next     1.1;
  27.  
  28. 1.1
  29. date     88.08.15.16.38.04;  author susan;  state Exp;
  30. branches ;
  31. next     ;
  32.  
  33.  
  34. desc
  35. @Scrolling test
  36. @
  37.  
  38.  
  39. 2.2
  40. log
  41. @Merged into do_copyarea.c
  42. @
  43. text
  44. @@
  45.  
  46.  
  47. 2.1
  48. log
  49. @Massive changes, I'm not going to go into details.
  50. @
  51. text
  52. @a0 68
  53. #include "x11perf.h"
  54.  
  55. #define NUMPOINTS 100
  56.  
  57. static GC bggc, fggc;
  58. static Window w;
  59. static XRectangle ws[3] = {
  60.     {100, 100, 200, 200},
  61.     {150, 150, 200, 200},
  62.     {200, 200, 200, 200}
  63.   };
  64. static  XPoint points[NUMPOINTS];
  65.  
  66. Bool InitScrolling(d, p)
  67.     Display *d;
  68.     Parms p;
  69. {
  70.     int i;
  71.     XGCValues gcv;
  72.  
  73.     w = None;
  74.     i = 0;
  75.     for (i = 0; i < NUMPOINTS; i++)
  76.     {    
  77.         points[i].x = rand() % WIDTH;
  78.         points[i].y = rand() % HEIGHT;
  79.     }
  80.     CreatePerfStuff(d, 1, WIDTH, HEIGHT, &w, &bggc, &fggc);
  81.     XDrawLines(d, w, fggc, points, NUMPOINTS, CoordModeOrigin);
  82.     XSync(d, 0);    
  83.     return True;
  84. }
  85.  
  86. void DoScrolling(d, p)
  87.     Display *d;
  88.     Parms p;
  89. {
  90.     int i;
  91.  
  92.     
  93.     for (i=0; i<p->reps; i++)
  94.     {
  95.     XCopyArea(d, w, w, fggc, 0, 10, WIDTH, HEIGHT - 10, 0, 0);
  96. /*
  97.     XCopyArea(d, w, w, fggc, 1, 10, WIDTH-1, HEIGHT - 10, 0, 0);
  98. */
  99.     }
  100. }
  101.  
  102. void MidScroll(d, p)
  103.     Display *d;
  104.     Parms p;
  105. {
  106.     XDrawLines(d, w, fggc, points, NUMPOINTS, CoordModeOrigin);
  107.     XSync(d, 0);    
  108. }
  109.  
  110. void EndScrolling(d, p)
  111.     Display *d;
  112.     Parms p;
  113. {
  114.     int i;
  115.     if (w != None)
  116.         XDestroyWindow(d, w);
  117.     XFreeGC(d, bggc);
  118.     XFreeGC(d, fggc);
  119. }
  120.  
  121. @
  122.  
  123.  
  124. 2.0
  125. log
  126. @version from /usr/src/pmax
  127. @
  128. text
  129. @d14 1
  130. a14 1
  131. void InitScrolling(d, p)
  132. d31 1
  133. @
  134.  
  135.  
  136. 1.2
  137. log
  138. @Added -fg -bg capabilities
  139. @
  140. text
  141. @@
  142.  
  143.  
  144. 1.1
  145. log
  146. @Initial revision
  147. @
  148. text
  149. @d5 1
  150. a5 1
  151. static GC whitegc, blackgc;
  152. d28 2
  153. a29 2
  154.     CreatePerfStuff(d, 1, WIDTH, HEIGHT, &w, &whitegc, &blackgc);
  155.     XDrawLines(d, w, blackgc, points, NUMPOINTS, CoordModeOrigin);
  156. d42 4
  157. a45 1
  158.         XCopyArea(d, w, w, blackgc, 0, 10, WIDTH, HEIGHT - 10, 0, 0);
  159. d53 1
  160. a53 1
  161.     XDrawLines(d, w, blackgc, points, NUMPOINTS, CoordModeOrigin);
  162. d64 2
  163. a65 2
  164.     XFreeGC(d, whitegc);
  165.     XFreeGC(d, blackgc);
  166. @
  167.