From 4116e204927051fb7781f4e04bc702297c647cbb Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Tue, 20 Feb 2018 23:23:57 +0000 Subject: [PATCH] Pixie 2.2, Taskbar 2 git-svn-id: svn://kolibrios.org@7166 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/lib/kolibri.h | 14 ++ programs/cmm/pixie2/pixie.c | 60 ++++--- programs/cmm/pixie2/settings.h | 11 +- programs/cmm/pixie2/skin.png | Bin 2938 -> 3255 bytes programs/cmm/taskbar2/appicons.ini | 123 ++++++++++++++ programs/cmm/taskbar2/compile.bat | 5 + programs/cmm/taskbar2/taskbar2.c | 260 +++++++++++++++++++++++++++++ 7 files changed, 446 insertions(+), 27 deletions(-) create mode 100644 programs/cmm/taskbar2/appicons.ini create mode 100644 programs/cmm/taskbar2/compile.bat create mode 100644 programs/cmm/taskbar2/taskbar2.c diff --git a/programs/cmm/lib/kolibri.h b/programs/cmm/lib/kolibri.h index c1d92ee23d..2d84dc395e 100644 --- a/programs/cmm/lib/kolibri.h +++ b/programs/cmm/lib/kolibri.h @@ -333,6 +333,15 @@ inline fastcall int TestBit( EAX, CL) $and eax,1 } +:void SetClientScreenArea(dword _left, _right, _top, _bottom) +{ + EAX = 48; + EBX = 6; + ECX = _left * 65536 + _right; + EDX = _top * 65536 + _bottom; + $int 64; +} + //------------------------------------------------------------------------------ :void DefineAndDrawWindow(dword _x, _y, _w, _h, _window_type, _bgcolor, _title, _flags) @@ -544,6 +553,11 @@ inline RefreshWindow(dword ID_REFRESH,ID_ACTIVE) DefineAndDrawWindow(_x, _y, _w, _h, 0x41,0x000000,NULL,0b); } +:void DefineUnDragableWindow(dword _x, _y, _w, _h) +{ + DefineAndDrawWindow(_x, _y, _w, _h, 0x01, 0, 0, 0x01fffFFF); +} + :void EventDragWindow() { dword tmp_x,tmp_y; diff --git a/programs/cmm/pixie2/pixie.c b/programs/cmm/pixie2/pixie.c index d14e38a279..146d9d83b6 100644 --- a/programs/cmm/pixie2/pixie.c +++ b/programs/cmm/pixie2/pixie.c @@ -34,7 +34,7 @@ char default_dir[] = "/rd/1"; od_filter filter2 = { 8, "MP3\0\0" }; -#define ABOUT_MESSAGE "'Pixies Player v2.0 +#define ABOUT_MESSAGE "'Pixies Player v2.3 A tiny MP3 folder player. Controls: @@ -43,9 +43,7 @@ Play/Stop: Space or P key Start playing selected file: Enter Goto next/previous track: Ctrl + Left/Right Change sound volume: Left/Right key -Mute: M key' -Std" -#define WIN_W_SMALL 127 -#define WIN_H_SMALL 39 +Mute: M key' -td" scroll_bar scroll1 = { 5,200,398,44,0,2,115,15,0,0xeeeeee,0xBBBbbb,0xeeeeee,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1}; @@ -167,7 +165,7 @@ void main() if (list.ProcessKey(key_scancode)) DrawPlayList(); break; case evReDraw: - if (window_mode == WINDOW_MODE_NORMAL) DefineDragableWindow(win_x_normal, win_y_normal, skin.w - 1, skin.h + list.h); + if (window_mode == WINDOW_MODE_NORMAL) DefineDragableWindow(win_x_normal, win_y_normal, skin.w - 1, skin.h + list.h-1); if (window_mode == WINDOW_MODE_SMALL) DefineDragableWindow(win_x_small, win_y_small, WIN_W_SMALL, WIN_H_SMALL); draw_window(); if (param[0]) { @@ -232,40 +230,54 @@ void draw_window() { } } +dword GetSongTitle() +{ + char cur_y_playing_title[245]; + strcpy(#cur_y_playing_title, #current_filename); + cur_y_playing_title[strlen(#cur_y_playing_title)-4] = '\0'; + if (strlen(#cur_y_playing_title) > 36) strcpy(#cur_y_playing_title + 34, "..."); + return #cur_y_playing_title; +} + void DrawTopPanel() { - char cur_y_playing_title[245]; + int button_y; - //if (playback_mode == PLAYBACK_MODE_STOPED) img_draw stdcall(skin.image, 13, 0, 22, skin.h, 300, 0); //Mode depended if (window_mode == WINDOW_MODE_NORMAL) { + button_y = 47; img_draw stdcall(skin.image, 0, 0, skin.w, skin.h, 0, 0); - strcpy(#cur_y_playing_title, #current_filename); - cur_y_playing_title[strlen(#cur_y_playing_title)-4] = '\0'; - if (strlen(#cur_y_playing_title) > 36) strcpy(#cur_y_playing_title + 33, "..."); - DrawPixieTitle(#work_folder + strrchr(#work_folder, '/')); - WriteText(10, 26, list.font_type, theme.color_top_panel_text, #cur_y_playing_title); - button_y = 45; + if (playback_mode != PLAYBACK_MODE_STOPED) img_draw stdcall(skin.image, 38, button_y, 33, 17, skin.w+1, WIN_H_SMALL+1); + if /*(!list.count) && */ (!work_folder) DrawPixieTitle("Pixie"); + else DrawPixieTitle(#work_folder + strrchr(#work_folder, '/')); + WriteText(10, 26, list.font_type, theme.color_top_panel_song_name, GetSongTitle()); + //Playing control buttons + DefineHiddenButton(7, button_y, 30, 16, BUTTON_PLAYBACK_PREV); + DefineHiddenButton(39, button_y, 30, 16, BUTTON_PLAYBACK_PLAY_PAUSE); + DefineHiddenButton(71, button_y, 30, 16, BUTTON_PLAYBACK_NEXT); + //Window control buttons + DefineHiddenButton(Form.width - 21, 1, 20, 13, BUTTON_WINDOW_CLOSE); + DefineHiddenButton(Form.width - 43, 1, 20, 13, BUTTON_WINDOW_MINIMIZE); + DefineHiddenButton(Form.width - 65, 1, 20, 13, BUTTON_WINDOW_REDUCE); + //Open and volume DefineHiddenButton(Form.width - 56, button_y, 23, 23, BUTTON_OPEN_DIALOG); DefineHiddenButton(Form.width - 27, button_y, 23, 23, BUTTON_SHOW_VOLUME); } else if (window_mode == WINDOW_MODE_SMALL) { + button_y = 7; img_draw stdcall(skin.image, 0, 0, WIN_W_SMALL, WIN_H_SMALL, skin.w-1, 0); DefineHiddenButton(0, 0, WIN_W_SMALL, WIN_H_SMALL, 99 + BT_NOFRAME); - button_y = 9; + //Playing control buttons + DefineHiddenButton(8, button_y, 24, 16, BUTTON_PLAYBACK_PREV); + DefineHiddenButton(34, button_y, 24, 16, BUTTON_PLAYBACK_PLAY_PAUSE); + DefineHiddenButton(60, button_y, 24, 16, BUTTON_PLAYBACK_NEXT); + //Window control buttons + DefineHiddenButton(Form.width - 20, 1, 19, 13, BUTTON_WINDOW_CLOSE); + DefineHiddenButton(Form.width - 20, 16, 19, 13, BUTTON_WINDOW_REDUCE); } - if (!list.count) DrawPixieTitle("Pixie"); - //Playing control buttons - DefineHiddenButton(5, button_y, 23, 23, BUTTON_PLAYBACK_PREV); - DefineHiddenButton(34, button_y-2, 27, 25, BUTTON_PLAYBACK_PLAY_PAUSE); - DefineHiddenButton(65, button_y, 23, 23, BUTTON_PLAYBACK_NEXT); - //Window control buttons - DefineHiddenButton(Form.width - 18, 1, 15, 15, BUTTON_WINDOW_CLOSE); - DefineHiddenButton(Form.width - 18, 16, 15, 15, BUTTON_WINDOW_REDUCE); - DefineHiddenButton(Form.width - 32, 1, 15, 15, BUTTON_WINDOW_MINIMIZE); } @@ -283,7 +295,7 @@ void DrawScroller() void DrawPixieTitle(dword _title) { - WriteTextB(10, 6, list.font_type, theme.color_top_panel_text, _title); + WriteTextB(10, 6, list.font_type, theme.color_top_panel_folder_name, _title); } //===================================================// diff --git a/programs/cmm/pixie2/settings.h b/programs/cmm/pixie2/settings.h index 0b02f9266d..cd20e36404 100644 --- a/programs/cmm/pixie2/settings.h +++ b/programs/cmm/pixie2/settings.h @@ -1,5 +1,6 @@ struct struct_pixie_colors { - dword color_top_panel_text, + dword color_top_panel_folder_name, + color_top_panel_song_name, color_list_bg, color_list_text, color_list_active_bg, @@ -11,6 +12,9 @@ struct struct_pixie_colors { char config_section[] = "Config"; +#define WIN_W_SMALL 114 +#define WIN_H_SMALL 31 + void LoadIniConfig() { ini_get_int stdcall (#pixie_ini_path, #config_section, "window_mode", WINDOW_MODE_NORMAL); window_mode = EAX; @@ -22,14 +26,15 @@ void LoadIniConfig() Libimg_LoadImage(#skin, abspath("skin.png")); skin.w = 322; - theme.color_top_panel_text = 0x5C5146; + theme.color_top_panel_folder_name = 0xDDDDDB; + theme.color_top_panel_song_name = 0xBEBEBE; theme.color_list_bg = 0xE2E2E2; theme.color_list_text = 0x595959; theme.color_list_active_bg = 0xFAF3AF; theme.color_list_active_text = 0x85663F; theme.color_list_active_pointer = 0x85663F; theme.color_list_scroller = 0xBBBbbb; - theme.color_list_border = 0x736D65; + theme.color_list_border = 0x010101; scroll1.bckg_col = theme.color_list_bg; scroll1.frnt_col = theme.color_list_border; scroll1.line_col = theme.color_list_border; diff --git a/programs/cmm/pixie2/skin.png b/programs/cmm/pixie2/skin.png index 49594fb11e24496433f2bffd4434450a43d2554e..f9d52a010dd230abdc63adfbef78f9713257d990 100644 GIT binary patch literal 3255 zcmZvfdpwi<8^`ZbXq!|-XhexZ+tVB>hm=q$iX2A69H!V%G$EB*Qx2W6O(^8>IOdo} zG?mKmtc{sDB#%QFWo^#+-OBTOe!X75f9}`)dfnIkx!%|Hz3$KTx^JDZwU&V>LjVAf zIdb@rJpimI1Mh95CBf^g+gWP>fL%Uv=)kFqoq}$+!;T)RQeP7(H#DuBn;`{@4=&dE zKt!M7a!)X(*ImCO)Y`6A8fWAseeJEA^SdpZhW8y)l+ZfyO&uyBbaMaZtDT}>k)lmY zywSW^)wkKU1s%}aDt;tdxVqVxzzs^T^}T`_DyZPbZq#v__W|=?#;?A?dv#qZwMQ2C z`b^6%t%O8c)x;N!jCj$*CdB!~va&M0AjO)1vuB^po7krur7Vc~LAG^fZ(7rbx2>H1 z@cK1L4=Wzyp_1<1>vI;2cUCk_5?|4i5gx9WRljW3U;^8G8!c~aVVbYPN&-n4aUar5 zBXxtSGBX<{IxQ(Px8ZeRp=;OUfcqJ7MeSAo5ZEbm#I*_uNnQ%iCD%0ee%b7FUP+3`L z)o{+`iTFp>`(mU~z!8?Erh$Ru1-hJ;ZAqb9)y`<5cnm$z`~4l8&Cblj)RvdqC?0f1 zvPK=CyPfGZ$hrBMvdN8dat-Z;ZhkWX=bw$r0v=pyS{kmQp#k4aGx(5fhl{Ymd;swhf2J&dGBYDAkQXw*BTGSiY6#(pA{O79^+R9;m@68eY)r5$31-9 zgS!R-@yd59^eQYYWO)0F!m~ndA|>w1V@}<_e_x;A=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!zvWhUDD~Oep-Wjh=swvspCTwye=}PKFbs7 zpuy~o`<}f!bXH6&hz~XRC@Zg8iaF*>RY*r|8KJBOm^#MjH2OGnYo>Ndg-c9x_r2|g zPwee2)M!UI=4wE~YyTr1VC8q(_BT@V52;CN-fNG*XeHiQoIHiTR@0k0863f%5?6D@ zX_Y|D*Tkw$-C!3>OD852NYmo#yv0pS0MtMMc6cQq2H6?R*FN#Nr)fwL9kz1F0@0?X0xj$-V8;=>3 z1*@ey?nC}sCc9CZI~{>fe_g2+wMC|+tTtljGxdu!o>o@2BKl4U74+^}ua~V8V( zL%7BlQn9Ks=cD34u9{dF>kO4eYmc#xq%V9fFQ{Q|5uFp~yPzF}M~$9{izzROG0eg| zZBd!{o@=r0&Tze*9&Ve?&FX1z8*JIP*~}4)h@>=vGqK?B9`z@}E#u|H!?>qXT`QiZ zvE=za%d}~Q;yX z{n`tlT)LeqfPZ_BbHTQCk`BWhpF*y|g%gFlnD*R#!_#*BhGkzcO(%bcJjmIs>!+fveA2-$=8_RdS*&m?{YSevAe`` zdmJtdN*Ipf{}n~mCw*K_28}j2isSzYN3SfY^!k0;$og~&$^^@NxsrU$B;5i-fbGoU% z-4syFK4?Tzu6Njoe>+!_7rrz|8W4CE;bVJ>8mG{2uI7KNNR&M<12;{rOzMp8!2bu9 CEzOVs diff --git a/programs/cmm/taskbar2/appicons.ini b/programs/cmm/taskbar2/appicons.ini new file mode 100644 index 0000000000..7efc091bdd --- /dev/null +++ b/programs/cmm/taskbar2/appicons.ini @@ -0,0 +1,123 @@ +[icons] +tmpdisk=36 +vmode=7 +netcfg=33 +setup=5 +calendar=52 +appearance.kex=62 +palitra=61 +skincfg=80 +@volume=64 +panels_cfg=63 +mousecfg=54 +drvinst.kex=71 +board=19 +netstat=33 +gmon=57 +cpu=60 +clipview=83 +test=37 +cpuid=37 +disptest=7 +fspeed=45 +hdd_info=50 +kbd=37 +mgb=38 +pcidev=38 +tinypad=9 +eolite=1 +shell=2 +kfar=16 +rdsave=17 +fb2read=44 +animage=15 +kpack=10 +snake=32 +mine=14 +seawar=66 +tetris=47 +pong=12 +15=34 +docpack=8 +board=19 +hexedit=22 +debug=39 +pipes=26 +sudoku=25 +gomoku=24 +xonix=21 +checkers=20 +kosilka=23 +flood-it=59 +fasm=10 +clicks=18 +webview=31 +syspanel=6 +app+=27 +diff=84 +textreader=85 +calc=4 +sdlquake=56 +doom=43 +doom=43 +lasertank=72 +lrl=41 +kosilka=23 +bomber=14 +tanks=67 +sw=66 +almaz=81 +klavisha=69 +clicks=18 +checkers=20 +sudoku=25 +mine=14 +flood-it=59 +knight=82 +15=34 +gomoku=24 +msquare=25 +lines=59 +2048=53 +fara=42 +tetris=47 +pipes=26 +snake=32 +xonix=21 +freecell=68 +pong=12 +pong3=12 +arcanii=12 +tinypad=9 +webview=31 +t_edit=58 +txtread=85 +zsea=46 +kiv=70 +font_viewer=76 +animage=15 +pixie=65 +fplay=40 +ac97snd=64 +midamp=74 +rtfread=55 +graph=28 +heed=22 +shell=2 +fasm=10 +kpack=10 +view3ds=75 +fb2read=44 +cobj=2 +eolite=1 +@menu=49 + +[attached] +/sys/@menu=? +/sys/File managers/eolite=? +/sys/tinypad=? +/sys/media/pixie/pixie=? +/sys/network/webview=? + +[taskbar] +attachement=0 \ No newline at end of file diff --git a/programs/cmm/taskbar2/compile.bat b/programs/cmm/taskbar2/compile.bat new file mode 100644 index 0000000000..9ba3a775f6 --- /dev/null +++ b/programs/cmm/taskbar2/compile.bat @@ -0,0 +1,5 @@ +C-- taskbar2.c +@del @taskbar +@rename taskbar2.com @taskbar +@del warning.txt +@pause \ No newline at end of file diff --git a/programs/cmm/taskbar2/taskbar2.c b/programs/cmm/taskbar2/taskbar2.c new file mode 100644 index 0000000000..e543bed95b --- /dev/null +++ b/programs/cmm/taskbar2/taskbar2.c @@ -0,0 +1,260 @@ +#define MEMSIZE 4096*20 + +//===================================================// +// // +// LIB // +// // +//===================================================// + +#include "../lib/gui.h" +#include "../lib/list_box.h" +#include "../lib/io.h" +#include "../lib/collection.h" +#include "../lib/patterns/restart_process.h" + +#include "../lib/mem.h" + +#include "../lib/obj/libio.h" +#include "../lib/obj/libimg.h" +#include "../lib/obj/libini.h" + +#include "../lib/patterns/libimg_load_skin.h" + + +//===================================================// +// // +// DATA // +// // +//===================================================// + +int current_process_id = 0; +int proc_list[256]; +collection attached; + +llist list; + +proc_info Form; +proc_info Process; + +enum { + ATTACHEMENT_BOTTOM, + ATTACHEMENT_LEFT, + ATTACHEMENT_TOP, + ATTACHEMENT_RIGHT +}; +int attachement = ATTACHEMENT_BOTTOM; + +#define CELLW 40 +#define CELLH 40 + +dword COLOR_BG = 0x3B3B3B; +dword COLOR_MENU_BG = 0x323232; +dword COLOR_OPENED = 0x999999; +dword COLOR_ACTIVE = 0x0099FF; +dword COLOR_TEXT = 0xFFFfff; + + +//===================================================// +// // +// CODE // +// // +//===================================================// + +void main() +{ + byte btn; + load_dll(libio, #libio_init,1); + load_dll(libimg, #libimg_init,1); + load_dll(libini, #lib_init,1); + + Libimg_LoadImage(#skin, "/sys/icons32.png"); + Libimg_FillTransparent(skin.image, skin.w, skin.h, COLOR_BG); + + ini_get_int stdcall ("/sys/appicons.ini", "taskbar", "attachement", ATTACHEMENT_BOTTOM); + attachement = EAX; + + SetAttachement(); + GetAttachedItems(); + + GetProcessInfo(#Form, SelfInfo); + SetWindowLayerBehaviour(-1, ZPOS_DESKTOP); + SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER); + loop() + { + WaitEventTimeout(50); + switch(EAX & 0xFF) + { + case evMouse: + if (!CheckActiveProcess(Form.ID)) break; + mouse.get(); + if (mouse.down) {} + //if (list.ProcessMouse()) DrawProcessList(); + break; + case evKey: + GetKeys(); + if (key_scancode == SCAN_CODE_ESC) { + RunProgram(#program_path, NULL); + ExitProcess(); + } + break; + case evButton: + btn = GetButtonID(); + btn -= 100; + if (btn < attached.count) RunProgram(attached.get(btn), NULL); + else EventSetActiveProcess(btn); + break; + case evReDraw: + DefineUnDragableWindow(NULL, NULL, NULL, NULL); + list.SetSizes(0, 0, Form.width+1, Form.height+2, CELLH); + default: + DrawProcessList(); + } + } +} + + +void GetProcessList() +{ + int i, j; + list.count=0; + + for (i=0; i