From 06eafb0c920cb901ab3b12642fc096745ae4b516 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Tue, 8 May 2018 18:35:13 +0000 Subject: [PATCH] IconEdit 0.56: add crop tool, fix several issues git-svn-id: svn://kolibrios.org@7275 a494cfbc-eb01-0410-851d-a64ba20cac60 --- data/common/icons16.png | Bin 7479 -> 7474 bytes programs/cmm/iconedit/canvas_resize.h | 6 +++- programs/cmm/iconedit/colors_mas.h | 2 +- programs/cmm/iconedit/iconedit.c | 42 +++++++++++++++------- programs/cmm/iconedit/tools/screen_copy.h | 2 +- programs/cmm/iconedit/tools/selection.h | 2 +- 6 files changed, 37 insertions(+), 17 deletions(-) diff --git a/data/common/icons16.png b/data/common/icons16.png index 95e1c512f34f655c0312af9f60ff9606db1b5c3f..62493dc27b4407f27147ebd0af3b7eca4e7cae43 100644 GIT binary patch literal 7474 zcmV-29nIp2P)`F9?q8h-$-m~EMs5%?(NJR&S8UtwQqzdO#-cbW+CjofDjvjSuQHISW@9gPEM2LWj5R5HM9EI8={GQjK6SUUkN`bTnk1R!Jn znPRMp%eRF{X6Cr`Gl*mWJBVavPRXeT*g+&Svl3th;eejAQshPxAOTnvnWIXhypGyH z3vjy;YZpM=by2J*aC8M z3oRkGfSjCsONcEXJw3+~Vhcz~$+Cvn0TL6_Eg`l5A(xBwN{z^D32;ZXc0RaL^MNrSWJLrA(7Ne-FlKBBqN7t#72?a6N`jVW7b7*t0LgNjYU99E7j8Z!0yj)+*B^p(P(EbD!GJ=Lr3|# zBS8GrCOY$*uQYd7g*9F8WN)&+TNOzgHW^72 z0Rbvgp5YL)sz|!hnNevbUD)~vhZwbkWK?%CxMW@M(!N?8sj-s&2&Tcgn%bIr^L zRO++cXL%&@O0@D_Nd*_J`-P@+(fXAur8;Tz%YgYiPwN0VIXSXgwtj;zX+Px^`8gmq z=MnV9!m! zhCSby9yYT>X$biCO(@Mz3UJ|_7+m}y8kdGgq0E0hsuoT}+2S22PfABsS{_{S`%t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hBAm}xRaJ2**OLbMj;#TRu!s1~;VZI_74ZaQ zqN#u@*HIdpmjQxG5Ro(GK+C-s@8zO-T1VRi%rF9)QX(o284p(hBhta=MG+~DX#^q{ z0T5;ZpzvvG8UX=BWhsk565D8M8UZEfJIGhAFv^W2Of*kvWPsR>v_Z570*P?NZWN)@ zHq~Ab09q*|_W6K8e)4XlsA!!?qXKCAfK%1p(fNA=C{Oe2Fu>gtt(yn%_$MAX_CELL_SIZE) || (new_rows>MAX_CELL_SIZE) { - notify("'Maximum icon size exceeded!\nPlease, try something less or equal to 256x256.' -E"); + sprintf(#param, + "'Maximum icon size exceeded! Please, try\nsomething less or equal to %ix%i.' -E", + MAX_CELL_SIZE, MAX_CELL_SIZE); + notify(#param); return; } image.create(new_rows, new_columns); actionsHistory.init(); ActivateWindow(GetProcessSlot(Form.ID)); + DrawEditArea(); ExitProcess(); } diff --git a/programs/cmm/iconedit/colors_mas.h b/programs/cmm/iconedit/colors_mas.h index 0962eb3c6d..3efcb4edb8 100644 --- a/programs/cmm/iconedit/colors_mas.h +++ b/programs/cmm/iconedit/colors_mas.h @@ -1,4 +1,4 @@ -#define MAX_CELL_SIZE 256 +#define MAX_CELL_SIZE 128 ////////////////////////////////////////////////////////////////////////////////////// // // diff --git a/programs/cmm/iconedit/iconedit.c b/programs/cmm/iconedit/iconedit.c index 246c405621..48d62891bd 100644 --- a/programs/cmm/iconedit/iconedit.c +++ b/programs/cmm/iconedit/iconedit.c @@ -4,13 +4,6 @@ * Licence: GPL v2 */ -/* -TODO: -window colors -enhance icon -pipet aside color view -*/ - #define MEMSIZE 4096*500 #include "../lib/gui.h" @@ -32,7 +25,7 @@ pipet aside color view // // //===================================================// -#define T_TITLE "Icon Editor 0.55 Alpha" +#define T_TITLE "Icon Editor 0.56 Alpha" #define TOPBAR_H 24+8 #define LEFTBAR_W 16+5+5+3+3 @@ -87,6 +80,7 @@ enum { BTN_ZOOM_IN, BTN_ZOOM_OUT, BTN_CANVAS_RESIZE, + BTN_CROP, BTNS_PALETTE_COLOR_MAS = 100, BTNS_LAST_USED_COLORS = 400 }; @@ -300,6 +294,9 @@ void main() case BTN_CANVAS_RESIZE: notify("Sorry, not implemented yet."); break; + case BTN_CROP: + EventCrop(); + break; case CLOSE_BTN: EventExitIconEdit(); break; @@ -334,7 +331,7 @@ void main() case evReDraw: Window_CanvasReSize.thread_exists(); - draw_window(); + DrawWindow(); break; } } @@ -362,19 +359,20 @@ void DrawStatusBar() { zoom.draw(wrapper.x, wrapper.y + wrapper.h + 6); + sprintf(#param,"%i x %i", image.columns, image.rows); DrawCaptButton( - wrapper.x+wrapper.w-calc(strlen(#param)*8) +6 - 1, + wrapper.x+wrapper.w-calc(strlen(#param)*8) -6 - 1, zoom.y, - calc(strlen(#param)*8)-6, + calc(strlen(#param)*8)+6, 18, BTN_CANVAS_RESIZE, system.color.work_button, system.color.work_button_text, - sprintf(#param,"%i x %i", image.rows, image.columns) + #param ); } -void draw_window() +void DrawWindow() { #define GAP 27 #define BLOCK_SPACE 10 @@ -404,6 +402,8 @@ void draw_window() DrawTopPanelButton(BTN_FLIP_VER, tx.inc(GAP), 35); 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 @@ -689,6 +689,22 @@ void EventMove(dword _action) actionsHistory.saveCurrentState(); } +void EventCrop() +{ + if (selection.state) { + EventSaveIconToFile(); + image.create(selection.buf.rows, selection.buf.columns); + selection.move_to_point(0,0); + selection.apply_to_image(); + selection.reset(); + actionsHistory.init(); + DrawWindow(); + } + else { + notify("'You need to select something before usnig crop tool.' -W"); + } +} + stop: char test_icon_stak[4096]; diff --git a/programs/cmm/iconedit/tools/screen_copy.h b/programs/cmm/iconedit/tools/screen_copy.h index 6a0503bbd1..16108bd784 100644 --- a/programs/cmm/iconedit/tools/screen_copy.h +++ b/programs/cmm/iconedit/tools/screen_copy.h @@ -2,7 +2,7 @@ dword screen_copy; void ScreenCopy_activate() { SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE); - screen_copy = malloc(image.columns * image.rows * 3 ); + screen_copy = malloc(image.columns * image.rows * 3 +4); } void ScreenCopy_onMouseEvent(int mouseX, int mouseY, int lkm, int pkm) { diff --git a/programs/cmm/iconedit/tools/selection.h b/programs/cmm/iconedit/tools/selection.h index b803c7b0a3..7a699a5aee 100644 --- a/programs/cmm/iconedit/tools/selection.h +++ b/programs/cmm/iconedit/tools/selection.h @@ -98,10 +98,10 @@ void ApplySelectionToImage() { if (STATE_SELECTED != selection.state) return; selection.apply_to_image(); + selection.reset(); actionsHistory.saveCurrentState(); DrawCanvas(); - selection.reset(); } bool is_selection_moving() {