Meta: Add files to repository
This commit is contained in:
parent
80a0428b66
commit
39198164cd
1029 changed files with 78311 additions and 0 deletions
24
System/Shell/Commands/wpset.HC
Normal file
24
System/Shell/Commands/wpset.HC
Normal file
|
@ -0,0 +1,24 @@
|
|||
I64 @shell_cmd_wpset(@shell* sh, I64 argc, U8** argv)
|
||||
{
|
||||
U8 buf[512];
|
||||
if (argc < 2) {
|
||||
return 0;
|
||||
}
|
||||
I64 size = 0;
|
||||
U64 fbuf = FileSystem.ReadFile(argv[1], &size);
|
||||
if (!fbuf) {
|
||||
StrPrint(&buf, "Error reading file %s\n", argv[1]);
|
||||
Stdio.WriteLine(sh, &buf);
|
||||
return 1;
|
||||
}
|
||||
Context2D* new = Image.BufferToContext2D(fbuf, size);
|
||||
Free(fbuf);
|
||||
if (!new) {
|
||||
StrPrint(&buf, "Error in Image.BufferToContext2D\n");
|
||||
Stdio.WriteLine(sh, &buf);
|
||||
return 1;
|
||||
}
|
||||
Compositor.SetWallpaper(new);
|
||||
DelContext2D(new);
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue