Eolite 4.46: display cut

git-svn-id: svn://kolibrios.org@7998 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2020-05-29 10:54:04 +00:00
parent 3feca3e420
commit 942caa5ace
4 changed files with 18 additions and 79 deletions

View File

@ -87,8 +87,19 @@ void EventCopy(bool _cut_active)
if (getElementSelectedFlag(i) == true) { if (getElementSelectedFlag(i) == true) {
sprintf(copy_buf_offset,"%s/%s",#path,items.get(i)*304+buf+72); sprintf(copy_buf_offset,"%s/%s",#path,items.get(i)*304+buf+72);
copy_buf_offset += strlen(copy_buf_offset) + 1; copy_buf_offset += strlen(copy_buf_offset) + 1;
setElementSelectedFlag(i, false);
if (cut_active) {
if (i>=files.first) && (i<files.first+files.visible)
PutShadow(files.x+4,i-files.first*files.item_h+files.y,16,files.item_h,1,-3);
}
} }
} }
if (cut_active) {
pause(20);
List_ReDraw();
}
if (selected_count==1) setElementSelectedFlag(files.cur_y, false); if (selected_count==1) setElementSelectedFlag(files.cur_y, false);
Clipboard__SetSlotData(size_buf, buff_data); Clipboard__SetSlotData(size_buf, buff_data);
free(buff_data); free(buff_data);

View File

@ -1,5 +1,5 @@
#define TITLE "Eolite File Manager 4.45" #define TITLE "Eolite File Manager 4.46"
#define ABOUT_TITLE "EOLITE 4.45" #define ABOUT_TITLE "EOLITE 4.46"
#ifdef LANG_RUS #ifdef LANG_RUS
?define T_FILE "” ©«" ?define T_FILE "” ©«"

View File

@ -206,7 +206,7 @@
DrawBar(x,y+8,w,1,0x4E00E7); DrawBar(x,y+8,w,1,0x4E00E7);
} }
:void PutShadow(dword x,y,w,h,skinned,strength) :void PutShadow(dword x,y,w,h,skinned, signed strength)
{ {
proc_info wForm; proc_info wForm;
dword shadow_buf = mem_Alloc(w*h*3); dword shadow_buf = mem_Alloc(w*h*3);
@ -260,14 +260,15 @@
return gray; return gray;
} }
:void ShadowImage(dword color_image, w, h, strength) :void ShadowImage(dword color_image, w, h, signed strength)
{ {
dword col, to; byte col;
dword to;
strength = 10 - strength; strength = 10 - strength;
to = w*h*3 + color_image; to = w*h*3 + color_image;
for ( ; color_image < to; color_image++) for ( ; color_image < to; color_image++)
{ {
col = strength * DSBYTE[color_image] / 10; col = math.min(strength * DSBYTE[color_image] / 10, 255);
DSBYTE[color_image] = col; DSBYTE[color_image] = col;
} }
} }

View File

@ -1,73 +0,0 @@
#ifndef INCLUDE_LIBIMG_LOAD_SKIN_H
#define INCLUDE_LIBIMG_LOAD_SKIN_H
#ifndef INCLUDE_LIBIMG_H
#include "../lib/obj/libimg.h"
#endif
:struct libimg_image {
dword image, w, h, imgsrc;
void load_as24b();
void load();
void replace_color();
} skin;
:void libimg_image::load_as24b(dword file_path)
{
dword image_pointer = load_image(file_path);
if (!image_pointer) notify("'Error: Image not loaded' -E");
img_convert stdcall(image_pointer, 0, Image_bpp24, 0, 0);
if (!EAX) {
notify("'Error: Image can not be converted to 24b' -E");
} else {
image = image_pointer = EAX;
w = DSWORD[image_pointer+4];
h = DSWORD[image_pointer+8];
imgsrc = ESDWORD[image_pointer+24];
}
}
:void libimg_image::load(dword file_path)
{
dword image_pointer = load_image(file_path);
if (!EAX) {
notify("'Error: Image not loaded' -E");
} else {
image = image_pointer = EAX;
w = DSWORD[image_pointer+4];
h = DSWORD[image_pointer+8];
imgsrc = ESDWORD[image_pointer+24];
}
}
:void libimg_image::replace_color(dword old_color, new_color)
{
dword i, max_i;
max_i = w * h * 4 + imgsrc;
for (i = imgsrc; i < max_i; i += 4) if (DSDWORD[i]==old_color) DSDWORD[i] = new_color;
}
:libimg_image icons32draw;
:void DrawIcon32(dword x,y, bg, icon_n) {
//load_dll(libimg, #libimg_init,1);
if (!icons32draw.image) {
icons32draw.load("/sys/icons32.png");
icons32draw.replace_color(0x00000000, bg);
}
if (icon_n>=0) img_draw stdcall(icons32draw.image, x, y, 32, 32, 0, icon_n*32);
}
:libimg_image icons16draw;
:void DrawIcon16(dword x,y, bg, icon_n) {
//load_dll(libimg, #libimg_init,1);
if (!icons16draw.image) {
icons16draw.load("/sys/icons16.png");
icons16draw.replace_color(0xffFFFfff, bg);
icons16draw.replace_color(0xffCACBD6, MixColors(bg, 0, 220));
}
if (icon_n>=0) img_draw stdcall(icons16draw.image, x, y, 16, 16, 0, icon_n*16);
}
#endif