Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5782 → Rev 5781

/programs/cmm/browser/WebView.c
128,12 → 128,21
if (bufsize) && (mouse.pkm) && (mouse.up) { CreateThread(#menu_rmb,#stak+4092); break; }
if (WB1.list.MouseScroll(mouse.vert)) WB1.DrawPage();
}
scrollbar_v_mouse (#scroll_wv);
if (WB1.list.first != scroll_wv.position)
//Drag scroller
scroll_wv.all_redraw = 0;
if (!mouse.lkm) scroll_used=0;
if (mouse.x>=scroll_wv.start_x) && (mouse.x<=scroll_wv.start_x+scroll_wv.size_x)
&& (mouse.y>=scroll_wv.start_y+scroll_wv.btn_height) && (-scroll_wv.btn_height+scroll_wv.start_y+scroll_wv.size_y>mouse.y)
&& (WB1.list.count>WB1.list.visible) && (mouse.lkm) scroll_used=1;
if (scroll_used)
{
WB1.list.first = scroll_wv.position;
WB1.DrawPage();
break;
mouse.y = mouse.y + 5;
half_scroll_size = WB1.list.h - 16 * WB1.list.visible / WB1.list.count - 3 /2;
if (half_scroll_size+WB1.list.y>mouse.y) || (mouse.y<0) || (mouse.y>4000) mouse.y=half_scroll_size+WB1.list.y;
btn=WB1.list.first;
WB1.list.first = mouse.y -half_scroll_size -WB1.list.y * WB1.list.count / WB1.list.h;
if (WB1.list.visible+WB1.list.first>WB1.list.count) WB1.list.first=WB1.list.count-WB1.list.visible;
if (btn!=WB1.list.first) WB1.DrawPage();
}
break;
 
/programs/cmm/lib/font.h
9,6 → 9,10
#include "../lib/io.h"
#endif
 
 
#define CP866 0
#define ANSI 1
 
:struct __SIZE
{
word width,height;
34,7 → 38,6
byte symbol(word x;byte s;dword c);
byte symbol_size(byte s);
dword prepare(word x,y;dword text1);
void prepare_buf(word x,y,w,h;dword text1);
void show(word x,y);
byte textcenter(word x,y,w,h;dword txt);
dword getsize(dword text1);
41,27 → 44,37
dword textarea(word x,y;dword text,c);
byte changeSIZE();
void PixelRGB(word x,y);
//dword GetPixel(word x,y);
dword GetPixel(word x,y);
dword tmp_y,tmp_height,tmp_x;
byte no_bg_copy;
dword bg_color;
};
FONT font = 0;
/*
 
:dword FONT::GetPixel(word x,y)
{
dword tmp = y*size.width*3;
tmp += x*3 + buffer;
dword tmp;
tmp = y*size.width*3;
tmp += x*3;
tmp += buffer;
r = DSBYTE[tmp];
g = DSBYTE[tmp+1];
b = DSBYTE[tmp+2];
}*/
tmp++;
g = DSBYTE[tmp];
tmp++;
b = DSBYTE[tmp];
}
:void FONT::PixelRGB(dword x,y)
{
dword tmp = y*size.width*3;
tmp += x*3 + buffer;
dword tmp;
tmp = y*size.width*3;
tmp += x*3;
tmp += buffer;
 
DSBYTE[tmp] = r;
DSBYTE[tmp+1] = g;
DSBYTE[tmp+2] = b;
tmp++;
DSBYTE[tmp] = g;
tmp++;
DSBYTE[tmp] = b;
}
:byte FONT::changeSIZE()
{
150,7 → 163,8
}
yi = 0;
iii = 0;
tmp = 4*block*s + data;
tmp = 4*block*s;
tmp +=data;
while(yi<height)
{
xi = 0;
185,6 → 199,7
{
signed len=0;
dword c;
word _tmp_h;
c = color;
IF(!text1)return false;
IF(size.text)IF(!changeSIZE())return false;
199,6 → 214,7
b = AL;
getsize(text1);
y -= size.offset_y;
tmp_y = y;
EDX = size.width*size.height*3;
IF(!buffer_size)
304,6 → 320,8
IF(xi>rw)rw=xi;
___x = x+xi;
IF(italic)___x+=math.ceil(ital);
if(___x<Form_SELF_FONTS.cwidth)&&(tmp_y+yi<Form_SELF_FONTS.cheight)
{
PixelRGB(___x,TMP);
_TMP_WEIGHT = size.TMP_WEIGHT;
WHILE(_TMP_WEIGHT)
312,6 → 330,7
_TMP_WEIGHT--;
}
}
}
xi++;
iii++;
}
322,54 → 341,24
}
:byte FONT::load(dword path)
{
dword tmp;
buffer_size = 0;
IF(data)free(data);
if (!io.readKPACK(path)) { debug("Error while loading font: "); debugln(path); return false; }
begin = data = io.buffer_data;
if (!io.readKPACK(path))
{
debug("Error while loading font: ");
debugln(path);
return false;
}
begin = tmp = data = io.buffer_data;
size_file = io.FILES_SIZE;
EBX = begin + size_file;
height = DSBYTE[EBX - 1];
width = DSBYTE[EBX - 2];
tmp +=size_file;
tmp--;
height = DSBYTE[tmp];
tmp--;
width = DSBYTE[tmp];
block = math.ceil(height*width/32);
return true;
}
 
:void FONT::prepare_buf(word x,y,w,h; dword text1)
{
signed len=0;
dword c;
c = color;
IF(!text1)return;
IF(size.text)IF(!changeSIZE())return;
GetProcessInfo(#Form_SELF_FONTS, SelfInfo);
AX = c; r = AL; g = AH; c>>=16; AX = c; b = AL;
getsize(text1);
y -= size.offset_y;
size.width = w;
size.height = y;
EDX = size.width*size.height*3;
IF(!buffer_size)
{
buffer_size = EDX;
buffer = malloc(buffer_size);
EBX = bg_color;
EDI = buffer;
EAX = buffer_size+EDI;
WHILE (EDI<EAX)
{
ESDWORD[EDI] = EBX;
$add edi,3
}
}
WHILE(DSBYTE[text1])
{
x+=symbol(x,DSBYTE[text1]);
IF(weight)x+=math.ceil(size.text/17);
text1++;
}
return;
}
 
 
#endif