Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 7261 → Rev 7262

/programs/cmm/iconedit/cursors/bar.cur
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programs/cmm/iconedit/cursors/fill.cur
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programs/cmm/iconedit/cursors/line.cur
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programs/cmm/iconedit/cursors
Property changes:
Added: tsvn:logminsize
+5
\ No newline at end of property
/programs/cmm/iconedit/iconedit.c
16,6 → 16,7
#include "../lib/gui.h"
#include "../lib/random.h"
#include "../lib/mem.h"
#include "../lib/cursor.h"
 
#include "../lib/obj/libimg.h"
#include "../lib/obj/box_lib.h"
31,7 → 32,7
// //
//===================================================//
 
#define T_TITLE "Icon Editor 0.50 Alpha"
#define T_TITLE "Icon Editor 0.51 Alpha"
 
#define TOOLBAR_H 24+8
#define PANEL_LEFT_W 16+5+5+3+3
114,6 → 115,15
0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF
};
 
CustomCursor Cursor;
dword CursorBar = FROM "cursors/bar.cur";
dword CursorFill = FROM "cursors/fill.cur";
dword CursorLine = FROM "cursors/line.cur";
dword CursorPencil = FROM "cursors/pencil.cur";
dword CursorPipette = FROM "cursors/pipette.cur";
dword CursorRectangle = FROM "cursors/rectangle.cur";
dword CursorSelect = FROM "cursors/select.cur";
 
_image image;
 
#include "actions_history.h"
200,6 → 210,9
DrawEditArea();
}
 
if (wrapper.hovered()) SetCursor();
else Cursor.Restore();
 
if (mouse.down) {
if (b_color_gradient.hovered())
|| (b_last_colors.hovered())
/programs/cmm/iconedit/tools/pipette.h
4,7 → 4,7
}
 
void PipetteTool_onMouseEvent(int mouseX, int mouseY, int lkm, int pkm) {
//if (!canvas.hovered()) return; //TODO: option "Restrict pipette to canvas area"
if (!canvas.hovered()) return; //TODO: option "Restrict pipette to canvas area"
tool_color = GetPixelUnderMouse();
DrawBar(Form.cwidth-30, 5, 20, 20, tool_color);
/programs/cmm/iconedit/tools.h
4,6 → 4,7
 
struct Tool {
int id;
dword cursor;
void (*activate)();
void (*deactivate)();
void (*onMouseEvent)(int x, int y, int lkm, int pkm);
37,17 → 38,21
void initTools()
{
tools[TOOL_PENCIL].id = TOOL_PENCIL;
tools[TOOL_PENCIL].cursor = #CursorPencil;
tools[TOOL_PENCIL].onMouseEvent = #PencilTool_onMouseEvent;
tools[TOOL_PENCIL].deactivate = #PencilTool_reset;
tools[TOOL_PIPETTE].id = TOOL_PIPETTE;
tools[TOOL_PIPETTE].cursor = #CursorPipette;
tools[TOOL_PIPETTE].activate = #PipetteTool_activate;
tools[TOOL_PIPETTE].onMouseEvent = #PipetteTool_onMouseEvent;
tools[TOOL_FILL].id = TOOL_FILL;
tools[TOOL_FILL].cursor = #CursorFill;
tools[TOOL_FILL].onMouseEvent = #FillTool_onMouseEvent;
tools[TOOL_LINE].id = TOOL_LINE;
tools[TOOL_LINE].cursor = #CursorLine;
tools[TOOL_LINE].activate = #SimpleFigureTool_Reset;
tools[TOOL_LINE].deactivate = #SimpleFigureTool_Reset;
tools[TOOL_LINE].onMouseEvent = #SimpleFigureTool_onMouseEvent;
54,6 → 59,7
tools[TOOL_LINE].onCanvasDraw = #SimpleFigureTool_onCanvasDraw;
tools[TOOL_RECT].id = TOOL_RECT;
tools[TOOL_RECT].cursor = #CursorRectangle;
tools[TOOL_RECT].activate = #SimpleFigureTool_Reset;
tools[TOOL_RECT].deactivate = #SimpleFigureTool_Reset;
tools[TOOL_RECT].onMouseEvent = #SimpleFigureTool_onMouseEvent;
60,6 → 66,7
tools[TOOL_RECT].onCanvasDraw = #SimpleFigureTool_onCanvasDraw;
 
tools[TOOL_BAR].id = TOOL_BAR;
tools[TOOL_BAR].cursor = #CursorBar;
tools[TOOL_BAR].activate = #SimpleFigureTool_Reset;
tools[TOOL_BAR].deactivate = #SimpleFigureTool_Reset;
tools[TOOL_BAR].onMouseEvent = #SimpleFigureTool_onMouseEvent;
66,6 → 73,7
tools[TOOL_BAR].onCanvasDraw = #SimpleFigureTool_onCanvasDraw;
 
tools[TOOL_SELECT].id = TOOL_SELECT;
tools[TOOL_SELECT].cursor = #CursorSelect;
tools[TOOL_SELECT].activate = #SelectTool_activate;
tools[TOOL_SELECT].deactivate = #SelectTool_deactivate;
tools[TOOL_SELECT].onMouseEvent = #SelectTool_onMouseEvent;
73,6 → 81,7
tools[TOOL_SELECT].onKeyEvent = #SelectTool_onKeyEvent;
 
tools[TOOL_SCREEN_COPY].id = TOOL_SCREEN_COPY;
tools[TOOL_SCREEN_COPY].cursor = NULL;
tools[TOOL_SCREEN_COPY].activate = #ScreenCopy_activate;
tools[TOOL_SCREEN_COPY].onMouseEvent = #ScreenCopy_onMouseEvent;
}
94,7 → 103,16
if ((index != TOOL_NONE) && (tools[index].activate != 0))
tools[index].activate();
 
Cursor.Restore();
if (wrapper.hovered()) SetCursor();
DrawLeftPanel();
DrawCanvas();
}
 
void SetCursor()
{
if (tools[currentTool].cursor) && (!Cursor.CursorPointer) {
Cursor.Load(tools[currentTool].cursor);
Cursor.Set();
}
}
/programs/cmm/lib/cursor.h
37,10 → 37,12
 
dword CustomCursor::Restore()
{
if (!CursorPointer) return;
EAX = 37;
EBX = 5;
ECX = 0;
$int 0x40
CursorPointer = 0;
}
 
void CustomCursor::Delete()