diff --git a/data/Tupfile.lua b/data/Tupfile.lua index 169b614e67..9155d24bf7 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -571,6 +571,7 @@ tup.append_table(img_files, { {"APP_PLUS", PROGS .. "/cmm/app_plus/app_plus.com"}, {"EASYSHOT", PROGS .. "/cmm/easyshot/easyshot.com"}, {"MOUSECFG", PROGS .. "/cmm/mousecfg/mousecfg.com"}, + {"NOTES", PROGS .. "/cmm/notes/notes.com"}, {"PANELS_CFG", PROGS .. "/cmm/panels_cfg/panels_cfg.com"}, {"SYSPANEL", PROGS .. "/cmm/software_widget/software_widget.com"}, {"SYSMON", PROGS .. "/cmm/sysmon/sysmon.com"}, diff --git a/data/common/icons16.png b/data/common/icons16.png index 62493dc27b..4877a5e0f7 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 6d6104e561..802e47cd69 100644 Binary files a/data/common/icons32.png and b/data/common/icons32.png differ diff --git a/programs/cmm/iconedit/colors_mas.h b/programs/cmm/iconedit/colors_mas.h index 0962eb3c6d..56cb76b9ad 100644 --- a/programs/cmm/iconedit/colors_mas.h +++ b/programs/cmm/iconedit/colors_mas.h @@ -53,6 +53,7 @@ struct _image { unsigned rows, columns; dword mas[MAX_CELL_SIZE*MAX_CELL_SIZE]; + dword mas_copy[MAX_CELL_SIZE*MAX_CELL_SIZE]; dword img; _pixel_state pixel_state; void create(); @@ -221,7 +222,8 @@ enum { MOVE_DOWN, FLIP_VER, FLIP_HOR, - ROTE + ROTATE_LEFT, + ROTATE_RIGHT }; void _image::move(int _direction) { @@ -277,10 +279,45 @@ void _image::move(int _direction) set_pixel(r, c, get_pixel(rows-r-1, c)); set_pixel(rows-r-1, c, first_element_data); } + break; + case ROTATE_LEFT: + //slow but the code is simple + //need to rewrite in case of big images support + move(ROTATE_RIGHT); + move(ROTATE_RIGHT); + move(ROTATE_RIGHT); break; + case ROTATE_RIGHT: + if (columns!=rows) { + notify("Sorry, rotate is implemented for square canvaces only!"); + break; + } + + for (r=0; r< rows; + break; } } +/* +1234 +5678 +90AB + +951 +0 +A +B + +*/ diff --git a/programs/cmm/iconedit/iconedit.c b/programs/cmm/iconedit/iconedit.c index dd83bf1146..4221340505 100644 --- a/programs/cmm/iconedit/iconedit.c +++ b/programs/cmm/iconedit/iconedit.c @@ -41,7 +41,7 @@ In other case please use tool to get an image from screen.' -Wt" #endif -#define T_TITLE "Icon Editor 0.57b Alpha" +#define T_TITLE "Icon Editor 0.58 Alpha" #define TOPBAR_H 24+8 #define LEFTBAR_W 16+5+5+3+3 @@ -162,7 +162,7 @@ void main() { word btn; libimg_image open_image; - dword tmp_bg_col; + dword bg_col; load_dll(libio, #libio_init, 1); load_dll(libimg, #libimg_init, 1); @@ -172,8 +172,10 @@ void main() Libimg_LoadImage(#left_icons, "/sys/icons16.png"); system.color.get(); + bg_col = system.color.work; + if (GrayScaleImage(#bg_col,1,1)<65) bg_dark=true; else bg_dark=false; - semi_white = MixColors(system.color.work, 0xFFFfff, 96); + semi_white = MixColors(system.color.work, 0xFFFfff, bg_dark*90 + 96); Libimg_ReplaceColor(top_icons.image, top_icons.w, top_icons.h, 0xffFFFfff, semi_white); Libimg_ReplaceColor(top_icons.image, top_icons.w, top_icons.h, 0xffCACBD6, MixColors(semi_white, 0, 220)); @@ -181,7 +183,6 @@ void main() Libimg_ReplaceColor(left_icons.image, left_icons.w, left_icons.h, 0xffCACBD6, MixColors(system.color.work, 0, 200)); //fix line and rectandle color for dark skins - if (GrayScaleImage(#system.color.work,1,1)<65) bg_dark=true; else bg_dark=false; if (bg_dark) Libimg_ReplaceColor(left_icons.image, left_icons.w, left_icons.h, 0xff545454, 0xffD3D3D4); EventSetActiveColor(1, color1); @@ -293,6 +294,12 @@ void main() case BTN_FLIP_HOR: EventMove(FLIP_HOR); break; + case BTN_ROTATE_LEFT: + EventMove(ROTATE_LEFT); + break; + case BTN_ROTATE_RIGHT: + EventMove(ROTATE_RIGHT); + break; case BTN_TEST_ICON: EventTestIcon(); break; @@ -345,6 +352,24 @@ void main() case SCAN_CODE_KEY_O: EventOpenIcon(); break; + case SCAN_CODE_LEFT: + EventMove(MOVE_LEFT); + break; + case SCAN_CODE_RIGHT: + EventMove(MOVE_RIGHT); + break; + case SCAN_CODE_UP: + EventMove(MOVE_UP); + break; + case SCAN_CODE_DOWN: + EventMove(MOVE_DOWN); + break; + case SCAN_CODE_KEY_R: + EventMove(BTN_ROTATE_RIGHT); + break; + case SCAN_CODE_KEY_L: + EventMove(BTN_ROTATE_LEFT); + break; } } @@ -434,7 +459,7 @@ void DrawWindow() DrawBar(0, TOPBAR_H-1, Form.cwidth, 1, system.color.work_graph); tx.n = 5-GAP; - DrawTopPanelButton(BTN_NEW, tx.inc(GAP), 2); //not implemented + DrawTopPanelButton(BTN_NEW, tx.inc(GAP), 2); DrawTopPanelButton(BTN_OPEN, tx.inc(GAP), 0); //not implemented DrawTopPanelButton(BTN_SAVE, tx.inc(GAP), 5); DrawTopPanelButton(BTN_MOVE_LEFT, tx.inc(GAP+BLOCK_SPACE), 30); @@ -444,12 +469,12 @@ void DrawWindow() DrawTopPanelButton(BTN_FLIP_HOR, tx.inc(GAP+BLOCK_SPACE), 34); DrawTopPanelButton(BTN_FLIP_VER, tx.inc(GAP), 35); + DrawTopPanelButton(BTN_ROTATE_LEFT, tx.inc(GAP), 37); + DrawTopPanelButton(BTN_ROTATE_RIGHT, tx.inc(GAP), 36); DrawTopPanelButton(BTN_TEST_ICON, tx.inc(GAP+BLOCK_SPACE), 12); DrawTopPanelButton(BTN_CROP, tx.inc(GAP+BLOCK_SPACE), 46); - // DrawTopPanelButton(BTN_ROTATE_LEFT, tx.inc(GAP), 36); //not implemented - // DrawTopPanelButton(BTN_ROTATE_RIGHT, tx.inc(GAP), 37); //not implemented DrawEditArea(); @@ -566,21 +591,24 @@ void GenerateCurrentColorGradient() } } +int DrawGradientMarker(dword marker_x, marker_color) +{ + if (marker_x > b_color_gradient.w - 1) marker_x = b_color_gradient.w - 1; + DrawBar(b_color_gradient.x + marker_x-2, b_color_gradient.y-3, 5, 1, marker_color); + DrawBar(b_color_gradient.x + marker_x-1, b_color_gradient.y-2, 3, 1, marker_color); + PutPixel(b_color_gradient.x + marker_x, b_color_gradient.y-1, marker_color); + return marker_x; +} + +int old_marker_pos; void DrawCurrentColorGradient() { int i; - dword hitch_color=system.color.work; - int hitch_x = b_color_gradient.x+lmax-1; - if (lmax>b_color_gradient.w-2) hitch_x=b_color_gradient.x+b_color_gradient.w-3; - for (i=0 ; i right_bar.w) return; + if (image.rows > preview_h) return; + + _PutImage(right_bar.w - image.columns / 2 + x - 3, + preview_h - image.rows / 2 + y, + image.columns, image.rows, image.get_image() + ); } dword GetPixelUnderMouse() diff --git a/programs/cmm/iconedit/tools.h b/programs/cmm/iconedit/tools.h index 806f80007e..31690d7e3f 100644 --- a/programs/cmm/iconedit/tools.h +++ b/programs/cmm/iconedit/tools.h @@ -85,6 +85,7 @@ void initTools() tools[TOOL_SCREEN_COPY].cursor = NULL; tools[TOOL_SCREEN_COPY].activate = #ScreenCopy_activate; tools[TOOL_SCREEN_COPY].onMouseEvent = #ScreenCopy_onMouseEvent; + tools[TOOL_SCREEN_COPY].onKeyEvent = #ScreenCopy_onKeyEvent; } diff --git a/programs/cmm/iconedit/tools/screen_copy.h b/programs/cmm/iconedit/tools/screen_copy.h index 16108bd784..025cbc6881 100644 --- a/programs/cmm/iconedit/tools/screen_copy.h +++ b/programs/cmm/iconedit/tools/screen_copy.h @@ -27,10 +27,20 @@ void ScreenCopy_onMouseEvent(int mouseX, int mouseY, int lkm, int pkm) { DrawCanvas(); if (mouse.down) { + ScreenCopy_onKeyEvent(SCAN_CODE_ENTER); + } +} + +void ScreenCopy_onKeyEvent(dword keycode) { + if (SCAN_CODE_ENTER == keycode) { + actionsHistory.saveCurrentState(); screen_copy = free(screen_copy); SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER); - actionsHistory.saveCurrentState(); setCurrentTool(previousTool); if (!CheckActiveProcess(Form.ID)) ActivateWindow(GetProcessSlot(Form.ID)); } + if (SCAN_CODE_ESC == keycode) { + ScreenCopy_onKeyEvent(SCAN_CODE_ENTER); + actionsHistory.undoLastAction(); + } } diff --git a/programs/cmm/iconedit/tools/selection.h b/programs/cmm/iconedit/tools/selection.h index cd0cd09dc8..c9a460fdbb 100644 --- a/programs/cmm/iconedit/tools/selection.h +++ b/programs/cmm/iconedit/tools/selection.h @@ -200,9 +200,18 @@ void SelectTool_onMouseEvent(int mouseX, int mouseY, int lkm, int pkm) { } if (mouse.up) { - selection.copy_to_buf(); + selection.copy_to_buf(); } } +/* + //forbid to select a single pixel + if (mouse.up) { + if (! selection.end_x-selection.start_x) + && (! selection.end_y-selection.start_y) { + selection.reset(); + } + } +*/ } void SelectTool_onKeyEvent(dword keycode) { diff --git a/programs/cmm/lib/gui.h b/programs/cmm/lib/gui.h index c8215733dc..4fa7c91c30 100644 --- a/programs/cmm/lib/gui.h +++ b/programs/cmm/lib/gui.h @@ -254,8 +254,8 @@ struct block { }; :bool block::hovered() { - if ((mouse.x>x) && (mouse.y>y) - && (mouse.y=x) && (mouse.y>=y) + && (mouse.y<=y+h) && (mouse.x<=x+w)) return true; return false; } diff --git a/programs/cmm/notes/engine.h b/programs/cmm/notes/engine.h index c879815036..18d6ace851 100644 --- a/programs/cmm/notes/engine.h +++ b/programs/cmm/notes/engine.h @@ -116,6 +116,7 @@ dword NOTES::DrawLine(int line_n, draw_h) { COL_BOTTOM_LINE=0xE8EFF4, COL_BG, cur_text; + int drawy; char line_text[4096]; if (line_n<0) return; x = 1; @@ -131,10 +132,12 @@ dword NOTES::DrawLine(int line_n, draw_h) { } else { - DefineButton(RED_LINE_X-CHBOX/2+x, item_h*line_n+5+y, CHBOX-1,CHBOX-1, CHECKBOX_ID+line_n+BT_HIDE, 0); //checkbox - _PutImage(RED_LINE_X-CHBOX/2+x, item_h*line_n+5+y, CHBOX,CHBOX, lines[line_n].state*CHBOX*CHBOX*3+#checkbox); - if (cur_text) WriteText(x+RED_LINE_X+6, item_h*line_n+7+y, 0x80, lines[line_n].state*0x777777, cur_text); - if (lines[line_n].state == true) DrawBar(x+RED_LINE_X+6, item_h*line_n+11+y, strlen(cur_text)*6, 1, 0x444444); //strike + drawy = item_h*line_n+5+y; + DefineButton(RED_LINE_X-CHBOX/2+x, drawy, CHBOX-1,CHBOX-1, CHECKBOX_ID+line_n+BT_HIDE, 0); //checkbox + _PutImage(RED_LINE_X-CHBOX/2+x,drawy, CHBOX,CHBOX, lines[line_n].state*CHBOX*CHBOX*3+#checkbox); + if (cur_text) WriteText(x+RED_LINE_X+6, drawy+2, 0x80, lines[line_n].state*0x777777, cur_text); + if (lines[line_n].state == true) DrawBar(x+RED_LINE_X+6, drawy+6, strlen(cur_text)*6, 1, 0x444444); //strike + DrawBar(WIN_W,drawy,1,item_h,0xBBBBBB); //fast fix; proper fix is to restrict WriteText() char length } DrawBar(x, line_n*item_h+draw_h-1+y, w, 1, COL_BOTTOM_LINE); DrawBar(x+RED_LINE_X, line_n*item_h+y, 1, draw_h, COL_RED_LINE); diff --git a/programs/cmm/notes/notes.c b/programs/cmm/notes/notes.c index 2cedb5fb05..8c6149494e 100644 --- a/programs/cmm/notes/notes.c +++ b/programs/cmm/notes/notes.c @@ -1,4 +1,4 @@ -// Notes v1.0 +// Notes v1.1 #define MEMSIZE 0xDAE80 #include "..\lib\kolibri.h" @@ -47,6 +47,7 @@ edit_box notebox = {NULL,NULL,NULL,COL_BG_ACTIVE,0x94AECE,COL_BG_ACTIVE,0xffffff dword lists[] = { 0xEAEAEA, 0xCDCDCD, 0xF0F0F0, 0xD8D8D8, 0 }; bool delete_active = false; +bool window_dragable = true; block delBtn; //===================================================// @@ -61,6 +62,8 @@ void main() bool first_redraw=true; dword cur_line_offset; load_dll(boxlib, #box_lib_init,0); + + if (GetCpuFrequency()/1000000>=1000) window_dragable=true; else window_dragable=false; if (param) notes.OpenTxt(#param); else notes.OpenTxt(abspath("notes.txt")); @@ -75,7 +78,8 @@ void main() if (delete_active) && (delBtn.hovered()) break; - if (mouse.lkm) && (mouse.ynotes.count) return; + if (line_n<0) || (line_n>=notes.count) return; notes.cur_y = line_n; notebox.text = notes.DrawLine(notes.cur_y, notes.item_h); EventListRedraw(); diff --git a/programs/other/t_edit/t_edit.ini b/programs/other/t_edit/t_edit.ini index 843593bfa4..b70166cc1b 100644 --- a/programs/other/t_edit/t_edit.ini +++ b/programs/other/t_edit/t_edit.ini @@ -1,9 +1,9 @@ [Window] t=20 l=100 -w=840 -h=740 -symbol_w=9 +w=780 +h=680 +symbol_w=8 symbol_h=16 font_s=16 scroll_type=0 diff --git a/programs/system/cpuid/trunk/intel.gif b/programs/system/cpuid/trunk/intel.gif index 571ab7f868..c0d99552c3 100644 Binary files a/programs/system/cpuid/trunk/intel.gif and b/programs/system/cpuid/trunk/intel.gif differ diff --git a/programs/system/cpuid/trunk/knopka.gif b/programs/system/cpuid/trunk/knopka.gif deleted file mode 100644 index e4e11d1356..0000000000 Binary files a/programs/system/cpuid/trunk/knopka.gif and /dev/null differ diff --git a/programs/system/cpuid/trunk/knopka2.bmp b/programs/system/cpuid/trunk/knopka2.bmp deleted file mode 100644 index 1baa1c3990..0000000000 Binary files a/programs/system/cpuid/trunk/knopka2.bmp and /dev/null differ diff --git a/programs/system/cpuid/trunk/knopka2.gif b/programs/system/cpuid/trunk/knopka2.gif deleted file mode 100644 index 75c087219d..0000000000 Binary files a/programs/system/cpuid/trunk/knopka2.gif and /dev/null differ