home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 287.lha / WSM.doc < prev    next >
Text File  |  1989-09-08  |  7KB  |  153 lines

  1.  
  2.     WSM (Workbench Screen Manager) Document
  3.     8/2/89  Sterling L. Brown
  4.     ----------------------------------------------------------------
  5.  
  6.     WSM is a useful utility that adds a third dimension to the
  7.     Workbench work area by letting you open and manage alternate Workbench
  8.     screens.  This utility evolved from my attempts at putting a CLI or Shell
  9.     on a new screen.  After lots of work and half way into a new console
  10.     device, I mistakenly stumbled across a way to do this that the Amiga
  11.     already supports.
  12.  
  13.     I turns out that any screen that has its Type member set to WBENCHSCREEN
  14.     can be used as an alternate workbench screen.  HOW?  By bringing the
  15.     secondary screen to the top, any program that opens its window to the
  16.     Workbench screen will open its window to the new screen.  This includes
  17.     Shells, CLIs, Workbench programs and utilities, and Even Workbench
  18.     itself. Just think of the possibilities of having workbench distribute
  19.     its windows across 2 screens, or 3 screens, or 4 screens,...
  20.  
  21.     This very simple 'c' code will do nothing more than open a screen
  22.     and put a SHELL on it.  After you run it, you can experiment with
  23.     the workbench windows.  Remember, Only programs that open their
  24.     windows to the Workbench screen can share the alternate screens.
  25.  
  26.  
  27.     ----------------------  C U T   H E R E -------------------------
  28. /*  alternate WbenchScreen program written by Sterling Brown */
  29. /*  you can have as many screens as you have CHIP ram        */
  30.  
  31. #include <intuition/intuition.h>
  32.  
  33. struct GfxBase *GfxBase;
  34. struct IntuitionBase *IntuitionBase;   /* Base of Intuition library */
  35. struct Screen *Screen;
  36.  
  37. struct NewScreen NewScreen =
  38. {
  39.     0,0,640,200,2,
  40.     0,1,
  41.     HIRES,
  42.     WBENCHSCREEN,
  43.     NULL,
  44.     NULL,                      /* Title                  */
  45.     NULL,
  46.     NULL
  47. };
  48.  
  49. void main()
  50. {                       /* Open Libraries   */
  51.     GfxBase = (struct GfxBase*) OpenLibrary("graphics.library",0);
  52.     if(GfxBase==NULL)
  53.         exit(10);Üj
  54.     if(IntuitionBase == NULL)
  55.     {
  56.         CloseLibrary(GfxBase);
  57.         exit(20);
  58.     }
  59.     if((Screen=(struct Screen *)OpenScreen(&NewScreen))==NULL)
  60.     {
  61.         CloseLibrary(GfxBase);
  62.         CloseLibrary(IntuitionBase);
  63.         exit(30);
  64.     }
  65.  
  66.    Execute("Newshell",0,0);
  67.    exit(0);             /* leave the screen open and exit   */
  68. }                       /* And that's all!!  */
  69.     ----------------------  C U T   H E R E -------------------------
  70.  
  71.  
  72.     This program gives us a screen that we could use for any program that
  73.     opens its window to the Workbench screen.  The only draw back is that
  74.     it gives us no way to close the screen when we are finished with it.
  75.     This is where WSM comes in.  With it you can open as many screen as
  76.     you have the CHIP RAM for.  The extra RAM of the new Agnus chip really
  77.     comes in handy now.  To open a screen simply press the 'OPEN SCREEN'
  78.     button.  The screen will open with the settings shown in the WSM window.
  79.     The default settings are Hi-Res with 2 bitplanes.  You can also close
  80.     any Workbench screen previously opened provided it does not have any
  81.     windows on it.  To do so, bring the screen you want to close to the
  82.     top of the screen stack and press the 'CLOSE SCREEN' button.
  83.  
  84.     WSM has a few other helpful features worth mentioning.  It keeps a
  85.     count of all Workbench screens and displays the number at the top of its
  86.     window.  It lets you change the number of bit planes of the new screens
  87.     you open.  I added an iconifying feature so it wont clutter up the
  88.     screen when your not using it.  To toggle Iconification press the
  89.     right mouse button.  WSM also lets you select the resolution of the
  90.     new screen.  You have a choice of Hi-Res, Low-Res, Hi-Res-Interlaced,
  91.     and Low-Res-Interlaced.
  92.  
  93.  
  94.  
  95. HINTS:
  96.  
  97.     *   I use the Workbench Palette program to change a new screens color.
  98.         Did you know that the Palette program takes advantage of more than
  99.         two bit planes if present?
  100.  
  101.     *   Since WSM opens Iconified window to a Workbench screen, this makes
  102.         it easy to change the screen its on after you run it.  Put a new
  103.         screen in front of the one WSM is on, press the right mouse button
  104.         and let WSM Iconify itself to that screen.  I also do this with
  105.         my favorite editor DME, by Matt Dillon.
  106.  
  107.     *   I recommend that you only 'loadwb' once.  There is no need to have
  108.         more than one WorkBench running since one Workbench can access
  109.         all of the screens.  If you must load more than one Workbench,
  110.         then put a clean screen in front for the new workbench to attach
  111.         itself to.  If you do not do this, you will never be able to access
  112.         the new WorkBench.  This is because WorkBench opens a BACKDROP window
  113.         which will open behind the old Workbench BACKDROP window and will be
  114.         lost forever.
  115.  
  116.     *   I imagine that we all have used the <L-AMIGA/N> and <L-AMIGA/M> keys
  117.         to toggle the WorkBench screen to the top and bottom of the screen
  118.         stack respectively.  Now that we have more than one WorkBench
  119.         screen, these keys now take on different functions.  The <L-AMIGA/M>
  120.         key combination takes the first Workbench screen in the screen stack
  121.         and swaps it to the bottom of all the screens.  The <L-AMIGA/N> key
  122.         combination takes the first Workbench screen in the screen stack and
  123.         swaps it to the top of all the screens.  These keys have always done
  124.         just that, but with only one Workbench screen we could never tell
  125.         just how it was working.
  126.  
  127.  
  128. FEEDBACK:
  129.  
  130.     If anyone has any comments they wish to make please contact me at one
  131.     of the Email addresses below.
  132.  
  133.  
  134.  
  135. /**************************************************************************/
  136.     WSM and this document are Public Domain and are freely redistributable.
  137.     But Hey, If any one wants to send me a token of their appreciation, I
  138.     wont turn it down.  ;^)
  139.  
  140.     Enjoy....
  141.  
  142.  
  143. \===========================\    The Human      /===========================/
  144.  \ Sterling L. Brown........ \   Operating     /  "Don't blame me for my   /
  145.   \                           \    System     /    spelling!.... Blame    /
  146.    \ AmigaDos, UNIX, MSDOS     \=============/     my Spellchecker!"-me  /
  147.     \=================\                               /=================/
  148.           // A Serious \      CIS:   71101,616       / "O give me a home
  149.        _ //  Amiga      \  USENET: sterling@dasys1  /   where the serial
  150.        \X/   Programmer  \=========================/    ports rome!"
  151.  
  152.  
  153.