home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD2.bin
/
bbs
/
dev
/
oberon-a-1.4ß.lha
/
Oberon-A
/
source
/
amiga
/
Commodities.mod
< prev
next >
Wrap
Text File
|
1994-08-08
|
13KB
|
472 lines
(***************************************************************************
$RCSfile: Commodities.mod $
Description: Interface to commodities.library
Created by: fjc (Frank Copeland)
$Revision: 3.2 $
$Author: fjc $
$Date: 1994/08/08 00:57:41 $
Includes Release 40.15
(C) Copyright 1985-1993 Commodore-Amiga, Inc.
All Rights Reserved
Oberon-A interface Copyright © 1994, Frank Copeland.
This file is part of the Oberon-A Interface.
See Oberon-A.doc for conditions of use and distribution.
***************************************************************************)
MODULE Commodities;
(*
** $C- CaseChk $I- IndexChk $L+ LongAdr $N- NilChk
** $P- PortableCode $R- RangeChk $S- StackChk $T- TypeChk
** $V- OvflChk $Z- ZeroVars
*)
IMPORT E := Exec, IE := InputEvent, KM := KeyMap, SYS := SYSTEM;
(**-- Pointer declarations ---------------------------------------------*)
TYPE
NewBrokerPtr * = CPOINTER TO NewBroker;
InputXpressionPtr * = CPOINTER TO InputXpression;
IXPtr * = CPOINTER TO IX;
CxObjPtr * = CPOINTER TO CxObj;
CxMsgPtr * = CPOINTER TO CxMsg;
(*
** $VER: commodities.h 38.4 (24.2.93)
**
** Commodities definitions.
*)
(*****************************************************************************)
TYPE
NewBroker * = RECORD
version * : SHORTINT; (* Must be set to NB_VERSION *)
name * : E.STRPTR;
title * : E.STRPTR;
descr * : E.STRPTR;
unique * : E.WSET;
flags * : E.WSET;
pri * : SHORTINT;
port * : E.MsgPortPtr;
reservedChannel * : INTEGER;
END;
CONST
(* constant for NewBroker.version *)
nbVersion * = 5; (* Version of NewBroker structure *)
(* Sizes for various buffers *)
cbdNamelen * = 24;
cbdTitlelen * = 40;
cbdDescrlen * = 40;
(* Flags for NewBroker.unique *)
nbuDuplicate * = 0;
nbuUnique * = 1; (* will not allow duplicates *)
nbuNotify * = 2; (* sends cxmUnique to existing broker *)
(* Flags for NewBroker.flags *)
cofShowHide * = 4;
(*****************************************************************************)
TYPE
(* Fake data types for system private objects *)
CxObj = RECORD END;
CxMsg = RECORD END;
(* Pointer to a function returning a LONG *)
PFL = PROCEDURE () : LONGINT;
(*****************************************************************************)
CONST
(* Commodities object types *)
invalid * = 0; (* not a valid object (probably null) *)
filter * = 1; (* input event messages only *)
typeFilter * = 2; (* obsolete, do not use *)
send * = 3; (* sends a message *)
signal * = 4; (* sends a signal *)
translate * = 5; (* translates input event into chain *)
broker * = 6; (* application representative *)
debug * = 7; (* dumps info to serial port *)
custom * = 8; (* application provides function *)
zero * = 9; (* system terminator node *)
(*****************************************************************************)
CONST
(* Commodities message types *)
mIEvent * = 32;
mCommand * = 64;
(* Only mIEvent messages are passed through the input network. Other types
* of messages are sent to an optional port in your broker. This means that
* you must test the message type in your message handling, if input messages
* and command messages come to the same port.
*
* mIEvent: Messages of this type rattle around the Commodities input
* network. They are sent to you by a Sender object, and passed
* to you as a synchronous function call by a Custom object.
*
* The message port or function entry point is stored in the
* object, and the ID field of the message will be set to what
* you arrange issuing object.
*
* The data section of the message will point to the input event
* triggering the message.
*
* mCommand: These messages are sent to a port attached to your Broker.
* They are sent to you when the controller program wants your
* program to do something. The ID value identifies the command.
*)
CONST
(* ID values associated with a message of type mCommand *)
cmdDisable * = 15; (* please disable yourself *)
cmdEnable * = 17; (* please enable yourself *)
cmdAppear * = 19; (* open your window, if you can *)
cmdDisappear * = 21; (* go dormant *)
cmdKill * = 23; (* go away for good *)
cmdListChg * = 27; (* Someone changed the broker list *)
cmdUnique * = 25; (* someone tried to create a broker
* with your name. Suggest you appear.
*)
(*****************************************************************************)
TYPE
InputXpression * = RECORD
version * : E.UBYTE; (* must be set to ixVersion *)
class * : E.UBYTE; (* class must match exactly *)
code * : E.WSET; (* Bits that we want *)
codeMask * : E.WSET; (* Set bits here to indicate which bits in code
* are don't care bits.
*)
qualifier * : E.WSET; (* Bits that we want *)
qualMask * : E.WSET; (* Set bits here to indicate which bits in
* qualifier are don't care bits
*)
qualSame * : E.WSET; (* synonyms in qualifier *)
END;
IX * = InputXpression;
CONST
(* constant for InputXpression.version *)
ixVersion * = 2;
(* constants for InputXpression.qualSame *)
ixsymShift * = 0; (* left- and right- shift are equivalent *)
ixsymCaps * = 1; (* either shift or caps lock are equivalent *)
ixsymAlt * = 2; (* left- and right- alt are equivalent *)
ixsymShiftMask * = {IE.qualLShift, IE.qualRShift};
ixsymCapsMask * = ixsymShiftMask + {IE.qualCapsLock};
ixsymAltMask * = {IE.qualLAlt, IE.qualRAlt};
(* constant for InputXpression.qualMask *)
ixNormalQuals * = {0..14}; (* avoid RELATIVEMOUSE *)
(*****************************************************************************)
CONST
(* Error returns from CxBroker() *)
cbErrOk * = 0; (* No error *)
cbErrSysErr * = 1; (* System error, no memory, etc *)
cbErrDup * = 2; (* uniqueness violation *)
cbErrVersion * = 3; (* didn't understand NewBroker.nb_Version *)
(*****************************************************************************)
CONST
(* Return values from CxObjError() *)
coErrIsNull * = 1; (* you called CxObjError(NULL) *)
coErrNullAttach * = 2; (* someone attached NULL to my list *)
coErrBadFilter * = 4; (* a bad filter description was given *)
coErrBadType * = 8; (* unmatched type-specific operation *)
(*****************************************************************************)
(**-- Library Base variable --------------------------------------------*)
TYPE
CommoditiesBasePtr * = CPOINTER TO CommoditiesBase;
CommoditiesBase * = RECORD (E.Library) END;
CONST
name * = "commodities.library";
VAR
base * : CommoditiesBasePtr;
(**-- Library Functions ------------------------------------------------*)
(*
** $VER: commodities_protos.h 38.4 (27.2.92)
*)
TYPE
CustomProcType * = PROCEDURE ( obj : CxObjPtr; msg : CxMsgPtr );
(* --- functions in V36 or higher (distributed as Release 2.0) ---*)
(* OBJECT UTILITIES *)
LIBCALL (base : CommoditiesBasePtr) CreateCxObj*
( type [0] : E.ULONG;
arg1 [8] : SYS.LONGWORD;
arg2 [9] : SYS.LONGWORD )
: CxObjPtr;
-30;
LIBCALL (base : CommoditiesBasePtr) CxBroker*
( VAR nb [8] : NewBroker;
VAR error [0] : LONGINT )
: CxObjPtr;
-36;
LIBCALL (base : CommoditiesBasePtr) ActivateCxObj*
( co [8] : CxObjPtr;
true [0] : E.LBOOL )
: E.LBOOL;
-42;
LIBC