Subversion Repositories Kolibri OS

Rev

Rev 5996 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5996 Rev 5997
Line 22... Line 22...
22
:struct LABEL
22
:struct LABEL
23
{
23
{
24
	__SIZE size;
24
	__SIZE size;
25
	int width,height;
25
	int width,height;
26
	byte bold,italic,smooth;
26
	byte bold,italic,smooth;
27
	dword color;
27
	dword color, background;
28
	dword font,font_begin;
28
	dword font,font_begin;
29
	word block;
29
	word block;
30
	byte init();
30
	byte init();
31
	byte changeSIZE();
31
	byte changeSIZE();
32
	byte symbol();
32
	byte symbol();
Line 213... Line 213...
213
	dword i,line_w,to;
213
	dword i,line_w,to;
214
	line_w = size.width * 3;
214
	line_w = size.width * 3;
215
	to = size.height - 1 * line_w + raw - 3;
215
	to = size.height - 1 * line_w + raw - 3;
216
	for(i=raw; i < to; i+=3)
216
	for(i=raw; i < to; i+=3)
217
	{
217
	{
218
		IF(i-raw%line_w +3 == line_w) continue;
218
		if(i-raw%line_w +3 == line_w) continue;
219
		IF(b24(i)==0x000000) && (b24(i+3)!=0x000000) && (b24(i+line_w)!=0x000000) && (b24(i+3+line_w)==0x000000)
219
		if(b24(i)==0x000000) && (b24(i+3)!=0x000000) && (b24(i+line_w)!=0x000000) && (b24(i+3+line_w)==0x000000)
220
		{ 
220
		{
221
			ShadowPixel(i+3, 2);
221
			ShadowImage(i+3, 1, 1, 2);
222
			ShadowPixel(i+line_w, 2);
222
			ShadowImage(i+line_w, 1, 1, 2);
223
		}
223
		}
224
		ELSE IF(b24(i)!=0x000000) && (b24(i+3)==0x000000) && (b24(i+line_w)==0x000000) && (b24(i+3+line_w)!=0x000000)
224
		else if(b24(i)!=0x000000) && (b24(i+3)==0x000000) && (b24(i+line_w)==0x000000) && (b24(i+3+line_w)!=0x000000)
225
		{
225
		{
226
			ShadowPixel(i, 2);
226
			ShadowImage(i, 1, 1, 2);
227
			ShadowPixel(i+3+line_w, 2);
227
			ShadowImage(i+3+line_w, 1, 1, 2);
228
		}
228
		}
229
	}
229
	}
230
}
230
}
Line 231... Line 231...
231
 
231
 
232
:int LABEL::write_center(dword x,y,w,h; dword background, color1; byte fontSizePoints; dword txt)
232
:int LABEL::write_center(dword x,y,w,h; dword _background, _color; byte fontSizePoints; dword txt)
233
{
233
{
234
	size.pt = fontSizePoints;
234
	size.pt = fontSizePoints;
235
	getsize(txt);
235
	getsize(txt);
236
	return write(w-size.width/2+x,y, background, color1, fontSizePoints, txt);
236
	return write(w-size.width/2+x,y, _background, _color, fontSizePoints, txt);
Line 237... Line 237...
237
}
237
}
238
 
238
 
239
:int LABEL::write(int x,y; dword background, color1; byte fontSizePoints; dword text1)
239
:int LABEL::write(int x,y; dword _background, _color; byte fontSizePoints; dword text1)
240
{
240
{
241
	signed len=0;
241
	signed len=0;
242
	IF(!text1)return false;
242
	IF(!text1)return false;
243
	IF(size.pt)IF(!changeSIZE())return false;
243
	IF(size.pt)IF(!changeSIZE())return false;
244
	size.pt = fontSizePoints;
244
	size.pt = fontSizePoints;
-
 
245
	getsize(text1);
245
	getsize(text1);
246
	color = _color;
246
	color = color1;
247
	background = _background;
247
	y -= size.offset_y;
248
	y -= size.offset_y;
248
	EDX = size.width*size.height*3;
249
	EDX = size.width*size.height*3;
249
	IF(!raw_size)
250
	IF(!raw_size)
Line 272... Line 273...
272
	IF (smooth) apply_smooth();
273
	IF (smooth) apply_smooth();
273
	show_buf(x,y);
274
	show_buf(x,y);
274
	return len;
275
	return len;
275
}
276
}
Line 276... Line 277...
276
 
277
 
277
:void LABEL::write_buf(int x,y,w,h; dword background, color1; byte fontSizePoints; dword text1)
278
:void LABEL::write_buf(int x,y,w,h; dword _background, _color; byte fontSizePoints; dword text1)
278
{
279
{
279
	dword new_raw_size;
280
	dword new_raw_size;
280
	IF(!text1)return;
281
	IF(!text1)return;
Line 281... Line 282...
281
	IF(size.pt)IF(!changeSIZE())return;
282
	IF(size.pt)IF(!changeSIZE())return;
282
	
283
	
283
	size.pt = fontSizePoints;
284
	size.pt = fontSizePoints;
284
	getsize(text1);
285
	getsize(text1);
-
 
286
	y -= size.offset_y;
Line 285... Line 287...
285
	y -= size.offset_y;
287
	color = _color;
286
	color = color1;
288
	background = _background;
Line 287... Line 289...
287
 
289