home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
441.lha
/
dmouse_v1.24
/
dmouse-ipc.doc
< prev
next >
Wrap
Text File
|
1990-11-13
|
2KB
|
66 lines
Talking to DMouse.
DMouse listens on the "DMouse.ipc" port. To send a message, setup an
IORequest structure with the appropriate command and then
FindPort()/PutMsg() atomically, then wait for the request to be returned
to the reply port specified in the request.
*** REFER TO THE EXAMPLE BLANKER.C FOR USAGE
DMCMD_MOUSEON turn on mouse (io_Command 0x80)
DMCMD_MOUSEOFF turn off mouse 0x81
DMCMD_SCREENON turn on screen 0x82
DMCMD_SCREENOFF turn off screen 0x83
DMCMD_ADDHANDLER io_Message.mn_ReplyPort 0x84
contains port to send
msgs to.
DNCMD_REMHANDLER io_Message.mn_ReplyPort 0x85
contains port to stop
sending msgs to.
DNCMD_PLEASEREMOVE (DMouse->blanker) 0x86
DNCMD_ADDHANDLER:
io_Unit contains a magic cookie used to identify the handler and should
be set to some unique memory address (no accesses are actually made,
its just an identifier.
io_Flags contains a bitmap of things our blanker can handle:
0x03 we can handle mouse blanking
0x0C we can handle screen blanking
0x0F we can handle both
The request is NOT returned until you send a DNCMD_REMHANDLER request.
If DMouse is killed it will sent a DNCMD_PLEASEREMOVE (0x86) packet to
all active handlers and expect them to remove their handlers with a
DNCMD_REMHANDLER request.
NOTE: You may run multiple blankers. DMouse will send requests to
ALL active handlers.
DNCMD_REMHANDLER:
io_Unit contains a magic cookie that identifies which handler to remove.
The request is returned and then the original DNCMD_ADDHANDLER request
will be returned to you. You can still receive DMouse commands up until
you finally get the original DNCMD_ADDHANDLER request back.
on return, io_Error is 0 on success, -1 on failure.
DNCMD_PLEASEREMOVE:
DMouse sends this to you asking you to remove your handler. If you
receive this packet you must remove your handler with DNCMD_REMHANDLER.
DNCMD_MOUSEON,MOUSEOFF,SCREENON, SCREENOFF and PLEASEREMOVE commands
will be sent to the port specified in DNCMD_ADDHANDLER while it is
active and are expected to be returned to the DMouse handler. You can
differentiate packets sourced by DMouse and packets sourced by you by
looking at the mn_Node.ln_Type field. If it is NT_MESSAGE it was
sourced by DMouse, else it was sourced by you and replied by DMouse.