mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-24 22:50:28 +00:00
Merge branch 'master' into fontbook
This commit is contained in:
commit
9b82ba8278
48 changed files with 944 additions and 112 deletions
69
.github/workflows/build.yml
vendored
Normal file
69
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
name: Build ZealOS ISOs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- 'screenshots/**'
|
||||
- '**/LICENSE'
|
||||
pull_request:
|
||||
branches:
|
||||
- 'master'
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- 'screenshots/**'
|
||||
- '**/LICENSE'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: 'true'
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
sudo apt-get -y update
|
||||
sudo apt-get -y install build-essential git xorriso qemu-system-x86
|
||||
|
||||
- name: Enable KVM Group Perms
|
||||
run: |
|
||||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
||||
sudo udevadm control --reload-rules
|
||||
sudo udevadm trigger --name-match=kvm
|
||||
|
||||
- name: Run ISOs Build Script
|
||||
timeout-minutes: 10
|
||||
if: ${{ success() }}
|
||||
run: |
|
||||
cd build
|
||||
./build-iso.sh --headless
|
||||
cd ..
|
||||
|
||||
- name: ISO Check
|
||||
if: ${{ success() && hashFiles('./build/*.iso') == '' }}
|
||||
run: |
|
||||
echo "ISOs not built!"
|
||||
exit 1
|
||||
|
||||
- name: Releasing Latest ISOs
|
||||
if: ${{ success() && github.event_name == 'push'}}
|
||||
uses: "GutPuncher/action-automatic-releases@latest"
|
||||
with:
|
||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
automatic_release_tag: "latest"
|
||||
prerelease: false
|
||||
title: "Pre-Built ISOs [${{ github.sha }}]"
|
||||
files: ./build/*.iso
|
||||
|
||||
- name: OK
|
||||
if: ${{ success() }}
|
||||
run: |
|
||||
echo "Build OK"
|
|
@ -1,6 +1,6 @@
|
|||
# ZealOS
|
||||
|
||||
[![Discord](https://img.shields.io/discord/934200098144022609?color=7289DA&label=Discord&logo=discord&logoColor=white)](https://discord.gg/rK6U3xdr7D) [![](https://img.shields.io/badge/wiki-documentation-forestgreen)](https://zeal-operating-system.github.io/ZealOS-wiki/)
|
||||
[![Discord](https://img.shields.io/discord/934200098144022609?color=7289DA&label=Discord&logo=discord&logoColor=white)](https://discord.gg/rK6U3xdr7D) [![](https://img.shields.io/badge/wiki-documentation-forestgreen)](https://zeal-operating-system.github.io/ZealOS-wiki/) [![Build ZealOS ISOs](https://github.com/Zeal-Operating-System/ZealOS/actions/workflows/build.yml/badge.svg)](https://github.com/Zeal-Operating-System/ZealOS/actions/workflows/build.yml)
|
||||
|
||||
The Zeal Operating System is a modernized fork of the 64-bit Temple Operating System. Guiding principles of development include transparency, full user control, and adherence to public-domain/open-source implementations.
|
||||
|
||||
|
|
BIN
build/AUTO.ISO
BIN
build/AUTO.ISO
Binary file not shown.
|
@ -13,8 +13,10 @@ then
|
|||
exit
|
||||
fi
|
||||
|
||||
# Uncomment if you use doas instead of sudo
|
||||
#alias sudo=doas
|
||||
[ "$1" = "--headless" ] && QEMU_HEADLESS='-display none'
|
||||
|
||||
KVM=''
|
||||
(lsmod | grep -q kvm) && KVM=' -accel kvm'
|
||||
|
||||
# Set this true if you want to test ISOs in QEMU after building.
|
||||
TESTING=false
|
||||
|
@ -50,7 +52,7 @@ set +e
|
|||
|
||||
echo "Making temp vdisk, running auto-install ..."
|
||||
$QEMU_BIN_PATH/qemu-img create -f raw $TMPDISK 1024M
|
||||
$QEMU_BIN_PATH/qemu-system-x86_64 -machine q35,accel=kvm -drive format=raw,file=$TMPDISK -m 1G -rtc base=localtime -smp 4 -cdrom AUTO.ISO -device isa-debug-exit
|
||||
$QEMU_BIN_PATH/qemu-system-x86_64 -machine q35 $KVM -drive format=raw,file=$TMPDISK -m 1G -rtc base=localtime -smp 4 -cdrom AUTO.ISO -device isa-debug-exit $QEMU_HEADLESS
|
||||
|
||||
echo "Copying all src/ code into vdisk Tmp/OSBuild/ ..."
|
||||
rm ../src/Home/Registry.ZC 2> /dev/null
|
||||
|
@ -62,9 +64,9 @@ sudo cp -r ../src/* $TMPMOUNT/Tmp/OSBuild
|
|||
umount_tempdisk
|
||||
|
||||
echo "Rebuilding kernel headers, kernel, OS, and building Distro ISO ..."
|
||||
$QEMU_BIN_PATH/qemu-system-x86_64 -machine q35,accel=kvm -drive format=raw,file=$TMPDISK -m 1G -rtc base=localtime -smp 4 -device isa-debug-exit
|
||||
$QEMU_BIN_PATH/qemu-system-x86_64 -machine q35 $KVM -drive format=raw,file=$TMPDISK -m 1G -rtc base=localtime -smp 4 -device isa-debug-exit $QEMU_HEADLESS
|
||||
|
||||
LIMINE_BINARY_BRANCH="v5.x-branch-binary"
|
||||
LIMINE_BINARY_BRANCH="v6.x-branch-binary"
|
||||
|
||||
if [ -d "limine" ]
|
||||
then
|
||||
|
@ -73,6 +75,8 @@ then
|
|||
git fetch
|
||||
git remote set-head origin $LIMINE_BINARY_BRANCH
|
||||
git switch $LIMINE_BINARY_BRANCH
|
||||
git config --local pull.ff true
|
||||
git config --local pull.rebase true
|
||||
git pull
|
||||
rm limine
|
||||
|
||||
|
@ -130,11 +134,11 @@ if [ "$TESTING" = true ]; then
|
|||
cd ..
|
||||
fi
|
||||
echo "Testing limine-zealbooter-xorriso isohybrid boot in UEFI mode ..."
|
||||
$QEMU_BIN_PATH/qemu-system-x86_64 -machine q35,accel=kvm -m 1G -rtc base=localtime -bios ovmf/OVMF.fd -smp 4 -cdrom ZealOS-limine.iso
|
||||
$QEMU_BIN_PATH/qemu-system-x86_64 -machine q35 $KVM -m 1G -rtc base=localtime -bios ovmf/OVMF.fd -smp 4 -cdrom ZealOS-limine.iso $QEMU_HEADLESS
|
||||
echo "Testing limine-zealbooter-xorriso isohybrid boot in BIOS mode ..."
|
||||
$QEMU_BIN_PATH/qemu-system-x86_64 -machine q35,accel=kvm -m 1G -rtc base=localtime -smp 4 -cdrom ZealOS-limine.iso
|
||||
$QEMU_BIN_PATH/qemu-system-x86_64 -machine q35 $KVM -m 1G -rtc base=localtime -smp 4 -cdrom ZealOS-limine.iso $QEMU_HEADLESS
|
||||
echo "Testing native ZealC MyDistro legacy ISO in BIOS mode ..."
|
||||
$QEMU_BIN_PATH/qemu-system-x86_64 -machine q35,accel=kvm -m 1G -rtc base=localtime -smp 4 -cdrom ZealOS-MyDistro.iso
|
||||
$QEMU_BIN_PATH/qemu-system-x86_64 -machine q35 $KVM -m 1G -rtc base=localtime -smp 4 -cdrom ZealOS-MyDistro.iso $QEMU_HEADLESS
|
||||
fi
|
||||
|
||||
# comment these 2 lines if you want lingering old Distro ISOs
|
||||
|
|
22
build/git-pr-switch.sh
Executable file
22
build/git-pr-switch.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Checkout a (PR) fork branch locally for testing.
|
||||
#
|
||||
#
|
||||
|
||||
echo
|
||||
echo "git-pr-switch.sh -- Checkout a (PR) fork branch locally for testing."
|
||||
echo
|
||||
echo "Clean up your working directory before running this script."
|
||||
echo
|
||||
read -p "Enter fork author username: " FORK_USERNAME
|
||||
echo $FORK_USERNAME
|
||||
read -p "Enter fork branch name: " FORK_BRANCH
|
||||
echo $FORK_BRANCH
|
||||
FORK_LOCAL=$FORK_BRANCH"-testing"
|
||||
echo "Creating new local branch for testing: "$FORK_LOCAL" ..."
|
||||
git checkout -B $FORK_LOCAL
|
||||
echo "Pulling changes from user's branch into new local branch..."
|
||||
git pull https://github.com/$FORK_USERNAME/ZealOS.git $FORK_BRANCH
|
||||
|
||||
|
|
@ -90,6 +90,7 @@ else
|
|||
umount_vdisk
|
||||
[ -f ../src/Tmp/AUTO.ISO.C ] && mv ../src/Tmp/AUTO.ISO.C ./AUTO.ISO
|
||||
echo "Finished."
|
||||
cd ../
|
||||
git status
|
||||
;;
|
||||
vm)
|
||||
|
|
|
@ -584,9 +584,9 @@ Bool MoveDo(GameState *state, I64 piece_num, I64 x2, I64 y2, Bool final)
|
|||
game_over = TRUE;
|
||||
}
|
||||
GameSnapShot;
|
||||
}
|
||||
}
|
||||
|
||||
return ToBool(score_adjust);
|
||||
return ToBool(score_adjust);
|
||||
}
|
||||
|
||||
I64 MoveFind(I64 x, I64 y, Move *mvs, I64 mv_cnt)
|
||||
|
@ -664,18 +664,25 @@ I64 MoveCnt(GameState *state)
|
|||
{
|
||||
I64 i, res = 0, mv_cnt;
|
||||
Move mvs[32];
|
||||
Bool king_stalemate = TRUE;
|
||||
|
||||
for (i = 0; i < 32; i++)
|
||||
{
|
||||
if (state->pieces[i].player == state->cur_player)
|
||||
{
|
||||
mv_cnt = PieceMoves(state, i, mvs);
|
||||
mv_cnt = ChkPieceMoves(state, i, mvs,mv_cnt);
|
||||
res += mv_cnt;
|
||||
}
|
||||
return res;
|
||||
if (state->pieces[i].type != P_KING && state->pieces[i].player >= 0)
|
||||
king_stalemate = FALSE;
|
||||
}
|
||||
if (king_stalemate)
|
||||
return 0;
|
||||
else
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
U0 DrawIt(CTask *task, CDC *dc)
|
||||
{
|
||||
I64 i, x, y, z, k0, k1;
|
||||
|
|
|
@ -6,7 +6,7 @@ that you can place ctrls on the
|
|||
wall paper.
|
||||
|
||||
See $LK,"::/Demo/Graphics/Slider.ZC"$
|
||||
and $LK,"::/Demo/Graphics/WallPaperFish.ZC"$
|
||||
and $LK,"::/Demo/Graphics/WallPapers/WallPaperFish.ZC"$
|
||||
before messing with this program.
|
||||
|
||||
It must be "System Included".
|
498
src/Demo/Graphics/WallPapers/WallPaperDesktop.ZC
Executable file
498
src/Demo/Graphics/WallPapers/WallPaperDesktop.ZC
Executable file
|
@ -0,0 +1,498 @@
|
|||
#help_index "Windows"
|
||||
|
||||
class CWallPaperGlobals
|
||||
{
|
||||
I64 last_calc_idle_count, last_swap_counter[MP_PROCESSORS_NUM];
|
||||
F64 last_calc_idle_delta_time;
|
||||
U8 top_line[STR_LEN];
|
||||
} *wall = CAlloc(sizeof(CWallPaperGlobals));
|
||||
wall->last_calc_idle_delta_time = 1.0;
|
||||
|
||||
class CTaskWallPaperData
|
||||
{
|
||||
I64 alloced_u8s, used_u8s;
|
||||
U8 caller_stack[4096 - $$];
|
||||
};
|
||||
|
||||
U0 UserTerm()
|
||||
{
|
||||
|
||||
CTask *user = User;
|
||||
|
||||
user->border_src = BDS_CONST;
|
||||
user->text_attr = DKGRAY << 4 + BLUE;
|
||||
user->title_src = TTS_LOCKED_CONST;
|
||||
user->title_src = user->display_doc->filename.name;
|
||||
DocClear(user->border_doc, TRUE);
|
||||
DocClear;
|
||||
|
||||
user->win_width = GR_WIDTH / 2;
|
||||
WinHorz((user->win_width/8) - ((user->win_width/2)/6),
|
||||
(user->win_width/8) + ((user->win_width/2)/6) - 1, user);
|
||||
|
||||
user->win_height = GR_HEIGHT / 2;
|
||||
WinVert((user->win_height/8) - ((user->win_height/2)/7),
|
||||
(user->win_height/8) + ((user->win_height/2)/7) - 1, user);
|
||||
|
||||
|
||||
I64 initialWinTop = user->win_top;
|
||||
I64 initialWinLeft = user->win_left;
|
||||
|
||||
user->win_top = (GR_HEIGHT/2)/8;
|
||||
user->win_bottom = (GR_HEIGHT/2)/8;
|
||||
user->win_left = (GR_WIDTH/2)/8;
|
||||
user->win_right = (GR_WIDTH/2)/8;
|
||||
|
||||
while(user->win_left > initialWinLeft){
|
||||
user->win_left--;
|
||||
user->win_right++;
|
||||
Sleep(2);
|
||||
}
|
||||
|
||||
while(user->win_top > initialWinTop){
|
||||
user->win_top--;
|
||||
user->win_bottom++;
|
||||
Sleep(10);
|
||||
}
|
||||
|
||||
// WinToTop(user);
|
||||
// WinZBufUpdate;
|
||||
Dir;
|
||||
}
|
||||
|
||||
U0 WallPaper(CTask *_task)
|
||||
{
|
||||
I64 i, j, k, l = TEXT_ROWS - 1;
|
||||
CTask *task;
|
||||
CTaskWallPaperData *wpd;
|
||||
CHashTable *old_hash = Fs->hash_table;
|
||||
CCPU *c;
|
||||
CDateStruct ds;
|
||||
U8 *st;
|
||||
|
||||
_task->text_attr = DKGRAY << 4 + LTGRAY;
|
||||
if (sys_data_bp)
|
||||
{
|
||||
TextPrint(Fs, 0, l--, DKGRAY << 4 + YELLOW,
|
||||
"%010X/%010X %010X/%010X%12td%12td%12td",
|
||||
sys_data_bp->used_u8s, sys_data_bp->alloced_u8s,
|
||||
sys_code_bp->used_u8s, sys_code_bp->alloced_u8s,
|
||||
cmp.compiled_lines, blkdev.read_count, blkdev.write_count);
|
||||
|
||||
TextPrint(Fs, 0, l--, DKGRAY << 4 + LTGRAY,
|
||||
"______Data_Heap______ ______Code_Heap______ "
|
||||
"___Lines___ ___Reads___ __Writes___");
|
||||
}
|
||||
else
|
||||
{
|
||||
TextPrint(Fs, 0, l--, DKGRAY << 4 + LTGRAY,
|
||||
"%010X/%010X%12td%12td%12td",
|
||||
sys_code_bp->used_u8s, sys_code_bp->alloced_u8s,
|
||||
cmp.compiled_lines, blkdev.read_count, blkdev.write_count);
|
||||
|
||||
TextPrint(Fs, 0, l--, DKGRAY << 4 + LTGRAY,
|
||||
"____CodeData_Heap____ "
|
||||
"___Lines___ ___Reads___ ___Writes__");
|
||||
}
|
||||
TextPrint(Fs, 0, l--, DKGRAY << 4 + LTGRAY, "ProgressBars:%016X %016X %016X %016X",
|
||||
progress1, progress2, progress3, progress4);
|
||||
|
||||
for (i = 0; i < mp_count; i++)
|
||||
{
|
||||
c = &cpu_structs[i];
|
||||
if (winmgr.t->calc_idle_count != wall->last_calc_idle_count)
|
||||
{
|
||||
wall->last_calc_idle_delta_time = winmgr.t->calc_idle_delta_time;
|
||||
wall->last_swap_counter[i] = winmgr.t->last_swap_counter[i];
|
||||
winmgr.t->last_swap_counter[i] = c->swap_counter;
|
||||
}
|
||||
|
||||
task = c->executive_task;
|
||||
do
|
||||
{
|
||||
wpd = &task->wallpaper_data;
|
||||
if (!TaskValidate(task))
|
||||
break;
|
||||
if (!(winmgr.updates & 5))
|
||||
{
|
||||
if (c == Gs)
|
||||
Fs->hash_table = task->hash_table;
|
||||
else //precaution
|
||||
Fs->hash_table = old_hash;
|
||||
|
||||
StrPrint(wpd->caller_stack, " %p ", TaskCaller(task, 0));
|
||||
for (j = 1; j < 16; j++)
|
||||
{
|
||||
if ((k = TaskCaller(task, j)) > 0)
|
||||
CatPrint(wpd->caller_stack, "? %p ", k);
|
||||
}
|
||||
}
|
||||
TextPrint(Fs, 0, l--, DKGRAY << 4 + YELLOW, wpd->caller_stack);
|
||||
j = UnusedStack(task);
|
||||
if (j < 0)
|
||||
Panic("Stack Overflow", task);
|
||||
if (!(winmgr.updates & 15))
|
||||
{
|
||||
wpd->alloced_u8s = TaskMemAlloced(task);
|
||||
wpd->used_u8s = TaskMemUsed(task);
|
||||
}
|
||||
TextPrint(Fs, 0, l--, DKGRAY << 4 + LTGRAY,
|
||||
" %-18ts #%08X %010X %010X/%010X %04X:%02tX:%08X",
|
||||
task->task_title, task, j, wpd->used_u8s, wpd->alloced_u8s,
|
||||
task->task_flags, task->display_flags, task->win_inhibit);
|
||||
if (!TaskValidate(task))
|
||||
break;
|
||||
task = task->next_task;
|
||||
}
|
||||
while (task != c->executive_task);
|
||||
|
||||
TextPrint(Fs, 0, l--, DKGRAY << 4 + LTGRAY, "CPU%02X %2tf%% ContextSwaps/s:%9,d", i,
|
||||
100.0 * (1.0 - c->idle_factor), ToI64((winmgr.t->last_swap_counter[i]
|
||||
- wall->last_swap_counter[i]) / wall->last_calc_idle_delta_time));
|
||||
}
|
||||
TextPrint(Fs, 0, l--, DKGRAY << 4 + LTGRAY,
|
||||
" ___Description____ #__Task__ UnusedStack _UsedMem_/_AllocMem_ ______Flags_____");
|
||||
|
||||
if (!(winmgr.updates & 15) || !*wall->top_line)
|
||||
{
|
||||
Date2Struct(&ds, Now);
|
||||
i = sys_code_bp->alloced_u8s - sys_code_bp->used_u8s;
|
||||
if (sys_data_bp)
|
||||
i += sys_data_bp->alloced_u8s - sys_data_bp->used_u8s;
|
||||
StrPrint(wall->top_line,
|
||||
" ≡ %3tZ %02d/%02d/%02d %02d:%02d:%02d │ FPS: %2tf │ Mem: %010X │ CPU: ",
|
||||
ds.day_of_week, "ST_DAYS_OF_WEEK", ds.mon, ds.day_of_mon, ds.year % 100,
|
||||
ds.hour, ds.min, ds.sec, winmgr.fps, i);
|
||||
}
|
||||
TextPrint(Fs, 0, 0, DKGRAY << 4 + LTGRAY, wall->top_line);
|
||||
|
||||
if (screencast.record)
|
||||
TextPrint(Fs, 44 - 4, 0, DKGRAY << 4 + LTGREEN, "*");
|
||||
for (i = 0; i < mp_count; i++)
|
||||
{
|
||||
c = &cpu_structs[i];
|
||||
if (i & 1)
|
||||
TextPrint(Fs, 60 + i * 2, 0, DKGRAY << 4 + LTGRAY, "%2tf", 100.0 * (1.0 - c->idle_factor));
|
||||
else
|
||||
TextPrint(Fs, 60 + i * 2, 0, DKGRAY << 4 + LTGREEN, "%2tf", 100.0 * (1.0 - c->idle_factor));
|
||||
}
|
||||
|
||||
st = ScanCode2KeyName(kbd.last_down_scan_code);
|
||||
TextPrint(Fs, TEXT_COLS - 25, 0, DKGRAY << 4 + LTGREEN, "%25ts", st);
|
||||
Free(st);
|
||||
|
||||
Fs->hash_table = old_hash;
|
||||
wall->last_calc_idle_count = winmgr.t->calc_idle_count;
|
||||
}
|
||||
|
||||
$SP,"<1>",BI=1$
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$SP,"<2>",BI=2,BP="::/Demo/Graphics/WallPapers/WallPaperDesktop/DesktopIcons.DD,1"$
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$SP,"<3>",BI=3,BP="::/Demo/Graphics/WallPapers/WallPaperDesktop/DesktopIcons.DD,2"$
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$SP,"<4>",BI=4,BP="::/Demo/Graphics/WallPapers/WallPaperDesktop/DesktopIcons.DD,3"$
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$SP,"<5>",BI=5$
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$SP,"<6>",BI=6$
|
||||
|
||||
|
||||
|
||||
|
||||
U0 DrawTermBttn(CDC *dc, CCtrl *c)
|
||||
{
|
||||
Sprite3(dc, c->left-8, c->top-8, 0, $IB,"<1>",BI=1$);
|
||||
}
|
||||
|
||||
U0 LeftClickTermBttn(CCtrl *, I64, I64, Bool down)
|
||||
{
|
||||
if (down)
|
||||
User;
|
||||
}
|
||||
|
||||
CCtrl *TermBttnNew()
|
||||
{
|
||||
I64 min_x, max_x, min_y, max_y;
|
||||
CCtrl *c = SysCAlloc(sizeof(CCtrl));
|
||||
|
||||
c->win_task = sys_winmgr_task;
|
||||
c->flags = CTRLF_SHOW;
|
||||
c->type = CTRLT_GENERIC;
|
||||
c->draw_it = &DrawTermBttn;
|
||||
c->left_click = &LeftClickTermBttn;
|
||||
|
||||
SpriteExtents($IB,"<1>",BI=1$, &min_x, &max_x, &min_y, &max_y);
|
||||
//min must be zero
|
||||
c->left = sys_winmgr_task->pix_width - (max_x - min_x + 1);
|
||||
c->right = c->left + (max_x - min_x + 1) - 1;
|
||||
c->top = sys_winmgr_task->pix_height - (max_y - min_y + 1);
|
||||
c->bottom = c->top + (max_y - min_y + 1) - 1;
|
||||
|
||||
QueueInsert(c, sys_winmgr_task->last_ctrl);
|
||||
TaskDerivedValsUpdate(sys_winmgr_task);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
//// HOME
|
||||
U0 DrawHomeIcon(CDC *dc, CCtrl *c)
|
||||
{
|
||||
|
||||
c->top = (sys_task->win_bottom * 8) + 26;
|
||||
c->bottom = c->top + 60 + 8;
|
||||
|
||||
//dc->color = PURPLE;
|
||||
//GrRect(dc, c->left, c->top, c->right, c->bottom);
|
||||
|
||||
Sprite3(dc, c->left, c->top, -1, $IB,"<2>",BI=2$);
|
||||
|
||||
}
|
||||
|
||||
U0 LeftClickHomeIcon(CCtrl *, I64, I64, Bool down)
|
||||
{
|
||||
if (down)
|
||||
Spawn(&UserTerm, , "User Terminal");
|
||||
}
|
||||
|
||||
CCtrl *HomeIconNew()
|
||||
{
|
||||
I64 min_x, max_x, min_y, max_y;
|
||||
CCtrl *c = SysCAlloc(sizeof(CCtrl));
|
||||
|
||||
c->win_task = sys_winmgr_task;
|
||||
c->flags = CTRLF_SHOW;
|
||||
c->type = CTRLT_GENERIC;
|
||||
c->draw_it = &DrawHomeIcon;
|
||||
c->left_click = &LeftClickHomeIcon;
|
||||
|
||||
SpriteExtents($IB,"<2>",BI=2$, &min_x, &max_x, &min_y, &max_y);
|
||||
//min must be zero
|
||||
c->left = 8;
|
||||
c->right = c->left + (max_x - min_x + 1) - 1;
|
||||
c->top = (sys_task->win_bottom*8) + (max_y - min_y + 1);
|
||||
c->bottom = c->top + max_y + 8;
|
||||
|
||||
QueueInsert(c, sys_winmgr_task->last_ctrl);
|
||||
TaskDerivedValsUpdate(sys_winmgr_task);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
//// TELNET
|
||||
U0 DrawTelnetIcon(CDC *dc, CCtrl *c)
|
||||
{
|
||||
|
||||
c->top = (sys_task->win_bottom * 8) + 16*2 + 80;
|
||||
//dc->color = RED;
|
||||
//GrRect(dc, c->left, c->top, c->right, c->bottom);
|
||||
Sprite3(dc, c->left, c->top, -1, $IB,"<3>",BI=3$);
|
||||
}
|
||||
|
||||
U0 LeftClickTelnetIcon(CCtrl *, I64, I64, Bool down)
|
||||
{
|
||||
if (down)
|
||||
PopUp("ExeFile2(\"~/Net/Programs/Telnet/Telnet.ZC\");");
|
||||
}
|
||||
|
||||
CCtrl *TelnetIconNew()
|
||||
{
|
||||
I64 min_x, max_x, min_y, max_y;
|
||||
CCtrl *c = SysCAlloc(sizeof(CCtrl));
|
||||
|
||||
c->win_task = sys_winmgr_task;
|
||||
c->flags = CTRLF_SHOW;
|
||||
c->type = CTRLT_GENERIC;
|
||||
c->draw_it = &DrawTelnetIcon;
|
||||
c->left_click = &LeftClickTelnetIcon;
|
||||
|
||||
SpriteExtents($IB,"<3>",BI=3$, &min_x, &max_x, &min_y, &max_y);
|
||||
//min must be zerocp
|
||||
c->left = 8;
|
||||
c->right = c->left + (max_x - min_x);
|
||||
c->top = (sys_task->win_bottom*8) + (max_y - min_y + 1) * 2;
|
||||
c->bottom = c->top + max_y + 16;
|
||||
|
||||
QueueInsert(c, sys_winmgr_task->last_ctrl);
|
||||
TaskDerivedValsUpdate(sys_winmgr_task);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
//// PALETTE EDITOR
|
||||
U0 DrawPaletteIcon(CDC *dc, CCtrl *c)
|
||||
{
|
||||
|
||||
c->top = (sys_task->win_bottom * 8) + 16*3 + 130;
|
||||
//dc->color = RED;
|
||||
//GrRect(dc, c->left, c->top, c->right, c->bottom);
|
||||
Sprite3(dc, c->left, c->top, -1, $IB,"<4>",BI=4$);
|
||||
}
|
||||
|
||||
U0 LeftClickPaletteIcon(CCtrl *, I64, I64, Bool down)
|
||||
{
|
||||
if (down)
|
||||
PopUp("ExeFile2(\"~/PaletteEditor/Run.ZC\");");
|
||||
}
|
||||
|
||||
CCtrl *PaletteIconNew()
|
||||
{
|
||||
I64 min_x, max_x, min_y, max_y;
|
||||
CCtrl *c = SysCAlloc(sizeof(CCtrl));
|
||||
|
||||
c->win_task = sys_winmgr_task;
|
||||
c->flags = CTRLF_SHOW;
|
||||
c->type = CTRLT_GENERIC;
|
||||
c->draw_it = &DrawPaletteIcon;
|
||||
c->left_click = &LeftClickPaletteIcon;
|
||||
|
||||
SpriteExtents($IB,"<7>",BI=7$, &min_x, &max_x, &min_y, &max_y);
|
||||
//min must be zerocp
|
||||
c->left = 8;
|
||||
c->right = c->left + (max_x - min_x);
|
||||
c->top = (sys_task->win_bottom*8) + (max_y - min_y + 1) * 3;
|
||||
c->bottom = c->top + max_y + 16;
|
||||
|
||||
QueueInsert(c, sys_winmgr_task->last_ctrl);
|
||||
TaskDerivedValsUpdate(sys_winmgr_task);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
U0 DrawNetLogBttn(CDC *dc, CCtrl *c)
|
||||
{
|
||||
Sprite3(dc, c->left-8, c->top-8, 0, $IB,"<5>",BI=5$);
|
||||
}
|
||||
|
||||
U0 LeftClickNetLogBttn(CCtrl *, I64, I64, Bool down)
|
||||
{
|
||||
if(down)
|
||||
Sys("NetLogToggle;");
|
||||
}
|
||||
|
||||
CCtrl *NetLogIconNew()
|
||||
{
|
||||
I64 min_x, max_x, min_y, max_y;
|
||||
CCtrl *c = SysCAlloc(sizeof(CCtrl));
|
||||
|
||||
c->win_task = sys_winmgr_task;
|
||||
c->flags = CTRLF_SHOW;
|
||||
c->type = CTRLT_GENERIC;
|
||||
c->draw_it = &DrawNetLogBttn;
|
||||
c->left_click = &LeftClickNetLogBttn;
|
||||
|
||||
SpriteExtents($IB,"<5>",BI=5$, &min_x, &max_x, &min_y, &max_y);
|
||||
//min must be zero
|
||||
c->left = sys_winmgr_task->pix_width - (max_x - min_x + 1);
|
||||
c->right = c->left + (max_x - min_x + 1) - 1;
|
||||
c->top = sys_winmgr_task->pix_height - (max_y - min_y + 1) - 40;
|
||||
c->bottom = c->top + (max_y - min_y + 1) - 1;
|
||||
|
||||
QueueInsert(c, sys_winmgr_task->last_ctrl);
|
||||
TaskDerivedValsUpdate(sys_winmgr_task);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
U0 DrawShowStatsBttn(CDC *dc, CCtrl *c)
|
||||
{
|
||||
Sprite3(dc, c->left-8, c->top-8, 0, $IB,"<6>",BI=6$);
|
||||
}
|
||||
|
||||
U0 LeftClickShowStatsBttn(CCtrl *, I64, I64, Bool down)
|
||||
{
|
||||
if(down)
|
||||
Sys("WallPaperToggle;");
|
||||
}
|
||||
|
||||
CCtrl *ShowStatsIconNew()
|
||||
{
|
||||
I64 min_x, max_x, min_y, max_y;
|
||||
CCtrl *c = SysCAlloc(sizeof(CCtrl));
|
||||
|
||||
c->win_task = sys_winmgr_task;
|
||||
c->flags = CTRLF_SHOW;
|
||||
c->type = CTRLT_GENERIC;
|
||||
c->draw_it = &DrawShowStatsBttn;
|
||||
c->left_click = &LeftClickShowStatsBttn;
|
||||
|
||||
SpriteExtents($IB,"<6>",BI=6$, &min_x, &max_x, &min_y, &max_y);
|
||||
//min must be zero
|
||||
c->left = sys_winmgr_task->pix_width - (max_x - min_x + 1);
|
||||
c->right = c->left + (max_x - min_x + 1) - 1;
|
||||
c->top = sys_winmgr_task->pix_height - (max_y - min_y + 1) - 80;
|
||||
c->bottom = c->top + (max_y - min_y + 1) - 1;
|
||||
|
||||
QueueInsert(c, sys_winmgr_task->last_ctrl);
|
||||
TaskDerivedValsUpdate(sys_winmgr_task);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
U0 WallPaperInit(Bool enableTermIcon = TRUE, Bool enableDesktopIcons = TRUE)
|
||||
{
|
||||
if (Fs != sys_task)
|
||||
{
|
||||
"Must be System Included with SHIFT-F5.\n"
|
||||
"(Would crash when code mem was freed.)\n";
|
||||
return;
|
||||
}
|
||||
if(enableTermIcon)
|
||||
{
|
||||
TermBttnNew;
|
||||
NetLogIconNew;
|
||||
ShowStatsIconNew;
|
||||
|
||||
}
|
||||
if(enableDesktopIcons)
|
||||
{
|
||||
HomeIconNew;
|
||||
TelnetIconNew;
|
||||
PaletteIconNew;
|
||||
}
|
||||
gr.fp_wall_paper = &WallPaper;
|
||||
}
|
||||
|
||||
WallPaperInit; |