mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-25 23:10:32 +00:00
WallPaper DolDoc
This commit is contained in:
parent
b32f9cea77
commit
28bd343db7
21 changed files with 117 additions and 1 deletions
78
src/Demo/Graphics/WallPaperDolDoc.ZC
Executable file
78
src/Demo/Graphics/WallPaperDolDoc.ZC
Executable file
|
@ -0,0 +1,78 @@
|
||||||
|
U0 (*old_wall_paper)(CTask *task);
|
||||||
|
CDoc *wallpaper_doc;
|
||||||
|
|
||||||
|
RegDefault("Wallpapers/Current", "1;\n");
|
||||||
|
RegExe("Wallpapers/Current");
|
||||||
|
|
||||||
|
Bool show_stats = FALSE;
|
||||||
|
|
||||||
|
U0 WallPaperSet(I8 direction) {
|
||||||
|
CDirEntry *tmpde1;
|
||||||
|
// read the current wallpaper index from the registry
|
||||||
|
I64 current = RegExe("Wallpapers/Current");
|
||||||
|
I64 max = 0;
|
||||||
|
|
||||||
|
// SysLog("Reading current wallpaper index from registry: %d\n", current);
|
||||||
|
|
||||||
|
// search the wallpapers directory for .DD files
|
||||||
|
tmpde1 = FilesFind("~/Wallpapers/1024/*.DD", 1);
|
||||||
|
if (tmpde1) {
|
||||||
|
do {
|
||||||
|
max++;
|
||||||
|
tmpde1 = tmpde1->next;
|
||||||
|
} while (tmpde1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// move to the next/previous wallpaper
|
||||||
|
current += direction;
|
||||||
|
if (current < 1)
|
||||||
|
current = max; // wrap around to the end
|
||||||
|
if (current > max)
|
||||||
|
current = 1; // wrap around to the start
|
||||||
|
|
||||||
|
// write the new current index back to the registry
|
||||||
|
RegWrite("Wallpapers/Current", "%d;\n", current);
|
||||||
|
|
||||||
|
// SysLog("Current: %d\n", current);
|
||||||
|
// Change the wallpaper
|
||||||
|
Sys("WallPaperDolDocInit(\"~/Wallpapers/1024/%d.DD\");\n", current);
|
||||||
|
}
|
||||||
|
|
||||||
|
U0 WallPaperToggle()
|
||||||
|
{
|
||||||
|
if (Fs != sys_task)
|
||||||
|
{
|
||||||
|
"\nMust be ran as system";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
show_stats = !show_stats;
|
||||||
|
if(show_stats)
|
||||||
|
sys_winmgr_task->display_doc = old_wall_paper;
|
||||||
|
else
|
||||||
|
sys_winmgr_task->display_doc = wallpaper_doc;
|
||||||
|
}
|
||||||
|
|
||||||
|
U0 WallPaperDolDocInit(I64 filepath="::/Home/Wallpapers/Default.DD")
|
||||||
|
{
|
||||||
|
if (Fs != sys_task)
|
||||||
|
{
|
||||||
|
"\nMust be System Included. (SHIFT-F5 / RightClick->System Include) \n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
old_wall_paper = gr.fp_wall_paper;
|
||||||
|
wallpaper_doc = DocRead(filepath, DOCF_DBL_DOLLARS | DOCF_NO_CURSOR);
|
||||||
|
|
||||||
|
sys_winmgr_task->display_doc = wallpaper_doc;
|
||||||
|
DocCursor(OFF, wallpaper_doc);
|
||||||
|
|
||||||
|
// if (gr_palette[0] > gr_palette[15])
|
||||||
|
// Fs->text_attr = WHITE << 4 + WHITE;
|
||||||
|
// else
|
||||||
|
// Fs->text_attr = BLACK << 4 + BLACK;
|
||||||
|
|
||||||
|
|
||||||
|
wallpaper_doc->win_task = sys_winmgr_task;
|
||||||
|
|
||||||
|
// gr.fp_wall_paper = &WallPaperDD;
|
||||||
|
}
|
2
src/Home/Wallpapers/1024/1.DD
Executable file
2
src/Home/Wallpapers/1024/1.DD
Executable file
File diff suppressed because one or more lines are too long
2
src/Home/Wallpapers/1024/10.DD
Executable file
2
src/Home/Wallpapers/1024/10.DD
Executable file
File diff suppressed because one or more lines are too long
2
src/Home/Wallpapers/1024/11.DD
Executable file
2
src/Home/Wallpapers/1024/11.DD
Executable file
File diff suppressed because one or more lines are too long
2
src/Home/Wallpapers/1024/12.DD
Executable file
2
src/Home/Wallpapers/1024/12.DD
Executable file
File diff suppressed because one or more lines are too long
2
src/Home/Wallpapers/1024/13.DD
Executable file
2
src/Home/Wallpapers/1024/13.DD
Executable file
File diff suppressed because one or more lines are too long
2
src/Home/Wallpapers/1024/14.DD
Executable file
2
src/Home/Wallpapers/1024/14.DD
Executable file
File diff suppressed because one or more lines are too long
2
src/Home/Wallpapers/1024/2.DD
Executable file
2
src/Home/Wallpapers/1024/2.DD
Executable file
File diff suppressed because one or more lines are too long
2
src/Home/Wallpapers/1024/3.DD
Executable file
2
src/Home/Wallpapers/1024/3.DD
Executable file
File diff suppressed because one or more lines are too long
2
src/Home/Wallpapers/1024/4.DD
Executable file
2
src/Home/Wallpapers/1024/4.DD
Executable file
File diff suppressed because one or more lines are too long
2
src/Home/Wallpapers/1024/5.DD
Executable file
2
src/Home/Wallpapers/1024/5.DD
Executable file
File diff suppressed because one or more lines are too long
2
src/Home/Wallpapers/1024/6.DD
Executable file
2
src/Home/Wallpapers/1024/6.DD
Executable file
File diff suppressed because one or more lines are too long
2
src/Home/Wallpapers/1024/7.DD
Executable file
2
src/Home/Wallpapers/1024/7.DD
Executable file
File diff suppressed because one or more lines are too long
2
src/Home/Wallpapers/1024/8.DD
Executable file
2
src/Home/Wallpapers/1024/8.DD
Executable file
File diff suppressed because one or more lines are too long
2
src/Home/Wallpapers/1024/9.DD
Executable file
2
src/Home/Wallpapers/1024/9.DD
Executable file
File diff suppressed because one or more lines are too long
2
src/Home/Wallpapers/1280/1.DD
Executable file
2
src/Home/Wallpapers/1280/1.DD
Executable file
File diff suppressed because one or more lines are too long
2
src/Home/Wallpapers/1280/2.DD
Executable file
2
src/Home/Wallpapers/1280/2.DD
Executable file
File diff suppressed because one or more lines are too long
2
src/Home/Wallpapers/1280/3.DD
Executable file
2
src/Home/Wallpapers/1280/3.DD
Executable file
File diff suppressed because one or more lines are too long
2
src/Home/Wallpapers/1280/4.DD
Executable file
2
src/Home/Wallpapers/1280/4.DD
Executable file
File diff suppressed because one or more lines are too long
2
src/Home/Wallpapers/Default.DD
Executable file
2
src/Home/Wallpapers/Default.DD
Executable file
File diff suppressed because one or more lines are too long
|
@ -34,7 +34,7 @@ U0 GrUpdateTaskWin(CTask *task)
|
||||||
if (gr.fp_wall_paper)
|
if (gr.fp_wall_paper)
|
||||||
(*gr.fp_wall_paper)(task);
|
(*gr.fp_wall_paper)(task);
|
||||||
}
|
}
|
||||||
else if (!(task->win_inhibit & WIF_SELF_DOC))
|
/* else */ if (!(task->win_inhibit & WIF_SELF_DOC))
|
||||||
DocUpdateTaskDocs(task);
|
DocUpdateTaskDocs(task);
|
||||||
if (TaskValidate(task))
|
if (TaskValidate(task))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue