2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
9 /******************************************************************************
26 Create a new shell in a new console window. This window will become
29 The window belonging to the new shell may be specified by
30 using the WINDOW tooltype.
34 The attributes are read as tooltypes from the Shell icon.
36 WINDOW -- Specification of the shell window. It must be in the form
37 con:[X]/[Y]/[WIDTH]/[HEIGHT]...
39 X -- number of pixels from the left edge of
41 Y -- number of pixels from the top edge of
43 WIDTH -- width of the shell window in pixels
44 HEIGHT -- height of the shell window in pixels
45 TITLE -- text to appear in the shell window's
47 AUTO -- the window automatically appears when the
48 program needs input or output
49 ALT -- the window appears in the specified size
50 and position when the zoom gadget is clicked
51 BACKDROP -- the window is a backdrop window
52 CLOSE -- include a close gadget
53 INACTIVE -- the window is not made active when opened
54 NOBORDER -- the window is borderless, only the size,
55 depth and zoom gadgets are available
56 NOCLOSE -- the window has no close gadget
57 NODEPTH -- the window has no depth gadget
58 NODRAG -- the window cannot be drag; implies NOCLOSE
59 NOSIZE -- the window has no size gadget
60 SCREEN -- name of a public screen to open the window on
61 SIMPLE -- if the window is enlarged the text expands to
62 fill the available space
63 SMART -- if the window is enlarged the text will not
65 WAIT -- the window can only be closed by selecting
66 the close gadget or entering CTRL-\.
69 FROM -- File to execute before resorting to normal shell
70 operations. If nothing is specified S:Shell-Startup
73 STACK -- Stack size in Bytes.
78 As opposed to C:NewShell, this is a Workbench Tool.
90 ******************************************************************************/
92 #include <proto/dos.h>
93 #include <proto/icon.h>
96 #include <aros/debug.h>
98 const TEXT ver
[] = "$VER:CLI 1.1 (30.11.2013) © AROS Dev Team";
102 struct DiskObject
*dobj
;
103 LONG rc
= RETURN_FAIL
;
105 dobj
= GetDiskObject("PROGDIR:Shell");
110 STRPTR result
, winspec
, fromspec
;
111 STRPTR
*toolarray
= dobj
->do_ToolTypes
;
113 result
= FindToolType(toolarray
, "STACK");
115 StrToLong(result
, &stack
);
117 stack
= AROS_STACKSIZE
;
119 result
= FindToolType(toolarray
, "FROM");
123 fromspec
= "S:Shell-Startup";
125 result
= FindToolType(toolarray
, "WINDOW");
129 winspec
= "CON:0/50//130/AROS-Shell/CLOSE";
131 from
= Open(fromspec
, MODE_OLDFILE
);
132 win
= Open(winspec
, MODE_NEWFILE
);
134 if (stack
< AROS_STACKSIZE
)
135 stack
= AROS_STACKSIZE
;
137 D(bug("[CLI] stack %d from %s window %s\n", stack
, fromspec
, winspec
));
141 struct TagItem tags
[] =
143 { SYS_Asynch
, TRUE
},
144 { SYS_Background
, FALSE
},
145 { SYS_Input
, (IPTR
)win
},
146 { SYS_Output
, (IPTR
)NULL
},
147 { SYS_Error
, (IPTR
)NULL
},
148 { SYS_ScriptInput
, (IPTR
)from
},
149 { SYS_UserShell
, TRUE
},
150 { NP_StackSize
, stack
},
154 rc
= SystemTagList("", tags
);
167 FreeDiskObject(dobj
);