home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume21 / walls / part01 < prev    next >
Encoding:
Text File  |  1994-01-12  |  3.9 KB  |  139 lines

  1. Newsgroups: comp.sources.x
  2. From: leres@hot.ee.lbl.gov (Craig Leres)
  3. Subject: v21i090:  walls - horizontal walls for multiheaded Suns under X11R5, Part01/01
  4. Message-ID: <1994Jan12.185806.15300@sparky.sterling.com>
  5. X-Md4-Signature: 995dd95e231b642dd016d40e4c314067
  6. Sender: chris@sparky.sterling.com (Chris Olson)
  7. Reply-To: leres@ee.lbl.gov (ucbvax!leres for uucp weenies)
  8. Organization: Lawrence Berkeley Laboratory, Berkeley CA
  9. Date: Wed, 12 Jan 1994 18:58:06 GMT
  10. Approved: chris@sterling.com
  11.  
  12. Submitted-by: leres@hot.ee.lbl.gov (Craig Leres)
  13. Posting-number: Volume 21, Issue 90
  14. Archive-name: walls/part01
  15. Environment: X11R5, untested
  16.  
  17. [ I was not able to test this patch, as I have no multi-headed suns ]
  18. [ avaliable to me                            ]
  19. [        Chris                            ]
  20.  
  21. Appended are context diffs that implement horizontal walls for
  22. multiheaded Suns. You specify the layout with flag to the server:
  23.  
  24.     -screenzero l
  25.  
  26. or:
  27.  
  28.     -screenzero r
  29.  
  30. Note that due to the way that the Sun server searches for frame
  31. buffers, the color monitor is usually screen zero.
  32.  
  33.         Craig
  34. ------
  35. RCS file: RCS/sun.h,v
  36. retrieving revision 1.1
  37. diff -c -r1.1 sun.h
  38. *** /tmp/,RCSt1a11013    Mon Dec 20 19:23:48 1993
  39. --- sun.h    Mon Dec 20 19:21:04 1993
  40. ***************
  41. *** 159,164 ****
  42. --- 159,165 ----
  43.   } CrPrivRec, *CrPrivPtr;
  44.   
  45.   extern int  sunScreenIndex;
  46. + extern char sunScreenZero;
  47.   
  48.   typedef struct {
  49.       int            width, height;
  50. RCS file: RCS/sunIo.c,v
  51. retrieving revision 1.1
  52. diff -c -r1.1 sunIo.c
  53. *** /tmp/,RCSt1a11023    Mon Dec 20 19:24:03 1993
  54. --- sunIo.c    Mon Dec 20 19:21:06 1993
  55. ***************
  56. *** 359,364 ****
  57. --- 359,369 ----
  58.       FlipPixels = TRUE;
  59.       return 1;
  60.       }
  61. +     if (strcmp (argv[i], "-screenzero") == 0) {    /* -screenzero [l|r] */
  62. +     if (++i >= argc) UseMsg ();
  63. +     sunScreenZero = *argv[i];
  64. +     return 2;
  65. +     }
  66.       return 0;
  67.   }
  68.   
  69. ***************
  70. *** 370,374 ****
  71. --- 375,380 ----
  72.       ErrorF("-debug                 disable non-blocking console mode\n");
  73.       ErrorF("-dev filename          name of device to open\n");
  74.       ErrorF("-mono                  force monochrome-only screen\n");
  75. +     ErrorF("-screenzero [l|r]      screen zero is l(eft) or r(ight)\n");
  76.       ErrorF("-zaphod                disable active Zaphod mode\n");
  77.   }
  78. RCS file: RCS/sunMouse.c,v
  79. retrieving revision 1.2
  80. diff -c -r1.2 sunMouse.c
  81. *** /tmp/,RCSt1a11032    Mon Dec 20 19:24:22 1993
  82. --- sunMouse.c    Mon Dec 20 19:21:08 1993
  83. ***************
  84. *** 53,58 ****
  85. --- 53,59 ----
  86.   #include    "mipointer.h"
  87.   
  88.   Bool ActiveZaphod = TRUE;
  89. + char sunScreenZero;
  90.   
  91.   static Bool sunCursorOffScreen();
  92.   static void sunCrossScreen();
  93. ***************
  94. *** 392,400 ****
  95. --- 393,412 ----
  96.       if (ActiveZaphod &&
  97.       screenInfo.numScreens > 1 && (*x >= (*pScreen)->width || *x < 0))
  98.       {
  99. +     /*
  100. +      * Implement horizontal walls; sunScreenZero tells us where
  101. +      * screen zero is
  102. +      */
  103.       index = (*pScreen)->myNum;
  104.       if (*x < 0)
  105.       {
  106. +         if ((sunScreenZero == 'l' && index == 0) ||
  107. +         (sunScreenZero == 'r' && index == screenInfo.numScreens - 1))
  108. +         { /* Implement wall - don't let the mouse escape this way. */
  109. +         *x = 0;
  110. +         return FALSE;
  111. +         }
  112.           index = (index ? index : screenInfo.numScreens) - 1;
  113.           *pScreen = screenInfo.screens[index];
  114.           *x += (*pScreen)->width;
  115. ***************
  116. *** 401,406 ****
  117. --- 413,425 ----
  118.       }
  119.       else
  120.       {
  121. +         if ((sunScreenZero == 'r' && index == 0) ||
  122. +         (sunScreenZero == 'l' && index == screenInfo.numScreens - 1))
  123. +         { /* Implement wall - don't let the mouse escape this way. */
  124. +         *x = (*pScreen)->width - 1;
  125. +         return FALSE;
  126. +         }
  127.           *x -= (*pScreen)->width;
  128.           index = (index + 1) % screenInfo.numScreens;
  129.           *pScreen = screenInfo.screens[index];
  130.  
  131. exit 0 # Just in case...
  132. -- 
  133.   // chris@Sterling.COM           | Send comp.sources.x submissions to:
  134. \X/  Amiga: The only way to fly!  |    sources-x@sterling.com
  135.        "It's intuitively obvious to the most casual observer..."
  136.  GCS d++(--) -p+ c++ !l u++ e+ m+(-) s++/++ n h--- f+ g+++ w+ t++ r+ y+
  137.