forked from KolibriOS/kolibrios
Aelia: fix check_is_the_adress_local(), slighter font smooth
calc: fix dec-hex-bin 3d style button appearance Blueberries skin: update git-svn-id: svn://kolibrios.org@6216 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
ceaabc7ffa
commit
2c3c9a032a
@ -61,6 +61,7 @@ dword CursorFile = FROM "pointer.cur";
|
||||
|
||||
#include "favicon.h"
|
||||
#include "ini.h"
|
||||
#include "tag.h"
|
||||
#include "gui.h"
|
||||
#include "label.h"
|
||||
#include "link.h"
|
||||
|
@ -68,98 +68,33 @@ int stroka_y=5, line_length=0;
|
||||
= =
|
||||
========================================================*/
|
||||
|
||||
/* <title> <meta encoding> <a hrf=""> <img src="" alt=""> <h1>..<h6> <b> <u> <s> <pre> */
|
||||
|
||||
struct _DOM {
|
||||
dword start;
|
||||
dword end;
|
||||
dword len;
|
||||
};
|
||||
|
||||
struct _style {
|
||||
bool b, u, i, s;
|
||||
bool h1, h2, h3, h4, h5, h6;
|
||||
bool a;
|
||||
bool pre;
|
||||
bool ignore;
|
||||
dword color;
|
||||
void clear();
|
||||
} style;
|
||||
|
||||
void _style::clear()
|
||||
{
|
||||
b=u=i=s=0;
|
||||
h1=h2=h3=h4=h5=h6=0;
|
||||
a=0;
|
||||
pre=0;
|
||||
ignore=0;
|
||||
color=0;
|
||||
}
|
||||
|
||||
struct _text {
|
||||
dword start;
|
||||
int x, y;
|
||||
};
|
||||
|
||||
struct _tag {
|
||||
dword start;
|
||||
dword name;
|
||||
dword param[10];
|
||||
dword value[10];
|
||||
void parce();
|
||||
int nameis();
|
||||
void clear();
|
||||
};
|
||||
|
||||
void _tag::parce()
|
||||
{
|
||||
dword o = name = start;
|
||||
while (ESBYTE[o]!=' ') && (ESBYTE[o]) o++; //searching for a space after tag name
|
||||
ESBYTE[o] = '\0';
|
||||
strlwr(name);
|
||||
}
|
||||
|
||||
int _tag::nameis(dword _in_tag_name)
|
||||
{
|
||||
if (name) && (strcmp(_in_tag_name, name)==0) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void _tag::clear()
|
||||
{
|
||||
start=name=0;
|
||||
}
|
||||
|
||||
#define HTML_PADDING_X 8;
|
||||
#define HTML_PADDING_Y 5;
|
||||
|
||||
|
||||
void ParceHtml(byte draw)
|
||||
{
|
||||
dword DOM_start, DOM_end, DOM_len, DOM_pos;
|
||||
int stroka_x = HTML_PADDING_X;
|
||||
int stroka_y = HTML_PADDING_Y;
|
||||
dword line_break;
|
||||
byte ch, zeroch;
|
||||
_DOM DOM;
|
||||
_text text;
|
||||
_tag tag;
|
||||
dword DOM_pos;
|
||||
|
||||
tag.clear();
|
||||
style.clear();
|
||||
/* Create DOM */
|
||||
debugln("creating DOM");
|
||||
DOM.len = strlen(io.buffer_data);
|
||||
DOM.start = malloc(DOM.len);
|
||||
DOM.end = DOM.start + DOM.len;
|
||||
strlcpy(DOM.start, io.buffer_data, DOM.len);
|
||||
//RemoveSpecialSymbols(DOM.start, DOM.len);
|
||||
//DOM.len = strlen(DOM.start);
|
||||
DOM_len = strlen(io.buffer_data);
|
||||
DOM_start = malloc(DOM_len);
|
||||
DOM_end = DOM_start + DOM_len;
|
||||
strlcpy(DOM_start, io.buffer_data, DOM_len);
|
||||
|
||||
/* Parce DOM */
|
||||
debugln("starting DOM parce...");
|
||||
text.start = DOM.start;
|
||||
for (DOM_pos=DOM.start; DOM_pos<DOM.end; DOM_pos++)
|
||||
text.start = DOM_start;
|
||||
for (DOM_pos=DOM_start; DOM_pos<DOM_end; DOM_pos++)
|
||||
{
|
||||
if (ESBYTE[DOM_pos]==0x0D) || (ESBYTE[DOM_pos]==0x0A) ESBYTE[DOM_pos]=' ';
|
||||
ch = ESBYTE[DOM_pos];
|
||||
@ -234,5 +169,5 @@ dword DOM_pos;
|
||||
label.size.height = list.count+5*list.item_h;
|
||||
label.raw_size = 0;
|
||||
}
|
||||
free(DOM.start);
|
||||
free(DOM_start);
|
||||
}
|
105
programs/cmm/aelia/tag.h
Normal file
105
programs/cmm/aelia/tag.h
Normal file
@ -0,0 +1,105 @@
|
||||
struct _tag {
|
||||
dword start;
|
||||
dword name;
|
||||
dword param[10];
|
||||
dword value[10];
|
||||
void parce();
|
||||
int nameis();
|
||||
void clear();
|
||||
};
|
||||
|
||||
void _tag::parce()
|
||||
{
|
||||
dword o = name = start;
|
||||
while (ESBYTE[o]!=' ') && (ESBYTE[o]) o++; //searching for a space after tag name
|
||||
ESBYTE[o] = '\0';
|
||||
strlwr(name);
|
||||
}
|
||||
|
||||
int _tag::nameis(dword _in_tag_name)
|
||||
{
|
||||
if (name) && (strcmp(_in_tag_name, name)==0) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void _tag::clear()
|
||||
{
|
||||
start=name=0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
unsigned int GetNextParam()
|
||||
{
|
||||
byte kavichki=0;
|
||||
int i = strlen(#tagparam) - 1;
|
||||
|
||||
if (!tagparam) return 0;
|
||||
|
||||
WHILE((i > 0) && ((tagparam[i] == '"') || (tagparam[i] == ' ') || (tagparam[i] == '\'') || (tagparam[i] == '/')))
|
||||
{
|
||||
IF (tagparam[i] == '"') || (tagparam[i] == '\'') kavichki=tagparam[i];
|
||||
tagparam[i] = 0x00;
|
||||
i--;
|
||||
}
|
||||
|
||||
if (kavichki)
|
||||
{
|
||||
i=strrchr(#tagparam, kavichki);
|
||||
strlcpy(#val, #tagparam + i, sizeof(val));
|
||||
}
|
||||
else
|
||||
{
|
||||
WHILE((i > 0) && (tagparam[i] <>'=')) i--; //i=strrchr(#tagparam, '=')+1;
|
||||
i++;
|
||||
strlcpy(#val, #tagparam + i, sizeof(val));
|
||||
|
||||
WHILE (val[0] == ' ') strcpy(#val, #val+1);
|
||||
}
|
||||
tagparam[i] = 0x00;
|
||||
|
||||
FOR ( ; ((tagparam[i] <>' ') && (i > 0); i--)
|
||||
{
|
||||
IF (tagparam[i] == '=') //äåðçêàÿ çàãëóøêà
|
||||
tagparam[i + 1] = 0x00;
|
||||
}
|
||||
strlcpy(#attr, #tagparam + i + 1, sizeof(attr));
|
||||
tagparam[i] = 0x00;
|
||||
strlwr(#attr);
|
||||
return 1;
|
||||
}
|
||||
*/
|
||||
|
||||
//
|
||||
// STYLE
|
||||
//
|
||||
|
||||
struct _style {
|
||||
bool b, u, i, s;
|
||||
bool h1, h2, h3, h4, h5, h6;
|
||||
bool a;
|
||||
bool pre;
|
||||
bool ignore;
|
||||
dword color;
|
||||
void clear();
|
||||
} style;
|
||||
|
||||
void _style::clear()
|
||||
{
|
||||
b=u=i=s=0;
|
||||
h1=h2=h3=h4=h5=h6=0;
|
||||
a=0;
|
||||
pre=0;
|
||||
ignore=0;
|
||||
color=0;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// TEXT
|
||||
//
|
||||
|
||||
struct _text {
|
||||
dword start;
|
||||
int x, y;
|
||||
};
|
@ -224,7 +224,7 @@ inline fastcall dword b24(EAX) { return DSDWORD[EAX] & 0x00FFFFFF; }
|
||||
// wb
|
||||
if(b24(i)!=background) && (b24(i+3)==background) && (b24(i+line_w)==background) && (b24(i+3+line_w)!=background)
|
||||
{
|
||||
dark_background = MixColors(background,b24(i),200);
|
||||
dark_background = MixColors(background,b24(i),210);
|
||||
DSDWORD[i+3] = DSDWORD[i+3] & 0xFF000000 | dark_background;
|
||||
DSDWORD[i+line_w] = DSDWORD[i+line_w] & 0xFF000000 | dark_background;
|
||||
}
|
||||
@ -232,7 +232,7 @@ inline fastcall dword b24(EAX) { return DSDWORD[EAX] & 0x00FFFFFF; }
|
||||
// bw
|
||||
else if(b24(i)==background) && (b24(i+3)!=background) && (b24(i+line_w)!=background) && (b24(i+3+line_w)==background)
|
||||
{
|
||||
dark_background = MixColors(background,b24(i+3),200);
|
||||
dark_background = MixColors(background,b24(i+3),210);
|
||||
DSDWORD[i] = DSDWORD[i] & 0xFF000000 | dark_background;
|
||||
DSDWORD[i+3+line_w] = DSDWORD[i+3+line_w] & 0xFF000000 | dark_background;
|
||||
}
|
||||
|
@ -105,12 +105,12 @@ int check_is_the_adress_local(dword _in)
|
||||
_in++;
|
||||
if(!strncmp(_in,"rd/",3)) return true;
|
||||
if(!strncmp(_in,"fd/",3)) return true;
|
||||
if(!strncmp(_in,"hd/",3)) return true;
|
||||
if(!strncmp(_in,"bd/",3)) return true;
|
||||
if(!strncmp(_in,"cd/",3)) return true;
|
||||
if(!strncmp(_in,"hd",2)) return true;
|
||||
if(!strncmp(_in,"bd",2)) return true;
|
||||
if(!strncmp(_in,"cd",2)) return true;
|
||||
if(!strncmp(_in,"sys/",4)) return true;
|
||||
if(!strncmp(_in,"tmp/",4)) return true;
|
||||
if(!strncmp(_in,"usbhd",6)) return true;
|
||||
if(!strncmp(_in,"usbhd",5)) return true;
|
||||
if(!strncmp(_in,"kolibrios",10)) return true;
|
||||
return false;
|
||||
}
|
||||
|
@ -675,9 +675,7 @@ no_new_row:
|
||||
cmp edx, BTNSP_X
|
||||
jbe newbutton
|
||||
|
||||
mcall , <253, 36>, <55, 22>, 2, 0xF0969D ; 'C'
|
||||
mcall , <236,53>, <DISPLAY_Y,DISPLAY_H>, 3, [sc.work] ; 'dec-bin-hex'
|
||||
mov esi, [sc.work_button]
|
||||
mcall , <253, 36>, <55, 22>, 2, 0xF0969D ; 'C'
|
||||
|
||||
|
||||
mov ecx, [sc.work_button_text]
|
||||
@ -718,19 +716,19 @@ print_display:
|
||||
mcall 38, < DISPLAY_X+1, DISPLAY_W+DISPLAY_X-1>, <DISPLAY_Y+1, DISPLAY_Y+1>, 0xE0E0E0 ; internal shadow
|
||||
mcall , < DISPLAY_X+1, DISPLAY_X+1>, <DISPLAY_Y+2, DISPLAY_Y+DISPLAY_H-1>, ; internal shadow
|
||||
mcall 13, < DISPLAY_X+2, DISPLAY_W-2>, <DISPLAY_Y+2, DISPLAY_H-2>, 0xFFFfff ; background
|
||||
mcall 8, <236,53>, <DISPLAY_Y,DISPLAY_H>, 3, [sc.work] ; 'dec-bin-hex'
|
||||
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, 0x40000000
|
||||
mcall 4, <135,6>,,calc,1,[sc.work]
|
||||
|
||||
mov ebx, 250 shl 16 + DISPLAY_Y+(DISPLAY_H-14)/2
|
||||
|
||||
mov edx, [display_type]
|
||||
shl edx, 2
|
||||
add edx, display_type_text
|
||||
mov esi, 3
|
||||
mov edi, [sc.work]
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, 0x10000000
|
||||
mcall
|
||||
mcall 4,<250,DISPLAY_Y+(DISPLAY_H-14)/2>
|
||||
|
||||
cmp [dsign], byte '+'
|
||||
je positive
|
||||
|
@ -3,12 +3,12 @@ include '..\me_skin.inc'
|
||||
SKIN_PARAMS \
|
||||
height = bmp_center1.height,\ ; skin height
|
||||
margins = [6:5:43:3],\ ; margins [left:top:right:bottom]
|
||||
colors active = [binner=0xEDEBEB:\ ; border inner
|
||||
colors active = [binner=0xC8C8C8:\ ; border inner
|
||||
bouter=0x33383A:\ ; border outer
|
||||
bframe=0xEDEBEB],\ ; border middle
|
||||
colors inactive = [binner=0xEDEBEB:\ ; border inner
|
||||
bframe=0xC8C8C8],\ ; border middle
|
||||
colors inactive = [binner=0xC8C8C8:\ ; border inner
|
||||
bouter=0x747474:\ ; border outer
|
||||
bframe=0xEDEBEB],\ ; border middle
|
||||
bframe=0xC8C8C8],\ ; border middle
|
||||
dtp = 'default.dtp' ; dtp colors
|
||||
|
||||
SKIN_BUTTONS \
|
||||
|
Binary file not shown.
@ -5,7 +5,7 @@ struc system_colors
|
||||
.work_3d_dark dd 0xAEA6A6
|
||||
.work_3d_light dd 0xFBFBFB
|
||||
.window_title dd 0xF3F3F3
|
||||
.work dd 0xEDEBEB
|
||||
.work dd 0xC8C8C8
|
||||
.work_button dd 0xD9F382
|
||||
.work_button_text dd 0x333333
|
||||
.work_text dd 0x000000
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Loading…
Reference in New Issue
Block a user