diff --git a/data/Tupfile.lua b/data/Tupfile.lua index 339ec27ffb..4bc5ed254c 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -333,6 +333,7 @@ tup.append_table(img_files, { {"@SS", PROGS .. "/system/ss/trunk/@ss"}, {"@VOLUME", PROGS .. "/media/volume/volume"}, {"HACONFIG", PROGS .. "/other/ha/HACONFIG"}, + {"APM", PROGS .. "/system/apm/apm"}, {"ASCIIVJU", PROGS .. "/develop/asciivju/trunk/asciivju"}, {"CALC", PROGS .. "/other/calc/trunk/calc"}, {"CALENDAR", PROGS .. "/system/calendar/trunk/calendar"}, diff --git a/data/common/icons16.png b/data/common/icons16.png index 5869f6c1d5..a384efd65c 100644 Binary files a/data/common/icons16.png and b/data/common/icons16.png differ diff --git a/data/common/icons32.png b/data/common/icons32.png index 059dba67b2..e101514fa8 100644 Binary files a/data/common/icons32.png and b/data/common/icons32.png differ diff --git a/data/common/settings/syspanel.ini b/data/common/settings/syspanel.ini index 2be89679b1..2bc61e6daf 100644 --- a/data/common/settings/syspanel.ini +++ b/data/common/settings/syspanel.ini @@ -1,8 +1,8 @@ [Config] -window_width=600 +title=KolibriOS System Panel +win_width=670 cell_w=82 cell_h=78 -window_title=KolibriOS System Panel [Configuration] RamDisks=tmpdisk,36 @@ -19,6 +19,7 @@ Mouse=mousecfg,54 DriverInstall=/k/drivers/DRVINST.KEX,38 Autorun=tinypad|/sys/settings/autorun.dat,55 HotAngles=HACONFIG,105 +APM=apm,76 [Monitoring] Debug Board=develop/board,19 diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index 498699cecd..9960942e90 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -52,6 +52,7 @@ enum { struct Eolite_colors { + bool def; dword lpanel; dword list_vert_line; //vertical line between columns in list dword selec; @@ -588,7 +589,7 @@ void draw_window() //main rectangles DrawRectangle(1,40,Form.cwidth-3,Form.cheight - 42-status_bar_h,col.graph); DrawRectangle(0,39,Form.cwidth-1,-show_status_bar.checked*status_bar_h + Form.cheight - 40,col.work_gradient[4]); //bg - for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col.work_gradient[11-i]); + for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col.work_gradient[-i*3+15]); llist_copy(#files_active, #files); strcpy(#active_path, #path); DrawStatusBar(); diff --git a/programs/cmm/eolite/include/gui.h b/programs/cmm/eolite/include/gui.h index 63f5c6f20b..18d23057a4 100644 --- a/programs/cmm/eolite/include/gui.h +++ b/programs/cmm/eolite/include/gui.h @@ -67,7 +67,7 @@ void DrawFilledBar(dword x, y, w, h) { int i, fill_h; if (h < 12) { - for (i=0; i=65) { //use light colors + col.def = true; col.list_bg = 0xFFFfff; col.list_gb_text = 0x000000; col.list_text_hidden = 0xA6A6B7; @@ -249,6 +250,7 @@ void SetAppColors() else { //use dark colors + col.def = false; col.list_bg = system.color.work; col.list_gb_text = system.color.work_text; col.list_text_hidden = 0xA6A6B7; diff --git a/programs/cmm/eolite/include/translations.h b/programs/cmm/eolite/include/translations.h index cd673c8238..9851750ce3 100644 --- a/programs/cmm/eolite/include/translations.h +++ b/programs/cmm/eolite/include/translations.h @@ -1,5 +1,5 @@ -#define TITLE "Eolite File Manager 4.21b" -#define ABOUT_TITLE "EOLITE 4.21b" +#define TITLE "Eolite File Manager 4.21c" +#define ABOUT_TITLE "EOLITE 4.21c" #ifdef LANG_RUS ?define T_FILE "” ©«" diff --git a/programs/cmm/kf_font_viewer/font_viewer.c b/programs/cmm/kf_font_viewer/font_viewer.c index 14a0d6f9fa..eaac2c9e51 100644 --- a/programs/cmm/kf_font_viewer/font_viewer.c +++ b/programs/cmm/kf_font_viewer/font_viewer.c @@ -17,6 +17,7 @@ _tabs tabs = { PHRASE_TAB }; block preview = { 0, PANELH, WIN_W, WIN_H - PANELH }; checkbox bold = { "Bold", false }; checkbox smooth = { "Smooth", true }; +checkbox colored = { "Colored", true }; void main() { @@ -31,8 +32,9 @@ void main() case evButton: btn = GetButtonID(); if (btn==1) ExitProcess(); - if (bold.click(btn)) kfont.bold = bold.checked; - if (smooth.click(btn)) kfont.smooth = smooth.checked; + bold.click(btn); + smooth.click(btn); + colored.click(btn); if (btn==PHRASE_TAB) || (btn==CHARS_TAB) tabs.click(btn); goto _DRAW_WINDOW_CONTENT; case evReDraw: @@ -42,10 +44,14 @@ void main() if (Form.status_window>2) break; _DRAW_WINDOW_CONTENT: + kfont.bold = bold.checked; + kfont.smooth = smooth.checked; + DrawBar(0, 0, Form.cwidth, PANELH-1, system.color.work); DrawBar(0, PANELH-1,Form.cwidth,1,system.color.work_graph); bold.draw(10, 8); smooth.draw(83,8); + colored.draw(170,8); tabs.draw_button(Form.cwidth-130, PHRASE_TAB, "Phrase"); tabs.draw_button(Form.cwidth-60, CHARS_TAB, "Chars"); @@ -61,15 +67,21 @@ void main() } } +dword pal[] = { 0x4E4153, 0x57417C, 0x89633B, 0x819156, 0x00CCCC, 0x2AD266, + 0xE000CC, 0x0498F9, 0xC3A9F5, 0xFFC200, 0xFF5836, 0xA086BA, + 0,0,0,0,0 }; + void DrawPreviewPhrase() { dword i, y; + dword c; char line[256]; kfont.raw_size = free(kfont.raw); - for (i=10, y=5; i<22; i++, y+=kfont.height;) //not flexible, need to calculate font count and max line length + for (i=10, y=12; i<22; i++, y+=kfont.height+3;) //not flexible, need to calculate font count and max line length { + if (colored.checked) c = pal[i-10]; else c=0; sprintf(#line," §¬¥à èà¨äâ /size font %d ¯¨ªá¥«¥©.",i); - kfont.WriteIntoBuffer(10,y,Form.cwidth,Form.cheight-PANELH, 0xFFFFFF, 0, i, #line); + kfont.WriteIntoBuffer(14,y,Form.cwidth,Form.cheight-PANELH, 0xFFFFFF, c, i, #line); } if (kfont.smooth) kfont.ApplySmooth(); kfont.ShowBuffer(preview.x, preview.y); diff --git a/programs/cmm/lib/gui.h b/programs/cmm/lib/gui.h index be6a3e47c5..573bb68e3d 100644 --- a/programs/cmm/lib/gui.h +++ b/programs/cmm/lib/gui.h @@ -69,7 +69,7 @@ dword ty = h/2-7+y; if (id>0) DefineButton(x,y,w,h,id,color_b); - WriteText(tx+1,ty+1,0x90,MixColors(color_b,0,230),text); + WriteText(tx+1,ty+1,0x90,LightenDarkenColor(color_b, -40),text); WriteText(tx,ty,0x90,color_t,text); } @@ -84,21 +84,29 @@ int ty = y + padding_v+1; int tw = strlen(text)*8; int w = tw + padding_h + padding_h; + unsigned darker_color = LightenDarkenColor(system.color.work_button, -40); if (id>0) DefineButton(x,y,w,h,id,system.color.work_button); - WriteText(tx+1,ty+1,0x90,MixColors(system.color.work_button,0,230),text); + WriteText(tx+1,ty+1,0x90,darker_color,text); WriteText(tx,ty,0x90,system.color.work_button_text,text); if (active_button_id==id) { - DrawBar(tx,ty+15,tw,1, MixColors(system.color.work_button,0,230)); + DrawBar(tx,ty+15,tw,1, darker_color); DrawBar(tx,ty+14,tw,1, system.color.work_button_text); } return w + right_margin; } +:unsigned LightenDarkenColor(dword color, amt) { + dword r = color >> 16 + amt << 16; + dword b = color >> 8 & 0x00FF + amt << 8; + dword g = color & 0x0000FF + amt; + return g | b | r ; +} + :void ActiveButtonSwitch(int min, max) { active_button_id++; diff --git a/programs/cmm/lib/kolibri.h b/programs/cmm/lib/kolibri.h index 2ecdd24554..fa4335273e 100644 --- a/programs/cmm/lib/kolibri.h +++ b/programs/cmm/lib/kolibri.h @@ -77,21 +77,16 @@ inline fastcall dword calc(EAX) { return EAX; } }; //------------------------------------------------------------------------------ -:dword wait_event_code; inline fastcall dword WaitEvent() { $mov eax,10 $int 0x40 - wait_event_code = EAX; - //if(wait_event_code==evMouse) MOUSE.get(); - //return wait_event_code; } inline fastcall dword CheckEvent() { $mov eax,11 $int 0x40 - wait_event_code = EAX; } :dword WaitEventTimeout(dword time) @@ -99,7 +94,6 @@ inline fastcall dword CheckEvent() EAX = 23; EBX = time; $int 0x40 - wait_event_code = EAX; } inline fastcall dword SetEventMask(EBX) diff --git a/programs/cmm/software_widget/software_widget.c b/programs/cmm/software_widget/software_widget.c index aadf65455f..991a5a7612 100644 --- a/programs/cmm/software_widget/software_widget.c +++ b/programs/cmm/software_widget/software_widget.c @@ -46,8 +46,8 @@ block ipos[128]; void load_config() { - ini_get_str stdcall (#settings_ini_path, "Config", "window_title", #window_title, sizeof(window_title), "Software widget"); - ini_get_int stdcall (#settings_ini_path, "Config", "window_width", 690); + ini_get_str stdcall (#settings_ini_path, "Config", "title", #window_title, sizeof(window_title), "Software widget"); + ini_get_int stdcall (#settings_ini_path, "Config", "win_width", 690); window_width = EAX; ini_get_int stdcall (#settings_ini_path, "Config", "cell_w", 73); list.item_w = EAX; diff --git a/programs/system/apm/apm.asm b/programs/system/apm/apm.asm index d69e2c28de..bb26f39d7b 100644 --- a/programs/system/apm/apm.asm +++ b/programs/system/apm/apm.asm @@ -43,27 +43,27 @@ redraw: mcall 49,0x0000,0x0001,0x5308 @@: mcall 12,1 - mcall 0,100*65536+235,100*65536+90,0x34ffffff,0x000000,title + mcall 0,100*65536+320,120*65536+120,0x34ffffff,0x000000,title mcall 49,0x0000,,0x5300 jnc @f - mcall 4,10*65536+3,0x80000000,text.4 + mcall 4,10*65536+12,0x90CE362B,ver.4 bts [flags], 1 jmp .end @@: cmp al, 0 jne @f - mov edx, text.1 + mov edx, ver.1 jmp .0 @@: cmp al, 1 jne @f - mov edx, text.2 + mov edx, ver.2 jmp .0 @@: - mov edx, text.3 + mov edx, ver.3 .0: push edx - mcall 4,169*65536+3,0x80dddddd,text.0 + mcall 4,237*65536+3,0x80AAAaaa,ver.0 pop edx add ebx, 47*65536 mcall @@ -119,49 +119,49 @@ redraw: mov edx, text.04 .2: push edx - mcall 4,10*65536+20,0x80000000,text.10 + mcall 4,10*65536+22,0x80000000,text.10 pop edx - mcall ,100*65536+20, + mcall ,100*65536+22, ;battery life, percentage and minutes/seconds - mcall ,10*65536+30,,text.20 + mcall ,10*65536+34,,text.20 pop cx cmp cl, 0xff jne @f - mcall ,100*65536+30,0x80000000,text.04 + mcall ,100*65536+34,0x80000000,text.04 pop eax jmp .end @@: shl ecx, 24 shr ecx, 24 - mcall 47,0x80030000,,100*65536+30,0x347636 + mcall 47,0x80030000,,100*65536+34,0x347636 .3: - mcall 4,115*65536+30,0x80000000,text.15 + mcall 4,115*65536+34,0x80000000,text.15 mov dx, [esp] shl edx, 17 shr edx, 17 mov ecx, edx - mcall 47,0x80030000,,140*65536+30 + mcall 47,0x80030000,,140*65536+34 pop cx mov edx, text.21 bt cx, 15 jc @f mov edx, text.22 @@: - mcall 4,160*65536+30,0x80000000 + mcall 4,160*65536+34,0x80000000 pop si .error: .end: ;buttons - mcall 8,148*65536+16,45*65536+15,3,0x00677ab0 - mcall ,166*65536+16,,4, - mcall ,184*65536+16,,5, - mcall ,202*65536+16,,6, + mcall 8,195*65536+21,56*65536+20,3,0x00BBD5E6 + mcall ,219*65536+21,,4, + mcall ,243*65536+21,,5, + mcall ,267*65536+21,,6, bt [flags], 1 jc @f - mcall ,65*65536+45,,2, + mcall ,86*65536+56,,2, @@: - mcall 4,10*65536+50,0x80564242,text.30 + mcall 4,10*65536+60,0x90564242,text.30 mcall 12,2 still: @@ -297,54 +297,35 @@ free_ports: ret -; ДÐÐÐЫЕ ПРОГРÐММЫ -title db '',0 +; DATA SECTION +title db 'Advanced Power Management',0 flags dw 0 +ver: +.0: db 'APM v.1.',0 +.1: db '0',0 +.2: db '1',0 +.3: db '2',0 +.4: db 'APM is not supported',0 + text: -.0: - db 'APM v.1.',0 -.1: - db '0',0 -.2: - db '1',0 -.3: - db '2',0 -.4: - db 'APM not supported',0 +.00: db 'power status:',0 +.01: db 'off-line',0 +.02: db 'on-line',0 +.03: db 'on backup power',0 +.04: db 'unknown',0 -.00: - db 'power status:',0 -.01: - db 'off-line',0 -.02: - db 'on-line',0 -.03: - db 'on backup power',0 -.04: - db 'unknown',0 +.10: db 'battery flag:',0 +.11: db 'high',0 +.12: db 'low',0 +.13: db 'critical',0 +.14: db 'charging',0 +.15: db ' % ,',0 -.10: - db 'battery flag:',0 -.11: - db 'high',0 -.12: - db 'low',0 -.13: - db 'critical',0 -.14: - db 'charging',0 -.15: - db ' % ,',0 +.20: db 'battery life:',0 +.21: db 'min',0 +.22: db 'sec',0 -.20: - db 'battery life:',0 -.21: - db 'min',0 -.22: - db 'sec',0 - -.30: - db 'STAND-BY: SYSTEM HDD: 0 1 2 3',0 +.30: db 'STAND-BY: SYSTEM HDD: 0 1 2 3',0 I_END: diff --git a/programs/system/apm/build.bat b/programs/system/apm/build.bat new file mode 100644 index 0000000000..a78367a645 --- /dev/null +++ b/programs/system/apm/build.bat @@ -0,0 +1,2 @@ +@fasm apm.asm apm +@pause \ No newline at end of file