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 49594fb11e..f9d52a010d 100644 Binary files a/programs/cmm/pixie2/skin.png and b/programs/cmm/pixie2/skin.png differ 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