Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77be090c57 | ||
|
|
bb85667b09 | ||
|
|
4588b2a7ac | ||
|
|
3e90a90b94 | ||
|
|
7c25bca493 | ||
|
|
275ee51ac4 | ||
|
|
b99f56c493 | ||
|
|
72393db48e | ||
|
|
c391d7ba48 | ||
|
|
8534576857 | ||
|
|
e4a9fc43d2 |
No files matched your search
+15
-14
@@ -1,6 +1,5 @@
|
||||
#define MEMSIZE 1024*60
|
||||
#include "..\lib\strings.h"
|
||||
#include "..\lib\mem.h"
|
||||
|
||||
#include "..\lib\gui.h"
|
||||
#include "..\lib\obj\proc_lib.h"
|
||||
#include "..\lib\patterns\simple_open_dialog.h"
|
||||
@@ -16,7 +15,7 @@
|
||||
#define WINW 570
|
||||
#define WINH 300
|
||||
#define CONX 28 //content X pos
|
||||
#define CONY 25 //content X pos
|
||||
#define CONY 25 //content Y pos
|
||||
|
||||
char default_dir[] = "/sys";
|
||||
od_filter filter2;
|
||||
@@ -37,15 +36,15 @@ od_filter filter2;
|
||||
?define CONTENT_HEADER_TEXT "KolibriOS работает в режиме дискеты"
|
||||
?define DESCRIPTION_TEXT "Многие приложения сейчас недоступны.
|
||||
|
||||
Причина в том, что не смонтирован дополнительный системный
|
||||
каталог. Но вы можете найти и задать его вручную. Его название
|
||||
'kolibrios'. Вы также можете загрузить latest-dirstr.7z через
|
||||
Причина в том, что не смонтирован дополнительный системный
|
||||
каталог. Но вы можете найти и задать его вручную. Его название
|
||||
'kolibrios'. Вы также можете загрузить latest-dirstr.7z через
|
||||
WebView и найти его внутри."
|
||||
?define MANUALLY_BUTTON_TEXT "Указать папку /kolibrios/..."
|
||||
?define OPEN_ANYWAY_BUTTON_TEXT "Запустить APP+ (некоторые программы будут недоступны)"
|
||||
#else
|
||||
?define WINDOW_TITLE_TEXT "Warning!"
|
||||
?define CONTENT_HEADER_TEXT "KolibriOS is in a Floppy-mode now"
|
||||
?define CONTENT_HEADER_TEXT "KolibriOS is running in floppy mode"
|
||||
?define DESCRIPTION_TEXT "A lot of apps aren't available.
|
||||
|
||||
The reason is that additional system directory is not mounted.
|
||||
@@ -53,7 +52,7 @@ But you can find and set it manually. Its name is 'kolibrios'.
|
||||
You can also download latest-dirstr.7z via WebView and find
|
||||
it inside."
|
||||
?define MANUALLY_BUTTON_TEXT "Choose /kolibrios/ folder..."
|
||||
?define OPEN_ANYWAY_BUTTON_TEXT "Open APP+ anyway (some programs won't be available) "
|
||||
?define OPEN_ANYWAY_BUTTON_TEXT "Open APP+ anyway (some programs won't be available)"
|
||||
#endif
|
||||
|
||||
//===================================================//
|
||||
@@ -106,7 +105,7 @@ void draw_window()
|
||||
WriteTextB(CONX+27+2,CONY+2,0x81,MixColors(sc.work, 0xB92234,220),CONTENT_HEADER_TEXT);
|
||||
WriteTextB(CONX+27,CONY,0x81,0xB92234,CONTENT_HEADER_TEXT);
|
||||
WriteTextLines(CONX,CONY+42,0x90,sc.work_text,DESCRIPTION_TEXT,20);
|
||||
DrawButtons();
|
||||
DrawButtons();
|
||||
}
|
||||
|
||||
void DrawButtons()
|
||||
@@ -117,7 +116,7 @@ void DrawButtons()
|
||||
|
||||
void CheckKosMounted()
|
||||
{
|
||||
if (dir_exists("/kolibrios"))
|
||||
if (dir_exists("/kolibrios"))
|
||||
{
|
||||
if (file_exists(APP_PLUS_INI_PATH)) EventOpenApp();
|
||||
ExitProcess();
|
||||
@@ -140,13 +139,13 @@ void EventManualSearch()
|
||||
OpenDialog_start stdcall (#o_dialog);
|
||||
if (o_dialog.status) SetAdditionalSystemDirectory("kolibrios", #openfile_path+1);
|
||||
pause(3);
|
||||
CheckKosMounted();
|
||||
CheckKosMounted();
|
||||
}
|
||||
|
||||
void EventOpenApp()
|
||||
{
|
||||
if (RunProgram("/sys/syspanel", APP_PLUS_INI_PATH) < 0) {
|
||||
notify("'App+ can not be started because\n/sys/syspanel does not exists' -E");
|
||||
notify("'App+ cannot start because\n/sys/syspanel does not exist' -E");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,8 +153,10 @@ void EventButton(dword id)
|
||||
{
|
||||
if (id==CLOSE_BTN) ExitProcess();
|
||||
else if (id==BTN_MANUAL_SEARCH) EventManualSearch();
|
||||
else if (id==BTN_OPEN_ANYWAY) { EventOpenApp(); ExitProcess(); }
|
||||
else if (id==BTN_OPEN_ANYWAY) {
|
||||
EventOpenApp();
|
||||
ExitProcess();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
stop:
|
||||
+4
-2
@@ -89,7 +89,7 @@ checkbox tbMenuButton = { MENU_BUTTON };
|
||||
checkbox dkFsize = { FSIZE };
|
||||
checkbox dkAshow = { ASHOW };
|
||||
|
||||
int dkLocation;
|
||||
int dkLocation=0;
|
||||
checkbox tbRunApplButton;
|
||||
checkbox tbClnDeskButton;
|
||||
|
||||
@@ -174,6 +174,7 @@ void DrawWindowContent()
|
||||
dword frame_y;
|
||||
word win_center_x = Form.cwidth / 2 + 20;
|
||||
incn y;
|
||||
int i;
|
||||
|
||||
SetDisabledMode();
|
||||
|
||||
@@ -198,7 +199,8 @@ void DrawWindowContent()
|
||||
//DOCKY
|
||||
frame_y = calc(y.inc(20));
|
||||
DefineButton(22, y.inc(18), PIMG_W-1, PIMG_H-1, 200 + BT_HIDE, 0);
|
||||
DrawPanelsImage(y.n, dkLocation+1);
|
||||
if (!dkLocation) i=2; else i=dkLocation;
|
||||
DrawPanelsImage(y.n, i+1);
|
||||
WriteTextWithBg(68, y.inc(7), 0xD0, sc.work_text, CHANGE_POS, sc.work);
|
||||
dkFsize.draw(22, y.inc(35));
|
||||
dkAshow.draw(win_center_x, y.n);
|
||||
|
||||
+7
-14
@@ -22,8 +22,9 @@ void TWebBrowser::RenderLine(dword _line)
|
||||
zoom = list.font_w / BASIC_CHAR_W;
|
||||
|
||||
//there is some shit happens!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
if (pw > draw_w + BODY_MARGIN) {
|
||||
//debugln("shit");
|
||||
if (debug_mode) && (pw > draw_w + BODY_MARGIN) {
|
||||
debugln("anomaly");
|
||||
debugln(_line);
|
||||
}
|
||||
|
||||
if (debug_mode) {
|
||||
@@ -80,14 +81,12 @@ void TWebBrowser::RenderTextbuf()
|
||||
//Yes, we do. Lets calculate where...
|
||||
br = len;
|
||||
|
||||
//debugln(" \\n");
|
||||
|
||||
//Is a new line fits in the maximum line width?
|
||||
if (br * list.font_w + draw_x - left_gap >= draw_w) {
|
||||
br = draw_w - draw_x / list.font_w;
|
||||
br = draw_w - draw_x + left_gap - BODY_MARGIN / list.font_w;
|
||||
if (br < 0) br = 0;
|
||||
while(br) {
|
||||
if (ESBYTE[lbp + br]==' ') {
|
||||
if (ESBYTE[lbp + br]==' ') || (ESBYTE[lbp + br]=='-') {
|
||||
if (br < len) br++;
|
||||
break;
|
||||
}
|
||||
@@ -96,15 +95,10 @@ void TWebBrowser::RenderTextbuf()
|
||||
}
|
||||
//Maybe a new line is too big for the whole new line? Then we have to split it
|
||||
if (!br) && (len * list.font_w >= draw_w) {
|
||||
//debugln("bigbr");
|
||||
//debugval("draw_x", draw_x);
|
||||
//debugval("draw_w", draw_w);
|
||||
br = draw_w - draw_x / list.font_w;
|
||||
//debugval("cut into 1", br * list.font_w);
|
||||
br = draw_w - draw_x + left_gap - BODY_MARGIN / list.font_w;
|
||||
if (br < 0) {
|
||||
NewLine();
|
||||
br = draw_w - draw_x / list.font_w;
|
||||
//debugval("cut into 2", br * list.font_w);
|
||||
br = draw_w - draw_x + left_gap - BODY_MARGIN / list.font_w;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +111,6 @@ void TWebBrowser::RenderTextbuf()
|
||||
if (ESBYTE[lbp]) NewLine();
|
||||
} else {
|
||||
NewLine();
|
||||
RenderLine(lbp);
|
||||
}
|
||||
}
|
||||
RenderLine(lbp);
|
||||
|
||||
@@ -89,7 +89,7 @@ void TWebBrowser::tag_font()
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (bg_colors.count>1) text_colors.pop();
|
||||
if (text_colors.count>1) text_colors.pop();
|
||||
if (bg_colors.count>1) bg_colors.pop(); //never pop the last color
|
||||
}
|
||||
}
|
||||
@@ -190,8 +190,9 @@ void TWebBrowser::tag_ol_ul_dt()
|
||||
|
||||
void TWebBrowser::tag_li()
|
||||
{
|
||||
//if (style.nav) return;
|
||||
if (tag.opened) {
|
||||
if (style.nav) {
|
||||
chrncat(#linebuf, ' ', sizeof(TWebBrowser.linebuf));
|
||||
} else if (tag.opened) {
|
||||
if (!style.tag_list.level) style.tag_list.upd_level(1, 'u');
|
||||
if (!style.pre) NewLine();
|
||||
if (style.tag_list.order_type() == 'u') {
|
||||
|
||||
+21
-14
@@ -363,7 +363,7 @@ void ProcessKeyEvent()
|
||||
|
||||
void SetElementSizes()
|
||||
{
|
||||
omnibox_edit.width = Form.cwidth - BUTTON_W - SEARCH_GO_GAP - BUTTON_W - omnibox_edit.left - 52 - 16;
|
||||
omnibox_edit.width = Form.cwidth - BUTTON_W - SEARCH_GO_GAP - BUTTON_W - omnibox_edit.left - 52 - 23;
|
||||
if (Form.cwidth - scroll_wv.size_x != WB1.list.w) {
|
||||
//temporary fix for crash
|
||||
//related to 'cur_img_url' var read
|
||||
@@ -391,7 +391,7 @@ void draw_window()
|
||||
DrawBar(0,TOOLBAR_H-2, Form.cwidth,1, MixColors(sc.dark, sc.work, 180));
|
||||
DrawBar(0,TOOLBAR_H-1, Form.cwidth,1, sc.line);
|
||||
DrawBar(0, PADDING, omnibox_edit.left-2, TSZE+1, sc.work);
|
||||
DrawBar(omnibox_edit.left+omnibox_edit.width+18, PADDING, Form.cwidth-omnibox_edit.left-omnibox_edit.width-18, TSZE+1, sc.work);
|
||||
DrawBar(omnibox_edit.left+omnibox_edit.width+24, PADDING, Form.cwidth-omnibox_edit.left-omnibox_edit.width-24, TSZE+1, sc.work);
|
||||
|
||||
DrawTopPanelButton(BACK_BUTTON, PADDING-1, PADDING, 30, false);
|
||||
DrawTopPanelButton(FORWARD_BUTTON, PADDING+TSZE+PADDING-2, PADDING, 31, false);
|
||||
@@ -445,9 +445,16 @@ void EventScrollUpAndDown(int _direction)
|
||||
|
||||
void EventToggleDebugMode()
|
||||
{
|
||||
int cy = WB1.list.first;
|
||||
debug_mode ^= 1;
|
||||
if (debug_mode) notify("'Debug mode ON'-I");
|
||||
else notify("'Debug mode OFF'-I");
|
||||
WB1.Reparse();
|
||||
WB1.list.first = WB1.list.cur_y = cy;
|
||||
WB1.DrawPage();
|
||||
if (debug_mode) {
|
||||
DrawStatusBar("Debug mode = ON");
|
||||
} else {
|
||||
DrawStatusBar("Debug mode = OFF");
|
||||
}
|
||||
}
|
||||
|
||||
void EventAllTabsClick(dword _n)
|
||||
@@ -792,11 +799,11 @@ bool UrlExtIs(dword base, ext)
|
||||
|
||||
void DrawProgress()
|
||||
{
|
||||
dword pct;
|
||||
dword pct = 10, fullw = omnibox_edit.width + 23; // full omnibox width incl. icon
|
||||
if (!http.transfer) return;
|
||||
if (http_get_type==PAGE) && (prbar.max) pct = prbar.value*30/prbar.max; else pct = 10;
|
||||
if (http_get_type==IMG) pct = prbar.value * 70 / prbar.max + 30;
|
||||
DrawBar(omnibox_edit.left-1, omnibox_edit.top+20, pct*omnibox_edit.width+16/100, 2, 0x72B7EB);
|
||||
if (http_get_type==IMG) pct = prbar.value*70/prbar.max + 30;
|
||||
if (http_get_type==PAGE) && (prbar.max) pct = prbar.value*30/prbar.max;
|
||||
DrawBar(omnibox_edit.left-1, omnibox_edit.top+20, pct*fullw/100, 2, 0x72B7EB);
|
||||
}
|
||||
|
||||
void EventShowPageMenu()
|
||||
@@ -918,18 +925,18 @@ void DrawStatusBar(dword _msg)
|
||||
void DrawOmnibox()
|
||||
{
|
||||
int imgxoff;
|
||||
DrawOvalBorder(omnibox_edit.left-2, omnibox_edit.top-3, omnibox_edit.width+18, 24, sc.line,
|
||||
DrawOvalBorder(omnibox_edit.left-2, omnibox_edit.top-3, omnibox_edit.width+24, 24, sc.line,
|
||||
sc.line, sc.line, sc.dark);
|
||||
DrawBar(omnibox_edit.left-1, omnibox_edit.top-2, omnibox_edit.width+18, 1, 0xD8DCD8);
|
||||
DrawBar(omnibox_edit.left-1, omnibox_edit.top-1, omnibox_edit.width+18, 1, omnibox_edit.bg_color);
|
||||
DrawBar(omnibox_edit.left-1, omnibox_edit.top-2, omnibox_edit.width+24, 1, 0xD8DCD8);
|
||||
DrawBar(omnibox_edit.left-1, omnibox_edit.top-1, omnibox_edit.width+24, 1, omnibox_edit.bg_color);
|
||||
DrawBar(omnibox_edit.left-1, omnibox_edit.top, 1, 22, omnibox_edit.bg_color);
|
||||
|
||||
if (omnibox_edit.flags & ed_focus) omnibox_edit.flags = ed_focus; else omnibox_edit.flags = 0;
|
||||
EditBox_UpdateText(#omnibox_edit, omnibox_edit.flags);
|
||||
edit_box_draw stdcall(#omnibox_edit);
|
||||
if (http.transfer) imgxoff = 16*23*3; else imgxoff = 0;
|
||||
PutImage(omnibox_edit.left+omnibox_edit.width+1, omnibox_edit.top-1, 16, 23, imgxoff + #editbox_icons);
|
||||
DefineHiddenButton(omnibox_edit.left+omnibox_edit.width-1, omnibox_edit.top-2, 17, 23, REFRESH_BUTTON);
|
||||
if (http.transfer) imgxoff = 23*23*3; else imgxoff = 0;
|
||||
PutImage(omnibox_edit.left+omnibox_edit.width, omnibox_edit.top-1, 23, 23, imgxoff + #editbox_icons);
|
||||
DefineHiddenButton(omnibox_edit.left+omnibox_edit.width, omnibox_edit.top-2, 22, 23, REFRESH_BUTTON);
|
||||
|
||||
DrawProgress();
|
||||
}
|
||||
|
||||
@@ -59,4 +59,6 @@ void _cache::clear()
|
||||
type.drop();
|
||||
current_buf = NULL;
|
||||
current_size = NULL;
|
||||
current_type = NULL;
|
||||
current_charset = NULL;
|
||||
}
|
||||
+1
-1
@@ -115,4 +115,4 @@ char editbox_icons[] = FROM "res/editbox_icons.raw";
|
||||
|
||||
#define DEFAULT_URL URL_SERVICE_HOMEPAGE
|
||||
|
||||
char version[]="WebView 3.95";
|
||||
char version[]="WebView 3.98";
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 199 B After Width: | Height: | Size: 1.1 KiB |
@@ -1 +1 @@
|
||||
№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№ЇЇЇ╠╠╠мммМММммм╠╠╠ЇЇЇ№№№№№№№№№№№№№№№№№№№№№№№№▄▄▄МММММММММММММММММММММ▄▄▄№№№╠╠╠№№№№№№№№№№№№▄▄▄ММММММ╠╠╠ЇЇЇ№№№ЇЇЇ╠╠╠ММММММ╠╠╠МММ№№№№№№№№№ЇЇЇММММММ▄▄▄№№№№№№№№№№№№№№№ЇЇЇМММММММММ№№№№№№№№№╠╠╠МММ╠╠╠№№№№№№№№№№№№№№№№№№╠╠╠МММММММММ№№№№№№№№№мммМММЇЇЇ№№№№№№№№№№№№№№№╠╠╠ММММММММММММ№№№№№№№№№МММммм№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№мммМММЇЇЇ№№№№№№№№№№№№№№№№№№№№№ЇЇЇММММММ№№№№№№№№№╠╠╠МММ╠╠╠№№№№№№№№№№№№№№№№№№№№№╠╠╠МММ╠╠╠№№№№№№№№№ЇЇЇММММММ▄▄▄№№№№№№№№№№№№№№№▄▄▄ММММММЇЇЇ№№№№№№№№№№№№▄▄▄ММММММ╠╠╠ЇЇЇ№№№ЇЇЇ╠╠╠ММММММ▄▄▄№№№№№№№№№№№№№№№№№№▄▄▄МММММММММММММММММММММ▄▄▄№№№№№№№№№№№№№№№№№№№№№№№№ЇЇЇ╠╠╠мммМММммм╠╠╠ЇЇЇ№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№▄▄▄№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№\L╘№№№№№№№№№№№№\L╘№№№№№№№№№№№№№№№№№№№№№№№№№№№\L╘\L╘\L╘№№№№№№\L╘\L╘\L╘№№№№№№№№№№№№№№№№№№№№№\L╘\L╘\L╘\L╘\L╘\L╘\L╘\L╘\L╘4$д№№№№№№№№№№№№№№№№№№№№№\L╘\L╘\L╘\L╘\L╘\L╘\L╘4$д№№№№№№№№№№№№№№№№№№№№№№№№№№№\L╘\L╘\L╘\L╘\L╘4$д№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№\L╘\L╘\L╘\L╘\L╘4$д№№№№№№№№№№№№№№№№№№№№№№№№№№№\L╘\L╘\L╘\L╘\L╘\L╘\L╘\L╘№№№№№№№№№№№№№№№№№№№№№\L╘\L╘\L╘\L╘4$д4$д\L╘\L╘\L╘4$д№№№№№№№№№№№№№№№№№№№№№\L╘\L╘4$д№№№№№№4$д\L╘4$д№№№№№№№№№№№№№№№№№№№№№№№№№№№4$д№№№№№№№№№№№№4$д№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№▄▄▄
|
||||
▐▐▌бЯЮВБ~xwtВБ~бЯЮ▐▐▌ ╜╗╗ ¤¤¤млк{xuЙЕГСОМЦУССОМЙЕГ{xuмлл╗╗╣rpm нмй~{ПНКЙЕГ~{x{xu|yЙЕГПНККЖДЙЕГxvs ▐▐▌{xuПНКБ|ввЯччх√√√ччхеввКИДЩХТЩХТyxu вЯЯЙЕГЙЕГввЯ ╛╜╗КЖДЩХТЩХТyxu ГБСОМ~{xччх ╜╗╗rpmxvsyxuyxutqo xwtЦУС{xu··· ДБСОМ~{xшчч бЮЭЙЕГЙЕГдба пон}yx┤│▓ ▌▌▌{xuПНКБ|двбччч√√√чччдвб~{ЙЕГ|yv нкк~{ПНКЙЕГ~{x{xu~{xЙЕГПНК~{нлй √√√нкк{xuЙЕГСОМЦУССОМЙЕГ{xuнкк№№№ ▐▌▌вЯЯВБxwtВБвЯЯ▐▌▌ ▄▄▄ ,╨ ,╨ ,╨ФОъ,╨ ,╨ФОъ,╨ ,╨ФОъJA┘JA┘JA┘ JA┘ФОъJA┘JA┘,╨ ,╨JA┘JA┘JA┘JA┘JA┘JA┘JA┘JA┘JA┘JA┘JA┘JA┘,╨ жJA┘JA┘JA┘JA┘JA┘JA┘JA┘JA┘JA┘JA┘JA┘,╨ ж жJA┘JA┘JA┘JA┘JA┘JA┘JA┘JA┘JA┘,╨ ж ,╨JA┘JA┘JA┘JA┘JA┘JA┘JA┘,╨ ж ,╨JA┘JA┘JA┘JA┘JA┘JA┘,╨ ,╨JA┘JA┘JA┘JA┘JA┘JA┘JA┘JA┘ ж ,╨ФОъJA┘JA┘JA┘JA┘JA┘JA┘JA┘JA┘JA┘,╨ ,╨ФОъJA┘JA┘JA┘JA┘,╨,╨JA┘JA┘JA┘JA┘JA┘,╨ ,╨JA┘JA┘JA┘JA┘,╨ ,╨JA┘JA┘JA┘,╨ ж ,╨JA┘,╨ ж ,╨JA┘,╨ ж ж ж ,╨ ж ▄▄▄
|
||||
@@ -42,7 +42,7 @@ By the way,
|
||||
' |
|
||||
() .-.,="``"=. - o -
|
||||
'=/_ \ |
|
||||
* | '=._ |
|
||||
* | '=.<a href=WebView:test> </a> |
|
||||
\ `=./`, '
|
||||
. '=.__.=' `=' *
|
||||
+ +
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
' |
|
||||
() .-.,="``"=. - o -
|
||||
'=/_ \ |
|
||||
* | '=._ |
|
||||
* | '=.<a href=WebView:test> </a> |
|
||||
\ `=./`, '
|
||||
. '=.__.=' `=' *
|
||||
+ +
|
||||
|
||||
+30
-30
@@ -1,39 +1,39 @@
|
||||
<html>
|
||||
<title>TEST</title>
|
||||
<style>a {display:block;font-size:130%;margin:5px 40px 5px 0;}</style>
|
||||
<body>
|
||||
<body bgcolor=#fff>
|
||||
|
||||
<pre><h2>HTTP</h2>
|
||||
<pre><h3><kosicon n=21>Tables</h3>
|
||||
<a href=//th99.infania.net>Total Hardware 1999</a>
|
||||
<a href=//wiby.org>wiby.org</a>
|
||||
<a href=//menuetos.net>menuetos.net</a>
|
||||
<a href=//macintosh.garden/>Macintosh Garden</a>
|
||||
<a href=//pci-ids.ucw.cz>pci.ids</a>
|
||||
<a href=//xcal1.vodafone.co.uk>Vodafone Test Files</a>
|
||||
<a href=//vetusware.com>vetusware.com</a>
|
||||
<a href=//toastytech.com/guis/index.html>GUI Gallery</a>
|
||||
<a href=//www.weitek.com/textual/support/driver.html>weitek</a>
|
||||
<a href=//www.abandonwarering.com/?Page=Listing>abandonware</a>
|
||||
<a href=//neonfloppy.sytes.net/articles/win3-usb/>neonfloppy</a>
|
||||
<a href=//www.win31.de/eindex.htm>win31.de</a>
|
||||
<a href=http://www.retro-computing.com/Home/retro-computing.php>retro-computing</a>
|
||||
<a href=https://www.alanwood.net/unicode/cyrillic.html>cyrillic</a>
|
||||
|
||||
<h3>VPN-only</h3>
|
||||
<a href=//dgmag.in>dgmag.in</a>
|
||||
<a href=//fdd5-25.pdp-11.ru>fdd5-25</a>
|
||||
<a href=//old-dos.ru>old-dos.ru</a>
|
||||
<a href=//artcon.ru>artcon.ru</a>
|
||||
<a href=//nubo.ru>nubo.ru</a>
|
||||
<a href=//mirrors.pdp-11.ru>mirrors.pdp-11.ru</a>
|
||||
<a href=//nostalgy.net.ru/>nostalgy.net.ru</a>
|
||||
<pre><h3><kosicon n=22>Demoscene</h3>
|
||||
<a href="https://amp.dascene.net/home.php">Amiga Music Preservation</a>
|
||||
<a href="https://files.scene.org">Scene.org</a>
|
||||
<a href=https://www.pouet.net/>Pouet.net</a>
|
||||
<a href="https://aminet.net/tree?path=mods">Aminet</a>
|
||||
<a href=https://barefeats.com/indarch.html>barefeats</a>
|
||||
|
||||
<h2>HTTPS :(</h2>
|
||||
<a href=//os-menuet.narod.ru>os-menuet.narod.ru</a>
|
||||
<a href=//mestack.narod.ru/index.html>mestack.narod.ru</a>
|
||||
<a href=//coolthemes.narod.ru/indexold.html>coolthemes.narod.ru</a>
|
||||
<a href=//lionovsky.us>lionovsky.us</a>
|
||||
<a href=//acmp.ru/index.asp?main=tasks>acmp.ru</a>
|
||||
<a href=//xn--80abh7bk0c.xn--p1ai>bashorg</a>
|
||||
<a href=//opennet.ru>opennet</a>
|
||||
<a href=//linux.org.ru>LOR</a>
|
||||
<a href=//www.xlr8yourmac.com/OSX/os_x_network_cards.html>OSX network cards</a>
|
||||
<h3><kosicon n=13>Forms</h3>
|
||||
<a href=//wiby.org>wiby.org</a>
|
||||
|
||||
|
||||
<h3><kosicon n=3>Other</h3>
|
||||
<a href=//menuetos.net>menuetos.net</a>
|
||||
<a href=//osnews.com>osnews.com</a>
|
||||
|
||||
|
||||
<h3><kosicon n=54>Cyrillic only</h3>
|
||||
<a href=//dgmag.in>dgmag.in</a> <a href=//old-dos.ru>old-dos.ru</a> <a href=//lionovsky.us>lionovsky.us</a> <a href=//mirrors.pdp-11.ru>mirrors.pdp-11.ru</a>
|
||||
<a href=//artcon.ru>artcon.ru</a> <a href=//nubo.ru>nubo.ru</a> <a href=//nostalgy.net.ru/>nostalgy.net.ru</a> <a href=//acmp.ru/index.asp?main=tasks>acmp.ru</a>
|
||||
<a href=//opennet.ru>opennet</a> <a href=//linux.org.ru>LOR</a>
|
||||
<a href=//samlib.ru/b>samlib.ru/b</a>
|
||||
<a href=//vetusware.com>vetusware.com</a>
|
||||
<a href=//electromyne.de>electromyne.de</a>
|
||||
<a href=//os-menuet.narod.ru>os-menuet.narod.ru</a> <a href=//coolthemes.narod.ru/indexold.html>coolthemes.narod.ru</a>
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-4
@@ -16,13 +16,10 @@ void SourceBufAdd(dword _mode, src)
|
||||
|
||||
if (font_found_pointer = strstr(src, "</font>")) {
|
||||
opened_font_counter--;
|
||||
src = font_found_pointer+2;
|
||||
}
|
||||
|
||||
src = src_orig;
|
||||
if (font_found_pointer = strstr(src, "<font ")) {
|
||||
if (font_found_pointer = strstr(src_orig, "<font ")) {
|
||||
opened_font_counter++;
|
||||
src = font_found_pointer+2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@
|
||||
|
||||
char dl_shared[] = "DL";
|
||||
|
||||
#define URL_SPEED_TEST "http://speedtest.tele2.net/100MB.zip"
|
||||
#define URL_SPEED_TEST "http://kolibrios.org/speedtest/100MB.zip"
|
||||
|
||||
enum {
|
||||
BTN_EXIT=1,
|
||||
|
||||
+58
-38
@@ -32,6 +32,7 @@ char proxy_address[256];
|
||||
#include "settings.h"
|
||||
|
||||
char* active_status;
|
||||
int save_path_set = false;
|
||||
|
||||
edit_box ed = {WIN_W-GAPX-GAPX,GAPX,20,0xffffff,0x94AECE,0xffffff,0xffffff,
|
||||
0x10000000, sizeof(uEdit)-2, #uEdit, 0, ed_focus + ed_always_focus, 19, 19};
|
||||
@@ -41,6 +42,8 @@ progress_bar pb = {0, GAPX, 52, WIN_W - GAPX - GAPX, 17, 0, NULL, NULL,
|
||||
|
||||
void main()
|
||||
{
|
||||
dword save_path_separator_pos;
|
||||
dword path_pointer;
|
||||
// dword shared_url; // only used by the disabled -mem branch (long URL via SHM)
|
||||
|
||||
load_dll(libini, #lib_init,1);
|
||||
@@ -56,14 +59,21 @@ void main()
|
||||
InitDownload();
|
||||
|
||||
if (param) {
|
||||
path_pointer = #param;
|
||||
//save path specified? Example: https://example.com/file|/sys/media/ac97snd
|
||||
if (save_path_separator_pos = strchr(#param, '|')) {
|
||||
save_path_set = true;
|
||||
strcpy(#filepath, save_path_separator_pos+1);
|
||||
ESBYTE[save_path_separator_pos] = '\0';
|
||||
}
|
||||
if (streqrp(#param, "-e ")) {
|
||||
autoclose.checked = true;
|
||||
param += 3;
|
||||
path_pointer += 3;
|
||||
}
|
||||
if (streqrp(#param, "-eo ")) {
|
||||
autoclose.checked = true;
|
||||
open_file = true;
|
||||
param += 4;
|
||||
path_pointer += 4;
|
||||
}
|
||||
|
||||
// Disabled long-URL-via-SHM ("DL") channel. memopen was never
|
||||
@@ -73,12 +83,12 @@ void main()
|
||||
// shared_url = memopen(#dl_shared, URL_SIZE+1, SHM_OPEN + SHM_WRITE);
|
||||
// strcpy(#uEdit, shared_url);
|
||||
// } else {
|
||||
strcpy(#uEdit, #param);
|
||||
// }
|
||||
|
||||
if (streq(#param, "-test")) {
|
||||
strcpy(#uEdit, URL_SPEED_TEST);
|
||||
} else {
|
||||
strcpy(#uEdit, path_pointer);
|
||||
}
|
||||
// }
|
||||
}
|
||||
if (uEdit[0]) StartDownloading(); else {
|
||||
edit_box_set_text stdcall (#ed, "http://");
|
||||
@@ -172,7 +182,11 @@ void DrawWindow()
|
||||
DrawBar(GAPX, WIN_H - 58, WIN_W - GAPX - GAPX, 1, sc.light);
|
||||
DrawBar(GAPX, WIN_H - 58 + 1, WIN_W - GAPX - GAPX, 1, sc.dark);
|
||||
WriteTextWithBg(GAPX, WIN_H - 48, 0xD0, sc.work_text, T_SAVE_TO, sc.work);
|
||||
WriteTextWithBg(GAPX + 108, WIN_H - 48, 0xD0, sc.work_text, #save_dir, sc.light);
|
||||
if (save_path_set) {
|
||||
WriteTextWithBg(GAPX + 108, WIN_H - 48, 0xD0, sc.work_text, #filepath, sc.light);
|
||||
} else {
|
||||
WriteTextWithBg(GAPX + 108, WIN_H - 48, 0xD0, sc.work_text, #save_dir, sc.light);
|
||||
}
|
||||
edit_box_draw stdcall (#ed);
|
||||
progressbar_draw stdcall(#pb);
|
||||
autoclose.draw(GAPX, WIN_H - 24);
|
||||
@@ -305,41 +319,47 @@ void SaveFile(int attempt)
|
||||
char notify_message[4296];
|
||||
char file_name[URL_SIZE+96];
|
||||
|
||||
//if save_path is not set then we have to combine it
|
||||
if (!save_path_set) {
|
||||
strcpy(#filepath, #save_dir);
|
||||
chrcat(#filepath, '/'); ///need to check the last symbol
|
||||
|
||||
strcpy(#filepath, #save_dir);
|
||||
chrcat(#filepath, '/'); ///need to check the last symbol
|
||||
|
||||
if (attempt > 9) {
|
||||
notify("'Too many saving attempts' -E");
|
||||
return;
|
||||
}
|
||||
|
||||
if (attempt > 0) {
|
||||
chrcat(#filepath, attempt+'0');
|
||||
chrcat(#filepath, '_');
|
||||
}
|
||||
|
||||
//Content-Disposition: attachment; filename="RealFootball_2018_Nokia_5800_EN_IGP_EU_TS_101.zip"
|
||||
if (http.header_field("content-disposition", #file_name, sizeof(file_name))) {
|
||||
if (EDX = strstr(#file_name,"filename=\"")) {
|
||||
strcat(#filepath, EDX+10);
|
||||
ESBYTE[strchr(#filepath,'\"')] = '\0';
|
||||
if (attempt > 9) {
|
||||
notify("'Too many saving attempts' -E");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// Clean all slashes at the end
|
||||
strcpy(#file_name, #uEdit);
|
||||
while (file_name[strlen(#file_name)-1] == '/') {
|
||||
file_name[strlen(#file_name)-1] = 0;
|
||||
}
|
||||
strcat(#filepath, #file_name+strrchr(#file_name, '/'));
|
||||
}
|
||||
|
||||
for (i=0; i<strlen(#filepath); i++) if(filepath[i]==':')||(filepath[i]=='?')filepath[i]='-';
|
||||
|
||||
while (file_exists(#filepath)) {
|
||||
SaveFile(attempt+1);
|
||||
return;
|
||||
}
|
||||
if (attempt > 0) {
|
||||
chrcat(#filepath, attempt+'0');
|
||||
chrcat(#filepath, '_');
|
||||
}
|
||||
|
||||
//Content-Disposition: attachment; filename="RealFootball_2018_Nokia_5800_EN_IGP_EU_TS_101.zip"
|
||||
if (http.header_field("content-disposition", #file_name, sizeof(file_name))) {
|
||||
if (EDX = strstr(#file_name,"filename=\"")) {
|
||||
strcat(#filepath, EDX+10);
|
||||
ESBYTE[strchr(#filepath,'\"')] = '\0';
|
||||
}
|
||||
} else {
|
||||
// Clean all slashes at the end
|
||||
strcpy(#file_name, #uEdit);
|
||||
while (file_name[strlen(#file_name)-1] == '/') {
|
||||
file_name[strlen(#file_name)-1] = 0;
|
||||
}
|
||||
strcat(#filepath, #file_name+strrchr(#file_name, '/'));
|
||||
}
|
||||
|
||||
for (i=0; i<strlen(#filepath); i++) if(filepath[i]==':')||(filepath[i]=='?')filepath[i]='-';
|
||||
}
|
||||
|
||||
// When an explicit save path is given, overwrite it instead of
|
||||
// auto-renaming - otherwise the fixed path always exists and recurses forever.
|
||||
if (!save_path_set) {
|
||||
while (file_exists(#filepath)) {
|
||||
SaveFile(attempt+1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (CreateFile(http.content_received, http.content_pointer, #filepath)==0) {
|
||||
miniprintf(#notify_message, T_FILE_SAVED_AS, #filepath);
|
||||
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
//Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2025
|
||||
//Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2026
|
||||
//GNU GPL license.
|
||||
|
||||
/*
|
||||
@@ -10,9 +10,9 @@ TODO:
|
||||
http://board.kolibrios.org/viewtopic.php?f=23&t=4521&p=77334#p77334
|
||||
*/
|
||||
|
||||
#define ABOUT_TITLE "Eolite 5.33"
|
||||
#define TITLE_EOLITE "Eolite File Manager 5.33"
|
||||
#define TITLE_KFM "Kolibri File Manager 2.33";
|
||||
#define ABOUT_TITLE "Eolite 5.34"
|
||||
#define TITLE_EOLITE "Eolite File Manager 5.34"
|
||||
#define TITLE_KFM "Kolibri File Manager 2.34";
|
||||
|
||||
#define MEMSIZE 1024 * 250
|
||||
#include "../lib/clipboard.h"
|
||||
@@ -112,7 +112,7 @@ edit_box popin_text = {200,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0x1000000
|
||||
|
||||
PathShow_data FileShow = {0, 56,215, 8, 100, 1, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
|
||||
|
||||
_ini icons_ini = { "/sys/File managers/icons.ini", NULL };
|
||||
_ini icons_ini = { "/sys/File managers/icon2ext.ini", NULL };
|
||||
|
||||
#include "include\settings.h"
|
||||
#include "include\gui.h"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 1012 B After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 2.5 KiB |
+10
-7
@@ -51,9 +51,9 @@ char *kfm_func = {
|
||||
#define T_DEVICES "Устройства"
|
||||
#define T_ACTIONS "Действия"
|
||||
char *actions[] = {
|
||||
59, "Новый файл", "F9",
|
||||
57, "Новая папка", "F7",
|
||||
60, "Настройки", "F10",
|
||||
59, "Новый файл", " F9",
|
||||
57, "Новая папка", " F7",
|
||||
60, "Настройки", "F10",
|
||||
0,0,0
|
||||
};
|
||||
#define T_SYS "Система "
|
||||
@@ -65,6 +65,7 @@ char *actions[] = {
|
||||
#define T_NVME "NVMe disk "
|
||||
#define T_USB "USB диск "
|
||||
#define T_RAM "RAM диск "
|
||||
#define T_VD "Виртуальный "
|
||||
#define T_UNC "Неизвестно "
|
||||
|
||||
#define WINDOW_TITLE_PROPERTIES "Свойства"
|
||||
@@ -150,9 +151,9 @@ char *kfm_func = {
|
||||
#define T_DEVICES "Devices"
|
||||
#define T_ACTIONS "Actions"
|
||||
char *actions[] = {
|
||||
59, "New file", "F9",
|
||||
57, "New folder", "F7",
|
||||
60, "Settings", "F10",
|
||||
59, "New file", " F9",
|
||||
57, "New folder", " F7",
|
||||
60, "Settings", "F10",
|
||||
0,0,0
|
||||
};
|
||||
#define T_SYS "System "
|
||||
@@ -164,6 +165,7 @@ char *actions[] = {
|
||||
#define T_NVME "NVMe disk "
|
||||
#define T_USB "USB disk "
|
||||
#define T_RAM "RAM disk "
|
||||
#define T_VD "Virtual "
|
||||
#define T_UNC "Unknown "
|
||||
|
||||
#define WINDOW_TITLE_PROPERTIES "Properties"
|
||||
@@ -257,10 +259,11 @@ char *devinfo = {
|
||||
"nv", 4, T_NVME,
|
||||
"tm", 5, T_RAM,
|
||||
"us", 6, T_USB,
|
||||
"vd", 7, T_VD,
|
||||
0
|
||||
};
|
||||
|
||||
#define DEV_H 17
|
||||
#define DEV_H 18
|
||||
#define DDW 110
|
||||
#define KFM2_DEVH 20
|
||||
#define SELECTY 10
|
||||
|
||||
+14
-12
@@ -127,25 +127,27 @@ void Tip(int y, dword caption, id, arrow)
|
||||
void ActionsDraw(int actions_y)
|
||||
{
|
||||
int i;
|
||||
Tip(actions_y-18, T_ACTIONS, 77, "");
|
||||
Tip(actions_y, T_ACTIONS, 77, "");
|
||||
actions_y += 18;
|
||||
for (i=0; actions[i*3]!=0; i++, actions_y+=DEV_H)
|
||||
{
|
||||
DrawBar(SB_BLOCKX,actions_y,SB_BLOCKW,DEV_H,0xFFFFFF); //схыюх
|
||||
DefineButton(SB_BLOCKX,actions_y,SB_BLOCKW-1,DEV_H,actions[i*3]+BT_HIDE,0xE4DFE1);
|
||||
WriteText(45,actions_y+4,0x80,0,actions[i*3+1]);
|
||||
WriteText(-strlen(actions[i*3+2])*6+SIDEBAR_W-SBPAD-7,actions_y+4,0x80,0x999999,actions[i*3+2]);
|
||||
DrawBar(SB_BLOCKX,actions_y,SB_BLOCKW,DEV_H,0xFFFFFF);
|
||||
DefineButton(SB_BLOCKX,actions_y,SB_BLOCKW-1,DEV_H,actions[i*3]+BT_HIDE,NULL);
|
||||
WriteText(45,actions_y+5,0x80,0,actions[i*3+1]);
|
||||
WriteText(SIDEBAR_W-SBPAD-7-18,actions_y+5,0x80,0x999999,actions[i*3+2]);
|
||||
PutImage(23,actions_y+2, 14,13, i*14*13*3+#factions);
|
||||
}
|
||||
}
|
||||
|
||||
void DrawLeftPanelBg(int actions_y)
|
||||
void DrawLeftPanelBg(int devices_h)
|
||||
{
|
||||
int start_y = actions_y+159;
|
||||
#define ACTIONS_H DEV_H*3 + 18
|
||||
int start_y = ACTIONS_H + devices_h + 90;
|
||||
int area_h;
|
||||
DrawBar(2,41,SIDEBAR_W-2,SBPAD,waves_pal[0]); //above devices block
|
||||
DrawBar(SB_BLOCKX,actions_y+75,SB_BLOCKW,SBPAD,EDX); //below devices block
|
||||
DrawBar(2,56,SBPAD,actions_y+103,EDX); //on the left
|
||||
DrawBar(SIDEBAR_W-SBPAD,56,SBPAD,actions_y+103,EDX); //on the right
|
||||
DrawBar(SB_BLOCKX,devices_h+75,SB_BLOCKW,SBPAD,EDX); //below devices block
|
||||
DrawBar(2,56,SBPAD,devices_h+ACTIONS_H+34,EDX); //on the left
|
||||
DrawBar(SIDEBAR_W-SBPAD,56,SBPAD,devices_h+ACTIONS_H+34,EDX); //on the right
|
||||
area_h = Form.cheight-start_y-2 - status_bar_h;
|
||||
if (area_h < 268){
|
||||
PutPaletteImage(#blue_hl, 190, area_h, 2, start_y, 8, #waves_pal);
|
||||
@@ -153,8 +155,8 @@ void DrawLeftPanelBg(int actions_y)
|
||||
DrawBar(2,start_y,SIDEBAR_W-2, area_h-268, waves_pal[0]);
|
||||
PutPaletteImage(#blue_hl, 190, 268, 2, Form.cheight-270-status_bar_h, 8, #waves_pal);
|
||||
}
|
||||
PutShadow(SB_BLOCKX,actions_y+75,SB_BLOCKW,1,1,3);
|
||||
PutShadow(SB_BLOCKX+1,actions_y+75+1,SB_BLOCKW-2,1,1,1);
|
||||
PutShadow(SB_BLOCKX,devices_h+75,SB_BLOCKW,1,1,3);
|
||||
PutShadow(SB_BLOCKX+1,devices_h+75+1,SB_BLOCKW-2,1,1,1);
|
||||
PutShadow(SB_BLOCKX,start_y,SB_BLOCKW,1,1,3);
|
||||
PutShadow(SB_BLOCKX+1,start_y+1,SB_BLOCKW-2,1,1,1);
|
||||
}
|
||||
|
||||
+62
-10
@@ -3,13 +3,71 @@ struct ICONS_INI {
|
||||
collection exts;
|
||||
collection_int i18;
|
||||
collection_int i32;
|
||||
byte loaded;
|
||||
int get();
|
||||
void load();
|
||||
void put();
|
||||
} ini_icons;
|
||||
|
||||
// Stores the icon number for a single extension, keeping the exts/i18/i32
|
||||
// collections aligned by position regardless of the order keys are read in.
|
||||
void ICONS_INI::put(dword _ext, int size, icon_n)
|
||||
{
|
||||
int ext_pos = exts.get_pos_by_name(_ext);
|
||||
if (ext_pos == -1) {
|
||||
exts.add(_ext);
|
||||
ext_pos = exts.count - 1;
|
||||
}
|
||||
if (size == 18) i18.set(ext_pos, icon_n);
|
||||
else i32.set(ext_pos, icon_n);
|
||||
}
|
||||
|
||||
// Callback for ini_enum_keys: key_name is the icon number, key_value is a
|
||||
// comma-separated list of extensions sharing that icon, e.g.
|
||||
// 3=doc,docx,exc,inf,log,ob07,odt,rtf,txt,wtx
|
||||
byte icons_ini_enum_key(dword key_value, key_name, sec_name, f_name)
|
||||
{
|
||||
char ext[7];
|
||||
int icon_n, size, i;
|
||||
dword src;
|
||||
|
||||
icon_n = atoi(key_name);
|
||||
if (streq(sec_name, "icons18")) size = 18; else size = 32;
|
||||
|
||||
src = key_value;
|
||||
while (ESBYTE[src]) {
|
||||
i = 0;
|
||||
while (ESBYTE[src]) && (ESBYTE[src] != ',') {
|
||||
if (ESBYTE[src] != ' ') && (i < 6) {
|
||||
ext[i] = ESBYTE[src];
|
||||
i++;
|
||||
}
|
||||
src++;
|
||||
}
|
||||
ext[i] = '\0';
|
||||
if (i) {
|
||||
strlwr(#ext);
|
||||
ini_icons.put(#ext, size, icon_n);
|
||||
}
|
||||
if (ESBYTE[src] == ',') src++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Reads the whole icon map once into the collections.
|
||||
void ICONS_INI::load()
|
||||
{
|
||||
if (loaded) return;
|
||||
loaded = true;
|
||||
ini_enum_keys stdcall (icons_ini.path, "icons18", #icons_ini_enum_key);
|
||||
ini_enum_keys stdcall (icons_ini.path, "icons32", #icons_ini_enum_key);
|
||||
}
|
||||
|
||||
int ICONS_INI::get(dword _file_path, _ext, int size)
|
||||
{
|
||||
char file_4bytes[4], ext[7];
|
||||
int ext_pos;
|
||||
load();
|
||||
if (!_ext) {
|
||||
ReadFile(0,4,#file_4bytes,_file_path);
|
||||
IF(DSDWORD[#file_4bytes]=='KCPK')
|
||||
@@ -22,16 +80,10 @@ int ICONS_INI::get(dword _file_path, _ext, int size)
|
||||
ext_pos = exts.get_pos_by_name(#ext);
|
||||
if (ext_pos != -1) {
|
||||
if (size == 18) return i18.get(ext_pos);
|
||||
else if (size == 32) return i32.get(ext_pos);
|
||||
} else {
|
||||
exts.add(#ext);
|
||||
icons_ini.section = "icons18";
|
||||
i18.set(exts.count-1, icons_ini.GetInt(#ext, 2));
|
||||
|
||||
icons_ini.section = "icons32";
|
||||
i32.set(exts.count-1, icons_ini.GetInt(#ext, 95));
|
||||
return get(#ext, size);
|
||||
if (size == 32) return i32.get(ext_pos);
|
||||
}
|
||||
if (size == 18) return 2;
|
||||
return 95;
|
||||
}
|
||||
|
||||
void DrawIconByExtension(dword file_path, extension, xx, yy, fairing_color)
|
||||
@@ -49,7 +101,7 @@ void DrawIconByExtension(dword file_path, extension, xx, yy, fairing_color)
|
||||
icons_ini.section = "drives32";
|
||||
icon_n = icons_ini.GetInt(#ext, 50);
|
||||
} else {
|
||||
icons_ini.section = "drives16";
|
||||
icons_ini.section = "drives18";
|
||||
icon_n = icons_ini.GetInt(#ext, 50);
|
||||
}
|
||||
} else {
|
||||
|
||||
+19
-15
@@ -81,11 +81,15 @@ void GetDiskIconAndName(dword dev_name, icon, disc_name)
|
||||
strcpy(disc_name, T_UNC);
|
||||
}
|
||||
|
||||
#define DISK_COUNT 8
|
||||
void _SystemDiscs::Draw()
|
||||
{
|
||||
char dev_name[15], disc_name[100], i, dev_icon;
|
||||
bool is_active=0;
|
||||
int draw_y, draw_x;
|
||||
#define DRAW_Y 74
|
||||
#define DRAW_X 17
|
||||
#define DRAW_PAD 2
|
||||
int draw_y = DRAW_Y+DRAW_PAD;
|
||||
|
||||
if (efm) {
|
||||
DrawSelect(2, KFM_DEV_DROPDOWN_1, location[0]);
|
||||
@@ -93,36 +97,36 @@ void _SystemDiscs::Draw()
|
||||
files.y = 40 + 17;
|
||||
} else {
|
||||
Tip(56, T_DEVICES, 55, "=");
|
||||
DrawBar(DRAW_X,DRAW_Y,SB_BLOCKW,DRAW_PAD,0xFFFFFF);
|
||||
for (i=0; i<30; i++) DeleteButton(100+i);
|
||||
|
||||
draw_y = 74;
|
||||
draw_x = 17;
|
||||
for (i=0;i<list.count;i++) {
|
||||
strcpy(#dev_name, list.get(i));
|
||||
GetDiskIconAndName(#dev_name, #dev_icon, #disc_name);
|
||||
if (strstr(path, #dev_name)==path) is_active=true; else is_active=false;
|
||||
|
||||
DrawBar(draw_x,draw_y,6,DEV_H+1,0xFFFFFF);
|
||||
DrawBar(draw_x+6+18,draw_y,160-6-18,DEV_H+1,0xFFFFFF);
|
||||
DefineHiddenButton(draw_x,draw_y,159,16,100+i);
|
||||
DrawBar(DRAW_X,draw_y,6,DEV_H+1,0xFFFFFF);
|
||||
DrawBar(DRAW_X+6+18,draw_y,160-6-18,DEV_H+1,0xFFFFFF);
|
||||
DefineHiddenButton(DRAW_X,draw_y,159,17,100+i);
|
||||
if (show_dev_name.checked)
|
||||
{
|
||||
strcat(#disc_name, #dev_name);
|
||||
if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#disc_name);
|
||||
WriteText(draw_x+29,draw_y+5,0x80,0,#disc_name);
|
||||
if (is_active) WriteText(DRAW_X+30,draw_y+5,0x80,0x555555,#disc_name);
|
||||
WriteText(DRAW_X+29,draw_y+5,0x80,0,#disc_name);
|
||||
//if (is_active) kfont.bold = true;
|
||||
//kfont.WriteIntoWindow(draw_x + 29, draw_y+2, 0xFFFfff, 0x000000, kfont.size.pt, #disc_name);
|
||||
//kfont.WriteIntoWindow(DRAW_X + 29, draw_y+2, 0xFFFfff, 0x000000, kfont.size.pt, #disc_name);
|
||||
//kfont.bold = false;
|
||||
} else {
|
||||
if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#dev_name);
|
||||
WriteText(draw_x+29,draw_y+5,0x80,0,#dev_name);
|
||||
if (is_active) WriteText(DRAW_X+30,draw_y+5,0x80,0x555555,#dev_name);
|
||||
WriteText(DRAW_X+29,draw_y+5,0x80,0,#dev_name);
|
||||
}
|
||||
PutImage(draw_x+6,draw_y, 18,17, is_active*7+dev_icon*17*18*3+#devices);
|
||||
PutImage(DRAW_X+6,draw_y, 18,17, is_active*DISK_COUNT+dev_icon*17*18*3+#devices);
|
||||
DrawBar(DRAW_X+6, draw_y+DEV_H-1, 18, 1, 0xFFffFF);
|
||||
draw_y += DEV_H;
|
||||
}
|
||||
DrawBar(draw_x+6, draw_y, 18, 1, 0xFFFfff);
|
||||
ActionsDraw(list.count*DEV_H+108);
|
||||
DrawLeftPanelBg(list.count*DEV_H);
|
||||
DrawBar(DRAW_X, draw_y, SB_BLOCKW, DRAW_PAD, 0xFFFFFF);
|
||||
ActionsDraw(draw_y+17);
|
||||
DrawLeftPanelBg(draw_y - DRAW_Y + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
-7
@@ -89,7 +89,7 @@ void RESULTS::drop()
|
||||
|
||||
void SearchThread()
|
||||
{
|
||||
int prev_first, prev_cur_y, clicked_item;
|
||||
int prev_first, prev_cur_y, clicked_item;
|
||||
|
||||
load_dll(Proc_lib, #OpenDialog_init,0);
|
||||
OpenDialog_init stdcall (#open_folder_dialog);
|
||||
@@ -112,17 +112,17 @@ void SearchThread()
|
||||
SelectList_Draw();
|
||||
} else {
|
||||
SelectList_DrawLine(select_list.cur_y);
|
||||
|
||||
clicked_item = mouse.y - select_list.y / select_list.item_h + select_list.first;
|
||||
|
||||
clicked_item = mouse.y - select_list.y / select_list.item_h + select_list.first;
|
||||
|
||||
if (select_list.MouseOver(mouse.x, mouse.y))
|
||||
{
|
||||
if (mouse.key&MOUSE_LEFT) && (mouse.up) {
|
||||
if ((prev_cur_y == select_list.cur_y) && (clicked_item < results.count)) EventRunFile();
|
||||
if ((prev_cur_y == select_list.cur_y) && (clicked_item < results.count)) EventRunFile();
|
||||
}
|
||||
|
||||
if (mouse.key&MOUSE_RIGHT) && (mouse.up) {
|
||||
if ((prev_cur_y == select_list.cur_y) && (clicked_item < results.count)) EventShowFileInFolder();
|
||||
if ((prev_cur_y == select_list.cur_y) && (clicked_item < results.count)) EventShowFileInFolder();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -222,8 +222,7 @@ void SelectList_DrawLine(dword i)
|
||||
} else {
|
||||
strcpy(#tname, results.name.get(select_list.first + i));
|
||||
strlwr(#tname);
|
||||
icons_ini.section = "icons18";
|
||||
icon = icons_ini.GetInt(#tname + strrchr(#tname, '.'), 2);
|
||||
icon = ini_icons.get(0, #tname + strrchr(#tname, '.'), 18);
|
||||
}
|
||||
|
||||
#define ICONX 7
|
||||
|
||||
@@ -260,7 +260,7 @@ inline fastcall void GetCurDir( ECX, EDX)
|
||||
previous but here virtual folders like
|
||||
'/' and '/tmp' are not recognised as FOLDERS
|
||||
by GetFileInfo() => BDVK.isfolder attribute :( */
|
||||
bool real_dir_exists(dword fpath)
|
||||
:bool real_dir_exists(dword fpath)
|
||||
{
|
||||
BDVK fpath_atr;
|
||||
if (GetFileInfo(fpath, #fpath_atr) != 0) return false;
|
||||
|
||||
+14
-10
@@ -905,16 +905,20 @@ inline signed csshexdec(dword text)
|
||||
:dword miniprintf(dword dst, format, insert_line)
|
||||
{
|
||||
dword in_pos = strchr(format, '%');
|
||||
EBX = ESBYTE[EAX+1];
|
||||
if (EBX == 's') {
|
||||
strncpy(dst, format, in_pos - format);
|
||||
strcat(dst, insert_line);
|
||||
strcat(dst, in_pos+2);
|
||||
}
|
||||
if (EBX == 'd') || (EBX == 'i') {
|
||||
strncpy(dst, format, in_pos - format);
|
||||
strcat(dst, itoa(insert_line));
|
||||
strcat(dst, in_pos+2);
|
||||
if (!in_pos) || (!insert_line) {
|
||||
strcpy(dst, format);
|
||||
} else {
|
||||
EBX = ESBYTE[EAX+1];
|
||||
if (EBX == 's') {
|
||||
strncpy(dst, format, in_pos - format);
|
||||
strcat(dst, insert_line);
|
||||
strcat(dst, in_pos+2);
|
||||
}
|
||||
if (EBX == 'd') || (EBX == 'i') {
|
||||
strncpy(dst, format, in_pos - format);
|
||||
strcat(dst, itoa(insert_line));
|
||||
strcat(dst, in_pos+2);
|
||||
}
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
if tup.getconfig("NO_CMM") ~= "" then return end
|
||||
if tup.getconfig("LANG") == "ru_RU"
|
||||
then C_LANG = "LANG_RUS"
|
||||
elseif tup.getconfig("LANG") == "es_ES"
|
||||
then C_LANG = "LANG_SPA"
|
||||
else C_LANG = "LANG_ENG" -- this includes default case without config
|
||||
end
|
||||
tup.foreach_rule("*.c", "c-- /D=AUTOBUILD /D=$(C_LANG) /OPATH=%o %f" .. tup.getconfig("KPACK_CMD"), "%B.com")
|
||||
+431
@@ -0,0 +1,431 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
//
|
||||
// unimg - FAT12 (floppy) image unpacker
|
||||
// Copyright (C) 2020-2026 KolibriOS Team
|
||||
//
|
||||
// Contributor Magomed Kostoev (Boppan, mkostoevr) - initial version in C
|
||||
// Contributor Kyryl Lipatov (Leency) - rewrite to C--, support any image type
|
||||
// Contributor Burer - Russian and Spanish translations, small fixes
|
||||
//
|
||||
// Usage:
|
||||
// unimg /path/to/img ["/output/dir"]
|
||||
// If output folder is not specified, image will be unpacked at /tmp0/1/[img_name.img_ext]
|
||||
|
||||
|
||||
#define MEMSIZE 1024*30
|
||||
#define ENTRY_POINT #main
|
||||
|
||||
#include "../lib/fs.h"
|
||||
|
||||
// NB: this file is stored in CP866 (for the Russian strings below).
|
||||
// Edit it with a CP866-aware editor, not UTF-8.
|
||||
#ifdef LANG_RUS
|
||||
?define MSG_USAGE "'unimg\nРаспаковщик образов FAT12.\nИспользование: unimg /путь/к/образу [\"/папка/вывода\"]' -tI"
|
||||
?define MSG_READ "'unimg\nОшибка чтения файла\n%s' -tE"
|
||||
?define MSG_FORMAT "'unimg\nОбраз не FAT12.\n%s' -tE"
|
||||
?define MSG_MKDIR "'unimg\nОшибка создания папки\n%s' -tE"
|
||||
?define MSG_DONE "'unimg\nРаспаковано в:\n%s' -tO"
|
||||
?define MSG_NOMEM "'unimg\nНедостаточно памяти' -tE"
|
||||
?define MSG_OOB "'unimg\nКластера FAT вне границ' -tE"
|
||||
?define INFO_NAME "\nВнутреннее имя "
|
||||
?define INFO_BPS "\nБайт в секторе "
|
||||
?define INFO_SPC "\nСекторов в кластере "
|
||||
?define INFO_RSC "\nРезервных секторов "
|
||||
?define INFO_NFAT "\nКоличество FAT "
|
||||
?define INFO_MRE "\nЗаписей в корне "
|
||||
?define INFO_BPC "\nБайт в кластере "
|
||||
?define INFO_SPF "\nСекторов в FAT "
|
||||
?define INFO_FATOFF "\nПервая FAT "
|
||||
?define INFO_ROOTOFF "\nКорневой каталог "
|
||||
?define INFO_DATAOFF "\nОбласть данных "
|
||||
#else
|
||||
#ifdef LANG_SPA
|
||||
?define MSG_USAGE "'unimg\nDescompresor de imagenes FAT12.\nUso: unimg /ruta/a/imagen [\"/carpeta/salida\"]' -tI"
|
||||
?define MSG_READ "'unimg\nError al leer el archivo\n%s' -tE"
|
||||
?define MSG_FORMAT "'unimg\nNo es una imagen FAT12.\n%s' -tE"
|
||||
?define MSG_MKDIR "'unimg\nNo se pudo crear la carpeta\n%s' -tE"
|
||||
?define MSG_DONE "'unimg\nDescomprimido en\n%s' -tO"
|
||||
?define MSG_NOMEM "'unimg\nSin memoria' -tE"
|
||||
?define MSG_OOB "'unimg\nCluster FAT fuera de limites' -tE"
|
||||
?define INFO_NAME "\nNombre interno "
|
||||
?define INFO_BPS "\nBytes en sector "
|
||||
?define INFO_SPC "\nSectores en cluster "
|
||||
?define INFO_RSC "\nSectores reservados "
|
||||
?define INFO_NFAT "\nNumero de FATs "
|
||||
?define INFO_MRE "\nEntradas raiz max "
|
||||
?define INFO_BPC "\nBytes en cluster "
|
||||
?define INFO_SPF "\nSectores en FAT "
|
||||
?define INFO_FATOFF "\nPrimera FAT "
|
||||
?define INFO_ROOTOFF "\nDirectorio raiz "
|
||||
?define INFO_DATAOFF "\nRegion de datos "
|
||||
#else
|
||||
?define MSG_USAGE "'unimg\nFAT12 image unpacker.\nUsage: unimg /path/to/img [\"/output/dir\"]' -tI"
|
||||
?define MSG_READ "'unimg\nFile read error\n%s' -tE"
|
||||
?define MSG_FORMAT "'unimg\nNot a FAT12 image.\n%s' -tE"
|
||||
?define MSG_MKDIR "'unimg\nCannot create output folder\n%s' -tE"
|
||||
?define MSG_DONE "'unimg\nUnpacked to\n%s' -tO"
|
||||
?define MSG_NOMEM "'unimg\nOut of memory' -tE"
|
||||
?define MSG_OOB "'unimg\nFAT cluster out of bounds' -tE"
|
||||
?define INFO_NAME "\nInternal name "
|
||||
?define INFO_BPS "\nBytes per sector "
|
||||
?define INFO_SPC "\nSectors per cluster "
|
||||
?define INFO_RSC "\nReserved sectors "
|
||||
?define INFO_NFAT "\nNumber of FATs "
|
||||
?define INFO_MRE "\nMax root entries "
|
||||
?define INFO_BPC "\nBytes per cluster "
|
||||
?define INFO_SPF "\nSectors per FAT "
|
||||
?define INFO_FATOFF "\nFirst FAT "
|
||||
?define INFO_ROOTOFF "\nRoot directory "
|
||||
?define INFO_DATAOFF "\nData region "
|
||||
#endif
|
||||
#endif
|
||||
|
||||
dword img_ptr;
|
||||
dword img_sz;
|
||||
|
||||
int bps;
|
||||
int spc;
|
||||
int rsc;
|
||||
int nfat;
|
||||
int mre;
|
||||
int spf;
|
||||
int bpc;
|
||||
int fat_off;
|
||||
int root_off;
|
||||
int data_off;
|
||||
|
||||
int lfn_nonascii;
|
||||
int lfn_checksum;
|
||||
|
||||
char cur_path[4096];
|
||||
int cur_path_len;
|
||||
|
||||
inline int fat_u8(int offset) { return DSBYTE[img_ptr + offset] & 0xFF; }
|
||||
inline int fat_u16(int offset) { return DSWORD[img_ptr + offset] & 0xFFFF; }
|
||||
inline dword fat_u32(int offset) { return ESDWORD[img_ptr + offset]; }
|
||||
|
||||
void fat12__open()
|
||||
{
|
||||
bps = fat_u16(11);
|
||||
spc = fat_u8(13);
|
||||
rsc = fat_u16(14);
|
||||
nfat = fat_u8(16);
|
||||
mre = fat_u16(17);
|
||||
spf = fat_u16(22);
|
||||
bpc = bps * spc;
|
||||
fat_off = rsc * bps;
|
||||
root_off = nfat * spf * bps + fat_off;
|
||||
data_off = mre * 32 + root_off;
|
||||
}
|
||||
|
||||
dword GetImageInfo(dword buf)
|
||||
{
|
||||
strcpy(buf, INFO_NAME); strncpy(buf+21, img_ptr+3, 8);
|
||||
strcat(buf, INFO_BPS); strcat(buf, itoa(bps));
|
||||
strcat(buf, INFO_SPC); strcat(buf, itoa(spc));
|
||||
strcat(buf, INFO_RSC); strcat(buf, itoa(rsc));
|
||||
strcat(buf, INFO_NFAT); strcat(buf, itoa(nfat));
|
||||
strcat(buf, INFO_MRE); strcat(buf, itoa(mre));
|
||||
strcat(buf, INFO_BPC); strcat(buf, itoa(bpc));
|
||||
strcat(buf, INFO_SPF); strcat(buf, itoa(spf));
|
||||
strcat(buf, INFO_FATOFF); strcat(buf, itoa(fat_off));
|
||||
strcat(buf, INFO_ROOTOFF); strcat(buf, itoa(root_off));
|
||||
strcat(buf, INFO_DATAOFF); strcat(buf, itoa(data_off));
|
||||
}
|
||||
|
||||
int cluster_to_offset(int c)
|
||||
{
|
||||
return c - 2 * bpc + data_off;
|
||||
}
|
||||
|
||||
int next_cluster(int c)
|
||||
{
|
||||
int v;
|
||||
v = fat_u16(c / 2 + fat_off + c);
|
||||
if (c & 1) return v >> 4;
|
||||
return v & 0xFFF;
|
||||
}
|
||||
|
||||
void extract_file(dword buf, int size, int cluster)
|
||||
{
|
||||
int written, n, src;
|
||||
written = 0;
|
||||
while (cluster >= 2) && (cluster < 0xFF7) {
|
||||
src = cluster_to_offset(cluster);
|
||||
n = bpc;
|
||||
if (written + n > size) n = size - written;
|
||||
if (n <= 0) break;
|
||||
// Stop on a corrupt FAT chain pointing outside the image
|
||||
if (src < 0) || (src + n > img_sz) break;
|
||||
memmov(buf + written, img_ptr + src, n);
|
||||
written += n;
|
||||
cluster = next_cluster(cluster);
|
||||
}
|
||||
}
|
||||
|
||||
void make_parent_dirs(dword initial_dir)
|
||||
{
|
||||
char path[4096];
|
||||
int i;
|
||||
strncpy(#path, initial_dir, strlen(initial_dir) + 1);
|
||||
for (i = 1; path[i]; i++) {
|
||||
if (path[i] == '/') {
|
||||
path[i] = '\0';
|
||||
CreateDir(#path);
|
||||
path[i] = '/';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int entry_short_name(int off, dword out)
|
||||
{
|
||||
int attr, i, n, b;
|
||||
b = fat_u8(off);
|
||||
if (!b) return -1;
|
||||
if (b == 0xE5) return 0;
|
||||
attr = fat_u8(off + 11);
|
||||
if (attr & 0x08) return 0;
|
||||
|
||||
n = 0;
|
||||
for (i = 0; i < 8; i++) {
|
||||
b = fat_u8(off + i);
|
||||
if (b == ' ') break;
|
||||
ESBYTE[out + n] = b;
|
||||
n++;
|
||||
}
|
||||
b = fat_u8(off + 8);
|
||||
if (b != ' ') {
|
||||
ESBYTE[out + n] = '.';
|
||||
n++;
|
||||
for (i = 8; i < 11; i++) {
|
||||
b = fat_u8(off + i);
|
||||
if (b == ' ') break;
|
||||
ESBYTE[out + n] = b;
|
||||
n++;
|
||||
}
|
||||
}
|
||||
ESBYTE[out + n] = '\0';
|
||||
return n;
|
||||
}
|
||||
|
||||
// Extracts characters from an LFN record.
|
||||
// Zeroes the buffer when the end of line (0x0000 or 0xFFFF) is encountered.
|
||||
int get_lfn_chars(int off, dword out)
|
||||
{
|
||||
int i, c, pos;
|
||||
// LFN stores 13 UCS-2 chars at non-contiguous offsets 1..10, 14..25, 28..31
|
||||
// (gaps: 11..13 attr/type/checksum, 26..27 cluster).
|
||||
i = 1;
|
||||
for (pos = 0; pos < 13; pos++) {
|
||||
c = fat_u16(off + i);
|
||||
if (c == 0x0000) || (c == 0xFFFF) { ESBYTE[out+pos] = 0; return pos; }
|
||||
if (c > 0x7F) lfn_nonascii = 1;
|
||||
ESBYTE[out + pos] = c & 0xFF;
|
||||
i += 2;
|
||||
if (i == 11) i = 14;
|
||||
if (i == 26) i = 28;
|
||||
}
|
||||
ESBYTE[out + pos] = 0;
|
||||
return pos;
|
||||
}
|
||||
|
||||
// Returns -1 to stop iteration, 0 to continue.
|
||||
int process_one_entry(int entry_off, dword lfn_buf, dword p_seq)
|
||||
{
|
||||
char chunk[15];
|
||||
int b, attr, seq, chunk_len, dest_offset;
|
||||
|
||||
b = fat_u8(entry_off);
|
||||
if (!b) return -1;
|
||||
if (b == 0xE5) { ESDWORD[p_seq] = -1; return 0; }
|
||||
|
||||
attr = fat_u8(entry_off + 11);
|
||||
if (attr == 0x0F) {
|
||||
seq = b;
|
||||
if (seq & 0x40) {
|
||||
seq &= 0x3F;
|
||||
if (seq < 1) || (seq > 20) { ESDWORD[p_seq] = -1; return 0; }
|
||||
ESDWORD[p_seq] = seq;
|
||||
lfn_nonascii = 0;
|
||||
lfn_checksum = fat_u8(entry_off + 13);
|
||||
EDI = lfn_buf; ECX = 65; EAX = 0; MEMSETD(EDI, ECX, EAX);
|
||||
}
|
||||
if (seq == ESDWORD[p_seq]) {
|
||||
chunk_len = get_lfn_chars(entry_off, #chunk);
|
||||
dest_offset = seq - 1;
|
||||
dest_offset *= 13;
|
||||
memmov(lfn_buf + dest_offset, #chunk, chunk_len);
|
||||
ESDWORD[p_seq] = ESDWORD[p_seq] - 1;
|
||||
} else {
|
||||
ESDWORD[p_seq] = -1;
|
||||
}
|
||||
} else {
|
||||
if (ESDWORD[p_seq] == 0) {
|
||||
if (handle_entry(entry_off, lfn_buf) < 0) return -1;
|
||||
} else {
|
||||
if (handle_entry(entry_off, NULL) < 0) return -1;
|
||||
}
|
||||
ESDWORD[p_seq] = -1;
|
||||
ESBYTE[lfn_buf] = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int handle_entry(int off, dword lfn_name)
|
||||
{
|
||||
char name[256];
|
||||
int nlen, attr, cluster, size, saved_len, use_lfn, sum, hi, i;
|
||||
dword buf;
|
||||
|
||||
if (off < 0) || (off + 32 > img_sz) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
attr = fat_u8(off + 11);
|
||||
if (attr == 0x0F) return 0;
|
||||
|
||||
// Verify LFN checksum against the short-name field (off..off+10).
|
||||
use_lfn = 0;
|
||||
if (lfn_name) && (ESBYTE[lfn_name]) && (!lfn_nonascii) {
|
||||
sum = 0;
|
||||
for (i = 0; i < 11; i++) {
|
||||
hi = sum & 1;
|
||||
hi = hi << 7;
|
||||
sum = sum >> 1;
|
||||
sum = sum + hi;
|
||||
sum = sum + fat_u8(off + i);
|
||||
sum = sum & 0xFF;
|
||||
}
|
||||
if (sum == lfn_checksum) use_lfn = 1;
|
||||
}
|
||||
|
||||
if (use_lfn) {
|
||||
strncpy(#name, lfn_name, 255);
|
||||
nlen = strlen(#name);
|
||||
} else {
|
||||
nlen = entry_short_name(off, #name);
|
||||
if (nlen < 0) return -1;
|
||||
if (nlen == 0) return 0;
|
||||
}
|
||||
|
||||
// Skip only the "." and ".." directory entries (a real LFN name may start with '.').
|
||||
if (name[0] == '.') && (name[1] == '\0') return 0;
|
||||
if (name[0] == '.') && (name[1] == '.') && (name[2] == '\0') return 0;
|
||||
|
||||
cluster = fat_u16(off + 26);
|
||||
|
||||
saved_len = cur_path_len;
|
||||
cur_path[cur_path_len] = '/';
|
||||
memmov(#cur_path + cur_path_len + 1, #name, nlen + 1);
|
||||
cur_path_len = cur_path_len + 1 + nlen;
|
||||
|
||||
if (attr & 0x10) {
|
||||
CreateDir(#cur_path);
|
||||
handle_folder(cluster);
|
||||
} else {
|
||||
size = fat_u32(off + 28);
|
||||
if (size > 0) {
|
||||
buf = malloc(size);
|
||||
if (!buf) {
|
||||
notify(MSG_NOMEM);
|
||||
} else {
|
||||
extract_file(buf, size, cluster);
|
||||
CreateFile(size, buf, #cur_path);
|
||||
free(buf);
|
||||
}
|
||||
} else {
|
||||
CreateFile(0, img_ptr, #cur_path);
|
||||
}
|
||||
}
|
||||
|
||||
cur_path_len = saved_len;
|
||||
cur_path[cur_path_len] = '\0';
|
||||
return 0;
|
||||
}
|
||||
|
||||
void handle_folder(int cluster)
|
||||
{
|
||||
int off, entries, i, entry_off;
|
||||
int lfn_expected_seq;
|
||||
char lfn_buf[260];
|
||||
|
||||
lfn_buf[0] = 0;
|
||||
lfn_expected_seq = -1;
|
||||
|
||||
while (cluster >= 2) && (cluster < 0xFF7) {
|
||||
off = cluster_to_offset(cluster);
|
||||
|
||||
if (off < 0) || (off + bpc > img_sz) {
|
||||
notify(MSG_OOB);
|
||||
return;
|
||||
}
|
||||
|
||||
entries = bpc / 32;
|
||||
for (i = 0; i < entries; i++) {
|
||||
entry_off = i * 32 + off;
|
||||
if (process_one_entry(entry_off, #lfn_buf, #lfn_expected_seq) < 0) return;
|
||||
}
|
||||
cluster = next_cluster(cluster);
|
||||
}
|
||||
}
|
||||
|
||||
void NotifyAndExit(dword message, opt)
|
||||
{
|
||||
miniprintf(#param, message, opt);
|
||||
notify(#param);
|
||||
ExitProcess();
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
char img_file[4096];
|
||||
char img_info[512];
|
||||
char root_lfn[260];
|
||||
int i, entry_off, lfn_expected_seq;
|
||||
|
||||
mem_init();
|
||||
|
||||
if (!param[0]) {
|
||||
NotifyAndExit(MSG_USAGE, NULL);
|
||||
}
|
||||
|
||||
if (i = strchr(#param, '"')) {
|
||||
ESBYTE[i-1] = '\0';
|
||||
strcpy(#cur_path, i+1);
|
||||
i = strchr(#cur_path, '"');
|
||||
if (i) ESBYTE[i] = '\0';
|
||||
}
|
||||
|
||||
strcpy(#img_file, #param);
|
||||
|
||||
if (!cur_path[0]) {
|
||||
memmov(#cur_path, "/tmp0/1", 8);
|
||||
strcat(#cur_path, #img_file + strrchr(#img_file, '/') - 1);
|
||||
}
|
||||
cur_path_len = strlen(#cur_path);
|
||||
|
||||
read_file(#img_file, #img_ptr, #img_sz);
|
||||
if (!img_ptr) || (!img_sz) {
|
||||
NotifyAndExit(MSG_READ, #img_file);
|
||||
}
|
||||
|
||||
fat12__open();
|
||||
if (root_off > img_sz) || (data_off > img_sz) {
|
||||
GetImageInfo(#img_info);
|
||||
NotifyAndExit(MSG_FORMAT, #img_info);
|
||||
}
|
||||
|
||||
make_parent_dirs(#cur_path);
|
||||
if (CreateDir(#cur_path)) {
|
||||
NotifyAndExit(MSG_MKDIR, #cur_path);
|
||||
}
|
||||
|
||||
root_lfn[0] = 0;
|
||||
lfn_expected_seq = -1;
|
||||
for (i = 0; i < mre; i++) {
|
||||
entry_off = i * 32 + root_off;
|
||||
if (process_one_entry(entry_off, #root_lfn, #lfn_expected_seq) < 0) break;
|
||||
}
|
||||
|
||||
NotifyAndExit(MSG_DONE, #cur_path);
|
||||
}
|
||||
+11
-10
@@ -1,4 +1,4 @@
|
||||
// Mouse Configuration Utility ver 1.7
|
||||
// Mouse Configuration Utility ver 1.71
|
||||
|
||||
#define MEMSIZE 4096*11
|
||||
|
||||
@@ -64,11 +64,13 @@ void main() {
|
||||
{
|
||||
case evMouse:
|
||||
mouse.get();
|
||||
IF (mouse_frame.hovered()) DrawMouseImage(mouse.lkm,mouse.pkm,mouse.mkm,mouse.vert);
|
||||
IF (mouse.click) || (mouse.up) DrawMouseImage(0,0,0,0);
|
||||
IF (mouse_frame.hovered()) {
|
||||
DrawMouseImage(mouse.key&MOUSE_LEFT,mouse.key&MOUSE_RIGHT,mouse.key&MOUSE_MIDDLE,mouse.vert);
|
||||
}
|
||||
if (mouse.up) DrawMouseImage(0,0,0,0);
|
||||
break;
|
||||
|
||||
CASE evButton:
|
||||
case evButton:
|
||||
id = @GetButtonID();
|
||||
IF (1 == id) ExitApp();
|
||||
else IF (pointer_speed.click(id)) ApplyCfg();
|
||||
@@ -119,21 +121,20 @@ void main() {
|
||||
#define white 0xffffff
|
||||
#define dgrey 0x2d353d
|
||||
|
||||
:struct IMG_PAL{ dword back, shad1, contour, left, right, middle, mwhite; }
|
||||
struct IMG_PAL{ dword back, shad1, contour, left, right, middle, mwhite; }
|
||||
pal = { 0xF0F2F3,0xABB0B2, dgrey, white, white, dgrey, white };
|
||||
|
||||
void DrawMouseImage(dword l,r,m,v) {
|
||||
#define IMG_W 59
|
||||
#define IMG_H 100
|
||||
|
||||
IF (l) pal.left = red;
|
||||
IF (l) pal.left = red; else pal.left = white;
|
||||
IF (r) pal.right = red; else pal.right = white;
|
||||
IF (m) pal.middle = red;
|
||||
IF (r) pal.right = red;
|
||||
IF (v) pal.middle = yellow;
|
||||
ELSE IF (v) pal.middle = yellow;
|
||||
ELSE pal.middle = dgrey;
|
||||
|
||||
PutPaletteImage(#panels_img_data,IMG_W,IMG_H,18+30,18+16,8,#pal);
|
||||
pal.left = pal.right = white;
|
||||
pal.middle = dgrey;
|
||||
IF (v) {
|
||||
pause(10);
|
||||
DrawMouseImage(l,r,m,0);
|
||||
|
||||
+13
-2
@@ -29,7 +29,7 @@
|
||||
char default_dir[] = "/sys";
|
||||
od_filter filter2 = { 15, "MP3\0WAV\0XM\0\0" };
|
||||
|
||||
#define ABOUT_MESSAGE " v2.94 Final
|
||||
#define ABOUT_MESSAGE " v2.95 Final
|
||||
|
||||
A tiny music folder player.
|
||||
Supports MP3, WAV, XM audio file formats.
|
||||
@@ -415,6 +415,7 @@ void EventStopPlaying()
|
||||
void EventStartPlaying()
|
||||
{
|
||||
word i;
|
||||
dword dl_run_id;
|
||||
char item_path[4096];
|
||||
char notify_message[512];
|
||||
EventStopPlaying();
|
||||
@@ -433,7 +434,17 @@ void EventStartPlaying()
|
||||
DrawPlayList();
|
||||
DrawTopPanel();
|
||||
//start_playing_time =
|
||||
player_run_id = RunProgram("/sys/media/ac97snd", #item_path);
|
||||
player_run_id = RunProgram("/sys/media/ac97snd", #item_path);
|
||||
if (player_run_id < 0) {
|
||||
dl_run_id = RunProgram("/sys/network/dl", "-e http://builds.kolibrios.org/en_US/data/programs/media/ac97snd/ac97snd.bin|/sys/media/ac97snd");
|
||||
// wait for the downloader to finish (it autocloses on completion), up to ~30s
|
||||
for (i=0; i<50; i++) {
|
||||
pause(10);
|
||||
if (!GetProcessSlot(dl_run_id)) break;
|
||||
}
|
||||
player_run_id = RunProgram("/sys/media/ac97snd", #item_path);
|
||||
if (player_run_id < 0) notify("'AC97SND backend not found and its download failed :('-E");
|
||||
}
|
||||
//player_run_id = RunProgram("/kolibrios/media/minimp3", #item_path);
|
||||
sprintf(#notify_message,"'Now playing:\n%s' -St",#current_filename);
|
||||
if (!repeat) && (window_mode==WINDOW_MODE_SMALL)
|
||||
|
||||
Reference in new issue
Block a user