home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
dirs
/
pointerlib_446.lzh
/
PointerLib
/
Pointer.doc
< prev
next >
Wrap
Text File
|
1991-01-28
|
5KB
|
174 lines
Pointer.library
written by luke wood
"Pointer.library" is a shared disk-based library to provide
programmers with access to an easy custom pointer and a
consistent user selected busy pointer. Please note that
Pointer.library requires the IFFParse.library to use custom
pointers
This Archive includes:
Pointer.doc => This file
Pointer.library => The library (copy to libs:)
UsePointer => A sample program
UsePointer.c => Source code to the sample program
Pointer.h => The prototype file
Pointer_pragma.h => The Lattice/SAS-C pragma file
Pointer.fd => The .fd file
Additionally there are 6 busy pointer images included:
StopWatch.ilbm GhostPointer.ilbm
ZZBubble.ilbm BusyBee.ilbm
HourGlass.ilbm CrossHair.ilbm
These files should be copied to the SYS:Prefs/presets drawer.
Copy ONE of these files to SYS:Prefs/presets/BusyPointer.ilbm,
that will be the busy pointer that applications will get when
they ask for a busy pointer. (If you are running under WB1.3 or
lower you will have to make the presets drawer, and get a copy of
LIBS:iffparse.library before you can use a custom pointer.) Or
make a custom pointer of your own using the WB2.0 Preferences
Pointer Editor. You can design a pointer with Dpaint, but be
sure to Load & Save it into the WB2.0 Preferences Pointer Editor
to convert the file to the correct format. Also make sure the Set
Point is in the right place and that the colors are consistent
with your primary pointer.
Run "UsePointer" and click in the window to see the pointer
activate. To see the other pointers, load them into DPaint as
brushes, or into the WB2.0 Pointer Editor.
-------------------------------
This archive may be freely redistributed as long as all the files
in this archive are retained. Use of the library is free to all
who wish to use it.
This archive and/or its contents may be included in a public
domain library (such as Fred Fish)
Your comments and suggestions are welcome, I am available on BIX
as "luke.wood" or through the U.S. Mail as: Luke Wood, P.O. Box
28622, Santa Ana, CA 92799-8622.
To use pointer.library in your program...
Open the pointer library.
PointerBase = OpenLibrary( "pointer.library", 36 );
if( PointerBase == NULL )
{
printf( "Pointer Open failed\n" );
exit( FALSE );
}
To load a custom pointer specify the pointer file to load.
MyPointer = LoadPointer( "SYS:Prefs/presets/CrossHair.ilbm" );
To use the pointer call the Intuition function SetPointer. (You
need to open Intuition First.)
SetPointer( MyWindow, MyPointer->Data,
MyPointer->Height, MyPointer->Width,
MyPointer->XOff, MyPointer->YOff );
When you want to turn off the pointer, call the Intuition function
ClearPointer().
ClearPointer( (struct Window*)MyWindow );
When your program is done with the pointer, free it by calling FreePointer().
if( MyPointer )
FreePointer( MyPointer );
If you need a busy pointer call SetBusyPointer() with your window
pointer.
SetBusyPointer( (struct Window*)MyWindow );
When you are done with the busy pointer clear it, with the
intuition function ClearPointer()
ClearPointer( (struct Window*)MyWindow );
The busy pointer will remain in memory as long as the library is
loaded. All of the programs that call SetBusyPointer will get
the same busy pointer image.
Please be sure to close the library when you are done with it.
if( PointerBase )
CloseLibrary( PointerBase );
=======================
LoadPointer
NAME
LoadPointer -- allocate memory and read a pointer file.
SYNOPSIS
pointer = LoadPointer(filename)
A0
FUNCTION
This routine reads in a preferences pointer file and
allocates memory as required.
INPUTS
filename -- the name of the file. If the filename does not
specify the path, then the file must reside in the current
directory.
RESULTS
pointer -- a pointer to a Pointer structure if successful,
else zero
=======================
FreePointer
NAME
FreePointer -- free memory for a previously loaded pointer.
SYNOPSIS
FreePointer( pointer )
A0
FUNCTION
This routine frees the memory that was allocated by a
call to LoadPointer().
INPUTS
pointer -- a pointer to the Pointer structure
RESULTS
None
=======================
SetBusyPointer
NAME
SetBusyPointer -- set a window to the user selected busy pointer.
SYNOPSIS
SetBusyPointer( window )
A0
FUNCTION
This routine sets up the window with the pointer that is set in
"SYS:Prefs/presets/BusyPointer.ilbm" file.
INPUTS
window -- a pointer to the structure of the Window to get
the busy pointer.
RESULTS
None