6 #ifndef WBREXX_H_INCLUDED
7 #define WBREXX_H_INCLUDED
14 extern int kprintf(const char *fmt
, ...);
15 extern int KPrintF(const char *fmt
, ...);
17 #include <libraries/commodities.h>
18 #include <scalos/scalos.h>
25 const char *ivm_WBmenuName
;
26 BOOL ivm_WindowRequired
;
27 const char *ivm_ScalosMenuName
;
28 ULONG (*ivm_MenuFunc
)(struct ScaWindowStruct
*swi
);
34 udaType_ScaWindowStruct
,
45 enum UDataType uda_Type
;
52 const char *lres_ResultString
; // nur wenn lres_Result == RETURN_OK;
54 const char *lres_ArgPtr
; // Pointer auf nächsten Teil des Object-Namens
56 STRPTR
*lres_Args
; // die originalen Argumente
58 struct RexxMsg
*lres_Message
;
62 char lres_ResultBuffer
[128];
65 #define LRESF_ORIGINALNAME 0x00000001
72 const struct LeafCmd
*lc_Next
; // next Leaf on this Level or NULL
74 const struct LeafCmd
*lc_Sub
; // Sub-Tree or NULL;
76 struct UData (*lc_Function
)(struct UData
, struct LeafData
*, const char *StemLeaf
, ULONG Index
);
78 ULONG (*lc_GetCount
)(struct UData
, struct LeafData
*); // only if ENUM == lc_Name
84 const struct CmdFunc
* CommandTable
;
86 struct MsgPort
* GlobalPort
;
90 /* This is for parsing commands the ARexx port receives. We employ
91 * the dos.library/ReadArgs parser for this purpose.
96 struct RDArgs
* ReadArgs
;
97 UBYTE Line
[512]; /* We allow for commands to be up to
98 * 511 characters long. This is far
99 * below the maximum string length
100 * limit ARexx imposed (32768
101 * characters) but should be more
102 * than sufficient for normal
105 STRPTR Args
[32]; /* Up to 32 command arguments are
110 /* A table to map command names to functions which
116 STRPTR CommandName
; /* Name of the command. */
117 STRPTR Template
; /* The command template in standard
121 /* Pointer to the function which implements this command. */
123 LONG (*Function
)(APTR
,struct RexxMsg
*,STRPTR
*);
126 /* The local data used by the functions the host supports. */
130 struct RexxParseData
* ParseData
;
131 struct RexxHost
* Host
;
132 struct CmdFunc
* CommandTable
; /* Pointer to table of commands. */
133 struct MsgPort
* GlobalPort
; /* Copied from RexxHost. */
134 STRPTR PortName
; /* Copied from RexxHost. */
135 ULONG Usage
; /* Usage count for Rx command. */
136 BOOL Terminate
; /* Set to TRUE if host should exit. */
139 /* This is a custom message the Rx command will need if the
140 * "CONSOLE" keyword is used.
145 struct Message Message
; /* Common message header. */
147 struct RexxMsg
* RexxMsg
; /* The client message. */
148 STRPTR PortName
; /* Copied from LocalData. */
149 UBYTE Command
[1]; /* Command to execute. */
153 enum IconState
{ icst_All
, icst_Selected
, icst_Unselected
};
158 struct Node tmi_Node
;
159 STRPTR tmi_Name
; // this is the "handle" to refer to this menu item
160 STRPTR tmi_Title
; // the item title
161 STRPTR tmi_Cmd
; // the command string
164 STRPTR tmi_MenuTitle
; // menu title for menus NULL for common tool menu items
165 STRPTR tmi_SubItem
; // sub item name or NULL for common tool menu items
167 APTR tmi_wbKey
; // "key" retrieved by WBAPPMENUA_GetKey
168 APTR tmi_wbTitleKey
; // "key" retrieved by WBAPPMENUA_GetTitleKey
170 struct AppObject
*tmi_MenuAppObject
;
171 struct AppObject
*tmi_ItemAppObject
;
172 struct AppObject
*tmi_SubAppObject
;
175 struct ToolMenuItem
*tmi_Parent
;
178 struct KeyboardCommand
180 struct Node kbc_Node
;
187 //----------------------------------------------------------------------------
191 int snprintf(char *, size_t, const char *, /*args*/ ...);
192 int vsnprintf(char *, size_t, const char *, va_list ap
);
195 //----------------------------------------------------------------------------
198 LONG
DoRexxCommand(CONST_STRPTR Command
);
199 LONG
ReturnRexxMsg(struct RexxMsg
* Message
,CONST_STRPTR Result
);
200 SAVEDS(VOID
) RxEntry(VOID
);
201 VOID
DeleteChildMessage(struct ChildMessage
*ChildMessage
);
202 struct ChildMessage
*CreateChildMessage(struct MsgPort
*ReplyPort
,
203 CONST_STRPTR Command
,struct RexxMsg
*RexxMessage
);
204 void ShutdownWBRexxProcess(void);
205 BOOL
StartWBRexxProcess(void);
206 CONST_STRPTR
GetNextArgPart(CONST_STRPTR ArgSrc
, STRPTR Buffer
, size_t MaxLen
);
207 ULONG
AddMenuItem(CONST_STRPTR Name
, CONST_STRPTR Title
, CONST_STRPTR Cmd
, CONST_STRPTR Shortcut
);
208 ULONG
RemoveMenuItem(CONST_STRPTR Name
);
209 ULONG
AddKeyboardCommand(CONST_STRPTR Name
, CONST_STRPTR Key
, CONST_STRPTR Cmd
);
210 ULONG
RemoveKeyboardCommand(CONST_STRPTR Name
);
211 BOOL
DoKeyboardCommand(struct IntuiMessage
*iMsg
);
215 LONG
Cmd_GetAttr(APTR UserData
,struct RexxMsg
*Message
,STRPTR
*Args
);
219 LONG
Cmd_Icon(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
223 LONG
Cmd_ActivateWindow(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
224 LONG
Cmd_ChangeWindow(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
225 LONG
Cmd_Delete(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
226 LONG
Cmd_Fault(APTR UserData
,struct RexxMsg
*Message
,STRPTR
*Args
);
227 LONG
Cmd_Help(APTR UserData
,struct RexxMsg
*Message
,STRPTR
*Args
);
228 LONG
Cmd_Info(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
229 LONG
Cmd_Keyboard(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
230 LONG
Cmd_LockGUI(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
231 LONG
Cmd_Menu(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
232 LONG
Cmd_MoveWindow(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
233 LONG
Cmd_NewDrawer(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
234 LONG
Cmd_Rename(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
235 LONG
Cmd_Rx(APTR UserData
,struct RexxMsg
*Message
,STRPTR
*Args
);
236 LONG
Cmd_SizeWindow(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
237 LONG
Cmd_UnlockGUI(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
238 LONG
Cmd_UnzoomWindow(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
239 LONG
Cmd_View(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
240 LONG
Cmd_Window(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
241 LONG
Cmd_WindowToBack(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
242 LONG
Cmd_WindowToFront(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
243 LONG
Cmd_ZoomWindow(APTR UserData
, struct RexxMsg
*Message
, STRPTR
*Args
);
246 //----------------------------------------------------------------------------