DEFINITION MODULE CommoditiesSupport;
(*$ LargeVars:=FALSE *)

FROM SYSTEM	IMPORT	ADDRESS;
FROM InputEvent	IMPORT	InputEventPtr,null;
FROM KeyMapD	IMPORT	KeyMapPtr;
IMPORT
  CD: CommoditiesD,
  ED: ExecD;

TYPE
  StrPtr=ADDRESS; (* POINTER TO NullTerminatedString *)

  (*
   * NIEMALS LoadA4:=TRUE und Pardealloc:=FALSE vergessen!
   * Und alle Checks aus!
   *)
  CustomProc=PROCEDURE(CD.CxObjPtr, CD.CxMsgPtr);

(* CxObjPtr, CxMsgPtr: sind Opaque! *)

(*************************
 * object creation macros
 *************************)

PROCEDURE CxFilter(d:StrPtr):CD.CxObjPtr;

PROCEDURE CxTypeFilter(type:LONGINT):CD.CxObjPtr;

PROCEDURE CxSender(port:ED.MsgPortPtr; id:LONGINT):CD.CxObjPtr;

PROCEDURE CxSignal(task:ED.TaskPtr; sigNum:LONGINT):CD.CxObjPtr;

PROCEDURE CxTranslate(ie:InputEventPtr):CD.CxObjPtr;

PROCEDURE CxDebug(id:LONGINT):CD.CxObjPtr;

PROCEDURE CxCustom(action:CustomProc; id:LONGINT):CD.CxObjPtr;

(* matches nothing   *)
PROCEDURE NullIx(VAR i:CD.IX):BOOLEAN;

(* Procedures from cx_lib *)
(* Wird automatisch vom Modul erledigt!
PROCEDURE ArgArrayDone(); (* should not be used! *)
PROCEDURE ArgArrayInit(); (* should not be used! *)
*)
PROCEDURE ArgInt(str:StrPtr; defaultVal:LONGINT):LONGINT;
PROCEDURE ArgString(str:StrPtr; defaultStr:StrPtr):StrPtr;
PROCEDURE UserFilter(str:StrPtr; defaultFilter:StrPtr):CD.CxObjPtr;
PROCEDURE FreeIEvents(ie:InputEventPtr);
PROCEDURE HotKey(descr:StrPtr; port:ED.MsgPortPtr; ID:LONGINT):CD.CxObjPtr;
PROCEDURE InvertString(str:StrPtr; km:KeyMapPtr):InputEventPtr;

END CommoditiesSupport.def
