@@ -11,11 +11,12 @@ use Graphical_shell::Shell_executable_type;
11
11
#[ test]
12
12
fn main ( ) {
13
13
use Drivers :: Native :: Window_screen ;
14
- use File_system :: { Flags_type , Open_type , Permissions_type } ;
14
+ use Executable :: Mount_static_executables ;
15
+ use File_system :: { Flags_type , Open_type } ;
15
16
use Graphics :: { Get_minimal_buffer_size , Input_type_type , Point_type } ;
16
17
use Users :: Group_identifier_type ;
17
18
18
- use Virtual_file_system :: File_type ;
19
+ use Virtual_file_system :: { File_type , Mount_static_devices } ;
19
20
20
21
// - Initialize the task manager.
21
22
let Task_instance = Task :: Initialize ( ) . unwrap ( ) ;
@@ -60,57 +61,34 @@ fn main() {
60
61
Virtual_file_system :: Create_default_hierarchy ( Virtual_file_system :: Get_instance ( ) , Task )
61
62
. unwrap ( ) ;
62
63
63
- Virtual_file_system :: Get_instance ( )
64
- . Mount_static_device (
65
- Task ,
66
- & "/Binaries/Graphical_shell" ,
67
- Create_device ! ( Shell_executable_type ) ,
68
- )
69
- . unwrap ( ) ;
70
-
71
- Virtual_file_system :: Get_instance ( )
72
- . Mount_static_device (
73
- Task ,
74
- & "/Binaries/Command_line_shell" ,
75
- Create_device ! ( Shell_executable_type ) ,
76
- )
77
- . unwrap ( ) ;
78
-
79
- Virtual_file_system :: Get_instance ( )
80
- . Set_permissions ( "/Binaries/Command_line_shell" , Permissions_type :: Executable )
81
- . unwrap ( ) ;
82
-
83
- Virtual_file_system :: Get_instance ( )
84
- . Create_directory ( & "/Configuration/Graphical_shell" , Task )
85
- . unwrap ( ) ;
64
+ Mount_static_executables ! (
65
+ Virtual_file_system :: Get_instance ( ) ,
66
+ Task ,
67
+ & [ ( & "/Binaries/Graphical_shell" , Shell_executable_type ) , ]
68
+ )
69
+ . unwrap ( ) ;
86
70
87
71
Virtual_file_system :: Get_instance ( )
88
- . Create_directory ( & "/Configuration/Graphical_shell /Shortcuts" , Task )
72
+ . Create_directory ( & "/Configuration/Shared /Shortcuts" , Task )
89
73
. unwrap ( ) ;
90
74
91
75
Drivers :: Native :: Console :: Mount_devices ( Task , Virtual_file_system :: Get_instance ( ) ) . unwrap ( ) ;
92
76
93
- Virtual_file_system :: Get_instance ( )
94
- . Mount_static_device (
95
- Task ,
96
- & "/Devices/Random" ,
97
- Create_device ! ( Drivers :: Native :: Random_device_type ) ,
98
- )
99
- . unwrap ( ) ;
100
-
101
- Virtual_file_system :: Get_instance ( )
102
- . Mount_static_device (
103
- Task ,
104
- & "/Devices/Null" ,
105
- Create_device ! ( Drivers :: Common :: Null_device_type ) ,
106
- )
107
- . unwrap ( ) ;
77
+ Mount_static_devices ! (
78
+ Virtual_file_system :: Get_instance ( ) ,
79
+ Task ,
80
+ & [
81
+ ( & "/Devices/Random" , Drivers :: Native :: Random_device_type ) ,
82
+ ( & "/Devices/Null" , Drivers :: Common :: Null_device_type ) ,
83
+ ]
84
+ )
85
+ . unwrap ( ) ;
108
86
109
87
// Add fake shortcuts.
110
88
for i in 0 ..20 {
111
89
File_type :: Open (
112
90
Virtual_file_system :: Get_instance ( ) ,
113
- format ! ( "/Configuration/Graphical_shell /Shortcuts/Test{}.json" , i) . as_str ( ) ,
91
+ format ! ( "/Configuration/Shared /Shortcuts/Test{}.json" , i) . as_str ( ) ,
114
92
Flags_type :: New ( Mode_type :: Write_only , Some ( Open_type :: Create ) , None ) ,
115
93
)
116
94
. unwrap ( )
@@ -122,7 +100,8 @@ fn main() {
122
100
"Command": "/Binaries/?",
123
101
"Arguments": "",
124
102
"Terminal": false,
125
- "Icon_string": "T!"
103
+ "Icon_string": "T!",
104
+ "Icon_color": [255, 0, 0]
126
105
}}
127
106
"# ,
128
107
i
@@ -150,29 +129,14 @@ fn main() {
150
129
)
151
130
. unwrap ( ) ;
152
131
153
- let Standard_in = Virtual_file_system :: Get_instance ( )
154
- . Open ( & "/Devices/Standard_in" , Mode_type :: Read_only . into ( ) , Task )
155
- . unwrap ( ) ;
156
-
157
- let Standard_out = Virtual_file_system :: Get_instance ( )
158
- . Open ( & "/Devices/Standard_out" , Mode_type :: Write_only . into ( ) , Task )
159
- . unwrap ( ) ;
160
-
161
- let Standard_error = Virtual_file_system :: Get_instance ( )
162
- . Open (
163
- & "/Devices/Standard_error" ,
164
- Mode_type :: Write_only . into ( ) ,
165
- Task ,
166
- )
167
- . unwrap ( ) ;
168
-
169
- let Standard = Standard_type :: New (
170
- Standard_in ,
171
- Standard_out ,
172
- Standard_error ,
132
+ let Standard = Standard_type :: Open (
133
+ & "/Devices/Standard_in" ,
134
+ & "/Devices/Standard_out" ,
135
+ & "/Devices/Standard_error" ,
173
136
Task ,
174
137
Virtual_file_system :: Get_instance ( ) ,
175
- ) ;
138
+ )
139
+ . unwrap ( ) ;
176
140
177
141
Task_instance
178
142
. Set_environment_variable ( Task , "Paths" , "/" )
0 commit comments