home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD2.bin
/
bbs
/
dev
/
cmanual-3.0.lha
/
CManual
/
Amiga
/
Appendices
/
FunctionsAndLibraries
/
IntuitionLibrary.doc
< prev
next >
Wrap
Text File
|
1993-10-12
|
43KB
|
1,363 lines
1 INTUITION LIBRARY
1.1 OPEN THE INTUITION LIBRARY
The Intuition Library must have been opened before you may use
the functions listed in this file.
/* Include the intuition definitions: */
#include <intuition/intuition.h>
/* Declare a pointer to the Intuition Library: */
struct IntuitionBase *IntuitionBase;
/* Open the Intuition Library: */
IntuitionBase = (struct IntuitionBase *)
OpenLibrary( "intuition.library", 0 );
if( !IntuitionBase )
exit(); /* Could NOT open the Intuition Library! */
/* ... */
/* Close the Intuition Library: */
CloseLibrary( IntuitionBase );
1.2 FUNCTIONS
ActivateGadget()
This function is used to activate a string or integer gadget,
although other gadgets too can be activated (selected) with
this function. This function can be used to make it easier
for the user to input text or values. Since the function will
automatically activate (select) a specified gadget can the
user continue to keep his/her fingers on the keyboard and
does not have to fiddle around with the mouse each time he/
she wants to input some values.
Synopsis: ActivateGadget( gadget, window, requester );
gadget: (struct Gadget *) Pointer to the gadget which
should be selected.
window: (struct Window *) Pointer to the window which the
gadget is connected to.
requester: (struct Requester *) If the gadget is connected to
a requester, set this pointer to point to that
requester, else NULL. Important, if this gadget is
connected to a requester, it must be displayed
when you execute this command! (See chapter 5
REQUESTERS for more information about requesters.)
ActivateWindow()
This function is used to activate a specified window.
Synopsis: ActivateWindow( window );
window: (struct Window *) Pointer to the window which
should be activated. Note! The window must be open
when you call the function!
AddGadget()
This function adds a gadget to the gadget list.
Synopsis: result = AddGadget( window, gadget, position );
result: (long) The actual position of the gadget when it
has been added.
window: (struct Window *) Pointer to the window, to which
the gadget should be added.
gadget: (struct Gadget *) Pointer to the gadget which will
be added.
position: (long) Position in the gadget list. (Starts from
zero). Eg:
0 -> Before all other gadgets.
1 -> After the first gadget, but before the
second.
If a too big value is entered (or -1), the gadget
will be placed last in the list.
Important, after your program has added the necessary
gadgets, you need to call the function RefreshGadgets() in
order to see your changes. You may add (or take away) several
gadgets, but when you are finished you must call that
function.
AddVSprite()
This function will add a VSprite to the VSprite list.
Synopsis: AddVSprite( vsprite, rp );
vsprite: (struct VSprite *) Pointer to an initialized
VSprite structure.
rp: (struct RastPort *) Pointer to the RastPort.
AllocRemember()
This function allocates both memory (same as AllocMem), but
will also allocate space for a Remember structure which are
initialized with the size of the allocated memory, and a
pointer to that memory. Each time the program allocates
memory with this function, the Remember structures are linked
together.
Since the Remember structures contains all necessary
information about the memory, and are linked together, all
memory can be deallocated with one single function call
(FreeRemember()).
Synopsis: memory = AllocRemember( remember, size, type );
memory: (char *) Pointer to the new allocated memory, or
NULL if no memory could be allocated. Remember!
Never use memory which you have not successfully
allocated.
remember: (struct Remember **) Address of a pointer to a
Remember structure. Before you call the
AllocRemember() function for the first time you
should set this pointer to NULL. (Note that it is
a pointer to a pointer!)
size: (long) The size (in bytes) of the memory you want.
(AllocMem() always allocates memory in multiples of
eight bytes. So if you only ask for 9 bytes, Exec
would actually give you 16 Bytes (2*8).)
type: (long) You need to choose one of the three
following types of memory (see chapter 0
INTRODUCTION for more information about Chip and
Fast memory):
MEMF_CHIP Chip memory. This memory can be
accessed by both the main processor, as
well as the Chips. Graphics/Sound data
MUST therefore be placed in Chip memory.
If it does not matter what type of
memory you get (Fast or Chip), you
should try to allocate Fast memory
before you allocate Chip memory. (Chip
memory is more valuable than Fast
memory.)
MEMF_FAST Fast memory. This memory can only be
accessed by the main processor.
(Graphics and Sound data can NOT be
stored in Fast memory, use Chip memory.)
This memory is normally a little bit
faster than Chip memory, since only the
main processor is working with it, and
it is not disturbed by the Chips.
MEMF_PUBLIC If it does not matter what type of
memory you get (you do not intend to
use the memory for Graphics/Sound data),
you should use Fast memory. However,
all Amigas do not have Fast memory,
since you need to by a memory expansion
in order to get it. If want to tell
Exec that you would like to use Fast
memory if there is any, else use Chip
memory, you should ask for MEMF_PUBLIC.
If you want the allocated memory to be cleared
(initialized to zeros), you should set the flag
MEMF_CLEAR.
AutoRequest()
This function opens a Simple requester. Intuition will
automatically activate it and take care of the response from
the user. It will return TRUE if the left gadget was
selected, and FALSE if the right gadget was selected.
Synopsis: result = AutoRequest( my_window, info_txt, pos_txt,
neg_txt, pos_IDCMP, neg_IDCMP,
width, height );
my_window: (struct Window *) Pointer to a window if there
exist one, else NULL.
info_txt: (struct IntuiText *) Pointer to an IntuiText
structure containing the "body text".
pos_txt: (struct IntuiText *) Pointer to an IntuiText
structure containing the "positive text". Eg:
"TRUE", "YES", "RETRY" etc. (Optional)
neg_txt: (struct IntuiText *) Pointer to an IntuiText
structure containing the "negative text". Eg:
"FALSE", "NO", "CANCEL" etc.
pos_IDCMP: (long) IDCMP flags which satisfy the "positive"
gadget. (The flag RELVERIFY is already set.)
pos_IDCMP: (long) IDCMP flags which satisfy the "negative"
gadget. (The flag RELVERIFY is already set.)
width: (long) How many pixels wide the requester should
be.
height: (long) How many lines high the requester should
be.
result: (long) Boolean value. The function returns TRUE if
the positive gadget was satisfied, and FALSE if
the negative gadget was satisfied.
BeginRefresh()
This f