Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba200a37b2 | ||
|
|
f338d09bb4 | ||
|
|
c64ca00185 | ||
|
|
7c25bca493 | ||
|
|
275ee51ac4 | ||
|
|
b99f56c493 | ||
|
|
72393db48e | ||
|
|
c391d7ba48 | ||
|
|
8534576857 | ||
|
|
e4a9fc43d2 | ||
|
|
02a0a7c566 | ||
|
|
ca4cf1fb9f |
No files matched your search
+36
-53
@@ -1,6 +1,5 @@
|
||||
#define MEMSIZE 1024*40
|
||||
#include "..\lib\strings.h"
|
||||
#include "..\lib\mem.h"
|
||||
#define MEMSIZE 1024*60
|
||||
|
||||
#include "..\lib\gui.h"
|
||||
#include "..\lib\obj\proc_lib.h"
|
||||
#include "..\lib\patterns\simple_open_dialog.h"
|
||||
@@ -15,9 +14,8 @@
|
||||
|
||||
#define WINW 570
|
||||
#define WINH 300
|
||||
#define CONX 30 //content X pos
|
||||
#define SCRX WINW-180
|
||||
#define SCRY 20
|
||||
#define CONX 28 //content X pos
|
||||
#define CONY 25 //content Y pos
|
||||
|
||||
char default_dir[] = "/sys";
|
||||
od_filter filter2;
|
||||
@@ -34,29 +32,28 @@ od_filter filter2;
|
||||
//===================================================//
|
||||
|
||||
#ifdef LANG_RUS
|
||||
?define WINDOW_TITLE_TEXT "Внимание! Это важно."
|
||||
?define CONTENT_HEADER_TEXT "ПАПКА /KOLIBRIOS/ НЕ НАЙДЕНА"
|
||||
?define DESCRIPTION_TEXT "Попробуйте найти ее самостоятельно.
|
||||
Содержимое искомой папки показано на
|
||||
картинке справа. В случае неверно
|
||||
выбранной папки требуется выполнить
|
||||
перезагрузку ПК и попробовать снова."
|
||||
?define WINDOW_TITLE_TEXT "Внимание!"
|
||||
?define CONTENT_HEADER_TEXT "KolibriOS работает в режиме дискеты"
|
||||
?define DESCRIPTION_TEXT "Многие приложения сейчас недоступны.
|
||||
|
||||
Причина в том, что не смонтирован дополнительный системный
|
||||
каталог. Но вы можете найти и задать его вручную. Его название
|
||||
'kolibrios'. Вы также можете загрузить latest-dirstr.7z через
|
||||
WebView и найти его внутри."
|
||||
?define MANUALLY_BUTTON_TEXT "Указать папку /kolibrios/..."
|
||||
?define OPEN_ANYWAY_BUTTON_TEXT "Запустить APP+ (некоторые программы будут недоступны)"
|
||||
#else
|
||||
?define WINDOW_TITLE_TEXT "Warning! It's important."
|
||||
?define CONTENT_HEADER_TEXT "/KOLIBRIOS/ IS NOT MOUNTED"
|
||||
?define DESCRIPTION_TEXT "Try to find it manually. It should look
|
||||
like image on the right.
|
||||
Note: this action can be done only once
|
||||
per 1 session of the OS running. If you
|
||||
will choose the wrong folder then you
|
||||
need to reboot a system to try again."
|
||||
?define MANUALLY_BUTTON_TEXT "Choose /kolibrios/ folder..."
|
||||
?define OPEN_ANYWAY_BUTTON_TEXT "Open APP+ anyway (some programs won't be available) "
|
||||
#endif
|
||||
?define WINDOW_TITLE_TEXT "Warning!"
|
||||
?define CONTENT_HEADER_TEXT "KolibriOS is running in floppy mode"
|
||||
?define DESCRIPTION_TEXT "A lot of apps aren't available.
|
||||
|
||||
char kolibrios_dirs[] = "..\0 3D \0demos \0develop\0drivers\0emul \0games \0grafx2";
|
||||
The reason is that additional system directory is not mounted.
|
||||
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)"
|
||||
#endif
|
||||
|
||||
//===================================================//
|
||||
// //
|
||||
@@ -104,38 +101,22 @@ void draw_window()
|
||||
{
|
||||
sc.get();
|
||||
DefineAndDrawWindow(screen.w-WINW/2, 100, WINW, WINH+skin_h, 0x34, sc.work, WINDOW_TITLE_TEXT,0);
|
||||
WriteTextB(CONX+2,SCRY+2,0x81,MixColors(sc.work, 0xB92234,220),CONTENT_HEADER_TEXT);
|
||||
WriteTextB(CONX,SCRY,0x81,0xB92234,CONTENT_HEADER_TEXT);
|
||||
draw_screen();
|
||||
WriteTextLines(CONX,SCRY+50,0x90,sc.work_text,DESCRIPTION_TEXT,20);
|
||||
DrawButtons();
|
||||
}
|
||||
|
||||
void draw_screen()
|
||||
{
|
||||
char i;
|
||||
int icon_n=1;
|
||||
DrawRectangle(WINW-180-1,SCRY-1, 145+1,170+1, sc.line);
|
||||
DrawBar(SCRX,SCRY,145,170,0xFFFfff);
|
||||
DrawBar(SCRX+25,SCRY+5,144-25,20,0xBBDDFF);
|
||||
for (i=0; i<8; i++) {
|
||||
draw_icon_16(SCRX+5, i*20+SCRY+5, icon_n);
|
||||
WriteText(SCRX+27, i*20+SCRY+11, 0x80, 0, i*8 + #kolibrios_dirs);
|
||||
icon_n = 0;
|
||||
}
|
||||
draw_icon_16w(CONX+2, CONY-3, 5);
|
||||
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();
|
||||
}
|
||||
|
||||
void DrawButtons()
|
||||
{
|
||||
DrawStandartCaptButton(CONX, WINH-80, BTN_MANUAL_SEARCH, MANUALLY_BUTTON_TEXT);
|
||||
DrawStandartCaptButton(CONX, WINH-42, BTN_OPEN_ANYWAY, OPEN_ANYWAY_BUTTON_TEXT);
|
||||
//DrawCaptButton(CONX, WINH-80, 300, 25, BTN_MANUAL_SEARCH, sc.button, sc.button_text, MANUALLY_BUTTON_TEXT);
|
||||
//DrawCaptButton(CONX, WINH-42, 500, 25, BTN_OPEN_ANYWAY, sc.button, sc.button_text, OPEN_ANYWAY_BUTTON_TEXT);
|
||||
DrawStandartCaptButton(CONX, WINH-CONY-58, BTN_MANUAL_SEARCH, MANUALLY_BUTTON_TEXT);
|
||||
DrawStandartCaptButton(CONX, WINH-CONY-22, BTN_OPEN_ANYWAY, OPEN_ANYWAY_BUTTON_TEXT);
|
||||
}
|
||||
|
||||
void CheckKosMounted()
|
||||
{
|
||||
if (dir_exists("/kolibrios"))
|
||||
if (dir_exists("/kolibrios"))
|
||||
{
|
||||
if (file_exists(APP_PLUS_INI_PATH)) EventOpenApp();
|
||||
ExitProcess();
|
||||
@@ -158,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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,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:
|
||||
+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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-8
@@ -32,7 +32,7 @@ char proxy_address[256];
|
||||
#include "settings.h"
|
||||
|
||||
char* active_status;
|
||||
char* save_path_set = false;
|
||||
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};
|
||||
@@ -87,7 +87,6 @@ void main()
|
||||
strcpy(#uEdit, URL_SPEED_TEST);
|
||||
} else {
|
||||
strcpy(#uEdit, path_pointer);
|
||||
debugln(path_pointer);
|
||||
}
|
||||
// }
|
||||
}
|
||||
@@ -182,7 +181,7 @@ 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);
|
||||
WriteText(GAPX, WIN_H - 48, 0x90, sc.work_text, T_SAVE_TO);
|
||||
WriteTextWithBg(GAPX, WIN_H - 48, 0xD0, sc.work_text, T_SAVE_TO, sc.work);
|
||||
if (save_path_set) {
|
||||
WriteTextWithBg(GAPX + 108, WIN_H - 48, 0xD0, sc.work_text, #filepath, sc.light);
|
||||
} else {
|
||||
@@ -320,7 +319,7 @@ void SaveFile(int attempt)
|
||||
char notify_message[4296];
|
||||
char file_name[URL_SIZE+96];
|
||||
|
||||
//if save_path is not set than we have to combine it
|
||||
//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
|
||||
@@ -353,10 +352,14 @@ void SaveFile(int attempt)
|
||||
for (i=0; i<strlen(#filepath); i++) if(filepath[i]==':')||(filepath[i]=='?')filepath[i]='-';
|
||||
}
|
||||
|
||||
while (file_exists(#filepath)) {
|
||||
SaveFile(attempt+1);
|
||||
return;
|
||||
}
|
||||
// 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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -905,8 +905,16 @@ inline signed csshexdec(dword text)
|
||||
:dword miniprintf(dword dst, format, insert_line)
|
||||
{
|
||||
dword in_pos = strchr(format, '%');
|
||||
|
||||
if (!in_pos) {
|
||||
_NO_STR:
|
||||
strcpy(dst, format);
|
||||
return dst;
|
||||
}
|
||||
|
||||
EBX = ESBYTE[EAX+1];
|
||||
if (EBX == 's') {
|
||||
if (!insert_line) goto _NO_STR;
|
||||
strncpy(dst, format, in_pos - format);
|
||||
strcat(dst, insert_line);
|
||||
strcat(dst, in_pos+2);
|
||||
|
||||
@@ -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")
|
||||
+335
@@ -0,0 +1,335 @@
|
||||
// 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;
|
||||
|
||||
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;
|
||||
// clamp to remaining size
|
||||
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);
|
||||
//debugln(#path);
|
||||
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 & 0x0F == 0x0F) return 0;
|
||||
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;
|
||||
}
|
||||
|
||||
int handle_entry(int off)
|
||||
{
|
||||
char name[13];
|
||||
int nlen, attr, cluster, size, saved_len;
|
||||
dword buf;
|
||||
|
||||
if (off < 0) || (off + 32 > img_sz) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
nlen = entry_short_name(off, #name);
|
||||
|
||||
if (nlen < 0) return -1;
|
||||
if (nlen == 0) return 0;
|
||||
if (name[0] == '.') return 0;
|
||||
|
||||
attr = fat_u8(off + 11);
|
||||
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;
|
||||
while (cluster >= 2) && (cluster < 0xFF7) {
|
||||
off = cluster_to_offset(cluster);
|
||||
|
||||
// Check that offset don't go negative
|
||||
// and we don't read over img size (img_sz)
|
||||
if (off < 0) || (off + bpc > img_sz) {
|
||||
notify(MSG_OOB);
|
||||
return;
|
||||
}
|
||||
|
||||
entries = bpc / 32;
|
||||
for (i = 0; i < entries; i++) {
|
||||
if (handle_entry(i * 32 + off) < 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];
|
||||
int i;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
for (i = 0; i < mre; i++) {
|
||||
if (handle_entry(i * 32 + root_off) < 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);
|
||||
|
||||
+8
-5
@@ -11,7 +11,6 @@
|
||||
#include "../lib/gui.h"
|
||||
#include "../lib/random.h"
|
||||
#include "../lib/kfont.h"
|
||||
#include "../lib/fs.h"
|
||||
|
||||
#include "../lib/obj/libimg.h"
|
||||
#include "../lib/obj/libini.h"
|
||||
@@ -30,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.
|
||||
@@ -416,7 +415,7 @@ void EventStopPlaying()
|
||||
void EventStartPlaying()
|
||||
{
|
||||
word i;
|
||||
BDVK CopyFile_atr;
|
||||
dword dl_run_id;
|
||||
char item_path[4096];
|
||||
char notify_message[512];
|
||||
EventStopPlaying();
|
||||
@@ -437,8 +436,12 @@ void EventStartPlaying()
|
||||
//start_playing_time =
|
||||
player_run_id = RunProgram("/sys/media/ac97snd", #item_path);
|
||||
if (player_run_id < 0) {
|
||||
RunProgram("/sys/network/dl", "-e http://builds.kolibrios.org/en_US/data/programs/media/ac97snd/ac97snd.bin|/sys/media/ac97snd");
|
||||
pause(100);
|
||||
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");
|
||||
}
|
||||
|
||||
+2
-3
@@ -128,8 +128,7 @@ void main()
|
||||
break;
|
||||
case SCAN_CODE_TAB:
|
||||
show_system.checked ^= 1;
|
||||
SelectList_LineChanged();
|
||||
break;
|
||||
goto _DRAW_WINDOW;
|
||||
default:
|
||||
if (select_list.ProcessKey(key_scancode)) {
|
||||
SelectList_LineChanged();
|
||||
@@ -157,6 +156,7 @@ void main()
|
||||
case evReDraw:
|
||||
sc.get();
|
||||
DefineAndDrawWindow(Form.left, Form.top, Form.width, Form.height, 0x33, sc.work, T_APP_TITLE, 0);
|
||||
WriteText(GAP+5, WIN_CONTENT_Y-20, 0x90, sc.work_text, T_PROC_HEADER);
|
||||
_DRAW_WINDOW:
|
||||
GetProcessInfo(#Form, SelfInfo);
|
||||
if (Form.status_window&ROLLED_UP) break;
|
||||
@@ -168,7 +168,6 @@ void main()
|
||||
}
|
||||
right_w = Form.cwidth - RIGHT_X - GAP;
|
||||
right_w &= ~1; // make sure the number is even
|
||||
WriteText(GAP+5, WIN_CONTENT_Y-20, 0x90, sc.work_text, T_PROC_HEADER);
|
||||
|
||||
DefineButton(RIGHT_X-38,WIN_CONTENT_Y-25,18,18,BTN_SHOWHIDE_SENSORS,sc.button);
|
||||
DrawRectangle3D(RIGHT_X-38,WIN_CONTENT_Y-25,19,18,sc.line,sc.light);
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
@del tmpdisk
|
||||
@rename tmpdisk.com tmpdisk
|
||||
@del warning.txt
|
||||
@pause
|
||||
if not exist tmpdisk ( @pause )
|
||||
@@ -2,4 +2,4 @@
|
||||
@del tmpdisk
|
||||
@rename tmpdisk.com tmpdisk
|
||||
@del warning.txt
|
||||
@pause
|
||||
if not exist tmpdisk ( @pause )
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 236 B |
@@ -1 +0,0 @@
|
||||
ЬЬЬЬЬЬЬЬЬЬЬЬЬЬД╝<┘I╝<┘I╝<┘I╝<┘I╝<┘I┘I┘IЬД┤<╝<┘I╝<ЬЬЬЬ┘I╝<┘I┘IЬД╝<┤<╝<╝<Ь№№№№№№Ь╝<┘I╝<┘IЬД┤<╝<┘I┤<Ь№№№№№№Ь╝<╝<┘I╝<ЬД┤<ЬЬЬЬ№№№№№№ЬЬЬЬ┘IЬД┤<Ь№№№№№№№№№№№№№№№№№№№№№№№№Ь╝<ЬД╝<Ь№№№№№№№№№№№№№№№№№№№№№№№№Ь┘IЬД┤<ЬЬЬЬ№№№№№№ЬЬЬЬ┘IЬД┤<┤<╝<┤<Ь№№№№№№Ь┘I╝<╝<┘IЬД┤<╝<┤<╝<Ь№№№№№№Ь┘I╝<┘I╝<ЬД╝<┤<╝<┤<ЬЬЬЬ╝<┤<╝<┘IЬДд4┤<д4┤<┤<╝<┤<┤<┤<╝<┤<╝<ЬДДДДДДДДДДДДДД,Ф,Ф,Ф,Ф,Ф,Ф,Ф,Ф,Ф,Ф,Ф,Ф,Ф,Ф,ФD▄SЇD▄SЇSЇSЇSЇSЇSЇSЇSЇSЇ,Ф,Ф<┌D▄SЇD▄D▄SЇD▄SЇD▄SЇSЇSЇ,Ф,ФD▄<┌D▄D▄D▄D▄SЇD▄SЇD▄SЇSЇ,Ф,Ф<┌D▄SЇ<┌D▄D▄D▄SЇD▄SЇD▄SЇ,Ф,Ф<┌4┤4┤4┤4┤4┤4┤4┤4┤4┤4┤SЇ,Ф,Ф<┌4┤№№№№№№№№№№№№№№№№№№№№№№№№4┤D▄,Ф,ФD▄4┤№№№№№№№№№№№№№№№№№№№№№№№№4┤SЇ,Ф,Ф<┌4┤4┤4┤4┤4┤4┤4┤4┤4┤4┤SЇ,Ф,Ф<┌D▄D▄D▄<┌D▄D▄<┌SЇD▄D▄SЇ,Ф,Ф9┴D▄D▄D▄D▄D▄D▄D▄SЇD▄SЇD▄,Ф,ФD▄9┴D▄9┴D▄9┴D▄9┴D▄<┌D▄SЇ,Ф,Ф9┴<┌9┴<┌9┴D▄9┴<┌9┴D▄<┌D▄,Ф,Ф,Ф,Ф,Ф,Ф,Ф,Ф,Ф,Ф,Ф,Ф,Ф,Ф,Ф
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 114 B |
@@ -1 +0,0 @@
|
||||
lddTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTlddTTTффф№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№фффTTTTTT┤ммффффффффффффффффффффффффффффффффф┤ммTTTTTT┤ммффффффффффффффффффффффффффффффффф┤ммTTTTTT┤ммффффффффффффффффффффффффффффффффф┤ммTTTTTT┤мм┤мм┤мм┤мм┤мм┤мм┤мм┤мм┤мм┤мм┤мм┤мм┤ммTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT№№№TTT№№№TTT№№№TTT№№№TTT№№№TTT№№№TTT№№№TTT№№№№№№TTT№№№TTT№№№TTT№№№TTT№№№TTT№№№TTT№№№TTT№№№
|
||||
+7
-6
@@ -16,7 +16,7 @@
|
||||
0};
|
||||
#else
|
||||
?define DELETE_DISK_TEXT "Trying to delete /tmp%i"
|
||||
?define NEW_DISK_TEXT "Trying to add virtual disk /tmp%i, the size of %i MB"
|
||||
?define NEW_DISK_TEXT "Trying to add RAM disk /tmp%i, the size of %i MB"
|
||||
char *rezult_text[]={
|
||||
"TmpDisk operation completed successfully",
|
||||
"unknown IOCTL code, wrong input/output size...",
|
||||
@@ -31,7 +31,7 @@
|
||||
char Console_Work()
|
||||
{
|
||||
unsigned int disk_size, driver_rezult;
|
||||
char size_t[256];
|
||||
char t_size[256];
|
||||
|
||||
strlwr(#param);
|
||||
|
||||
@@ -45,8 +45,8 @@ char Console_Work()
|
||||
ioctl.inp_size = sizeof(del_disk);
|
||||
ioctl.output = 0;
|
||||
ioctl.out_size = 0;
|
||||
sprintf(#size_t, DELETE_DISK_TEXT, add_disk.DiskId);
|
||||
debugln(#size_t);
|
||||
miniprintf(#t_size, DELETE_DISK_TEXT, add_disk.DiskId);
|
||||
debugln(#t_size);
|
||||
break;
|
||||
case 'a': //Add disk
|
||||
disk_size= strchr(#param, 's');
|
||||
@@ -62,8 +62,9 @@ char Console_Work()
|
||||
ioctl.inp_size = sizeof(add_disk);
|
||||
ioctl.output = 0;
|
||||
ioctl.out_size = 0;
|
||||
sprintf(#size_t, NEW_DISK_TEXT, add_disk.DiskId, add_disk.DiskSize/2048);
|
||||
debugln(#size_t);
|
||||
miniprintf(#t_size, NEW_DISK_TEXT, add_disk.DiskId);
|
||||
miniprintf(#param, #t_size, add_disk.DiskSize/2048);
|
||||
debugln(#param);
|
||||
break;
|
||||
default:
|
||||
debugln("\ntmpdisk: unknown command line parameters!");
|
||||
|
||||
+84
-69
@@ -5,33 +5,47 @@
|
||||
#include "..\lib\gui.h"
|
||||
#include "..\lib\obj\box_lib.h"
|
||||
|
||||
//===================================================//
|
||||
// //
|
||||
// TRANSLATIONS //
|
||||
// //
|
||||
//===================================================//
|
||||
|
||||
#ifdef LANG_RUS
|
||||
?define T_WIN_TITLE "TmpDisk 0.80: Управление дисками в ОЗУ"
|
||||
?define T_ADD_DISK " Добавить диск [Ins]"
|
||||
?define T_DELETE_DISK " Удалить диск [Del]"
|
||||
?define INTRO_TEXT_1 "Здесь будет отображаться список"
|
||||
?define INTRO_TEXT_2 "виртуальных дисков в системе."
|
||||
?define INTRO_TEXT_3 "Попробуйте добавить один..."
|
||||
?define SIZE_TEXT "Размер нового диска в МБ:"
|
||||
?define INTRO_TEXT_1 "Ни одного диска пока не добавлено."
|
||||
?define INTRO_TEXT_2 "Пожалуйста, добавьте tmp0, он необходим."
|
||||
?define NEW_DISK_SIZE "Размер нового диска"
|
||||
?define NEW_DISK_SIZE_W 19*8
|
||||
?define NOTIFY_TEXT_NO_DISK "'Для начала добавьте хотя бы один диск' -W"
|
||||
?define NOTIFY_SYSTEM_DISK0 "'Диск с номером 0 является системным и удалять его не рекомендуется.
|
||||
В случае, если вы точно знаете, что делаете, удалить его можно с зажатой клавишей SHIFT.' -W"
|
||||
?define NOTIFY_TEXT_DISK_LIMIT "'Достигнут предел количества виртуальных дисков' -W"
|
||||
?define FREE_RAM_TEXT "Размер свободной оперативной памяти: %i MБ"
|
||||
?define FREE_RAM_TEXT "MB (Доступно %i MБ)"
|
||||
|
||||
#else
|
||||
?define T_WIN_TITLE "TmpDisk 0.80: RAM Disk Manager"
|
||||
?define T_ADD_DISK " Add disk [Ins]"
|
||||
?define T_DELETE_DISK " Delete disk [Del]"
|
||||
?define INTRO_TEXT_1 " There will be list of mounted"
|
||||
?define INTRO_TEXT_2 " virtual disks."
|
||||
?define INTRO_TEXT_3 " Try to add one..."
|
||||
?define SIZE_TEXT "New Disk size in MB:"
|
||||
?define INTRO_TEXT_1 "No disks added yet."
|
||||
?define INTRO_TEXT_2 "Please add tmp0 as it is crucial."
|
||||
?define NEW_DISK_SIZE "New Disk size"
|
||||
?define NEW_DISK_SIZE_W 13*8
|
||||
?define NOTIFY_TEXT_NO_DISK "'You need to have at least one disk' -W"
|
||||
?define NOTIFY_SYSTEM_DISK0 "'Disc number 0 is a system disk. It is not recommended to delete it.
|
||||
In case when you know what you are doing you can delete it with the SHIFT key pressed.' -W"
|
||||
?define NOTIFY_TEXT_DISK_LIMIT "'Reached the limit of the number of virtual disks' -W"
|
||||
?define FREE_RAM_TEXT "Free RAM size: %i MB"
|
||||
?define FREE_RAM_TEXT "MB (Free RAM: %i MB)"
|
||||
#endif
|
||||
|
||||
//===================================================//
|
||||
// //
|
||||
// DATA //
|
||||
// //
|
||||
//===================================================//
|
||||
|
||||
struct path_string { unsigned char Item[10]; };
|
||||
path_string disk_list[10];
|
||||
|
||||
@@ -39,26 +53,31 @@ dword devbuf;
|
||||
char disk_num;
|
||||
char selected;
|
||||
|
||||
proc_info Form;
|
||||
#define WIN_W 400
|
||||
#define WIN_H 240
|
||||
|
||||
unsigned char icons_btn[] = FROM "img/btn.raw";
|
||||
unsigned char disk_icon[] = FROM "img/disk.raw";
|
||||
#define TOPPANELH 68
|
||||
#define BOTPANELH 26
|
||||
?define FREE_RAM_TEXT_X NEW_DISK_SIZE_W + 61
|
||||
|
||||
char new_disk_size[7];
|
||||
edit_box edit_disk_size= {50,0,7,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,
|
||||
sizeof(new_disk_size)-2,#new_disk_size,0, ed_focus+ed_figure_only};
|
||||
char new_disk_size[5];
|
||||
edit_box edit_disk_size= {40,NEW_DISK_SIZE_W+13,6,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,
|
||||
sizeof(new_disk_size)-1,#new_disk_size,0, ed_focus+ed_figure_only};
|
||||
|
||||
char tmp_path[8] = "/tmp#/1";
|
||||
|
||||
//===================================================//
|
||||
// //
|
||||
// CODE //
|
||||
// //
|
||||
//===================================================//
|
||||
|
||||
void Main_Window()
|
||||
{
|
||||
word id;
|
||||
int x;
|
||||
proc_info Form;
|
||||
|
||||
#define NO_DLL_INIT
|
||||
load_dll(boxlib, #box_lib_init,0);
|
||||
GetNewSizeDisk();
|
||||
edit_disk_size.left = strlen(SIZE_TEXT)*8 + 13;
|
||||
@SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
|
||||
loop()
|
||||
{
|
||||
@@ -143,44 +162,49 @@ void Main_Window()
|
||||
break;
|
||||
case evReDraw:
|
||||
sc.get();
|
||||
DefineAndDrawWindow(170,150,405,290,0x74,sc.work,"Virtual Disk Manager 0.69",0);
|
||||
DefineAndDrawWindow(screen.w-WIN_W/2,screen.h-WIN_H/2,
|
||||
WIN_W+9, WIN_H+skin_h+4,0x74,sc.work,T_WIN_TITLE,0);
|
||||
GetProcessInfo(#Form, SelfInfo);
|
||||
if (Form.status_window&ROLLED_UP) break;
|
||||
|
||||
DrawBar(0,0, Form.cwidth,TOPPANELH, sc.work);
|
||||
DrawBar(0,TOPPANELH, Form.cwidth,1, sc.line);
|
||||
WriteText(6, 9, 0x90, sc.work_text, SIZE_TEXT);
|
||||
DrawRectangle(edit_disk_size.left-1, edit_disk_size.top-1, edit_disk_size.width+2, 23,sc.line);
|
||||
edit_box_draw stdcall (#edit_disk_size);
|
||||
x = 6 + DrawStandartCaptButton(6, 36, 10, T_ADD_DISK);
|
||||
DrawStandartCaptButton(x, 36, 11, T_DELETE_DISK);
|
||||
PutImage(6+6, 42, 14,14, #icons_btn);
|
||||
PutImage(x+6, 42, 14,14, 14*14*3+#icons_btn);
|
||||
GetDisks();
|
||||
DrawTmpDisks();
|
||||
DrawWindowContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DrawWindowContent()
|
||||
{
|
||||
int x;
|
||||
char free_ram_text[60];
|
||||
DrawBar(0,0, WIN_W,TOPPANELH, sc.work);
|
||||
DrawBar(0,TOPPANELH, WIN_W,1, sc.line);
|
||||
WriteText(6, 9, 0x90, sc.work_text, NEW_DISK_SIZE);
|
||||
DrawRectangle(edit_disk_size.left-1, edit_disk_size.top-1, edit_disk_size.width+2, 23,sc.line);
|
||||
edit_box_draw stdcall (#edit_disk_size);
|
||||
#define BTN_W WIN_W - 12 / 2 - 3
|
||||
DrawCaptButton(6, 36, BTN_W, 24, 10, 0x45975E, 0xFFFfff, T_ADD_DISK);
|
||||
DrawCaptButton(6+BTN_W+6, 36, BTN_W, 24, 11, 0xC75C54, 0xFFFfff, T_DELETE_DISK);
|
||||
miniprintf(#free_ram_text, FREE_RAM_TEXT, GetFreeRAM()/1024);
|
||||
WriteText(FREE_RAM_TEXT_X, 9, 0x90, sc.work_text, #free_ram_text);
|
||||
GetDisks();
|
||||
DrawTmpDisks();
|
||||
}
|
||||
|
||||
|
||||
void GetNewSizeDisk()
|
||||
{
|
||||
int fr;
|
||||
fr = GetFreeRAM() / 5 * 2;
|
||||
fr = itoa(fr / 2048);
|
||||
strcpy(#new_disk_size, fr);
|
||||
EditBox_UpdateText(#edit_disk_size, edit_disk_size.flags);
|
||||
edit_box_draw stdcall (#edit_disk_size);
|
||||
edit_box_set_text stdcall (#edit_disk_size, fr);
|
||||
}
|
||||
|
||||
|
||||
void OpenTmpDisk()
|
||||
{
|
||||
unsigned char eol_param[10];
|
||||
if (!disk_num) return;
|
||||
strcpy(#eol_param, "/tmp#/1");
|
||||
eol_param[4] = disk_list[selected].Item[3];
|
||||
RunProgram("/sys/File managers/Eolite", #eol_param);
|
||||
if (disk_num) {
|
||||
tmp_path[4] = disk_list[selected].Item[3];
|
||||
RunProgram("/sys/File managers/Eolite", #tmp_path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -209,16 +233,6 @@ void GetDisks()
|
||||
}
|
||||
|
||||
|
||||
dword GetDiskSize(dword disk_n)
|
||||
{
|
||||
BDVK bdvk;
|
||||
char tmp_path[8];
|
||||
strcpy(#tmp_path, "/tmp#/1");
|
||||
tmp_path[4] = disk_n + '0';
|
||||
GetFileInfo(#tmp_path, #bdvk);
|
||||
return bdvk.sizelo;
|
||||
}
|
||||
|
||||
unsigned int disk_pos_x[]={13,13,13,102,102,102,191,191,191,279,279,279};
|
||||
unsigned int disk_pos_y[]={79,127,175, 79,127,175, 79,127,175, 79,127,175};
|
||||
|
||||
@@ -227,19 +241,13 @@ void DrawTmpDisks()
|
||||
#define SELECTION_ACTIVE 0x0080FF;
|
||||
#define SELECTION_INACTIVE 0x757489;
|
||||
dword selection_color;
|
||||
char free_ram_text[60];
|
||||
byte i;
|
||||
|
||||
DrawBar(0,TOPPANELH+1, Form.cwidth,Form.cheight-TOPPANELH-BOTPANELH-2, 0xFFFFFF);
|
||||
DrawBar(0,Form.cheight-BOTPANELH-1, Form.cwidth,1, sc.line);
|
||||
DrawBar(0,Form.cheight-BOTPANELH, Form.cwidth,BOTPANELH, sc.work);
|
||||
sprintf(#free_ram_text, FREE_RAM_TEXT, GetFreeRAM()/1024);
|
||||
WriteText(10, Form.cheight-20, 0x90, sc.work_text, #free_ram_text);
|
||||
DrawBar(0,TOPPANELH+1, WIN_W,WIN_H-TOPPANELH-1, sc.light);
|
||||
if (disk_num==0)
|
||||
{
|
||||
WriteText(17,TOPPANELH+15, 0x90, 0x777777, INTRO_TEXT_1);
|
||||
WriteText(17,TOPPANELH+15+15, 0x90, 0x777777, INTRO_TEXT_2);
|
||||
WriteText(17,TOPPANELH+15+42, 0x90, 0x777777, INTRO_TEXT_3);
|
||||
WriteText(20, TOPPANELH+22, 0x90, sc.work_text, INTRO_TEXT_1);
|
||||
WriteText(20, TOPPANELH+40, 0x90, 0xFF000d, INTRO_TEXT_2);
|
||||
return;
|
||||
};
|
||||
if (selected>=disk_num) selected=disk_num-1; //restore selected
|
||||
@@ -248,21 +256,29 @@ void DrawTmpDisks()
|
||||
DeleteButton(20+i);
|
||||
if (i>=disk_num) continue;
|
||||
DefineButton(disk_pos_x[i], disk_pos_y[i], 80, 40, 20+i, 0xFFFfff);
|
||||
WriteText(disk_pos_x[i]+29,disk_pos_y[i]+6, 0x90, 0x222222, #disk_list[i].Item);
|
||||
WriteText(disk_pos_x[i]+30,disk_pos_y[i]+24, 0x80, 0x555555,
|
||||
ConvertSize(GetDiskSize(disk_list[i].Item[3] - '0')));
|
||||
PutImage(disk_pos_x[i]+9,disk_pos_y[i]+10, 15,9, #disk_icon);
|
||||
WriteText(disk_pos_x[i]+34,disk_pos_y[i]+6, 0x90, 0x222222, #disk_list[i].Item);
|
||||
WriteText(disk_pos_x[i]+36,disk_pos_y[i]+24, 0x80, 0x555555,
|
||||
GetDiskSizeInMb(disk_list[i].Item[3]));
|
||||
draw_icon_16(disk_pos_x[i]+10,disk_pos_y[i]+10, 51);
|
||||
if (selected==i) {
|
||||
if ( edit_disk_size.flags & ed_focus)
|
||||
selection_color = SELECTION_INACTIVE;
|
||||
else
|
||||
selection_color = SELECTION_ACTIVE;
|
||||
DrawWideRectangle(disk_pos_x[i], disk_pos_y[i], 80, 40, 2, selection_color);
|
||||
PutPixel(disk_pos_x[i], disk_pos_y[i], 0xFFFfff);
|
||||
PutPixel(disk_pos_x[i], disk_pos_y[i], sc.light);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:dword GetDiskSizeInMb(dword disk_n)
|
||||
{
|
||||
BDVK bdvk;
|
||||
tmp_path[4] = disk_n;
|
||||
GetFileInfo(#tmp_path, #bdvk);
|
||||
miniprintf(#param, "%i MB", bdvk.sizelo / 1048576);
|
||||
return #param;
|
||||
}
|
||||
|
||||
void AddDisk()
|
||||
{
|
||||
@@ -290,9 +306,8 @@ void AddDisk()
|
||||
err = Console_Work();
|
||||
if ((err!=0) && (err<7)) notify(rezult_text[err]);
|
||||
pause(5);
|
||||
GetDisks();
|
||||
DrawTmpDisks();
|
||||
GetNewSizeDisk();
|
||||
DrawWindowContent();
|
||||
}
|
||||
|
||||
|
||||
@@ -314,8 +329,8 @@ void DelDisk()
|
||||
err = byte Console_Work();
|
||||
if ((err!=0) && (err<7)) notify(rezult_text[err]);
|
||||
pause(15);
|
||||
GetDisks();
|
||||
DrawTmpDisks();
|
||||
GetNewSizeDisk();
|
||||
DrawWindowContent();
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#define MEMSIZE 0xA0000
|
||||
#define MEMSIZE 1024*30
|
||||
#include "..\lib\kolibri.h"
|
||||
#include "..\lib\mem.h"
|
||||
#include "..\lib\strings.h"
|
||||
|
||||
Reference in new issue
Block a user