diff --git a/data/Tupfile.lua b/data/Tupfile.lua index 4be8d67e6..10b67c9bc 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -694,7 +694,6 @@ tup.append_table(extra_files, { {"kolibrios/utils/notes", VAR_PROGS .. "/cmm/notes/notes.com"}, {"kolibrios/utils/osupdate", VAR_PROGS .. "/cmm/misc/osupdate.com"}, {"kolibrios/utils/quark", VAR_PROGS .. "/cmm/quark/quark.com"}, - {"kolibrios/utils/kf_view", VAR_PROGS .. "/cmm/kf_font_viewer/font_viewer.com"}, }) end -- tup.getconfig('NO_CMM') ~= 'full' diff --git a/data/common/settings/assoc.ini b/data/common/settings/assoc.ini index 9308faeb9..ba2bab92f 100644 --- a/data/common/settings/assoc.ini +++ b/data/common/settings/assoc.ini @@ -79,7 +79,7 @@ next=$TextEditor [Assoc] /=/sys/file managers/eolite -kf=/kolibrios/utils/kf_view +kf=/sys/syspanel txt=$CodeEdit log=$CodeEdit diff --git a/programs/cmm/kf_font_viewer/Tupfile.lua b/programs/cmm/kf_font_viewer/Tupfile.lua deleted file mode 100644 index c502e2ec9..000000000 --- a/programs/cmm/kf_font_viewer/Tupfile.lua +++ /dev/null @@ -1,6 +0,0 @@ -if tup.getconfig("NO_CMM") ~= "" then return end -if tup.getconfig("LANG") == "ru_RU" -then C_LANG = "LANG_RUS" -else C_LANG = "LANG_ENG" -- this includes default case without config -end -tup.rule("font_viewer.c", "c-- /D=$(C_LANG) /OPATH=%o %f" .. tup.getconfig("KPACK_CMD"), "font_viewer.com") diff --git a/programs/cmm/kf_font_viewer/compile_en.bat b/programs/cmm/kf_font_viewer/compile_en.bat deleted file mode 100644 index 35b62b997..000000000 --- a/programs/cmm/kf_font_viewer/compile_en.bat +++ /dev/null @@ -1,4 +0,0 @@ -@del kf_view -@C-- font_viewer.c -@rename font_viewer.com kf_view -if not exist kf_view ( @pause ) \ No newline at end of file diff --git a/programs/cmm/kf_font_viewer/font/Tahoma.kf b/programs/cmm/kf_font_viewer/font/Tahoma.kf deleted file mode 100644 index 84c155192..000000000 Binary files a/programs/cmm/kf_font_viewer/font/Tahoma.kf and /dev/null differ diff --git a/programs/cmm/kf_font_viewer/font/Verdana.kf b/programs/cmm/kf_font_viewer/font/Verdana.kf deleted file mode 100644 index 83f3f6a10..000000000 Binary files a/programs/cmm/kf_font_viewer/font/Verdana.kf and /dev/null differ diff --git a/programs/cmm/kf_font_viewer/font_viewer.c b/programs/cmm/misc/font_viewer.h similarity index 89% rename from programs/cmm/kf_font_viewer/font_viewer.c rename to programs/cmm/misc/font_viewer.h index fcd9076e7..aeda49ff4 100644 --- a/programs/cmm/kf_font_viewer/font_viewer.c +++ b/programs/cmm/misc/font_viewer.h @@ -1,8 +1,4 @@ -#define MEMSIZE 1024*30 -#define ENTRY_POINT #main -#include "../lib/kfont.h" -#include "../lib/gui.h" #define BARH 28 #define WINW 528 @@ -12,11 +8,8 @@ char active_tab = 0; char colored = true; dword checkbox_flag; -void main() +void main_kfont() { - proc_info Form; - - mem_init(); checkbox_flag = memopen("CHECKBOX", NULL, SHM_READ); if (!param) strcpy(#param, DEFAULT_FONT); @@ -48,7 +41,7 @@ void main() case evReDraw: sc.get(); - DefineAndDrawWindow(215,100,WINW+9,WINH+GetSkinHeight()+4,0x74,0xFFFFFF,#title,0); + DefineAndDrawWindow(215,100,WINW+9,WINH+skin_h+4,0x74,0xFFFFFF,#title,0); GetProcessInfo(#Form, SelfInfo); if (Form.status_window&ROLLED_UP) break; _DRAW_WINDOW_CONTENT: diff --git a/programs/cmm/misc/software_widget.c b/programs/cmm/misc/software_widget.c index 7b3a612a7..6db15a234 100644 --- a/programs/cmm/misc/software_widget.c +++ b/programs/cmm/misc/software_widget.c @@ -10,11 +10,13 @@ SOFTWARE CENTER v2.87 #include "..\lib\obj\libini.h" #include "..\lib\kfont.h" #include "..\lib\list_box.h" -#include "..\lib\collection.h" proc_info Form; + +#include "font_viewer.h" + llist list; -collection app_path_collection=0; +dword app_path_collection; bool kolibrios_mounted; int window_width, @@ -30,17 +32,11 @@ char window_title[128], bool small_screen = false; -struct SW_COLORS - { - dword list_bg; - dword text; - dword graph; - dword dark; - dword light; - } swc; - block selection[128]; +#define MAX_ITEMS 75 +#define MAX_FPATH 1024 + void load_ini_config(dword _ini_path) { _ini ini; @@ -57,17 +53,21 @@ void main() { dword id; kfont.init(DEFAULT_FONT); - load_dll(libini, #lib_init,1); - kolibrios_mounted = dir_exists("/kolibrios"); - - if (param) { + if (streq(#param + strlen(#param) - 3, ".kf")) { + main_kfont(); + } else if (param) { strcpy(#settings_ini_path, #param); } else { strcpy(#settings_ini_path, "/sys/settings/"); strcat(#settings_ini_path, I_Path + strrchr(I_Path, '/')); strcat(#settings_ini_path, ".ini"); } + + load_dll(libini, #lib_init,1); + kolibrios_mounted = dir_exists("/kolibrios"); + + app_path_collection = malloc(MAX_FPATH*MAX_ITEMS); load_ini_config(#settings_ini_path); list.cur_y = -1; @@ -99,8 +99,8 @@ void main() break; case evReDraw: - SetAppColors(); DefineAndDrawWindow(screen.w-window_width/2,screen.h-window_height/2,window_width,window_height,0x74,0,"",0); + sc.get(); GetProcessInfo(#Form, SelfInfo); if (Form.status_window&ROLLED_UP) { DrawTitle(#window_title); @@ -110,41 +110,18 @@ void main() DrawTitle(#window_title); list.y = 0; } else { - DrawTitle(NULL); + DrawTitle(NULL); 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); + DrawBar(0, row +1 * list.item_h + list_pos, Form.cwidth, -row - 1 * list.item_h - list_pos + Form.cheight, sc.light); DrawSelection(); } } -void SetAppColors() -{ - dword bg_col, old_list_bg_color; - sc.get(); - old_list_bg_color = swc.list_bg; - bg_col = sc.work; - if (skin_is_dark()) - { - //dark colors - swc.list_bg = sc.work; - swc.text = sc.work_text; - swc.dark = sc.dark; - swc.light = sc.light; - } else { - //light colors - swc.list_bg = 0xF3F3F3; - swc.text = 0x000000; - swc.dark = 0xDCDCDC; - swc.light = 0xFCFCFC; - } -} - void DrawList() { list.count = 0; row = -1; - app_path_collection.drop(); list_pos = list.y; list.column_max = window_width - 10 / list.item_w; ini_enum_sections stdcall (#settings_ini_path, #process_sections); @@ -168,7 +145,7 @@ byte draw_icons_from_section(dword key_value, key_name, sec_name, f_name) col=0; } - if (col==0) DrawBar(0, row * list.item_h + list_pos, Form.cwidth, list.item_h, swc.list_bg); + if (col==0) DrawBar(0, row * list.item_h + list_pos, Form.cwidth, list.item_h, sc.light); 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, ','); @@ -177,20 +154,21 @@ byte draw_icons_from_section(dword key_value, key_name, sec_name, f_name) 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); + + strncpy(list.count * MAX_FPATH + app_path_collection, key_value, MAX_FPATH); text_x = col*list.item_w+5; text_y = list.item_h - 40 / 2; if (!strchr(key_name, ' ')) {//|| (kfont.getsize(key_name)+30