diff --git a/data/Tupfile.lua b/data/Tupfile.lua index 16c56b7198..bc68e75e5a 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -68,50 +68,54 @@ img_files = { {"SETTINGS/LANG.INI", build_type .. "/settings/lang.ini"}, {"SETTINGS/MENU.DAT", build_type .. "/settings/menu.dat"}, {"SETTINGS/NETWORK.INI", "common/settings/network.ini"}, - {"SETTINGS/SYSPANEL.INI", "common/settings/syspanel.ini"}, {"SETTINGS/SYSTEM.INI", "common/settings/system.ini"}, {"SETTINGS/TASKBAR.INI", "common/settings/taskbar.ini"}, } -- For russian build, add russian-only files. if build_type == "rus" then tup.append_table(img_files, { + {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/rus/example.asm"}, + {"PIPETKA", build_type .. "/pipetka"}, + {"GAMES/BASEKURS.KLA", build_type .. "/games/basekurs.kla"}, + {"GAMES/PADENIE", build_type .. "/games/padenie"}, + {"File Managers/KFAR.INI", build_type .. "/File Managers/kfar.ini"}, {"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/russian/dos_kolibri/kfm_keys.txt"}, {"SETTINGS/.shell", PROGS .. "/system/shell/bin/rus/.shell"}, {"SETTINGS/GAMES.INI", "rus/settings/games.ini"}, {"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"}, - {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/rus/example.asm"}, - {"PIPETKA", build_type .. "/pipetka"}, - {"File Managers/KFAR.INI", build_type .. "/File Managers/kfar.ini"}, - {"GAMES/BASEKURS.KLA", build_type .. "/games/basekurs.kla"}, - {"GAMES/PADENIE", build_type .. "/games/padenie"}, + {"SETTINGS/SYSPANEL.INI", "rus/settings/syspanel.ini"}, }) elseif build_type == "eng" then tup.append_table(img_files, { - {"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"}, - {"SETTINGS/GAMES.INI", "common/settings/games.ini"}, - {"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"}, {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"}, - {"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"}, {"File Managers/KFAR.INI", "common/File Managers/kfar.ini"}, + {"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"}, + {"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"}, + {"SETTINGS/GAMES.INI", "common/settings/games.ini"}, + {"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"}, + {"SETTINGS/SYSPANEL.INI", "common/settings/syspanel.ini"}, }) elseif build_type == "sp" then tup.append_table(img_files, { - {"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"}, - {"SETTINGS/GAMES.INI", "common/settings/games.ini"}, - {"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"}, {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"}, - {"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"}, {"File Managers/KFAR.INI", "common/File Managers/kfar.ini"}, -}) elseif build_type == "it" then tup.append_table(img_files, { {"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"}, - {"SETTINGS/GAMES.INI", "common/settings/games.ini"}, {"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"}, - {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"}, - {"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey_it.ini"}, - {"File Managers/KFAR.INI", "common/File Managers/kfar.ini"}, -}) else tup.append_table(img_files, { - {"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"}, {"SETTINGS/GAMES.INI", "common/settings/games.ini"}, - {"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"}, - {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"}, {"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"}, + {"SETTINGS/SYSPANEL.INI", "common/settings/syspanel.ini"}, +}) elseif build_type == "it" then tup.append_table(img_files, { + {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"}, {"File Managers/KFAR.INI", "common/File Managers/kfar.ini"}, + {"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"}, + {"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"}, + {"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey_it.ini"}, + {"SETTINGS/GAMES.INI", "common/settings/games.ini"}, + {"SETTINGS/SYSPANEL.INI", "common/settings/syspanel.ini"}, +}) else tup.append_table(img_files, { + {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"}, + {"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"}, + {"File Managers/KFAR.INI", "common/File Managers/kfar.ini"}, + {"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"}, + {"SETTINGS/GAMES.INI", "common/settings/games.ini"}, + {"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"}, + {"SETTINGS/SYSPANEL.INI", "common/settings/syspanel.ini"}, }) end --[[ diff --git a/data/common/icons32.png b/data/common/icons32.png index bd90a6f581..8597480a51 100644 Binary files a/data/common/icons32.png and b/data/common/icons32.png differ diff --git a/data/rus/settings/syspanel.ini b/data/rus/settings/syspanel.ini new file mode 100644 index 0000000000..47dec2b6d9 --- /dev/null +++ b/data/rus/settings/syspanel.ini @@ -0,0 +1,40 @@ +[Config] +title=Системная панель KolibriOS +win_width=700 +cell_w=84 +cell_h=84 + +[Конфигурация] +Виртуальные диски=tmpdisk,36 +Разрешение экрана=vmode,108 +Сетевые устройства=network/netcfg,71 +Системные настройки=setup,5 +Дата и время=calendar,52 +Генератор фона=media/palitra,61 +Оформление=/k/utils/appearance,62 +Окна=skincfg,80 +Громкость=@VOLUME,64 +Панели=barscfg,63 +Мышь=mousecfg,54 +Установка драйверов=/k/drivers/DRVINST.KEX,38 +Автозагрузка=tinypad|/sys/settings/autorun.dat,55 +HotAngles=HACONFIG,105 +Питание=apm,76 + +[Мониторинг] +Доска отладки=develop/board,19 +Статус сети=network/netstat,33 +Ghost monitor=gmon,107 +Системный монитор=sysmon,57 +Процессы=cpu,60 +Буфер обмена=develop/clipview,83 + +[Тестирование] +Тест защиты=test,37 +CpuId=cpuid,37 +Экран=disptest,113 +Скорость ФС=fspeed,45 +Информация о дисках=hdd_info,50 +Шина=kbd,37 +Скорость графики=mgb,121 +Устройства PCI=pcidev,38 \ No newline at end of file diff --git a/programs/cmm/lib/kfont.h b/programs/cmm/lib/kfont.h index a9724c6259..503c84031b 100644 --- a/programs/cmm/lib/kfont.h +++ b/programs/cmm/lib/kfont.h @@ -103,12 +103,12 @@ int kfont_char_width[255]; return true; } -:dword KFONT::getsize(byte fontSizePoints, dword text1) +:dword KFONT::getsize(byte font_size, dword text1) { size.height = size.width = 0; size.offset_x = size.offset_y = -1; - if (size.pt != fontSizePoints) { - size.pt = fontSizePoints; + if (size.pt != font_size) { + size.pt = font_size; if(!changeSIZE())return 0; } WHILE(DSBYTE[text1]) @@ -123,7 +123,7 @@ int kfont_char_width[255]; return size.width; } -//WILL NOT WORK if requested fontSizePoints +//WILL NOT WORK if requested font_size //is differ from precalculated kfont_char_width[] :int KFONT::get_label_width(dword _label) { @@ -242,13 +242,13 @@ inline fastcall dword b32(EAX) { return DSDWORD[EAX]; } } } -:void KFONT::WriteIntoBuffer(int x,y,w,h; dword _background, _color; byte fontSizePoints; dword text1) +:void KFONT::WriteIntoBuffer(int x,y,w,h; dword _background, _color; byte font_size; dword text1) { dword new_raw_size; if(!text1)return; - if (size.pt != fontSizePoints) { - getsize(fontSizePoints, text1); + if (size.pt != font_size) { + getsize(font_size, text1); y -= size.offset_y; } color = _color; @@ -277,22 +277,22 @@ inline fastcall dword b32(EAX) { return DSDWORD[EAX]; } return; } -:int KFONT::WriteIntoWindow(int x,y; dword _background, _color; byte fontSizePoints; dword text1) +:int KFONT::WriteIntoWindow(int x,y; dword _background, _color; byte font_size; dword text1) { if(!text1)return 0; - getsize(fontSizePoints, text1); + getsize(font_size, text1); raw_size = NULL; WriteIntoBuffer(0, -size.offset_y, size.width-size.offset_x, - size.height-size.offset_y, _background, _color, fontSizePoints, text1); + size.height-size.offset_y, _background, _color, font_size, text1); if (smooth) ApplySmooth(); ShowBuffer(x,y); return size.offset_x + size.width; } -:int KFONT::WriteIntoWindowCenter(dword x,y,w,h; dword _background, _color; byte fontSizePoints; dword text1) +:int KFONT::WriteIntoWindowCenter(dword x, _y,w,h, _background, _color; byte font_size; dword text1) { - getsize(fontSizePoints, text1); - return WriteIntoWindow(w-size.width/2+x-1,y, _background, _color, fontSizePoints, text1); + getsize(font_size, text1); + return WriteIntoWindow(w-size.width/2+x-1, _y, _background, _color, font_size, text1); } :void KFONT::ShowBuffer(dword _x, _y) diff --git a/programs/cmm/software_widget/software_widget.c b/programs/cmm/software_widget/software_widget.c index e5bf5c388a..0318b51a7f 100644 --- a/programs/cmm/software_widget/software_widget.c +++ b/programs/cmm/software_widget/software_widget.c @@ -18,7 +18,7 @@ SOFTWARE CENTER v2.86 proc_info Form; llist list; collection app_path_collection; -byte kolibrios_mounted; +bool kolibrios_mounted; int window_width, window_height; @@ -29,7 +29,7 @@ int list_pos, default_icon; char window_title[128], - settings_ini_path[256] = "/sys/settings/"; + settings_ini_path[256]; bool small_screen = false; @@ -42,22 +42,20 @@ struct SW_COLORS dword light; } swc; -block ipos[128]; +block selection[128]; -void load_config() +void load_ini_config(dword _ini_path) { - ini_get_str stdcall (#settings_ini_path, "Config", "title", #window_title, sizeof(window_title), "Software widget"); - ini_get_int stdcall (#settings_ini_path, "Config", "win_width", 690); - window_width = EAX; - ini_get_int stdcall (#settings_ini_path, "Config", "cell_w", 73); - list.item_w = EAX; - ini_get_int stdcall (#settings_ini_path, "Config", "cell_h", 71); - list.item_h = EAX; - ini_get_int stdcall (#settings_ini_path, "Config", "default_icon", 2); - default_icon = EAX; + _ini ini; + ini.path = _ini_path; + ini.section = "Config"; + ini.GetString("title", #window_title, sizeof(window_title), "Software widget"); + window_width = ini.GetInt("win_width", 690); + list.item_w = ini.GetInt("cell_w", 73); + list.item_h = ini.GetInt("cell_h", 71); + default_icon = ini.GetInt("default_icon", 2); } - void main() { dword id; @@ -68,17 +66,15 @@ void main() kolibrios_mounted = dir_exists("/kolibrios"); - if (param) - { + if (param) { strcpy(#settings_ini_path, #param); - } - else - { + } else { + strcpy(#settings_ini_path, "/sys/settings/"); strcat(#settings_ini_path, I_Path + strrchr(I_Path, '/')); strcat(#settings_ini_path, ".ini"); } - load_config(); + load_ini_config(#settings_ini_path); list.cur_y = -1; list.y = 32; @@ -98,13 +94,13 @@ void main() if (SCAN_CODE_LEFT == key_scancode) key_scancode = SCAN_CODE_UP; if (SCAN_CODE_RIGHT == key_scancode) key_scancode = SCAN_CODE_DOWN; if (list.ProcessKey(key_scancode)) DrawSelection(); - if (SCAN_CODE_ENTER == key_scancode) EventRunApp(list.cur_y); + if (SCAN_CODE_ENTER == key_scancode) EventIconClick(list.cur_y); break; case evButton: id=GetButtonID(); if (id==1) ExitProcess(); - if (id>=100) EventRunApp(id-100); + if (id>=100) EventIconClick(id-100); break; case evReDraw: @@ -120,7 +116,7 @@ void main() list.y = 0; } else { DrawTitle(NULL); - draw_top_bar(); + DrawTopBar(); } DrawList(); DrawBar(0, row +1 * list.item_h + list_pos, Form.cwidth, -row - 1 * list.item_h - list_pos + Form.cheight, swc.list_bg); @@ -169,10 +165,11 @@ void DrawList() { byte draw_icons_from_section(dword key_value, key_name, sec_name, f_name) { - int tmp, - icon_id, + int icon_id = default_icon, icon_char_pos; - int text_w; + int space_pos; + + dword icon_x, icon_y, text_x, text_y; //do not show items located in /kolibrios/ if this directory not mounted if (!strncmp(key_value, "/kolibrios/", 11)) || (!strncmp(key_value, "/k/", 3)) @@ -184,19 +181,28 @@ byte draw_icons_from_section(dword key_value, key_name, sec_name, f_name) } if (col==0) DrawBar(0, row * list.item_h + list_pos, Form.cwidth, list.item_h, swc.list_bg); - DefineButton(col*list.item_w+6, row*list.item_h + list_pos,list.item_w,list.item_h-5,list.count + 100 + BT_HIDE,0); - tmp = list.item_w/2; + DefineButton(col*list.item_w+6, row*list.item_h + list_pos,list.item_w,list.item_h-3,list.count + 100 + BT_HIDE,0); icon_char_pos = strchr(key_value, ','); - if (icon_char_pos) icon_id = atoi(icon_char_pos+1); else icon_id = default_icon; - img_draw stdcall(skin.image, col*list.item_w+tmp-10, row*list.item_h+5 + list_pos, 32, 32, 0, icon_id*32); + icon_x = col*list.item_w+calc(list.item_w/2)-10; + icon_y = row*list.item_h+5 + list_pos; + selection[list.count].x = icon_x-2; + selection[list.count].y = icon_y-2; if (icon_char_pos) ESBYTE[icon_char_pos] = '\0'; //delete icon from string app_path_collection.add(key_value); - //kfont.WriteIntoWindowCenter(col*list.item_w+7,row*list.item_h+47 + list_pos, list.item_w,0, swc.list_bg, swc.dark, 12, key_name); - text_w = kfont.WriteIntoWindowCenter(col*list.item_w+5,row*list.item_h+46 + list_pos, list.item_w,0, swc.list_bg, swc.text, 12, key_name); - ipos[list.count].x = list.item_w-text_w/2+calc(col*list.item_w)+5; - ipos[list.count].y = row*list.item_h+46 + list_pos + 16; - ipos[list.count].w = text_w; + + text_x = col*list.item_w+5; + text_y = list.item_h - 40 / 2; + if (kfont.getsize(key_name)+30