home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / pointerlib_446.lzh / PointerLib / Pointer.doc < prev    next >
Text File  |  1991-01-28  |  5KB  |  174 lines

  1.  
  2.  
  3.  
  4.                        Pointer.library
  5.  
  6.                      written by luke wood
  7.  
  8.  
  9. "Pointer.library" is a shared disk-based library to provide
  10. programmers with access to an easy custom pointer and a
  11. consistent user selected busy pointer.  Please note that
  12. Pointer.library requires the IFFParse.library to use custom
  13. pointers
  14.  
  15. This Archive includes:
  16.     Pointer.doc          => This file
  17.     Pointer.library      => The library (copy to libs:)
  18.     UsePointer           => A sample program
  19.     UsePointer.c         => Source code to the sample program
  20.     Pointer.h            => The prototype file
  21.     Pointer_pragma.h     => The Lattice/SAS-C pragma file
  22.     Pointer.fd           => The .fd file
  23.  
  24. Additionally there are 6 busy pointer images included:
  25.     StopWatch.ilbm       GhostPointer.ilbm
  26.     ZZBubble.ilbm        BusyBee.ilbm
  27.     HourGlass.ilbm       CrossHair.ilbm
  28.  
  29. These files should be copied to the SYS:Prefs/presets drawer. 
  30. Copy ONE of these files to SYS:Prefs/presets/BusyPointer.ilbm,
  31. that will be the busy pointer that applications will get when
  32. they ask for a busy pointer.  (If you are running under WB1.3 or
  33. lower you will have to make the presets drawer, and get a copy of
  34. LIBS:iffparse.library before you can use a custom pointer.) Or
  35. make a custom pointer of your own using the WB2.0 Preferences
  36. Pointer Editor.  You can design a pointer with Dpaint, but be
  37. sure to Load & Save it into the WB2.0 Preferences Pointer Editor
  38. to convert the file to the correct format. Also make sure the Set
  39. Point is in the right place and that the colors are consistent
  40. with your primary pointer.
  41.  
  42. Run "UsePointer" and click in the window to see the pointer
  43. activate.  To see the other pointers, load them into DPaint as
  44. brushes, or into the WB2.0 Pointer Editor.
  45.  
  46. -------------------------------
  47. This archive may be freely redistributed as long as all the files
  48. in this archive are retained. Use of the library is free to all
  49. who wish to use it.
  50.  
  51. This archive and/or its contents may be included in a public
  52. domain library (such as Fred Fish)
  53.  
  54. Your comments and suggestions are welcome, I am available on BIX
  55. as "luke.wood" or through the U.S. Mail as: Luke Wood, P.O. Box
  56. 28622, Santa Ana, CA 92799-8622.
  57.  
  58.  
  59. To use pointer.library in your program...
  60.  
  61. Open the pointer library.
  62.  
  63.     PointerBase = OpenLibrary( "pointer.library", 36 );
  64.     if( PointerBase == NULL )
  65.     {
  66.         printf( "Pointer Open failed\n" );
  67.         exit( FALSE );
  68.     }
  69.  
  70. To load a custom pointer specify the pointer file to load.
  71.  
  72.     MyPointer = LoadPointer( "SYS:Prefs/presets/CrossHair.ilbm" );
  73.  
  74. To use the pointer call the Intuition function SetPointer. (You
  75. need to open Intuition First.)
  76.  
  77.     SetPointer( MyWindow, MyPointer->Data,
  78.         MyPointer->Height, MyPointer->Width,
  79.         MyPointer->XOff, MyPointer->YOff );
  80.  
  81. When you want to turn off the pointer, call the Intuition function
  82. ClearPointer().
  83.  
  84.     ClearPointer( (struct Window*)MyWindow );
  85.  
  86. When your program is done with the pointer, free it by calling FreePointer().
  87.  
  88.     if( MyPointer )
  89.         FreePointer( MyPointer );
  90.  
  91. If you need a busy pointer call SetBusyPointer() with your window
  92. pointer.
  93.  
  94.     SetBusyPointer( (struct Window*)MyWindow );
  95.  
  96. When you are done with the busy pointer clear it, with the
  97. intuition function ClearPointer()
  98.  
  99.     ClearPointer( (struct Window*)MyWindow );
  100.  
  101. The busy pointer will remain in memory as long as the library is
  102. loaded.  All of the programs that call SetBusyPointer will get
  103. the same busy pointer image.
  104.  
  105. Please be sure to close the library when you are done with it.
  106.  
  107.     if( PointerBase )
  108.         CloseLibrary( PointerBase );
  109.  
  110.  
  111. =======================
  112. LoadPointer
  113.  
  114.     NAME
  115.         LoadPointer -- allocate memory and read a pointer file.
  116.  
  117.     SYNOPSIS
  118.         pointer = LoadPointer(filename)
  119.                               A0
  120.  
  121.     FUNCTION
  122.         This routine reads in a preferences pointer file and
  123.         allocates memory as required.
  124.  
  125.     INPUTS
  126.         filename -- the name of the file. If the filename does not
  127.         specify the path, then the file must reside in the current
  128.         directory.
  129.  
  130.     RESULTS
  131.         pointer -- a pointer to a Pointer structure if successful,
  132.         else zero
  133.  
  134. =======================
  135. FreePointer
  136.  
  137.     NAME
  138.         FreePointer -- free memory for a previously loaded pointer.
  139.  
  140.     SYNOPSIS
  141.         FreePointer( pointer )
  142.                      A0
  143.  
  144.     FUNCTION
  145.         This routine frees the memory that was allocated by a
  146.         call to LoadPointer().
  147.  
  148.     INPUTS
  149.         pointer -- a pointer to the Pointer structure
  150.  
  151.     RESULTS
  152.         None
  153.  
  154. =======================
  155. SetBusyPointer
  156.  
  157.     NAME
  158.         SetBusyPointer -- set a window to the user selected busy pointer.
  159.  
  160.     SYNOPSIS
  161.         SetBusyPointer( window )
  162.                         A0
  163.  
  164.     FUNCTION
  165.         This routine sets up the window with the pointer that is set in
  166.         "SYS:Prefs/presets/BusyPointer.ilbm" file.
  167.  
  168.     INPUTS
  169.         window -- a pointer to the structure of the Window to get
  170.         the busy pointer.
  171.  
  172.     RESULTS
  173.         None
  174.