home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d9xx
/
d968
/
justlook.lha
/
JustLook
/
Justlook.doc
< prev
next >
Wrap
Text File
|
1993-12-04
|
22KB
|
664 lines
TABLE OF CONTENTS
JustLook/ChooseMenu
JustLook/Click
JustLook/ClickGad
JustLook/FindGad
JustLook/FindScreen
JustLook/FindWindow
JustLook/GetRatio
JustLook/GoOverGad
JustLook/GoOverIcon
JustLook/IEDisable
JustLook/IEEnable
JustLook/IEWait
JustLook/InitSM
JustLook/MoveMouse
JustLook/RawType
JustLook/Rel2Abs
JustLook/SetDest
JustLook/WinAct
JustLook/WinDrag
JustLook/WinResize
JustLook/ChooseMenu JustLook/ChooseMenu
NAME
ChooseMenu - Selects a menu item.
SYNOPSIS
ErrorCode ChooseMenu(struct ScrMap *SM,struct Window *Win,SHORT Menu,
SHORT MItem,SHORT SItem);
FUNCTION
This one moves the mouse over a specified menu item and chooses
it. Menu, MItem and SItem start with ZERO not one. the left most
menu is numbered 0, the next is numbered 1 and so on. For MItem
and SItem, 0 refers to the top option. The one below it is numbered
1, and so on. Menu selection is done in the window pointed by Win
and it should be the active one, other wise strange things happen.
To suppress the pointer from going to a nonexistant menu item or
subitem, pass a -1 in the corresponding place
INPUTS
SM -- address af a ScrMap structure
Win -- pointer to the window containing the menu
Menu -- menu tilte number
MItem -- menu item below the menu title
SItem -- submenu number
RESULTS:
NO_ERROR: if every thing went OK.
NO_SM: SM is NULL
BAD_ITEM: Menu should not be less than 0
NO_ITEM: specified menu title not found
NO_MENU: specified menu item not found
NO_SUB: specified submenu not found
Error codes returned by Click() and MoveMouse()
SEE ALSO
Click(), MoveMouse()
JustLook/Click JustLook/Click
NAME
Click - clicks a mouse button.
SYNOPSIS
ErrorCode Click(struct ScrMap *SM,WORD MouseButton,UWORD Qualifier,
WORD UpDown);
FUNCTION
Clicks mouse buttons at the place specified by SM, the buttons to
press are in MouseButton, an optional qualifier in Qualifier and
the action (press down, up or first down then up) in UpDown.
INPUTS
SM -- addrees of a ScrMap structure
MouseButton -- the mouse button to act upon
Qualifier -- qualifier
UpDowd -- shows wether the action is a press, a release, or both
RESULTS:
NO_ERROR: if every thing goes OK.
NO_BUTTON: Given button in 'MouseButton' does not exits!.
NO_ACT: Mask in UpDown is unknown.
NO_SM: SM is NULL
NO_DEVICE: could not open input device
NO_EXTIO: could not create ExtIO structure
NO_MEM: could not allocate memory
NO_PORT: could not create port
SEE ALSO
InitSM()
JustLook/ClickGad JustLook/ClickGad
NAME
ClickGad - moves the mouse over a gadget and clicks.
SYNOPSIS
ErrorCode ClickGad(struct ScrMap *SM,struct Window *Win,char *GadName,
USHORT GadID,SHORT Speed);
FUNCTION
Calls GoOverGad() and then Click(). This is to shorten your
programs.
INPUTS
SM -- addrees of a ScrMap structure
Win -- pointer to window containing the gadget
GadName -- pointer to gadget name
GadID -- gadget UserID value
Speed -- mouse movement speed
RESULTS:
Error codes returned by GoOverGad() and Click()
SEE ALSO
GoOverGad(), Click()
JustLook/FindGad JustLook/FindGad
NAME
FindGad - finds the address of a gadget.
SYNOPSIS
struct Gadget *FindGad(struct Window *Win,char *GadName,USHORT GadID);
FUNCTION
Searches for the gadget with the name GadName in the window
pointed to by Win. if GadName is NULL, GadID is used in the search.
It is compared with the UserID field of the gadgets in the window
and a pointer to the first one found is returned.
INPUTS
Win -- pointer to the window containing the gadget
GadName -- pointer to the gadet name
GadID -- gadget UserID value
RESULTS:
A pointer to the Gadget structure: if search successful.
NULL: if gadget not found.
NOTES
GadName has priority over GadID, if GadName is not NULL, GadID
will not be used.
JustLook/FindScreen JustLook/FindScreen
NAME
FindScreen - finds the address of a screen.
SYNOPSIS
struct Screen *FindScreen(char *TitleToSearch);
FUNCTION
Given the screen name, this routine searches the IntuitionBase
structure, and if found, returns a pointer to a Screen structure.
After finding, the routine continues searching and if another
Screen with the given name is found, a SCR_REPEATED is returned.
The program should act appropriately upon reciving this.
INPUTS
TitleToSearch -- pointer to the screen name
RESULTS
A pointer to a Screen structure: if search successful.
SCR_REPEATED: if two or more screens with the same name were found.
NULL: if the screen is not found.
JustLook/FindWindow JustLook/FindWindow
NAME
FindWindow - Finds the address of a window.
SYNOPSIS
struct Window *FindWindow(char *TitleToSearch,
struct Screen *ScreenToSearch);
FUNCTION
This routines searches for a Window structure with a name in
TitleToSearch. if ScreenToSearch is NULL, all the screens in
IntuitionBase are inspected in turn, otherwise only the windows
in the specified screen are searched.
INPUTS
TitleToSearch -- pointer to the window name
ScreenToSearch -- pointer to a Screen to start the search from
RESULTS
A pointer to a Window structure: if search successful
WIN_REPEATED: if two or more windows with the same name were found
NULL: if the window was not found
JustLook/GetRatio JustLook/GetRatio
NAME
GetRatio - finds the relation between screen and pointer resolutions.
SYNOPSIS
ErrorCode GetRatio(struct ScrMap *SM,struct Screen *Scr);
FUNCTION
This function is for internal use. The pupose of it is to find out
the relation between the screen resolution and pointer resolution.
The pointer is instructed to move 8 pixels, then the actual
movement is inspected and a ratio is found. The main use of this
ratio is in Click() routine. This routine is called from InitSM().
With the scheme employed, it may be possible that the program
encounters problems when the screen and pointer resolutions are not
dividable (for example, when instructed to go ahead 8 pixels, the
pointer actually advances 5 pixels).
INPUTS
SM -- address of a ScrMap structure
Scr -- a pointer to a Screen Structure
RESULTS:
NO_ERROR: if every thing goes OK.
NO_RATIO: GetRatio() failed
NO_DEVICE: could not open input device
NO_EXTIO: could not create ExtIO structure
NO_MEM: could not allocate memory
NO_PORT: could not create message port
NOTES
For the reasons described above, you should call InitSM(), each
time the screen resolution changes.
SEE ALSO: ClicK(), InitSM().
JustLook/GoOverGad JustLook/GoOverGad
NAME
GoOverGad - moves the mouse over a gadget.
SYNOPSIS
ErrorCode GoOverGad(struct ScrMap *SM,struct Window *Win,char *GadName,
USHORT GadID,SHORT Speed);
FUNCTION
Finds the specified gadget with FindGad(), then moves the pinter
over it.
INPUTS
SM -- address of a ScrMap structure
Win -- pointer to a window containing the gadget
GadName -- pointer to gadget name
GadID -- gadget UserID value
RESULTS:
NO_SM: SM is NULL
NO_WIN: Win is NULL
Error codes returned by FindGad() and MoveMouse()
SEE ALSO
FindGad(), MoveMouse()
JustLook/GoOverIcon JustLook/GoOverIcon
NAME
GoOverIcon - moves the mouse pointer over an icon.
SYNOPSIS
ErrorCode GoOverIcon(struct ScrMap *SM,struct Window *Win,UBYTE *Name);
FUNCTION
A primitive attempt to provide icon clicking. The icon coordinates
are computed from the icon's structure on disk. and it should not
change its position on the screen, otherwise mouse poiter will
go wrong. This is because I did not find out how to get current
icon coordinates in the Workbench screen (Help!).
INPUTS
SM -- address of a ScrMap structure
Win -- pointer to the window
Name -- icon name
RESULTS:
NO_SM: SM is NULL
NO_WIN: Win is NULL
Error codes returnd by MoveMouse().
SEE ALSO MoveMouse()
JustLook/IEDisable JustLook/IEDisable
NAME
IEDiasable - disables mouse and/or keyboard.
SYNOPSIS
ErrorCode IEDisable(LONG Flag);
FUNCTION
Disables input event for mouse or keyboard, according to the
mask in Flag. KBD for keyboard and MOUSE for mouse. In this case
no one can use mouse or keybaord. A Message port is set up each
device disabled (mouse or keyboard). Their presence is always
checked so only one program at a time can disable mouse or keyboard.
Disabling is done by adding an input event handler at the priority
of 126, which nulls any event whose ie_SubClass is not 0xFF. Routines
in JustLook that generate input events, set ie_SubClass to 0xFF. The
handler code can be found in Hand.asm file.
INPUTS
Flag -- specifies the device to disable
RESULTS
NO_ERROR: every thing went OK
NO_ACT: flag should be KBD, MOUSE or KBD|MOUSE
PORT_FOUND: it seems that the device has already been disabled!
NO_PORT: could not create message port
NO_DEVICE: could not open input device
NO_EXTIO: could not create ExtIO structure
NO_MEM: could not allocate memory
SEE ALSO
IEEnable()
JustLook/IEEnable JustLook/IEEnable
NAME
IEEnable - enables mouse and/or keyboard.
SYNOPSIS
ErrorCode IEEnable(LONG Flag);
FUNCYION
Enables input event for mouse and keyboard after a previous call
to IEDisable(). The mask in Flag secifies what to enable: KBD for
keyboard or MOUSE for mouse. Enabling is done by removing the
message ports created by IEDisable() and if both keyboard and mouse
are enabled, the handler routine which filtered input events is
also removed.
INPUTS
Flag -- specifies the device to enable
RESULTS
NO_ERROR: if every thing goes OK
NO_ACT: you passed something other than KBD or MOUSE to the routine
NO_STRUCT:
NO_PORT: could not create message port
SEE ALSO
IEDisable()
JustLook/IEWait JustLook/IEWait
NAME
IEWait - waits for an input event.
SYNOPSIS
ErrorCode IEWait(LONG Flag);
FUNCTION
Waits for an InputEvent. Returns an event even if the owner of
the event is someone else. You give a mask of what you want spied
in the Flag variable. Two possible values are KBD for Keyboard
events and MOUSE for mouse events. Currently only MOUSE events are
supported. In ErrorCode you will get the result. A negative number
is an error. otherwise it returns a code for the mouse button
pressed.
This is done by adding a input event handler with a priority of
127. It waits for an event and signals the calling task, then the
handler is removed. Note that because this handler has priority
over IEDisable's one, it sends the signal before the event is
nullified.
INPUTS
Flag -- specifies which defice to wait for
RESULTS
LBMASK: if left mouse button pressed
MBMAASK: if middle mouse button pressed
RBMASK: if right mouse button pressed
NO_ACT: if anything other than a MOUSE is given in Flag
NO_SIG: could not allocate signal
NO_DEVICE: could not open input device
NO_EXTIO: could not create ExtIO
NO_MEM: could not allocate memory
NO_PORT: could not create message port
NOTES
You can use this function even when mouse is disabled. Also,
remember that currently you can only wait on mouse events.
SEE ALSO
IEDisable()
JustLook/InitSM JustLook/InitSM
NAME
InitSM - initializes a ScrMap structure.
SYNOPSIS
ErrorCode InitSM(struct ScrMap *SM,struct Screen *Scr);
FUNCTION
This function is used to initialize a SM structure. It is very
important to call this before using other JustLook routines.
Every ScrMap structure is tied to the Screen used to initialize it
so whenever screen resolution changes, use InitSM() on your SM
structure again!.
INPUTS
SM -- address of a ScrMap structure to initialize
Scr -- pointer to a Screen to be used in initialization
RESULTS
NO_ERROR: if every thing goes OK
NO_RATIO: GetRatio() failed
NO_DEVICE: could not open input device
NO_EXTIO: could not create ExtIO structure
NO_MEM: could not allocate memory
NO_PORT: could not create message port
SEE ALSO
GetRatio()
JustLook/MoveMouse JustLook/MoveMouse
NAME
MoveMouse - moves the mouse pointer.
SYNOPSIS
ErrorCode MoveMouse(struct ScrMap *SM,BOOLEAN IsRelative,SHORT Speed);
FUNCTION
Moves the mouse to the location specified in SM. If IsRelative
is ABSOLUTE, the DestX and DestY in SM are interpreted as the
absolute destination. if IsRelative is RELATIVE, destination in SM
is considered as relative to the current coordinate in SM.
The routine does not end untill the pointer reaches the destination,
or it detects that the pointer is not moving.
Even if for some problems the mouse pointer does not reach its
destination, the program assumes it has, and further moves will be
thought as starting from there (in RELATIVE movements).
INPUTS
SM -- address of a ScrMap structure
IsRelative -- shows wether movement is relative or absolute
Speed -- speed of mouse movement
RESULTS
NO_ERROR: if every thing goes OK
NO_MOVE: Pointer does not move! (maybe edge of screen?)
NO_DEVICE: could not open input device
NO_EXTIO: could not create ExtIO structure
NO_MEM: could not allocate memory
NO_PORT: could not create message port
SEE ALSO
SetDest(),
JustLook/RawType JustLook/RawType
NAME
RawType - generates raw key events.
SYNOPSIS
ErrorCode RawType(struct RawInfo *RawKeys,ULONG Length,ULONG delay);
FUNCTION
This is the only routines to handle keyboard. it sends raw key
events. The codes should be in a RawInfo structure. You place
the raw key number and also a qualifier (for example a SHIFT or
ALT key) in this structure. Length is the number of keys presses
to simulate. delay is passed to a DOS Delay() routine between each
key 'press'. This adjusts the speed of typing.
The reason only raw events are generated is that I don't know how
to go from translated keys to raw keys (the opposite of what is
usually done) in a way compatible with all Amiga keyboards and key
assignments (Help!), so I decided to put the burden on the shoulders
of the user!.
INPUTS
RawKeys -- pointer to an array of RayInfo structure
Length -- length of the above array
delay -- delay between key presses
RESULTS
NO_ERROR: if every thing went OK
NO_KEY: if RawKeys in NULL
NO_DEVICE: could not open input device
NO_EXTIO: could not create ExtIO structure
NO_MEM: could not allocate memory
NO_PORT: could not create message port
JustLook/Rel2Abs JustLook/Rel2Abs
NAME
Rel2Abs - converts relative coordinate to absolute.
SYNOPSIS
VOID Rel2Abs(struct ScrMap *SM,SHORT *x, SHORT *y);
FUNCTION
This procedure is for internal use. It converts the coordinates in
SM by adding the SHORT numbers pointed to by x and y to SM->CurrX
and SM->CurrY.
INPUTS
SM -- address of a ScrMap structure to act upon
x -- pointer to relative movement in X direction
y -- pointer to a relative movement in Y direction
RESULTS
None
JustLook/SetDest JustLook/SetDest
NAME
SetDest - sets destination for mouse movements.
SYNOPSIS
VOID SetDest(struct ScrMap *SM,SHORT X,SHORT Y);
FUNCTION
This is used to set the destination for MouseMove() routine. The
values in X and Y are copied to SM->DestX and SM->DestY respectively.
It is used to shorten both the amount of typing and program line
count in applications.
INPUTS
SM -- address of a ScrMap structure
X -- destination in X direction
Y -- destination in Y direction
RESULT
None
SEE ALSO
MoveMouse()
JustLook/WinAct JustLook/WinAct
NAME
WinAct - performs the specified action on the screen.
SYNOPSIS
ErrorCode WinAct(struct ScrMap *SM,struct Window *Win,LONG Act);
FUNCTION
Clicks on either the close or the depth gadget of a window, acording
to the value in Act. The actions are performed on a window
pointed to by Win.
The window is tested to see if close or depth gadgets are present,
if not so, a WIN_ACT error is returned, otherwise, mouse pointer
is moved to the place where the close or depth gadgets should be,
and a click is perforned
INPUTS
SM -- address of a ScrMap structure
Win -- pointer to a Window to act upon
Act -- Action to perform
RESULTS
NO_ERROR: if every thing goes OK
NO_SM: SM is NULL
NO_WIN: Win is NULL
NO_ACT: unknown action specified
Error codes returned by Click() and MoveMouse()
SEE ALSO MouseMove(), Click()
JustLook/WinDrag JustLook/WinDrag
NAME
WinDrag - drags the specified window.
SYNOPSIS
ErrorCode WinDrag(struct ScrMap *SM,struct Window *Win,
BOOLEAN IsRelative, SHORT X, SHORT Y);
FUNCTION
Drags the window pointed to by Win. If IsRelative is ABSOLUTE,
then the mouse pointer, after reaching the middle of the window,
goes to the absolute place specified by X and Y, other wise X and
Y are interpreted relative to the current coordinates in SM.
I should emphasize that this is the mouse pointer that is moved
by the specified amount, this is done after placing the pointer
in the middle of the window drag bar.
INPUTS
SM -- address of a ScrMap structure
Win -- pointer to a window to act upon
IsRelative -- shows wether dragging is relative or absolute
X -- drag 'X' pixels in the X direction
Y -- drag 'Y' pixels in the Y direction
RESULTS
NO_ERROR: if every thing goes OK
NO_SM: SM is NULL
NO_WIN: Win is NULL
Error codes returned by Click() and MoveMouse()
SEE ALSO
MoveMouse(), Click()
JustLook/WinResize JustLook/WinResize
NAME
WinResize - resizes a window.
SYNOPSIS
ErrorCode WinResize(struct ScrMap *SM,struct Window *Win,
BOOLEAN IsRelative,SHORT X,SHORT Y);
FUNCTION
Resizes the window pointed to by Win. If IsRelative is ABSOLUTE,
the resize gadget is draffed to that absolute point. Other wise a
relative move is made.
This is done by placing the mouse over the size gadget and then
moving it by the specified amount.
INPUTS
SM -- address of ScrMap structure
Win -- pointer to a window to act upon
IsRelative -- shows wethere resizing is relative or absolute
X -- resizes 'X' pixels in the X direction
Y -- resizes 'Y' pixels in the Y direction
RESULTS
NO_SM: SM is NULL
NO_WIN: Win is NULL
NO_ACT:
Errors codes returned by Click() and MoveMouse()
SEE ALSO
MoveMouse(),Click()