Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 7274 → Rev 7275

/programs/cmm/iconedit/canvas_resize.h
79,12 → 79,16
int new_rows = atoi(#text_rows);
int new_columns = atoi(#text_columns);
if (new_columns>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();
}
 
/programs/cmm/iconedit/colors_mas.h
1,4 → 1,4
#define MAX_CELL_SIZE 256
#define MAX_CELL_SIZE 128
 
//////////////////////////////////////////////////////////////////////////////////////
// //
/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
// //
//===================================================//
 
#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
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
case BTN_CANVAS_RESIZE:
notify("Sorry, not implemented yet.");
break;
case BTN_CROP:
EventCrop();
break;
case CLOSE_BTN:
EventExitIconEdit();
break;
334,7 → 331,7
case evReDraw:
Window_CanvasReSize.thread_exists();
draw_window();
DrawWindow();
break;
}
}
362,19 → 359,20
{
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
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
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];
/programs/cmm/iconedit/tools/screen_copy.h
2,7 → 2,7
 
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) {
/programs/cmm/iconedit/tools/selection.h
98,10 → 98,10
if (STATE_SELECTED != selection.state) return;
 
selection.apply_to_image();
selection.reset();
actionsHistory.saveCurrentState();
DrawCanvas();
selection.reset();
}
 
bool is_selection_moving() {