From bcdd96a753615fcbe6c2fe661c3aa1cf31c58d5c Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Tue, 21 Dec 2021 17:22:15 +0000 Subject: [PATCH] appearance: WiP of adding screensaver tab various small changes git-svn-id: svn://kolibrios.org@9453 a494cfbc-eb01-0410-851d-a64ba20cac60 --- data/Tupfile.lua | 6 +- data/common/settings/system.ini | 1 + data/eng/settings/menu.dat | 3 +- data/rus/settings/menu.dat | 3 +- programs/cmm/app_plus/app_plus.c | 1 - programs/cmm/appearance/appearance.c | 110 +++++++++++------- programs/cmm/appearance/ui_elements_preview.h | 3 +- programs/cmm/examples/menu.c | 3 +- programs/cmm/examples/timers.c | 3 +- programs/cmm/lib/gui/tabs.h | 6 +- programs/cmm/misc/install.c | 1 - programs/cmm/taskbar2/taskbar2.c | 1 - programs/emulator/e80/trunk/e80.c | 80 ++++++------- 13 files changed, 117 insertions(+), 104 deletions(-) diff --git a/data/Tupfile.lua b/data/Tupfile.lua index 4e763ec3e9..545bbaf4b6 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -440,9 +440,6 @@ tup.append_table(img_files, { {"3D/RAY", PROGS .. "/demos/ray/ray"}, {"3D/VIEW3DS", PROGS .. "/demos/view3ds/view3ds"}, {"DEMOS/BCDCLK", PROGS .. "/demos/bcdclk/trunk/bcdclk"}, - {"DEMOS/CIRCLE", PROGS .. "/develop/examples/circle/trunk/circle"}, - {"DEMOS/COLORREF", PROGS .. "/demos/colorref/trunk/colorref"}, - {"DEMOS/CSLIDE", PROGS .. "/demos/cslide/trunk/cslide"}, {"DEMOS/EYES", PROGS .. "/demos/eyes/trunk/eyes"}, {"DEMOS/FIREWORK", PROGS .. "/demos/firework/trunk/firework"}, {"DEMOS/MOVBACK", PROGS .. "/demos/movback/trunk/movback"}, @@ -465,7 +462,10 @@ tup.append_table(img_files, { {"DEVELOP/KEYASCII", PROGS .. "/develop/keyascii/trunk/keyascii"}, {"DEVELOP/MTDBG", PROGS .. "/develop/mtdbg/mtdbg"}, {"DEVELOP/SCANCODE", PROGS .. "/develop/scancode/trunk/scancode"}, + {"DEVELOP/EXAMPLES/CIRCLE", PROGS .. "/develop/examples/circle/trunk/circle"}, + {"DEVELOP/EXAMPLES/COLORREF", PROGS .. "/demos/colorref/trunk/colorref"}, {"DEVELOP/EXAMPLES/CONGET", PROGS .. "/develop/libraries/console_coff/examples/test_gets"}, + {"DEVELOP/EXAMPLES/CSLIDE", PROGS .. "/demos/cslide/trunk/cslide"}, {"DEVELOP/EXAMPLES/THREAD", PROGS .. "/develop/examples/thread/trunk/thread"}, {"DEVELOP/EXAMPLES/USE_MB", PROGS .. "/demos/use_mb/use_mb"}, {"File Managers/KFAR", PROGS .. "/fs/kfar/trunk/kfar"}, diff --git a/data/common/settings/system.ini b/data/common/settings/system.ini index 806ada0b64..d34f9a4489 100644 --- a/data/common/settings/system.ini +++ b/data/common/settings/system.ini @@ -17,6 +17,7 @@ PCI=on [screensaver] timeout=10 ;in minutes program=/sys/demos/spiral +available=3d/crownscr;demos/web;demos/zeroline;demos/spiral [style] buttons_gradient=1 diff --git a/data/eng/settings/menu.dat b/data/eng/settings/menu.dat index 6a7f2ead22..bd9bcd3d86 100644 --- a/data/eng/settings/menu.dat +++ b/data/eng/settings/menu.dat @@ -15,9 +15,7 @@ 53 Run |run 04 Shut down |end #1 **** DEMOS -16 Circle |demos/circle 16 Fractal |demos/tinyfrac -16 Color demo |demos/colorref 16 Eyes |demos/eyes 16 Tube |demos/tube 16 Plasma |demos/plasma @@ -50,6 +48,7 @@ 11 Fplay Video * |/kolibrios/media/fplay #5 **** DEV 54 Flat Assembler |develop/fasm +03 Example.asm |example.asm 49 Debugger |develop/mtdbg 13 Debug Board |develop/board 09 KPack Archiver |kpack diff --git a/data/rus/settings/menu.dat b/data/rus/settings/menu.dat index c8a6dc767b..f651cb67f7 100644 --- a/data/rus/settings/menu.dat +++ b/data/rus/settings/menu.dat @@ -15,9 +15,7 @@ 53 Запуск программы |run 04 Завершение работы |end #1 **** 2D Демки -16 Кружок |demos/circle 16 Фрактал Мандельброта |demos/tinyfrac -16 Цвета |demos/colorref 16 Глаза |demos/eyes 16 Труба |demos/tube 16 Plasma |demos/plasma @@ -50,6 +48,7 @@ 11 Видеоплеер Fplay * |/kolibrios/media/fplay #5 **** Разработка 54 Flat Assembler |develop/fasm +03 Example.asm |example.asm 09 Упаковщик KPack |kpack 49 Отладчик |develop/mtdbg 13 Доска отладки |develop/board diff --git a/programs/cmm/app_plus/app_plus.c b/programs/cmm/app_plus/app_plus.c index 9560dc3d4b..aaa8576c61 100644 --- a/programs/cmm/app_plus/app_plus.c +++ b/programs/cmm/app_plus/app_plus.c @@ -1,7 +1,6 @@ #define MEMSIZE 4096*20 #include "..\lib\strings.h" #include "..\lib\mem.h" -#include "..\lib\io.h" #include "..\lib\gui.h" #include "..\lib\obj\proc_lib.h" #include "..\lib\patterns\simple_open_dialog.h" diff --git a/programs/cmm/appearance/appearance.c b/programs/cmm/appearance/appearance.c index 989fabd9ff..38fdea6741 100644 --- a/programs/cmm/appearance/appearance.c +++ b/programs/cmm/appearance/appearance.c @@ -14,6 +14,7 @@ #include "../lib/patterns/select_list.h" #include "../lib/patterns/simple_open_dialog.h" +#include "../lib/patterns/restart_process.h" #include "ui_elements_preview.h" @@ -25,35 +26,39 @@ #ifdef LANG_RUS ?define WINDOW_HEADER "Настройки оформления" - ?define T_SKINS " Стиль окон" - ?define T_WALLPAPERS " Обои" ?define T_SELECT_FOLDER "Выбрать папку" ?define MENU_LIST "Открыть файл |Enter\nУдалить файл |Del" ?define T_PICTURE_MODE " Положение картинки " ?define T_CHECKBOX_STRETCH "Растянуть" ?define T_CHECKBOX_TILED "Замостить" ?define T_UPDATE_DOCK "Обновлять Dock-панель" + char t_skins[] = " Стиль окон"; + char t_wallpapers[] = " Обои"; + char t_screensaver[] = " Скринсейвер"; #else ?define WINDOW_HEADER "Appearance" - ?define T_SKINS " Skins" - ?define T_WALLPAPERS " Wallpapers" ?define T_SELECT_FOLDER "Select folder" ?define MENU_LIST "Open file |Enter\nDelete file |Del" ?define T_PICTURE_MODE " Picture Mode " ?define T_CHECKBOX_STRETCH "Stretch" ?define T_CHECKBOX_TILED "Tiled" ?define T_UPDATE_DOCK "Update Dock" + char t_skins[] = " Skins"; + char t_wallpapers[] = " Wallpapers"; + char t_screensaver[] = " Screensaver"; #endif -#define PANEL_H 40 +#define WIN_W 621 +#define PANEL_H 58 #define LP 10 //LIST_PADDING char skins_folder_path[4096]; char wallp_folder_path[4096]; -signed int active_skin=-1, active_wallpaper=-1; +signed int active_skin=-1, active_wallpaper=-1, active_screensaver=-1; enum { - BASE_TAB_BUTTON_ID=2, - BTN_SELECT_WALLP_FOLDER=10 }; + BASE_TAB_BUTTON_ID=3, + BTN_SELECT_WALLP_FOLDER=10, + BTN_TEST_SCREENSAVER }; char folder_path[4096]; char cur_file_path[4096]; @@ -61,14 +66,17 @@ char cur_skin_path[4096]; char temp_filename[4096]; int files_mas[400]; +_ini ini = { "/sys/settings/system.ini", "style" }; + int cur; proc_info Form; block skp; -enum {SKINS, WALLPAPERS}; +enum {SKINS, WALLPAPERS, SCREENSAVERS}; -_tabs tabs = { LP, LP, NULL, BASE_TAB_BUTTON_ID }; +_tabs tabs = { -sizeof(t_skins)-sizeof(t_wallpapers)-sizeof(t_screensaver)-3*8+WIN_W + - TAB_PADDING / 2, LP, NULL, BASE_TAB_BUTTON_ID }; checkbox update_docky = { T_UPDATE_DOCK, false }; @@ -86,11 +94,11 @@ checkbox optionbox_tiled = { T_CHECKBOX_TILED, false }; void GetRealFolderPathes() { - char real_skin_path[4096]; + char real_kolibrios_path[4096]; SetCurDir("/kolibrios"); - GetCurDir(#real_skin_path, sizeof(real_skin_path)); - sprintf(#skins_folder_path, "%s/res/skins", #real_skin_path); - sprintf(#wallp_folder_path, "%s/res/wallpapers", #real_skin_path); + GetCurDir(#real_kolibrios_path, sizeof(real_kolibrios_path)); + miniprintf(#skins_folder_path, "%s/res/skins", #real_kolibrios_path); + miniprintf(#wallp_folder_path, "%s/res/wallpapers", #real_kolibrios_path); } void main() @@ -105,8 +113,9 @@ void main() o_dialog.type = 2; //select folder OpenDialog_init stdcall (#o_dialog); - tabs.add(T_SKINS, #EventTabSkinsClick); - tabs.add(T_WALLPAPERS, #EventTabWallpappersClick); + tabs.add(#t_skins, #EventTabSkinsClick); + tabs.add(#t_wallpapers, #EventTabWallpappersClick); + tabs.add(#t_screensaver, #EventTabScreensaverClick); tabs.draw_active_tab(); SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER); @@ -145,8 +154,14 @@ void main() GetKeys(); if (select_list.ProcessKey(key_scancode)) EventApply(); if (key_scancode==SCAN_CODE_ENTER) EventOpenFile(); - if (key_scancode==SCAN_CODE_TAB) tabs.click(tabs.active_tab ^ 1); if (key_scancode==SCAN_CODE_DEL) EventDeleteFile(); + if (key_scancode==SCAN_CODE_TAB) { + id = tabs.active_tab+1; + if(id==3)id=0; + tabs.click(id + tabs.base_id); + draw_window(); + break; + } if (! edit_cmm.flags & ed_focus) && (! edit_st.flags & ed_focus) for (id=select_list.cur_y+1; idI = buffer[ 0]; -regs->HLs.B.l = buffer[ 1]; -regs->HLs.B.h = buffer[ 2]; -regs->DEs.B.l = buffer[ 3]; -regs->DEs.B.h = buffer[ 4]; -regs->BCs.B.l = buffer[ 5]; -regs->BCs.B.h = buffer[ 6]; -regs->AFs.B.l = buffer[ 7]; -regs->AFs.B.h = buffer[ 8]; -regs->HL.B.l = buffer[ 9]; -regs->HL.B.h = buffer[10]; -regs->DE.B.l = buffer[11]; -regs->DE.B.h = buffer[12]; -regs->BC.B.l = buffer[13]; -regs->BC.B.h = buffer[14]; -regs->IY.B.l = buffer[15]; -regs->IY.B.h = buffer[16]; -regs->IX.B.l = buffer[17]; -regs->IX.B.h = buffer[18]; -regs->IFF1 = regs->IFF2 = (buffer[19]&0x04) >>2; -regs->R.W = buffer[20]; -regs->AF.B.l = buffer[21]; -regs->AF.B.h = buffer[22]; -regs->SP.B.l =buffer[23]; -regs->SP.B.h =buffer[24]; -regs->IM = buffer[25]; +regs->I = buffer[ 0]; +regs->HLs.B.l = buffer[ 1]; +regs->HLs.B.h = buffer[ 2]; +regs->DEs.B.l = buffer[ 3]; +regs->DEs.B.h = buffer[ 4]; +regs->BCs.B.l = buffer[ 5]; +regs->BCs.B.h = buffer[ 6]; +regs->AFs.B.l = buffer[ 7]; +regs->AFs.B.h = buffer[ 8]; +regs->HL.B.l = buffer[ 9]; +regs->HL.B.h = buffer[10]; +regs->DE.B.l = buffer[11]; +regs->DE.B.h = buffer[12]; +regs->BC.B.l = buffer[13]; +regs->BC.B.h = buffer[14]; +regs->IY.B.l = buffer[15]; +regs->IY.B.h = buffer[16]; +regs->IX.B.l = buffer[17]; +regs->IX.B.h = buffer[18]; +regs->IFF1 = regs->IFF2 = (buffer[19]&0x04) >>2; +regs->R.W = buffer[20]; +regs->AF.B.l = buffer[21]; +regs->AF.B.h = buffer[22]; +regs->SP.B.l =buffer[23]; +regs->SP.B.h =buffer[24]; +regs->IM = buffer[25]; regs->BorderColor = buffer[26]; file.p00 = 0; @@ -276,9 +276,9 @@ file.p21 = filename; kol_file_70(&file); -regs->PC.B.l = Z80MemRead(regs->SP.W, regs); -regs->SP.W++; -regs->PC.B.h = Z80MemRead(regs->SP.W, regs); +regs->PC.B.l = Z80MemRead(regs->SP.W, regs); +regs->SP.W++; +regs->PC.B.h = Z80MemRead(regs->SP.W, regs); regs->SP.W++; } @@ -316,10 +316,10 @@ buffer[20] = regs->R.W & 0xFF; buffer[21] = regs->AF.B.l; buffer[22] = regs->AF.B.h; -sptmpl = Z80MemRead( regs->SP.W-1, regs ); +sptmpl = Z80MemRead( regs->SP.W-1, regs ); sptmph = Z80MemRead( regs->SP.W-2, regs ); -Z80MemWrite( --(regs->SP.W), regs->PC.B.h, regs); +Z80MemWrite( --(regs->SP.W), regs->PC.B.h, regs); Z80MemWrite( --(regs->SP.W), regs->PC.B.l, regs); buffer[23] = regs->SP.B.l; @@ -347,9 +347,9 @@ file.p21 = filename; kol_file_70(&file); -regs->SP.W += 2; -Z80MemWrite( regs->SP.W-1, sptmpl, regs ); -Z80MemWrite( regs->SP.W-2, sptmph, regs ); +regs->SP.W += 2; +Z80MemWrite( regs->SP.W-1, sptmpl, regs ); +Z80MemWrite( regs->SP.W-2, sptmph, regs ); } @@ -379,7 +379,7 @@ kol_file_70(&file); void wnd_draw() { kol_paint_start(); -kol_wnd_define( (screen_w-540)/2, (screen_h-440)/2, 540, 440, 0x34b0b0b0, 0x34b0b0b0, WND_CAPTION); +kol_wnd_define( (screen_w-540)/2, (screen_h-440)/2, 540, 440, 0x74b0b0b0, 0x74b0b0b0, WND_CAPTION); screen_print(&spectrumZ80); kol_paint_image((540 - screen_a_w)/2-5, (440 - screen_a_h-kol_skin_height())/2, @@ -414,9 +414,9 @@ spectrumZ80.RAM = (char*) malloc(64*1024); memcpy(spectrumZ80.RAM, BIOS48, 16*1024); Z80Reset( &spectrumZ80, 69888 ); -Z80FlagTables(); - -fila[1][1] = fila[1][2] = fila[2][2] = fila[3][2] = fila[4][2] = +Z80FlagTables(); + +fila[1][1] = fila[1][2] = fila[2][2] = fila[3][2] = fila[4][2] = fila[4][1] = fila[3][1] = fila[2][1] = 0xFF; debug = 0;