Compare commits
2 Commits
81b15607dc
...
1a1d333a4a
Author | SHA1 | Date | |
---|---|---|---|
1a1d333a4a | |||
6510440a68 |
@@ -694,7 +694,6 @@ tup.append_table(extra_files, {
|
|||||||
{"kolibrios/utils/notes", VAR_PROGS .. "/cmm/notes/notes.com"},
|
{"kolibrios/utils/notes", VAR_PROGS .. "/cmm/notes/notes.com"},
|
||||||
{"kolibrios/utils/osupdate", VAR_PROGS .. "/cmm/misc/osupdate.com"},
|
{"kolibrios/utils/osupdate", VAR_PROGS .. "/cmm/misc/osupdate.com"},
|
||||||
{"kolibrios/utils/quark", VAR_PROGS .. "/cmm/quark/quark.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'
|
end -- tup.getconfig('NO_CMM') ~= 'full'
|
||||||
|
|
||||||
|
@@ -79,7 +79,7 @@ next=$TextEditor
|
|||||||
[Assoc]
|
[Assoc]
|
||||||
/=/sys/file managers/eolite
|
/=/sys/file managers/eolite
|
||||||
|
|
||||||
kf=/kolibrios/utils/kf_view
|
kf=/sys/syspanel
|
||||||
|
|
||||||
txt=$CodeEdit
|
txt=$CodeEdit
|
||||||
log=$CodeEdit
|
log=$CodeEdit
|
||||||
|
@@ -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")
|
|
@@ -1,4 +0,0 @@
|
|||||||
@del kf_view
|
|
||||||
@C-- font_viewer.c
|
|
||||||
@rename font_viewer.com kf_view
|
|
||||||
if not exist kf_view ( @pause )
|
|
Binary file not shown.
Binary file not shown.
@@ -1,8 +1,4 @@
|
|||||||
#define MEMSIZE 1024*30
|
|
||||||
#define ENTRY_POINT #main
|
|
||||||
|
|
||||||
#include "../lib/kfont.h"
|
|
||||||
#include "../lib/gui.h"
|
|
||||||
|
|
||||||
#define BARH 28
|
#define BARH 28
|
||||||
#define WINW 528
|
#define WINW 528
|
||||||
@@ -12,11 +8,8 @@ char active_tab = 0;
|
|||||||
char colored = true;
|
char colored = true;
|
||||||
dword checkbox_flag;
|
dword checkbox_flag;
|
||||||
|
|
||||||
void main()
|
void main_kfont()
|
||||||
{
|
{
|
||||||
proc_info Form;
|
|
||||||
|
|
||||||
mem_init();
|
|
||||||
checkbox_flag = memopen("CHECKBOX", NULL, SHM_READ);
|
checkbox_flag = memopen("CHECKBOX", NULL, SHM_READ);
|
||||||
|
|
||||||
if (!param) strcpy(#param, DEFAULT_FONT);
|
if (!param) strcpy(#param, DEFAULT_FONT);
|
||||||
@@ -48,7 +41,7 @@ void main()
|
|||||||
|
|
||||||
case evReDraw:
|
case evReDraw:
|
||||||
sc.get();
|
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);
|
GetProcessInfo(#Form, SelfInfo);
|
||||||
if (Form.status_window&ROLLED_UP) break;
|
if (Form.status_window&ROLLED_UP) break;
|
||||||
_DRAW_WINDOW_CONTENT:
|
_DRAW_WINDOW_CONTENT:
|
@@ -10,11 +10,13 @@ SOFTWARE CENTER v2.87
|
|||||||
#include "..\lib\obj\libini.h"
|
#include "..\lib\obj\libini.h"
|
||||||
#include "..\lib\kfont.h"
|
#include "..\lib\kfont.h"
|
||||||
#include "..\lib\list_box.h"
|
#include "..\lib\list_box.h"
|
||||||
#include "..\lib\collection.h"
|
|
||||||
|
|
||||||
proc_info Form;
|
proc_info Form;
|
||||||
|
|
||||||
|
#include "font_viewer.h"
|
||||||
|
|
||||||
llist list;
|
llist list;
|
||||||
collection app_path_collection=0;
|
dword app_path_collection;
|
||||||
bool kolibrios_mounted;
|
bool kolibrios_mounted;
|
||||||
|
|
||||||
int window_width,
|
int window_width,
|
||||||
@@ -30,17 +32,11 @@ char window_title[128],
|
|||||||
|
|
||||||
bool small_screen = false;
|
bool small_screen = false;
|
||||||
|
|
||||||
struct SW_COLORS
|
|
||||||
{
|
|
||||||
dword list_bg;
|
|
||||||
dword text;
|
|
||||||
dword graph;
|
|
||||||
dword dark;
|
|
||||||
dword light;
|
|
||||||
} swc;
|
|
||||||
|
|
||||||
block selection[128];
|
block selection[128];
|
||||||
|
|
||||||
|
#define MAX_ITEMS 75
|
||||||
|
#define MAX_FPATH 1024
|
||||||
|
|
||||||
void load_ini_config(dword _ini_path)
|
void load_ini_config(dword _ini_path)
|
||||||
{
|
{
|
||||||
_ini ini;
|
_ini ini;
|
||||||
@@ -57,17 +53,21 @@ void main()
|
|||||||
{
|
{
|
||||||
dword id;
|
dword id;
|
||||||
kfont.init(DEFAULT_FONT);
|
kfont.init(DEFAULT_FONT);
|
||||||
load_dll(libini, #lib_init,1);
|
|
||||||
|
|
||||||
kolibrios_mounted = dir_exists("/kolibrios");
|
if (streq(#param + strlen(#param) - 3, ".kf")) {
|
||||||
|
main_kfont();
|
||||||
if (param) {
|
} else if (param) {
|
||||||
strcpy(#settings_ini_path, #param);
|
strcpy(#settings_ini_path, #param);
|
||||||
} else {
|
} else {
|
||||||
strcpy(#settings_ini_path, "/sys/settings/");
|
strcpy(#settings_ini_path, "/sys/settings/");
|
||||||
strcat(#settings_ini_path, I_Path + strrchr(I_Path, '/'));
|
strcat(#settings_ini_path, I_Path + strrchr(I_Path, '/'));
|
||||||
strcat(#settings_ini_path, ".ini");
|
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);
|
load_ini_config(#settings_ini_path);
|
||||||
list.cur_y = -1;
|
list.cur_y = -1;
|
||||||
@@ -99,8 +99,8 @@ void main()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case evReDraw:
|
case evReDraw:
|
||||||
SetAppColors();
|
|
||||||
DefineAndDrawWindow(screen.w-window_width/2,screen.h-window_height/2,window_width,window_height,0x74,0,"",0);
|
DefineAndDrawWindow(screen.w-window_width/2,screen.h-window_height/2,window_width,window_height,0x74,0,"",0);
|
||||||
|
sc.get();
|
||||||
GetProcessInfo(#Form, SelfInfo);
|
GetProcessInfo(#Form, SelfInfo);
|
||||||
if (Form.status_window&ROLLED_UP) {
|
if (Form.status_window&ROLLED_UP) {
|
||||||
DrawTitle(#window_title);
|
DrawTitle(#window_title);
|
||||||
@@ -110,41 +110,18 @@ void main()
|
|||||||
DrawTitle(#window_title);
|
DrawTitle(#window_title);
|
||||||
list.y = 0;
|
list.y = 0;
|
||||||
} else {
|
} else {
|
||||||
DrawTitle(NULL);
|
DrawTitle(NULL);
|
||||||
DrawTopBar();
|
DrawTopBar();
|
||||||
}
|
}
|
||||||
DrawList();
|
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();
|
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() {
|
void DrawList() {
|
||||||
list.count = 0;
|
list.count = 0;
|
||||||
row = -1;
|
row = -1;
|
||||||
app_path_collection.drop();
|
|
||||||
list_pos = list.y;
|
list_pos = list.y;
|
||||||
list.column_max = window_width - 10 / list.item_w;
|
list.column_max = window_width - 10 / list.item_w;
|
||||||
ini_enum_sections stdcall (#settings_ini_path, #process_sections);
|
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;
|
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);
|
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, ',');
|
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].x = icon_x-2;
|
||||||
selection[list.count].y = icon_y-2;
|
selection[list.count].y = icon_y-2;
|
||||||
if (icon_char_pos) ESBYTE[icon_char_pos] = '\0'; //delete icon from string
|
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_x = col*list.item_w+5;
|
||||||
text_y = list.item_h - 40 / 2;
|
text_y = list.item_h - 40 / 2;
|
||||||
if (!strchr(key_name, ' ')) {//|| (kfont.getsize(key_name)+30<list.item_w) <== too slow
|
if (!strchr(key_name, ' ')) {//|| (kfont.getsize(key_name)+30<list.item_w) <== too slow
|
||||||
kfont.WriteIntoWindowCenter(text_x, row*list.item_h+46 + list_pos, list.item_w,0, swc.list_bg, swc.text, 12, key_name);
|
kfont.WriteIntoWindowCenter(text_x, row*list.item_h+46 + list_pos, list.item_w,0, sc.light, sc.work_text, 12, key_name);
|
||||||
} else {
|
} else {
|
||||||
space_pos = strrchr(key_name, ' ');
|
space_pos = strrchr(key_name, ' ');
|
||||||
ESBYTE[key_name+space_pos-1] = '\0';
|
ESBYTE[key_name+space_pos-1] = '\0';
|
||||||
kfont.WriteIntoWindowCenter(text_x, row*list.item_h+46 + list_pos - 2, list.item_w,0, swc.list_bg, swc.text, 12, key_name);
|
kfont.WriteIntoWindowCenter(text_x, row*list.item_h+46 + list_pos - 2, list.item_w,0, sc.light, sc.work_text, 12, key_name);
|
||||||
kfont.WriteIntoWindowCenter(text_x, row*list.item_h+46 + list_pos + 13, list.item_w,0, swc.list_bg, swc.text, 12, key_name+space_pos);
|
kfont.WriteIntoWindowCenter(text_x, row*list.item_h+46 + list_pos + 13, list.item_w,0, sc.light, sc.work_text, 12, key_name+space_pos);
|
||||||
}
|
}
|
||||||
if (icon_char_pos) icon_id = atoi(icon_char_pos+1);
|
if (icon_char_pos) icon_id = atoi(icon_char_pos+1);
|
||||||
if (Form.cwidth) draw_icon_32(icon_x, icon_y, swc.list_bg, icon_id);
|
if (Form.cwidth) draw_icon_32(icon_x, icon_y, sc.light, icon_id);
|
||||||
list.count++;
|
list.count++;
|
||||||
col++;
|
col++;
|
||||||
return true;
|
return true;
|
||||||
@@ -212,10 +190,9 @@ byte process_sections(dword sec_name, f_name)
|
|||||||
old_row = row;
|
old_row = row;
|
||||||
|
|
||||||
if (!small_screen) {
|
if (!small_screen) {
|
||||||
DrawBar(0, row * list.item_h + list_pos, Form.cwidth , 29, swc.list_bg);
|
DrawBar(0, row * list.item_h + list_pos, Form.cwidth , 29, sc.light);
|
||||||
text_len = kfont.WriteIntoWindow(10, row * list.item_h + 10 + list_pos, swc.list_bg, swc.text, 15, sec_name);
|
text_len = kfont.WriteIntoWindow(10, row * list.item_h + 10 + list_pos, sc.light, sc.work_text, 15, sec_name);
|
||||||
DrawBar(text_len+20, row * list.item_h + list_pos + 20, Form.cwidth-text_len-20, 1, swc.dark);
|
DrawBar(text_len+20, row * list.item_h + list_pos + 20, Form.cwidth-text_len-20, 2, sc.work);
|
||||||
DrawBar(text_len+20, row * list.item_h + list_pos + 21, Form.cwidth-text_len-20, 1, swc.light);
|
|
||||||
list_pos += 29;
|
list_pos += 29;
|
||||||
}
|
}
|
||||||
ini_enum_keys stdcall (f_name, sec_name, #draw_icons_from_section);
|
ini_enum_keys stdcall (f_name, sec_name, #draw_icons_from_section);
|
||||||
@@ -233,7 +210,7 @@ void DrawTopBar()
|
|||||||
void EventIconClick(dword appid)
|
void EventIconClick(dword appid)
|
||||||
{
|
{
|
||||||
char run_app_path[4096];
|
char run_app_path[4096];
|
||||||
dword app_path = app_path_collection.get(appid);
|
dword app_path = MAX_FPATH * appid + app_path_collection;
|
||||||
dword param_pos = strchr(app_path, '|');
|
dword param_pos = strchr(app_path, '|');
|
||||||
if (param_pos) {
|
if (param_pos) {
|
||||||
ESBYTE[param_pos] = NULL;
|
ESBYTE[param_pos] = NULL;
|
||||||
@@ -273,7 +250,7 @@ void DrawSelection()
|
|||||||
int i;
|
int i;
|
||||||
dword col;
|
dword col;
|
||||||
for (i=0; i<list.count; i++) {
|
for (i=0; i<list.count; i++) {
|
||||||
if (i==list.cur_y) col=0x0080FF; else col=swc.list_bg;
|
if (i==list.cur_y) col=0x0080FF; else col=sc.light;
|
||||||
DrawWideRectangle(selection[i].x, selection[i].y, 36, 36, 2, col);
|
DrawWideRectangle(selection[i].x, selection[i].y, 36, 36, 2, col);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1675,6 +1675,14 @@ proc generate_window_header
|
|||||||
mov eax, [ebx+Image.Height]
|
mov eax, [ebx+Image.Height]
|
||||||
call bin2dec
|
call bin2dec
|
||||||
|
|
||||||
|
mov eax, [ebx+Image.Type]
|
||||||
|
dec eax
|
||||||
|
shl eax, 2
|
||||||
|
add eax, BppTypeNames
|
||||||
|
mov eax, [eax]
|
||||||
|
mov dword[edi], eax
|
||||||
|
add edi, 4
|
||||||
|
|
||||||
mov byte[edi], ')'
|
mov byte[edi], ')'
|
||||||
inc edi
|
inc edi
|
||||||
|
|
||||||
@@ -2544,6 +2552,21 @@ db 'XBM',0
|
|||||||
.end:
|
.end:
|
||||||
db 0
|
db 0
|
||||||
|
|
||||||
|
BppTypeNames:
|
||||||
|
db '@08b'
|
||||||
|
db '@24b'
|
||||||
|
db '@32b'
|
||||||
|
db '@15b'
|
||||||
|
db '@16b'
|
||||||
|
db '@01b'
|
||||||
|
db '@8gr'
|
||||||
|
db '@02b'
|
||||||
|
db '@04b'
|
||||||
|
db '@08a'
|
||||||
|
|
||||||
|
icons_resname db 'ICONS18W', 0
|
||||||
|
shared_icons_ptr dd ?
|
||||||
|
|
||||||
draw_window_fake:
|
draw_window_fake:
|
||||||
ret
|
ret
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user