version 1.46, 2000/02/04 15:05:36
|
version 1.47, 2000/02/08 16:29:43
|
Line 49 BackgroundImageCallbackBlock, *Backgroun
|
Line 49 BackgroundImageCallbackBlock, *Backgroun
|
* for a font attribute. |
* for a font attribute. |
*/ |
*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
typedef STRING (*PropertyParser) (Element element, |
typedef char* (*PropertyParser) (Element element, |
PSchema tsch, |
PSchema tsch, |
PresentationContext context, |
PresentationContext context, |
STRING cssRule, |
char* cssRule, |
CSSInfoPtr css, |
CSSInfoPtr css, |
ThotBool isHTML); |
ThotBool isHTML); |
#else |
#else |
typedef STRING (*PropertyParser) (); |
typedef char* (*PropertyParser) (); |
#endif |
#endif |
|
|
/* Description of the set of CSS properties supported */ |
/* Description of the set of CSS properties supported */ |
typedef struct CSSProperty |
typedef struct CSSProperty |
{ |
{ |
STRING name; |
char* name; |
PropertyParser parsing_function; |
PropertyParser parsing_function; |
} |
} |
CSSProperty; |
CSSProperty; |
Line 71 CSSProperty;
|
Line 71 CSSProperty;
|
|
|
struct unit_def |
struct unit_def |
{ |
{ |
STRING sign; |
char* sign; |
unsigned int unit; |
unsigned int unit; |
}; |
}; |
|
|
static struct unit_def CSSUnitNames[] = |
static struct unit_def CSSUnitNames[] = |
{ |
{ |
{TEXT ("pt"), STYLE_UNIT_PT}, |
{"pt", STYLE_UNIT_PT}, |
{TEXT ("pc"), STYLE_UNIT_PC}, |
{"pc", STYLE_UNIT_PC}, |
{TEXT ("in"), STYLE_UNIT_IN}, |
{"in", STYLE_UNIT_IN}, |
{TEXT ("cm"), STYLE_UNIT_CM}, |
{"cm", STYLE_UNIT_CM}, |
{TEXT ("mm"), STYLE_UNIT_MM}, |
{"mm", STYLE_UNIT_MM}, |
{TEXT ("em"), STYLE_UNIT_EM}, |
{"em", STYLE_UNIT_EM}, |
{TEXT ("px"), STYLE_UNIT_PX}, |
{"px", STYLE_UNIT_PX}, |
{TEXT ("ex"), STYLE_UNIT_XHEIGHT}, |
{"ex", STYLE_UNIT_XHEIGHT}, |
{TEXT ("%"), STYLE_UNIT_PERCENT} |
{"%", STYLE_UNIT_PERCENT} |
}; |
}; |
|
|
#define NB_UNITS (sizeof(CSSUnitNames) / sizeof(struct unit_def)) |
#define NB_UNITS (sizeof(CSSUnitNames) / sizeof(struct unit_def)) |
Line 93 static struct unit_def CSSUnitNames[] =
|
Line 93 static struct unit_def CSSUnitNames[] =
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static unsigned int hexa_val (CHAR_T c) |
static unsigned int hexa_val (char c) |
#else |
#else |
static unsigned int hexa_val (c) |
static unsigned int hexa_val (c) |
CHAR_T c; |
char c; |
#endif |
#endif |
{ |
{ |
if (c >= '0' && c <= '9') |
if (c >= '0' && c <= '9') |
Line 112 CHAR_T c;
|
Line 112 CHAR_T c;
|
SkipWord: |
SkipWord: |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING SkipWord (STRING ptr) |
static char* SkipWord (char* ptr) |
#else |
#else |
static STRING SkipWord (ptr) |
static char* SkipWord (ptr) |
STRING ptr; |
char* ptr; |
#endif |
#endif |
{ |
{ |
while (isalnum(*ptr) || *ptr == '-' || *ptr == '%') |
while (isalnum(*ptr) || *ptr == '-' || *ptr == '%') |
Line 127 STRING ptr;
|
Line 127 STRING ptr;
|
SkipBlanksAndComments: |
SkipBlanksAndComments: |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
STRING SkipBlanksAndComments (STRING ptr) |
char* SkipBlanksAndComments (char* ptr) |
#else |
#else |
STRING SkipBlanksAndComments (ptr) |
char* SkipBlanksAndComments (ptr) |
STRING ptr; |
char* ptr; |
#endif |
#endif |
{ |
{ |
ptr = TtaSkipBlanks (ptr); |
ptr = TtaSkipBlanks (ptr); |
Line 151 STRING ptr;
|
Line 151 STRING ptr;
|
SkipQuotedString: |
SkipQuotedString: |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING SkipQuotedString (STRING ptr, CHAR_T quote) |
static char* SkipQuotedString (char* ptr, char quote) |
#else |
#else |
static STRING SkipQuotedString (ptr, quote) |
static char* SkipQuotedString (ptr, quote) |
STRING ptr; |
char* ptr; |
CHAR_T quote; |
char quote; |
#endif |
#endif |
{ |
{ |
ThotBool stop; |
ThotBool stop; |
Line 195 CHAR_T quote;
|
Line 195 CHAR_T quote;
|
SkipProperty: |
SkipProperty: |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
STRING SkipProperty (STRING ptr) |
char* SkipProperty (char* ptr) |
#else |
#else |
STRING SkipProperty (ptr) |
char* SkipProperty (ptr) |
STRING ptr; |
char* ptr; |
#endif |
#endif |
{ |
{ |
while (*ptr != EOS && *ptr != ';' && *ptr != '}') |
while (*ptr != EOS && *ptr != ';' && *ptr != '}') |
Line 212 STRING ptr;
|
Line 212 STRING ptr;
|
value and its unit. |
value and its unit. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSUnit (STRING cssRule, PresentationValue *pval) |
static char* ParseCSSUnit (char* cssRule, PresentationValue *pval) |
#else |
#else |
static STRING ParseCSSUnit (cssRule, pval) |
static char* ParseCSSUnit (cssRule, pval) |
STRING cssRule; |
char* cssRule; |
PresentationValue *pval; |
PresentationValue *pval; |
#endif |
#endif |
{ |
{ |
Line 289 PresentationValue *pval;
|
Line 289 PresentationValue *pval;
|
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
for (uni = 0; uni < NB_UNITS; uni++) |
for (uni = 0; uni < NB_UNITS; uni++) |
{ |
{ |
if (!ustrncasecmp (CSSUnitNames[uni].sign, cssRule, |
if (!strncasecmp (CSSUnitNames[uni].sign, cssRule, strlen (CSSUnitNames[uni].sign))) |
ustrlen (CSSUnitNames[uni].sign))) |
|
{ |
{ |
pval->typed_data.unit = CSSUnitNames[uni].unit; |
pval->typed_data.unit = CSSUnitNames[uni].unit; |
pval->typed_data.real = real; |
pval->typed_data.real = real; |
Line 308 PresentationValue *pval;
|
Line 307 PresentationValue *pval;
|
else |
else |
pval->typed_data.value = val; |
pval->typed_data.value = val; |
} |
} |
return (cssRule + ustrlen (CSSUnitNames[uni].sign)); |
return (cssRule + strlen (CSSUnitNames[uni].sign)); |
} |
} |
} |
} |
|
|
Line 337 PresentationValue *pval;
|
Line 336 PresentationValue *pval;
|
ParseBorderValue |
ParseBorderValue |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseBorderValue (STRING cssRule, PresentationValue *border) |
static char* ParseBorderValue (char* cssRule, PresentationValue *border) |
#else |
#else |
static STRING ParseBorderValue (cssRule, border) |
static char* ParseBorderValue (cssRule, border) |
STRING cssRule; |
char* cssRule; |
PresentationValue *border |
PresentationValue *border |
#endif |
#endif |
{ |
{ |
Line 348 PresentationValue *border
|
Line 347 PresentationValue *border
|
border->typed_data.value = 0; |
border->typed_data.value = 0; |
border->typed_data.unit = STYLE_UNIT_INVALID; |
border->typed_data.unit = STYLE_UNIT_INVALID; |
border->typed_data.real = FALSE; |
border->typed_data.real = FALSE; |
if (!ustrncasecmp (cssRule, TEXT("thin"), 4)) |
if (!strncasecmp (cssRule, "thin", 4)) |
{ |
{ |
border->typed_data.unit = STYLE_UNIT_PX; |
border->typed_data.unit = STYLE_UNIT_PX; |
border->typed_data.value = 1; |
border->typed_data.value = 1; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("medium"), 6)) |
else if (!strncasecmp (cssRule, "medium", 6)) |
{ |
{ |
border->typed_data.unit = STYLE_UNIT_PX; |
border->typed_data.unit = STYLE_UNIT_PX; |
border->typed_data.value = 3; |
border->typed_data.value = 3; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("thick"), 5)) |
else if (!strncasecmp (cssRule, "thick", 5)) |
{ |
{ |
border->typed_data.unit = STYLE_UNIT_PX; |
border->typed_data.unit = STYLE_UNIT_PX; |
border->typed_data.value = 5; |
border->typed_data.value = 5; |
Line 375 PresentationValue *border
|
Line 374 PresentationValue *border
|
ParseBorderStyle |
ParseBorderStyle |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseBorderStyle (STRING cssRule, PresentationValue *border) |
static char* ParseBorderStyle (char* cssRule, PresentationValue *border) |
#else |
#else |
static STRING ParseBorderStyle (cssRule, border) |
static char* ParseBorderStyle (cssRule, border) |
STRING cssRule; |
char* cssRule; |
PresentationValue *border |
PresentationValue *border |
#endif |
#endif |
{ |
{ |
Line 386 PresentationValue *border
|
Line 385 PresentationValue *border
|
border->typed_data.value = 0; |
border->typed_data.value = 0; |
border->typed_data.unit = STYLE_UNIT_PX; |
border->typed_data.unit = STYLE_UNIT_PX; |
border->typed_data.real = FALSE; |
border->typed_data.real = FALSE; |
if (!ustrncasecmp (cssRule, TEXT("none"), 4)) |
if (!strncasecmp (cssRule, "none", 4)) |
border->typed_data.value = STYLE_BORDERNONE; |
border->typed_data.value = STYLE_BORDERNONE; |
else if (!ustrncasecmp (cssRule, TEXT("hidden"), 6)) |
else if (!strncasecmp (cssRule, "hidden", 6)) |
border->typed_data.value = STYLE_BORDERHIDDEN; |
border->typed_data.value = STYLE_BORDERHIDDEN; |
else if (!ustrncasecmp (cssRule, TEXT("dotted"), 6)) |
else if (!strncasecmp (cssRule, "dotted", 6)) |
border->typed_data.value = STYLE_BORDERDOTTED; |
border->typed_data.value = STYLE_BORDERDOTTED; |
else if (!ustrncasecmp (cssRule, TEXT("dashed"), 6)) |
else if (!strncasecmp (cssRule, "dashed", 6)) |
border->typed_data.value = STYLE_BORDERDASHED; |
border->typed_data.value = STYLE_BORDERDASHED; |
else if (!ustrncasecmp (cssRule, TEXT("solid"), 5)) |
else if (!strncasecmp (cssRule, "solid", 5)) |
border->typed_data.value = STYLE_BORDERSOLID; |
border->typed_data.value = STYLE_BORDERSOLID; |
else if (!ustrncasecmp (cssRule, TEXT("double"), 6)) |
else if (!strncasecmp (cssRule, "double", 6)) |
border->typed_data.value = STYLE_BORDERDOUBLE; |
border->typed_data.value = STYLE_BORDERDOUBLE; |
else if (!ustrncasecmp (cssRule, TEXT("groove"), 6)) |
else if (!strncasecmp (cssRule, "groove", 6)) |
border->typed_data.value = STYLE_BORDERGROOVE; |
border->typed_data.value = STYLE_BORDERGROOVE; |
else if (!ustrncasecmp (cssRule, TEXT("ridge"), 5)) |
else if (!strncasecmp (cssRule, "ridge", 5)) |
border->typed_data.value = STYLE_BORDERRIDGE; |
border->typed_data.value = STYLE_BORDERRIDGE; |
else if (!ustrncasecmp (cssRule, TEXT("inset"), 5)) |
else if (!strncasecmp (cssRule, "inset", 5)) |
border->typed_data.value = STYLE_BORDERINSET; |
border->typed_data.value = STYLE_BORDERINSET; |
else if (!ustrncasecmp (cssRule, TEXT("outset"), 6)) |
else if (!strncasecmp (cssRule, "outset", 6)) |
border->typed_data.value = STYLE_BORDEROUTSET; |
border->typed_data.value = STYLE_BORDEROUTSET; |
else |
else |
{ |
{ |
Line 425 PresentationValue *border
|
Line 424 PresentationValue *border
|
table |
table |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSColor (STRING cssRule, PresentationValue * val) |
static char* ParseCSSColor (char* cssRule, PresentationValue * val) |
#else |
#else |
static STRING ParseCSSColor (cssRule, val) |
static char* ParseCSSColor (cssRule, val) |
STRING cssRule; |
char* cssRule; |
PresentationValue *val; |
PresentationValue *val; |
#endif |
#endif |
{ |
{ |
CHAR_T colname[100]; |
char colname[100]; |
STRING ptr; |
char* ptr; |
unsigned short redval = (unsigned short) -1; |
unsigned short redval = (unsigned short) -1; |
unsigned short greenval = 0; /* composant of each RGB */ |
unsigned short greenval = 0; /* composant of each RGB */ |
unsigned short blueval = 0; /* default to red if unknown ! */ |
unsigned short blueval = 0; /* default to red if unknown ! */ |
Line 486 PresentationValue *val;
|
Line 485 PresentationValue *val;
|
cssRule = &cssRule[6]; |
cssRule = &cssRule[6]; |
} |
} |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("rgb"), 3)) |
else if (!strncasecmp (cssRule, "rgb", 3)) |
{ |
{ |
cssRule = &cssRule[3]; |
cssRule = &cssRule[3]; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
Line 498 PresentationValue *val;
|
Line 497 PresentationValue *val;
|
if (*cssRule == '%') |
if (*cssRule == '%') |
{ |
{ |
/* encoded as rgb(%red,%green,&blue) */ |
/* encoded as rgb(%red,%green,&blue) */ |
usscanf (cssRule, TEXT("%%%d"), &r); |
sscanf (cssRule, "%%%d", &r); |
while (*cssRule != EOS && *cssRule != TEXT(',')) |
while (*cssRule != EOS && *cssRule != TEXT(',')) |
cssRule++; |
cssRule++; |
cssRule++; |
cssRule++; |
usscanf (cssRule, TEXT("%%%d"), &g); |
sscanf (cssRule, "%%%d", &g); |
while (*cssRule != EOS && *cssRule != TEXT(',')) |
while (*cssRule != EOS && *cssRule != TEXT(',')) |
cssRule++; |
cssRule++; |
cssRule++; |
cssRule++; |
usscanf (cssRule, TEXT("%%%d"), &b); |
sscanf (cssRule, "%%%d", &b); |
redval = (unsigned short)(r * 255 / 100); |
redval = (unsigned short)(r * 255 / 100); |
greenval = (unsigned short)(g * 255 / 100); |
greenval = (unsigned short)(g * 255 / 100); |
blueval = (unsigned short)(b * 255 / 100); |
blueval = (unsigned short)(b * 255 / 100); |
Line 514 PresentationValue *val;
|
Line 513 PresentationValue *val;
|
else |
else |
{ |
{ |
/* encoded as rgb(red,green,blue) */ |
/* encoded as rgb(red,green,blue) */ |
usscanf (cssRule, TEXT("%d"), &r); |
sscanf (cssRule, "%d", &r); |
while (*cssRule != EOS && *cssRule != TEXT(',')) |
while (*cssRule != EOS && *cssRule != ',') |
cssRule++; |
cssRule++; |
cssRule++; |
cssRule++; |
usscanf (cssRule, TEXT("%d"), &g); |
sscanf (cssRule, "%d", &g); |
while (*cssRule != EOS && *cssRule != TEXT(',')) |
while (*cssRule != EOS && *cssRule != ',') |
cssRule++; |
cssRule++; |
cssRule++; |
cssRule++; |
usscanf (cssRule, TEXT("%d"), &b); |
sscanf (cssRule, "%d", &b); |
redval = (unsigned short)r; |
redval = (unsigned short)r; |
greenval = (unsigned short)g; |
greenval = (unsigned short)g; |
blueval = (unsigned short)b; |
blueval = (unsigned short)b; |
Line 553 PresentationValue *val;
|
Line 552 PresentationValue *val;
|
|
|
/* Lookup the color name in our own color name database */ |
/* Lookup the color name in our own color name database */ |
for (i = 0; i < NBCOLORNAME; i++) |
for (i = 0; i < NBCOLORNAME; i++) |
if (!ustrcasecmp (ColornameTable[i].name, colname)) |
if (!strcasecmp (ColornameTable[i].name, colname)) |
{ |
{ |
redval = ColornameTable[i].red; |
redval = ColornameTable[i].red; |
greenval = ColornameTable[i].green; |
greenval = ColornameTable[i].green; |
Line 584 PresentationValue *val;
|
Line 583 PresentationValue *val;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderTopWidth (Element element, PSchema tsch, |
static char* ParseCSSBorderTopWidth (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderTopWidth (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderTopWidth (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 614 ThotBool isHTML;
|
Line 613 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderBottomWidth (Element element, PSchema tsch, |
static char* ParseCSSBorderBottomWidth (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderBottomWidth (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderBottomWidth (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 645 ThotBool isHTML;
|
Line 644 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderLeftWidth (Element element, PSchema tsch, |
static char* ParseCSSBorderLeftWidth (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderLeftWidth (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderLeftWidth (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 676 ThotBool isHTML;
|
Line 675 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderRightWidth (Element element, PSchema tsch, |
static char* ParseCSSBorderRightWidth (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderRightWidth (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderRightWidth (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 707 ThotBool isHTML;
|
Line 706 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderWidth (Element element, PSchema tsch, |
static char* ParseCSSBorderWidth (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderWidth (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderWidth (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
{ |
{ |
STRING ptrT, ptrR, ptrB, ptrL; |
char *ptrT, *ptrR, *ptrB, *ptrL; |
|
|
ptrT = SkipBlanksAndComments (cssRule); |
ptrT = SkipBlanksAndComments (cssRule); |
/* First parse Border-Top */ |
/* First parse Border-Top */ |
Line 771 ThotBool isHTML;
|
Line 770 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderColorTop (Element element, PSchema tsch, |
static char* ParseCSSBorderColorTop (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderColorTop (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderColorTop (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 797 ThotBool isHTML;
|
Line 796 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderColorLeft (Element element, PSchema tsch, |
static char* ParseCSSBorderColorLeft (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderColorLeft (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderColorLeft (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 823 ThotBool isHTML;
|
Line 822 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderColorBottom (Element element, PSchema tsch, |
static char* ParseCSSBorderColorBottom (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderColorBottom (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderColorBottom (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 849 ThotBool isHTML;
|
Line 848 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderColorRight (Element element, PSchema tsch, |
static char* ParseCSSBorderColorRight (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderColorRight (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderColorRight (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 875 ThotBool isHTML;
|
Line 874 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderColor (Element element, PSchema tsch, |
static char* ParseCSSBorderColor (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderColor (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderColor (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
{ |
{ |
STRING ptrT, ptrR, ptrB, ptrL; |
char *ptrT, *ptrR, *ptrB, *ptrL; |
|
|
ptrT = SkipBlanksAndComments (cssRule); |
ptrT = SkipBlanksAndComments (cssRule); |
/* First parse Border-Top */ |
/* First parse Border-Top */ |
Line 939 ThotBool isHTML;
|
Line 938 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderStyleTop (Element element, PSchema tsch, |
static char* ParseCSSBorderStyleTop (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderStyleTop (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderStyleTop (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 965 ThotBool isHTML;
|
Line 964 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderStyleLeft (Element element, PSchema tsch, |
static char* ParseCSSBorderStyleLeft (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderStyleLeft (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderStyleLeft (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 991 ThotBool isHTML;
|
Line 990 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderStyleBottom (Element element, PSchema tsch, |
static char* ParseCSSBorderStyleBottom (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderStyleBottom (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderStyleBottom (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 1017 ThotBool isHTML;
|
Line 1016 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderStyleRight (Element element, PSchema tsch, |
static char* ParseCSSBorderStyleRight (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderStyleRight (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderStyleRight (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 1043 ThotBool isHTML;
|
Line 1042 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderStyle (Element element, PSchema tsch, |
static char* ParseCSSBorderStyle (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderStyle (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderStyle (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
{ |
{ |
STRING ptrT, ptrR, ptrB, ptrL; |
char *ptrT, *ptrR, *ptrB, *ptrL; |
|
|
ptrT = SkipBlanksAndComments (cssRule); |
ptrT = SkipBlanksAndComments (cssRule); |
/* First parse Border-Top */ |
/* First parse Border-Top */ |
Line 1107 ThotBool isHTML;
|
Line 1106 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderTop (Element element, PSchema tsch, |
static char* ParseCSSBorderTop (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderTop (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderTop (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
{ |
{ |
STRING ptr; |
char* ptr; |
|
|
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
while (*cssRule != ';' && *cssRule != EOS && *cssRule != ',') |
while (*cssRule != ';' && *cssRule != EOS && *cssRule != ',') |
Line 1143 ThotBool isHTML;
|
Line 1142 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderLeft (Element element, PSchema tsch, |
static char* ParseCSSBorderLeft (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderLeft (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderLeft (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
{ |
{ |
STRING ptr; |
char* ptr; |
|
|
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
while (*cssRule != ';' && *cssRule != EOS && *cssRule != ',') |
while (*cssRule != ';' && *cssRule != EOS && *cssRule != ',') |
Line 1179 ThotBool isHTML;
|
Line 1178 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderBottom (Element element, PSchema tsch, |
static char* ParseCSSBorderBottom (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderBottom (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderBottom (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
{ |
{ |
STRING ptr; |
char* ptr; |
|
|
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
while (*cssRule != ';' && *cssRule != EOS && *cssRule != ',') |
while (*cssRule != ';' && *cssRule != EOS && *cssRule != ',') |
Line 1215 ThotBool isHTML;
|
Line 1214 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorderRight (Element element, PSchema tsch, |
static char* ParseCSSBorderRight (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorderRight (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorderRight (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
{ |
{ |
STRING ptr; |
char* ptr; |
|
|
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
while (*cssRule != ';' && *cssRule != EOS && *cssRule != ',') |
while (*cssRule != ';' && *cssRule != EOS && *cssRule != ',') |
Line 1251 ThotBool isHTML;
|
Line 1250 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBorder (Element element, PSchema tsch, |
static char* ParseCSSBorder (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBorder (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBorder (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
{ |
{ |
STRING ptrT, ptrR, ptrB, ptrL; |
char *ptrT, *ptrR, *ptrB, *ptrL; |
|
|
ptrT = SkipBlanksAndComments (cssRule); |
ptrT = SkipBlanksAndComments (cssRule); |
/* First parse Border-Top */ |
/* First parse Border-Top */ |
Line 1284 ThotBool isHTML;
|
Line 1283 ThotBool isHTML;
|
ParseCSSClear : parse a CSS clear attribute string |
ParseCSSClear : parse a CSS clear attribute string |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSClear (Element element, PSchema tsch, |
static char* ParseCSSClear (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSClear (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSClear (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 1304 ThotBool isHTML;
|
Line 1303 ThotBool isHTML;
|
ParseCSSDisplay : parse a CSS display attribute string |
ParseCSSDisplay : parse a CSS display attribute string |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSDisplay (Element element, PSchema tsch, |
static char* ParseCSSDisplay (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSDisplay (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSDisplay (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 1321 ThotBool isHTML;
|
Line 1320 ThotBool isHTML;
|
pval.typed_data.unit = STYLE_UNIT_REL; |
pval.typed_data.unit = STYLE_UNIT_REL; |
pval.typed_data.real = FALSE; |
pval.typed_data.real = FALSE; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
if (!ustrncasecmp (cssRule, TEXT("block"), 5)) |
if (!strncasecmp (cssRule, "block", 5)) |
{ |
{ |
pval.typed_data.value = STYLE_NOTINLINE; |
pval.typed_data.value = STYLE_NOTINLINE; |
TtaSetStylePresentation (PRLine, element, tsch, context, pval); |
TtaSetStylePresentation (PRLine, element, tsch, context, pval); |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("inline"), 6)) |
else if (!strncasecmp (cssRule, "inline", 6)) |
{ |
{ |
pval.typed_data.value = STYLE_INLINE; |
pval.typed_data.value = STYLE_INLINE; |
TtaSetStylePresentation (PRLine, element, tsch, context, pval); |
TtaSetStylePresentation (PRLine, element, tsch, context, pval); |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("none"), 4)) |
else if (!strncasecmp (cssRule, "none", 4)) |
{ |
{ |
pval.typed_data.value = STYLE_HIDE; |
pval.typed_data.value = STYLE_HIDE; |
TtaSetStylePresentation (PRVisibility, element, tsch, context, pval); |
TtaSetStylePresentation (PRVisibility, element, tsch, context, pval); |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("list-item"), 9)) |
else if (!strncasecmp (cssRule, "list-item", 9)) |
cssRule = SkipProperty (cssRule); |
cssRule = SkipProperty (cssRule); |
else |
else |
fprintf (stderr, "invalid display value %s\n", cssRule); |
fprintf (stderr, "invalid display value %s\n", cssRule); |
Line 1351 ThotBool isHTML;
|
Line 1350 ThotBool isHTML;
|
ParseCSSFloat : parse a CSS float attribute string |
ParseCSSFloat : parse a CSS float attribute string |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSFloat (Element element, PSchema tsch, |
static char* ParseCSSFloat (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSFloat (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSFloat (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 1372 ThotBool isHTML;
|
Line 1371 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSLetterSpacing (Element element, PSchema tsch, |
static char* ParseCSSLetterSpacing (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSLetterSpacing (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSLetterSpacing (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 1393 ThotBool isHTML;
|
Line 1392 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSListStyleType (Element element, PSchema tsch, |
static char* ParseCSSListStyleType (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSListStyleType (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSListStyleType (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 1414 ThotBool isHTML;
|
Line 1413 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSListStyleImage (Element element, PSchema tsch, |
static char* ParseCSSListStyleImage (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSListStyleImage (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSListStyleImage (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 1435 ThotBool isHTML;
|
Line 1434 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSListStylePosition (Element element, PSchema tsch, |
static char* ParseCSSListStylePosition (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSListStylePosition (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSListStylePosition (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 1456 ThotBool isHTML;
|
Line 1455 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSListStyle (Element element, PSchema tsch, |
static char* ParseCSSListStyle (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSListStyle (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSListStyle (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 1477 ThotBool isHTML;
|
Line 1476 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSTextAlign (Element element, PSchema tsch, |
static char* ParseCSSTextAlign (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSTextAlign (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSTextAlign (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 1500 ThotBool isHTML;
|
Line 1499 ThotBool isHTML;
|
justify.typed_data.real = FALSE; |
justify.typed_data.real = FALSE; |
|
|
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
if (!ustrncasecmp (cssRule, TEXT("left"), 4)) |
if (!strncasecmp (cssRule, "left", 4)) |
{ |
{ |
align.typed_data.value = AdjustLeft; |
align.typed_data.value = AdjustLeft; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("right"), 5)) |
else if (!strncasecmp (cssRule, "right", 5)) |
{ |
{ |
align.typed_data.value = AdjustRight; |
align.typed_data.value = AdjustRight; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("center"), 6)) |
else if (!strncasecmp (cssRule, "center", 6)) |
{ |
{ |
align.typed_data.value = Centered; |
align.typed_data.value = Centered; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("justify"), 7)) |
else if (!strncasecmp (cssRule, "justify", 7)) |
{ |
{ |
justify.typed_data.value = Justified; |
justify.typed_data.value = Justified; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
Line 1546 ThotBool isHTML;
|
Line 1545 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSTextIndent (Element element, PSchema tsch, |
static char* ParseCSSTextIndent (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSTextIndent (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSTextIndent (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 1574 ThotBool isHTML;
|
Line 1573 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSTextTransform (Element element, PSchema tsch, |
static char* ParseCSSTextTransform (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSTextTransform (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSTextTransform (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 1595 ThotBool isHTML;
|
Line 1594 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSVerticalAlign (Element element, PSchema tsch, |
static char* ParseCSSVerticalAlign (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSVerticalAlign (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSVerticalAlign (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 1616 ThotBool isHTML;
|
Line 1615 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSWhiteSpace (Element element, PSchema tsch, |
static char* ParseCSSWhiteSpace (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSWhiteSpace (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSWhiteSpace (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 1629 ThotBool isHTML;
|
Line 1628 ThotBool isHTML;
|
#endif |
#endif |
{ |
{ |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
if (!ustrncasecmp (cssRule, TEXT("normal"), 6)) |
if (!strncasecmp (cssRule, "normal", 6)) |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
else if (!ustrncasecmp (cssRule, TEXT("pre"), 3)) |
else if (!strncasecmp (cssRule, "pre", 3)) |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
else |
else |
return (cssRule); |
return (cssRule); |
Line 1643 ThotBool isHTML;
|
Line 1642 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSWordSpacing (Element element, PSchema tsch, |
static char* ParseCSSWordSpacing (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSWordSpacing (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSWordSpacing (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 1665 ThotBool isHTML;
|
Line 1664 ThotBool isHTML;
|
value% or value |
value% or value |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSLineSpacing (Element element, PSchema tsch, |
static char* ParseCSSLineSpacing (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSLineSpacing (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSLineSpacing (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 1697 ThotBool isHTML;
|
Line 1696 ThotBool isHTML;
|
or an absolute size, or an imcrement relative to the parent |
or an absolute size, or an imcrement relative to the parent |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSFontSize (Element element, PSchema tsch, |
static char* ParseCSSFontSize (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSFontSize (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSFontSize (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 1710 ThotBool isHTML;
|
Line 1709 ThotBool isHTML;
|
#endif |
#endif |
{ |
{ |
PresentationValue pval; |
PresentationValue pval; |
STRING ptr = NULL; |
char* ptr = NULL; |
ThotBool real; |
ThotBool real; |
|
|
pval.typed_data.real = FALSE; |
pval.typed_data.real = FALSE; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
if (!ustrncasecmp (cssRule, TEXT("larger"), 6)) |
if (!strncasecmp (cssRule, "larger", 6)) |
{ |
{ |
pval.typed_data.unit = STYLE_UNIT_PERCENT; |
pval.typed_data.unit = STYLE_UNIT_PERCENT; |
pval.typed_data.value = 130; |
pval.typed_data.value = 130; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("smaller"), 7)) |
else if (!strncasecmp (cssRule, "smaller", 7)) |
{ |
{ |
pval.typed_data.unit = STYLE_UNIT_PERCENT; |
pval.typed_data.unit = STYLE_UNIT_PERCENT; |
pval.typed_data.value = 80; |
pval.typed_data.value = 80; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("xx-small"), 8)) |
else if (!strncasecmp (cssRule, "xx-small", 8)) |
{ |
{ |
pval.typed_data.unit = STYLE_UNIT_REL; |
pval.typed_data.unit = STYLE_UNIT_REL; |
pval.typed_data.value = 1; |
pval.typed_data.value = 1; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("x-small"), 7)) |
else if (!strncasecmp (cssRule, "x-small", 7)) |
{ |
{ |
pval.typed_data.unit = STYLE_UNIT_REL; |
pval.typed_data.unit = STYLE_UNIT_REL; |
pval.typed_data.value = 2; |
pval.typed_data.value = 2; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("small"), 5)) |
else if (!strncasecmp (cssRule, "small", 5)) |
{ |
{ |
pval.typed_data.unit = STYLE_UNIT_REL; |
pval.typed_data.unit = STYLE_UNIT_REL; |
pval.typed_data.value = 3; |
pval.typed_data.value = 3; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("medium"), 6)) |
else if (!strncasecmp (cssRule, "medium", 6)) |
{ |
{ |
pval.typed_data.unit = STYLE_UNIT_REL; |
pval.typed_data.unit = STYLE_UNIT_REL; |
pval.typed_data.value = 4; |
pval.typed_data.value = 4; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("large"), 5)) |
else if (!strncasecmp (cssRule, "large", 5)) |
{ |
{ |
pval.typed_data.unit = STYLE_UNIT_REL; |
pval.typed_data.unit = STYLE_UNIT_REL; |
pval.typed_data.value = 5; |
pval.typed_data.value = 5; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("x-large"), 7)) |
else if (!strncasecmp (cssRule, "x-large", 7)) |
{ |
{ |
pval.typed_data.unit = STYLE_UNIT_REL; |
pval.typed_data.unit = STYLE_UNIT_REL; |
pval.typed_data.value = 6; |
pval.typed_data.value = 6; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("xx-large"), 8)) |
else if (!strncasecmp (cssRule, "xx-large", 8)) |
{ |
{ |
pval.typed_data.unit = STYLE_UNIT_REL; |
pval.typed_data.unit = STYLE_UNIT_REL; |
pval.typed_data.value = 7; |
pval.typed_data.value = 7; |
Line 1772 ThotBool isHTML;
|
Line 1771 ThotBool isHTML;
|
else |
else |
{ |
{ |
/* look for a '/' within the current cssRule */ |
/* look for a '/' within the current cssRule */ |
ptr = ustrchr (cssRule, TEXT('/')); |
ptr = strchr (cssRule, '/'); |
if (ptr != NULL) |
if (ptr != NULL) |
{ |
{ |
/* keep the line spacing rule */ |
/* keep the line spacing rule */ |
Line 1819 ThotBool isHTML;
|
Line 1818 ThotBool isHTML;
|
a common generic font style name |
a common generic font style name |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSFontFamily (Element element, PSchema tsch, |
static char* ParseCSSFontFamily (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSFontFamily (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSFontFamily (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 1832 ThotBool isHTML;
|
Line 1831 ThotBool isHTML;
|
#endif |
#endif |
{ |
{ |
PresentationValue font; |
PresentationValue font; |
CHAR_T quoteChar; |
char quoteChar; |
|
|
font.typed_data.value = 0; |
font.typed_data.value = 0; |
font.typed_data.unit = STYLE_UNIT_REL; |
font.typed_data.unit = STYLE_UNIT_REL; |
Line 1846 ThotBool isHTML;
|
Line 1845 ThotBool isHTML;
|
else |
else |
quoteChar = '\0'; |
quoteChar = '\0'; |
|
|
if (!ustrncasecmp (cssRule, TEXT("times"), 5)) |
if (!strncasecmp (cssRule, "times", 5)) |
font.typed_data.value = STYLE_FONT_TIMES; |
font.typed_data.value = STYLE_FONT_TIMES; |
else if (!ustrncasecmp (cssRule, TEXT("serif"), 5)) |
else if (!strncasecmp (cssRule, "serif", 5)) |
font.typed_data.value = STYLE_FONT_TIMES; |
font.typed_data.value = STYLE_FONT_TIMES; |
else if (!ustrncasecmp (cssRule, TEXT("helvetica"), 9) || |
else if (!strncasecmp (cssRule, "helvetica", 9) || |
!ustrncasecmp (cssRule, TEXT("verdana"), 7)) |
!strncasecmp (cssRule, "verdana", 7)) |
font.typed_data.value = STYLE_FONT_HELVETICA; |
font.typed_data.value = STYLE_FONT_HELVETICA; |
else if (!ustrncasecmp (cssRule, TEXT("sans-serif"), 10)) |
else if (!strncasecmp (cssRule, "sans-serif", 10)) |
font.typed_data.value = STYLE_FONT_HELVETICA; |
font.typed_data.value = STYLE_FONT_HELVETICA; |
else if (!ustrncasecmp (cssRule, TEXT("courier"), 7)) |
else if (!strncasecmp (cssRule, "courier", 7)) |
font.typed_data.value = STYLE_FONT_COURIER; |
font.typed_data.value = STYLE_FONT_COURIER; |
else if (!ustrncasecmp (cssRule, TEXT("monospace"), 9)) |
else if (!strncasecmp (cssRule, "monospace", 9)) |
font.typed_data.value = STYLE_FONT_COURIER; |
font.typed_data.value = STYLE_FONT_COURIER; |
else |
else |
/* unknown font name. Skip it */ |
/* unknown font name. Skip it */ |
Line 1890 ThotBool isHTML;
|
Line 1889 ThotBool isHTML;
|
normal, bold, bolder, lighter, 100, 200, 300, ... 900, inherit. |
normal, bold, bolder, lighter, 100, 200, 300, ... 900, inherit. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSFontWeight (Element element, PSchema tsch, |
static char* ParseCSSFontWeight (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSFontWeight (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSFontWeight (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 1908 ThotBool isHTML;
|
Line 1907 ThotBool isHTML;
|
weight.typed_data.unit = STYLE_UNIT_REL; |
weight.typed_data.unit = STYLE_UNIT_REL; |
weight.typed_data.real = FALSE; |
weight.typed_data.real = FALSE; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
if (!ustrncasecmp (cssRule, TEXT("100"), 3) && !isalpha (cssRule[3])) |
if (!strncasecmp (cssRule, "100", 3) && !isalpha (cssRule[3])) |
{ |
{ |
weight.typed_data.value = -3; |
weight.typed_data.value = -3; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("200"), 3) && !isalpha (cssRule[3])) |
else if (!strncasecmp (cssRule, "200", 3) && !isalpha (cssRule[3])) |
{ |
{ |
weight.typed_data.value = -2; |
weight.typed_data.value = -2; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("300"), 3) && !isalpha (cssRule[3])) |
else if (!strncasecmp (cssRule, "300", 3) && !isalpha (cssRule[3])) |
{ |
{ |
weight.typed_data.value = -1; |
weight.typed_data.value = -1; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("normal"), 6) || |
else if (!strncasecmp (cssRule, "normal", 6) || |
(!ustrncasecmp (cssRule, TEXT("400"), 3) && !isalpha (cssRule[3]))) |
(!strncasecmp (cssRule, "400", 3) && !isalpha (cssRule[3]))) |
{ |
{ |
weight.typed_data.value = 0; |
weight.typed_data.value = 0; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("500"), 3) && !isalpha (cssRule[3])) |
else if (!strncasecmp (cssRule, "500", 3) && !isalpha (cssRule[3])) |
{ |
{ |
weight.typed_data.value = +1; |
weight.typed_data.value = +1; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("600"), 3) && !isalpha (cssRule[3])) |
else if (!strncasecmp (cssRule, "600", 3) && !isalpha (cssRule[3])) |
{ |
{ |
weight.typed_data.value = +2; |
weight.typed_data.value = +2; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("bold"), 4) || |
else if (!strncasecmp (cssRule, "bold", 4) || |
(!ustrncasecmp (cssRule, TEXT("700"), 3) && !isalpha (cssRule[3]))) |
(!strncasecmp (cssRule, "700", 3) && !isalpha (cssRule[3]))) |
{ |
{ |
weight.typed_data.value = +3; |
weight.typed_data.value = +3; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("800"), 3) && !isalpha (cssRule[3])) |
else if (!strncasecmp (cssRule, "800", 3) && !isalpha (cssRule[3])) |
{ |
{ |
weight.typed_data.value = +4; |
weight.typed_data.value = +4; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("900"), 3) && !isalpha (cssRule[3])) |
else if (!strncasecmp (cssRule, "900", 3) && !isalpha (cssRule[3])) |
{ |
{ |
weight.typed_data.value = +5; |
weight.typed_data.value = +5; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("inherit"), 7) || |
else if (!strncasecmp (cssRule, "inherit", 7) || |
!ustrncasecmp (cssRule, TEXT("bolder"), 6) || |
!strncasecmp (cssRule, "bolder", 6) || |
!ustrncasecmp (cssRule, TEXT("lighter"), 7)) |
!strncasecmp (cssRule, "lighter", 7)) |
{ |
{ |
/* not implemented */ |
/* not implemented */ |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
Line 1986 ThotBool isHTML;
|
Line 1985 ThotBool isHTML;
|
normal or small-caps |
normal or small-caps |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSFontVariant (Element element, PSchema tsch, |
static char* ParseCSSFontVariant (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSFontVariant (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSFontVariant (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 2004 ThotBool isHTML;
|
Line 2003 ThotBool isHTML;
|
style.typed_data.unit = STYLE_UNIT_REL; |
style.typed_data.unit = STYLE_UNIT_REL; |
style.typed_data.real = FALSE; |
style.typed_data.real = FALSE; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
if (!ustrncasecmp (cssRule, TEXT("small-caps"), 10)) |
if (!strncasecmp (cssRule, "small-caps", 10)) |
{ |
{ |
/* Not supported yet */ |
/* Not supported yet */ |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("normal"), 6)) |
else if (!strncasecmp (cssRule, "normal", 6)) |
{ |
{ |
/* Not supported yet */ |
/* Not supported yet */ |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("inherit"), 7)) |
else if (!strncasecmp (cssRule, "inherit", 7)) |
{ |
{ |
/* Not supported yet */ |
/* Not supported yet */ |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
Line 2032 ThotBool isHTML;
|
Line 2031 ThotBool isHTML;
|
italic, oblique or normal |
italic, oblique or normal |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSFontStyle (Element element, PSchema tsch, |
static char* ParseCSSFontStyle (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSFontStyle (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSFontStyle (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 2054 ThotBool isHTML;
|
Line 2053 ThotBool isHTML;
|
size.typed_data.unit = STYLE_UNIT_REL; |
size.typed_data.unit = STYLE_UNIT_REL; |
size.typed_data.real = FALSE; |
size.typed_data.real = FALSE; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
if (!ustrncasecmp (cssRule, TEXT("italic"), 6)) |
if (!strncasecmp (cssRule, "italic", 6)) |
{ |
{ |
style.typed_data.value = STYLE_FONT_ITALICS; |
style.typed_data.value = STYLE_FONT_ITALICS; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("oblique"), 7)) |
else if (!strncasecmp (cssRule, "oblique", 7)) |
{ |
{ |
style.typed_data.value = STYLE_FONT_OBLIQUE; |
style.typed_data.value = STYLE_FONT_OBLIQUE; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("normal"), 6)) |
else if (!strncasecmp (cssRule, "normal", 6)) |
{ |
{ |
style.typed_data.value = STYLE_FONT_ROMAN; |
style.typed_data.value = STYLE_FONT_ROMAN; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
Line 2105 ThotBool isHTML;
|
Line 2104 ThotBool isHTML;
|
!!!!!! |
!!!!!! |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSFont (Element element, PSchema tsch, |
static char* ParseCSSFont (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSFont (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSFont (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 2117 CSSInfoPtr css;
|
Line 2116 CSSInfoPtr css;
|
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
{ |
{ |
STRING ptr; |
char* ptr; |
|
|
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
if (!ustrncasecmp (cssRule, TEXT("caption"), 7)) |
if (!strncasecmp (cssRule, "caption", 7)) |
; |
; |
else if (!ustrncasecmp (cssRule, TEXT("icon"), 4)) |
else if (!strncasecmp (cssRule, "icon", 4)) |
; |
; |
else if (!ustrncasecmp (cssRule, TEXT("menu"), 4)) |
else if (!strncasecmp (cssRule, "menu", 4)) |
; |
; |
else if (!ustrncasecmp (cssRule, TEXT("message-box"), 11)) |
else if (!strncasecmp (cssRule, "message-box", 11)) |
; |
; |
else if (!ustrncasecmp (cssRule, TEXT("small-caption"), 13)) |
else if (!strncasecmp (cssRule, "small-caption", 13)) |
; |
; |
else if (!ustrncasecmp (cssRule, TEXT("status-bar"), 10)) |
else if (!strncasecmp (cssRule, "status-bar", 10)) |
; |
; |
else |
else |
{ |
{ |
Line 2165 ThotBool isHTML;
|
Line 2164 ThotBool isHTML;
|
cartouche, blink or none |
cartouche, blink or none |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSTextDecoration (Element element, PSchema tsch, |
static char* ParseCSSTextDecoration (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSTextDecoration (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSTextDecoration (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 2183 ThotBool isHTML;
|
Line 2182 ThotBool isHTML;
|
decor.typed_data.unit = STYLE_UNIT_REL; |
decor.typed_data.unit = STYLE_UNIT_REL; |
decor.typed_data.real = FALSE; |
decor.typed_data.real = FALSE; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
if (!ustrncasecmp (cssRule, TEXT("underline"), ustrlen (TEXT("underline")))) |
if (!strncasecmp (cssRule, "underline", strlen ("underline"))) |
{ |
{ |
decor.typed_data.value = Underline; |
decor.typed_data.value = Underline; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("overline"), ustrlen (TEXT("overline")))) |
else if (!strncasecmp (cssRule, "overline", strlen ("overline"))) |
{ |
{ |
decor.typed_data.value = Overline; |
decor.typed_data.value = Overline; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("line-through"), ustrlen (TEXT("line-through")))) |
else if (!strncasecmp (cssRule, "line-through", strlen ("line-through"))) |
{ |
{ |
decor.typed_data.value = CrossOut; |
decor.typed_data.value = CrossOut; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("box"), ustrlen (TEXT("box")))) |
else if (!strncasecmp (cssRule, "box", strlen ("box"))) |
{ |
{ |
/* the box text-decoration attribute is not yet supported */ |
/* the box text-decoration attribute is not yet supported */ |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("boxshadow"), ustrlen (TEXT("boxshadow")))) |
else if (!strncasecmp (cssRule, "boxshadow", strlen ("boxshadow"))) |
{ |
{ |
/* the boxshadow text-decoration attribute is not yet supported */ |
/* the boxshadow text-decoration attribute is not yet supported */ |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("box3d"), ustrlen (TEXT("box3d")))) |
else if (!strncasecmp (cssRule, "box3d", strlen ("box3d"))) |
{ |
{ |
/* the box3d text-decoration attribute is not yet supported */ |
/* the box3d text-decoration attribute is not yet supported */ |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("cartouche"), ustrlen (TEXT("cartouche")))) |
else if (!strncasecmp (cssRule, "cartouche", strlen ("cartouche"))) |
{ |
{ |
/*the cartouche text-decoration attribute is not yet supported */ |
/*the cartouche text-decoration attribute is not yet supported */ |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("blink"), ustrlen (TEXT("blink")))) |
else if (!strncasecmp (cssRule, "blink", strlen ("blink"))) |
{ |
{ |
/*the blink text-decoration attribute will not be supported */ |
/*the blink text-decoration attribute will not be supported */ |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
} |
} |
else if (!ustrncasecmp (cssRule, TEXT("none"), ustrlen (TEXT("none")))) |
else if (!strncasecmp (cssRule, "none", strlen ("none"))) |
{ |
{ |
decor.typed_data.value = NoUnderline; |
decor.typed_data.value = NoUnderline; |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
Line 2248 ThotBool isHTML;
|
Line 2247 ThotBool isHTML;
|
ParseCSSHeight : parse a CSS height attribute |
ParseCSSHeight : parse a CSS height attribute |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSHeight (Element element, PSchema tsch, |
static char* ParseCSSHeight (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSHeight (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSHeight (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 2263 ThotBool isHTML;
|
Line 2262 ThotBool isHTML;
|
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
|
|
/* first parse the attribute string */ |
/* first parse the attribute string */ |
if (!ustrcasecmp (cssRule, TEXT("auto"))) |
if (!strcasecmp (cssRule, "auto")) |
{ |
{ |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
/* ParseCSSHeight : auto */ |
/* ParseCSSHeight : auto */ |
Line 2278 ThotBool isHTML;
|
Line 2277 ThotBool isHTML;
|
ParseCSSWidth : parse a CSS width attribute |
ParseCSSWidth : parse a CSS width attribute |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSWidth (Element element, PSchema tsch, |
static char* ParseCSSWidth (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSWidth (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSWidth (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 2293 ThotBool isHTML;
|
Line 2292 ThotBool isHTML;
|
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
|
|
/* first parse the attribute string */ |
/* first parse the attribute string */ |
if (!ustrcasecmp (cssRule, TEXT("auto"))) |
if (!strcasecmp (cssRule, "auto")) |
{ |
{ |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
return (cssRule); |
return (cssRule); |
Line 2307 ThotBool isHTML;
|
Line 2306 ThotBool isHTML;
|
ParseCSSMarginTop : parse a CSS margin-top attribute |
ParseCSSMarginTop : parse a CSS margin-top attribute |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSMarginTop (Element element, PSchema tsch, |
static char* ParseCSSMarginTop (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSMarginTop (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSMarginTop (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 2338 ThotBool isHTML;
|
Line 2337 ThotBool isHTML;
|
attribute |
attribute |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSMarginBottom (Element element, PSchema tsch, |
static char* ParseCSSMarginBottom (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSMarginBottom (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSMarginBottom (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 2365 ThotBool isHTML;
|
Line 2364 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSMarginLeft (Element element, PSchema tsch, |
static char* ParseCSSMarginLeft (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSMarginLeft (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSMarginLeft (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 2396 ThotBool isHTML;
|
Line 2395 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSMarginRight (Element element, PSchema tsch, |
static char* ParseCSSMarginRight (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSMarginRight (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSMarginRight (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 2422 ThotBool isHTML;
|
Line 2421 ThotBool isHTML;
|
ParseCSSMargin : parse a CSS margin attribute string. |
ParseCSSMargin : parse a CSS margin attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSMargin (Element element, PSchema tsch, |
static char* ParseCSSMargin (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSMargin (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSMargin (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 2434 CSSInfoPtr css;
|
Line 2433 CSSInfoPtr css;
|
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
{ |
{ |
STRING ptrT, ptrR, ptrB, ptrL; |
char *ptrT, *ptrR, *ptrB, *ptrL; |
|
|
ptrT = SkipBlanksAndComments (cssRule); |
ptrT = SkipBlanksAndComments (cssRule); |
/* First parse Margin-Top */ |
/* First parse Margin-Top */ |
Line 2486 ThotBool isHTML;
|
Line 2485 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSPaddingTop (Element element, PSchema tsch, |
static char* ParseCSSPaddingTop (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSPaddingTop (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSPaddingTop (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 2513 ThotBool isHTML;
|
Line 2512 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSPaddingBottom (Element element, PSchema tsch, |
static char* ParseCSSPaddingBottom (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSPaddingBottom (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSPaddingBottom (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 2540 ThotBool isHTML;
|
Line 2539 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSPaddingLeft (Element element, PSchema tsch, |
static char* ParseCSSPaddingLeft (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSPaddingLeft (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSPaddingLeft (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 2567 ThotBool isHTML;
|
Line 2566 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSPaddingRight (Element element, PSchema tsch, |
static char* ParseCSSPaddingRight (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSPaddingRight (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSPaddingRight (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 2593 ThotBool isHTML;
|
Line 2592 ThotBool isHTML;
|
ParseCSSPadding : parse a CSS padding attribute string. |
ParseCSSPadding : parse a CSS padding attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSPadding (Element element, PSchema tsch, |
static char* ParseCSSPadding (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSPadding (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSPadding (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 2605 CSSInfoPtr css;
|
Line 2604 CSSInfoPtr css;
|
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
{ |
{ |
STRING ptrT, ptrR, ptrB, ptrL; |
char *ptrT, *ptrR, *ptrB, *ptrL; |
|
|
ptrT = SkipBlanksAndComments (cssRule); |
ptrT = SkipBlanksAndComments (cssRule); |
/* First parse Padding-Top */ |
/* First parse Padding-Top */ |
Line 2656 ThotBool isHTML;
|
Line 2655 ThotBool isHTML;
|
ParseCSSForeground : parse a CSS foreground attribute |
ParseCSSForeground : parse a CSS foreground attribute |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSForeground (Element element, PSchema tsch, |
static char* ParseCSSForeground (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSForeground (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSForeground (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 2681 ThotBool isHTML;
|
Line 2680 ThotBool isHTML;
|
ParseCSSBackgroundColor : parse a CSS background color attribute |
ParseCSSBackgroundColor : parse a CSS background color attribute |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBackgroundColor (Element element, PSchema tsch, |
static char* ParseCSSBackgroundColor (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBackgroundColor (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBackgroundColor (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
Line 2712 ThotBool isHTML;
|
Line 2711 ThotBool isHTML;
|
|
|
best.typed_data.unit = STYLE_UNIT_INVALID; |
best.typed_data.unit = STYLE_UNIT_INVALID; |
best.typed_data.real = FALSE; |
best.typed_data.real = FALSE; |
if (!ustrncasecmp (cssRule, TEXT("transparent"), ustrlen (TEXT("transparent")))) |
if (!strncasecmp (cssRule, "transparent", strlen ("transparent"))) |
{ |
{ |
best.typed_data.value = STYLE_PATTERN_NONE; |
best.typed_data.value = STYLE_PATTERN_NONE; |
best.typed_data.unit = STYLE_UNIT_REL; |
best.typed_data.unit = STYLE_UNIT_REL; |
Line 2810 void *extra;
|
Line 2809 void *extra;
|
Returns NULL or a new allocated url string. |
Returns NULL or a new allocated url string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
STRING GetCSSBackgroundURL (STRING styleString) |
char* GetCSSBackgroundURL (char* styleString) |
#else |
#else |
STRING GetCSSBackgroundURL (styleString) |
char* GetCSSBackgroundURL (styleString) |
STRING styleString; |
char* styleString; |
#endif |
#endif |
{ |
{ |
STRING b, e, ptr; |
char *b, *e, *ptr; |
int len; |
int len; |
|
|
ptr = NULL; |
ptr = NULL; |
b = ustrstr (styleString, TEXT("url")); |
b = strstr (styleString, "url"); |
if (b != NULL) |
if (b != NULL) |
{ |
{ |
b += 3; |
b += 3; |
Line 2850 STRING styleString;
|
Line 2849 STRING styleString;
|
if (*e != EOS) |
if (*e != EOS) |
{ |
{ |
len = (int)(e - b); |
len = (int)(e - b); |
ptr = (STRING) TtaGetMemory (len+1); |
ptr = (char*) TtaGetMemory (len+1); |
ustrncpy (ptr, b, len); |
strncpy (ptr, b, len); |
ptr[len] = EOS; |
ptr[len] = EOS; |
} |
} |
} |
} |
Line 2865 STRING styleString;
|
Line 2864 STRING styleString;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBackgroundImage (Element element, PSchema tsch, |
static char* ParseCSSBackgroundImage (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBackgroundImage (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBackgroundImage (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 2882 ThotBool isHTML;
|
Line 2881 ThotBool isHTML;
|
PresentationContextBlock *sblock; |
PresentationContextBlock *sblock; |
BackgroundImageCallbackPtr callblock; |
BackgroundImageCallbackPtr callblock; |
PresentationValue image, value; |
PresentationValue image, value; |
STRING url; |
char* url; |
STRING bg_image; |
STRING bg_image; |
CHAR_T saved; |
char saved; |
STRING base; |
char* base; |
CHAR_T tempname[MAX_LENGTH]; |
CHAR_T tempname[MAX_LENGTH]; |
CHAR_T imgname[MAX_LENGTH]; |
CHAR_T imgname[MAX_LENGTH]; |
unsigned int savedtype = 0; |
unsigned int savedtype = 0; |
Line 2910 ThotBool isHTML;
|
Line 2909 ThotBool isHTML;
|
|
|
url = NULL; |
url = NULL; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
if (!ustrncasecmp (cssRule, TEXT("url"), 3)) |
if (!strncasecmp (cssRule, "url", 3)) |
{ |
{ |
cssRule += 3; |
cssRule += 3; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
Line 3011 ThotBool isHTML;
|
Line 3010 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBackgroundRepeat (Element element, PSchema tsch, |
static char* ParseCSSBackgroundRepeat (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBackgroundRepeat (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBackgroundRepeat (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 3044 ThotBool isHTML;
|
Line 3043 ThotBool isHTML;
|
repeat.typed_data.unit = STYLE_UNIT_REL; |
repeat.typed_data.unit = STYLE_UNIT_REL; |
repeat.typed_data.real = FALSE; |
repeat.typed_data.real = FALSE; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
if (!ustrncasecmp (cssRule, TEXT("no-repeat"), 9)) |
if (!strncasecmp (cssRule, "no-repeat", 9)) |
repeat.typed_data.value = STYLE_REALSIZE; |
repeat.typed_data.value = STYLE_REALSIZE; |
else if (!ustrncasecmp (cssRule, TEXT("repeat-y"), 8)) |
else if (!strncasecmp (cssRule, "repeat-y", 8)) |
repeat.typed_data.value = STYLE_VREPEAT; |
repeat.typed_data.value = STYLE_VREPEAT; |
else if (!ustrncasecmp (cssRule, TEXT("repeat-x"), 8)) |
else if (!strncasecmp (cssRule, "repeat-x", 8)) |
repeat.typed_data.value = STYLE_HREPEAT; |
repeat.typed_data.value = STYLE_HREPEAT; |
else if (!ustrncasecmp (cssRule, TEXT("repeat"), 6)) |
else if (!strncasecmp (cssRule, "repeat", 6)) |
repeat.typed_data.value = STYLE_REPEAT; |
repeat.typed_data.value = STYLE_REPEAT; |
else |
else |
return (cssRule); |
return (cssRule); |
Line 3070 ThotBool isHTML;
|
Line 3069 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBackgroundAttachment (Element element, PSchema tsch, |
static char* ParseCSSBackgroundAttachment (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBackgroundAttachment (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBackgroundAttachment (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 3099 ThotBool isHTML;
|
Line 3098 ThotBool isHTML;
|
} |
} |
|
|
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
if (!ustrncasecmp (cssRule, TEXT("scroll"), 6)) |
if (!strncasecmp (cssRule, "scroll", 6)) |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
else if (!ustrncasecmp (cssRule, TEXT("fixed"), 5)) |
else if (!strncasecmp (cssRule, "fixed", 5)) |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
|
|
/* restore the refered element */ |
/* restore the refered element */ |
Line 3115 ThotBool isHTML;
|
Line 3114 ThotBool isHTML;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBackgroundPosition (Element element, PSchema tsch, |
static char* ParseCSSBackgroundPosition (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBackgroundPosition (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBackgroundPosition (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 3147 ThotBool isHTML;
|
Line 3146 ThotBool isHTML;
|
|
|
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
ok = TRUE; |
ok = TRUE; |
if (!ustrncasecmp (cssRule, TEXT("left"), 4)) |
if (!strncasecmp (cssRule, "left", 4)) |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
else if (!ustrncasecmp (cssRule, TEXT("right"), 5)) |
else if (!strncasecmp (cssRule, "right", 5)) |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
else if (!ustrncasecmp (cssRule, TEXT("center"), 6)) |
else if (!strncasecmp (cssRule, "center", 6)) |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
else if (!ustrncasecmp (cssRule, TEXT("top"), 3)) |
else if (!strncasecmp (cssRule, "top", 3)) |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
else if (!ustrncasecmp (cssRule, TEXT("bottom"), 6)) |
else if (!strncasecmp (cssRule, "bottom", 6)) |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
else if (isdigit (*cssRule)) |
else if (isdigit (*cssRule)) |
cssRule = SkipWord (cssRule); |
cssRule = SkipWord (cssRule); |
Line 3181 ThotBool isHTML;
|
Line 3180 ThotBool isHTML;
|
ParseCSSBackground : parse a CSS background attribute |
ParseCSSBackground : parse a CSS background attribute |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseCSSBackground (Element element, PSchema tsch, |
static char* ParseCSSBackground (Element element, PSchema tsch, |
PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static STRING ParseCSSBackground (element, tsch, context, cssRule, css, isHTML) |
static char* ParseCSSBackground (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
Line 3193 CSSInfoPtr css;
|
Line 3192 CSSInfoPtr css;
|
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
{ |
{ |
STRING ptr; |
char* ptr; |
|
|
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
while (*cssRule != ';' && *cssRule != EOS && *cssRule != ',') |
while (*cssRule != ';' && *cssRule != EOS && *cssRule != ',') |
{ |
{ |
/* perhaps a Backgroud Image */ |
/* perhaps a Backgroud Image */ |
if (!ustrncasecmp (cssRule, TEXT("url"), 3)) |
if (!strncasecmp (cssRule, "url", 3)) |
cssRule = ParseCSSBackgroundImage (element, tsch, context, cssRule, css, isHTML); |
cssRule = ParseCSSBackgroundImage (element, tsch, context, cssRule, css, isHTML); |
/* perhaps a Background Attachment */ |
/* perhaps a Background Attachment */ |
else if (!ustrncasecmp (cssRule, TEXT("scroll"), 6) || |
else if (!strncasecmp (cssRule, "scroll", 6) || |
!ustrncasecmp (cssRule, TEXT("fixed"), 5)) |
!strncasecmp (cssRule, "fixed", 5)) |
cssRule = ParseCSSBackgroundAttachment (element, tsch, context, cssRule, css, isHTML); |
cssRule = ParseCSSBackgroundAttachment (element, tsch, context, cssRule, css, isHTML); |
/* perhaps a Background Repeat */ |
/* perhaps a Background Repeat */ |
else if (!ustrncasecmp (cssRule, TEXT("no-repeat"), 9) || |
else if (!strncasecmp (cssRule, "no-repeat", 9) || |
!ustrncasecmp (cssRule, TEXT("repeat-y"), 8) || |
!strncasecmp (cssRule, "repeat-y", 8) || |
!ustrncasecmp (cssRule, TEXT("repeat-x"), 8) || |
!strncasecmp (cssRule, "repeat-x", 8) || |
!ustrncasecmp (cssRule, TEXT("repeat"), 6)) |
!strncasecmp (cssRule, "repeat", 6)) |
cssRule = ParseCSSBackgroundRepeat (element, tsch, context, cssRule, css, isHTML); |
cssRule = ParseCSSBackgroundRepeat (element, tsch, context, cssRule, css, isHTML); |
/* perhaps a Background Position */ |
/* perhaps a Background Position */ |
else if (!ustrncasecmp (cssRule, TEXT("left"), 4) || |
else if (!strncasecmp (cssRule, "left", 4) || |
!ustrncasecmp (cssRule, TEXT("right"), 5) || |
!strncasecmp (cssRule, "right", 5) || |
!ustrncasecmp (cssRule, TEXT("center"), 6) || |
!strncasecmp (cssRule, "center", 6) || |
!ustrncasecmp (cssRule, TEXT("top"), 3) || |
!strncasecmp (cssRule, "top", 3) || |
!ustrncasecmp (cssRule, TEXT("bottom"), 6) || |
!strncasecmp (cssRule, "bottom", 6) || |
isdigit (*cssRule)) |
isdigit (*cssRule)) |
cssRule = ParseCSSBackgroundPosition (element, tsch, context, cssRule, css, isHTML); |
cssRule = ParseCSSBackgroundPosition (element, tsch, context, cssRule, css, isHTML); |
/* perhaps a Background Color */ |
/* perhaps a Background Color */ |
Line 3247 ThotBool isHTML;
|
Line 3246 ThotBool isHTML;
|
*/ |
*/ |
static CSSProperty CSSProperties[] = |
static CSSProperty CSSProperties[] = |
{ |
{ |
{TEXT ("font-family"), ParseCSSFontFamily}, |
{"font-family", ParseCSSFontFamily}, |
{TEXT ("font-style"), ParseCSSFontStyle}, |
{"font-style", ParseCSSFontStyle}, |
{TEXT ("font-variant"), ParseCSSFontVariant}, |
{"font-variant", ParseCSSFontVariant}, |
{TEXT ("font-weight"), ParseCSSFontWeight}, |
{"font-weight", ParseCSSFontWeight}, |
{TEXT ("font-size"), ParseCSSFontSize}, |
{"font-size", ParseCSSFontSize}, |
{TEXT ("font"), ParseCSSFont}, |
{"font", ParseCSSFont}, |
|
|
{TEXT ("color"), ParseCSSForeground}, |
{"color", ParseCSSForeground}, |
{TEXT ("background-color"), ParseCSSBackgroundColor}, |
{"background-color", ParseCSSBackgroundColor}, |
{TEXT ("background-image"), ParseCSSBackgroundImage}, |
{"background-image", ParseCSSBackgroundImage}, |
{TEXT ("background-repeat"), ParseCSSBackgroundRepeat}, |
{"background-repeat", ParseCSSBackgroundRepeat}, |
{TEXT ("background-attachment"), ParseCSSBackgroundAttachment}, |
{"background-attachment", ParseCSSBackgroundAttachment}, |
{TEXT ("background-position"), ParseCSSBackgroundPosition}, |
{"background-position", ParseCSSBackgroundPosition}, |
{TEXT ("background"), ParseCSSBackground}, |
{"background", ParseCSSBackground}, |
|
|
{TEXT ("word-spacing"), ParseCSSWordSpacing}, |
{"word-spacing", ParseCSSWordSpacing}, |
{TEXT ("letter-spacing"), ParseCSSLetterSpacing}, |
{"letter-spacing", ParseCSSLetterSpacing}, |
{TEXT ("text-decoration"), ParseCSSTextDecoration}, |
{"text-decoration", ParseCSSTextDecoration}, |
{TEXT ("vertical-align"), ParseCSSVerticalAlign}, |
{"vertical-align", ParseCSSVerticalAlign}, |
{TEXT ("text-transform"), ParseCSSTextTransform}, |
{"text-transform", ParseCSSTextTransform}, |
{TEXT ("text-align"), ParseCSSTextAlign}, |
{"text-align", ParseCSSTextAlign}, |
{TEXT ("text-indent"), ParseCSSTextIndent}, |
{"text-indent", ParseCSSTextIndent}, |
{TEXT ("line-height"), ParseCSSLineSpacing}, |
{"line-height", ParseCSSLineSpacing}, |
|
|
{TEXT ("margin-top"), ParseCSSMarginTop}, |
{"margin-top", ParseCSSMarginTop}, |
{TEXT ("margin-right"), ParseCSSMarginRight}, |
{"margin-right", ParseCSSMarginRight}, |
{TEXT ("margin-bottom"), ParseCSSMarginBottom}, |
{"margin-bottom", ParseCSSMarginBottom}, |
{TEXT ("margin-left"), ParseCSSMarginLeft}, |
{"margin-left", ParseCSSMarginLeft}, |
{TEXT ("margin"), ParseCSSMargin}, |
{"margin", ParseCSSMargin}, |
|
|
{TEXT ("padding-top"), ParseCSSPaddingTop}, |
{"padding-top", ParseCSSPaddingTop}, |
{TEXT ("padding-right"), ParseCSSPaddingRight}, |
{"padding-right", ParseCSSPaddingRight}, |
{TEXT ("padding-bottom"), ParseCSSPaddingBottom}, |
{"padding-bottom", ParseCSSPaddingBottom}, |
{TEXT ("padding-left"), ParseCSSPaddingLeft}, |
{"padding-left", ParseCSSPaddingLeft}, |
{TEXT ("padding"), ParseCSSPadding}, |
{"padding", ParseCSSPadding}, |
|
|
{TEXT ("border-top-width"), ParseCSSBorderTopWidth}, |
{"border-top-width", ParseCSSBorderTopWidth}, |
{TEXT ("border-right-width"), ParseCSSBorderRightWidth}, |
{"border-right-width", ParseCSSBorderRightWidth}, |
{TEXT ("border-bottom-width"), ParseCSSBorderBottomWidth}, |
{"border-bottom-width", ParseCSSBorderBottomWidth}, |
{TEXT ("border-left-width"), ParseCSSBorderLeftWidth}, |
{"border-left-width", ParseCSSBorderLeftWidth}, |
{TEXT ("border-width"), ParseCSSBorderWidth}, |
{"border-width", ParseCSSBorderWidth}, |
{TEXT ("border-top-color"), ParseCSSBorderColorTop}, |
{"border-top-color", ParseCSSBorderColorTop}, |
{TEXT ("border-right-color"), ParseCSSBorderColorRight}, |
{"border-right-color", ParseCSSBorderColorRight}, |
{TEXT ("border-bottom-color"), ParseCSSBorderColorBottom}, |
{"border-bottom-color", ParseCSSBorderColorBottom}, |
{TEXT ("border-left-color"), ParseCSSBorderColorLeft}, |
{"border-left-color", ParseCSSBorderColorLeft}, |
{TEXT ("border-color"), ParseCSSBorderColor}, |
{"border-color", ParseCSSBorderColor}, |
{TEXT ("border-top-style"), ParseCSSBorderStyleTop}, |
{"border-top-style", ParseCSSBorderStyleTop}, |
{TEXT ("border-right-style"), ParseCSSBorderStyleRight}, |
{"border-right-style", ParseCSSBorderStyleRight}, |
{TEXT ("border-bottom-style"), ParseCSSBorderStyleBottom}, |
{"border-bottom-style", ParseCSSBorderStyleBottom}, |
{TEXT ("border-left-style"), ParseCSSBorderStyleLeft}, |
{"border-left-style", ParseCSSBorderStyleLeft}, |
{TEXT ("border-style"), ParseCSSBorderStyle}, |
{"border-style", ParseCSSBorderStyle}, |
{TEXT ("border-top"), ParseCSSBorderTop}, |
{"border-top", ParseCSSBorderTop}, |
{TEXT ("border-right"), ParseCSSBorderRight}, |
{"border-right", ParseCSSBorderRight}, |
{TEXT ("border-bottom"), ParseCSSBorderBottom}, |
{"border-bottom", ParseCSSBorderBottom}, |
{TEXT ("border-left"), ParseCSSBorderLeft}, |
{"border-left", ParseCSSBorderLeft}, |
{TEXT ("border"), ParseCSSBorder}, |
{"border", ParseCSSBorder}, |
|
|
{TEXT ("width"), ParseCSSWidth}, |
{"width", ParseCSSWidth}, |
{TEXT ("height"), ParseCSSHeight}, |
{"height", ParseCSSHeight}, |
{TEXT ("float"), ParseCSSFloat}, |
{"float", ParseCSSFloat}, |
{TEXT ("clear"), ParseCSSClear}, |
{"clear", ParseCSSClear}, |
|
|
{TEXT ("display"), ParseCSSDisplay}, |
{"display", ParseCSSDisplay}, |
{TEXT ("white-space"), ParseCSSWhiteSpace}, |
{"white-space", ParseCSSWhiteSpace}, |
|
|
{TEXT ("list-style-type"), ParseCSSListStyleType}, |
{"list-style-type", ParseCSSListStyleType}, |
{TEXT ("list-style-image"), ParseCSSListStyleImage}, |
{"list-style-image", ParseCSSListStyleImage}, |
{TEXT ("list-style-position"), ParseCSSListStylePosition}, |
{"list-style-position", ParseCSSListStylePosition}, |
{TEXT ("list-style"), ParseCSSListStyle} |
{"list-style", ParseCSSListStyle} |
}; |
}; |
#define NB_CSSSTYLEATTRIBUTE (sizeof(CSSProperties) / sizeof(CSSProperty)) |
#define NB_CSSSTYLEATTRIBUTE (sizeof(CSSProperties) / sizeof(CSSProperty)) |
|
|
Line 3326 static CSSProperty CSSProperties[] =
|
Line 3325 static CSSProperty CSSProperties[] =
|
but tolerate incorrect or incomplete input |
but tolerate incorrect or incomplete input |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static void ParseCSSRule (Element element, PSchema tsch, PresentationContext context, STRING cssRule, CSSInfoPtr css, ThotBool isHTML) |
static void ParseCSSRule (Element element, PSchema tsch, PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static void ParseCSSRule (element, tsch, context, cssRule, css, isHTML) |
static void ParseCSSRule (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
char* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
{ |
{ |
DisplayMode dispMode; |
DisplayMode dispMode; |
STRING p = NULL; |
char* p = NULL; |
int lg; |
int lg; |
unsigned int i; |
unsigned int i; |
ThotBool found; |
ThotBool found; |
Line 3356 ThotBool isHTML;
|
Line 3355 ThotBool isHTML;
|
/* look for the type of property */ |
/* look for the type of property */ |
for (i = 0; i < NB_CSSSTYLEATTRIBUTE && !found; i++) |
for (i = 0; i < NB_CSSSTYLEATTRIBUTE && !found; i++) |
{ |
{ |
lg = ustrlen (CSSProperties[i].name); |
lg = strlen (CSSProperties[i].name); |
if (!ustrncasecmp (cssRule, CSSProperties[i].name, lg)) |
if (!strncasecmp (cssRule, CSSProperties[i].name, lg)) |
{ |
{ |
cssRule += lg; |
cssRule += lg; |
found = TRUE; |
found = TRUE; |
Line 3409 ThotBool isHTML;
|
Line 3408 ThotBool isHTML;
|
described in thotlib/include/presentation.h |
described in thotlib/include/presentation.h |
-----------------------------------------------------------------------*/ |
-----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
void PToCss (PresentationSetting settings, STRING buffer, int len) |
void PToCss (PresentationSetting settings, char* buffer, int len) |
#else |
#else |
void PToCss (settings, buffer, len) |
void PToCss (settings, buffer, len) |
PresentationSetting settings; |
PresentationSetting settings; |
STRING param; |
char* param; |
int len |
int len |
#endif |
#endif |
{ |
{ |
Line 3443 int len
|
Line 3442 int len
|
switch (settings->value.typed_data.value) |
switch (settings->value.typed_data.value) |
{ |
{ |
case STYLE_FONT_HELVETICA: |
case STYLE_FONT_HELVETICA: |
ustrcpy (buffer, TEXT("font-family: helvetica")); |
strcpy (buffer, "font-family: helvetica"); |
break; |
break; |
case STYLE_FONT_TIMES: |
case STYLE_FONT_TIMES: |
ustrcpy (buffer, TEXT("font-family: times")); |
strcpy (buffer, "font-family: times"); |
break; |
break; |
case STYLE_FONT_COURIER: |
case STYLE_FONT_COURIER: |
ustrcpy (buffer, TEXT("font-family: courier")); |
strcpy (buffer, "font-family: courier"); |
break; |
break; |
} |
} |
break; |
break; |
Line 3457 int len
|
Line 3456 int len
|
switch (settings->value.typed_data.value) |
switch (settings->value.typed_data.value) |
{ |
{ |
case STYLE_FONT_ROMAN: |
case STYLE_FONT_ROMAN: |
ustrcpy (buffer, TEXT("font-style: normal")); |
strcpy (buffer, "font-style: normal"); |
break; |
break; |
case STYLE_FONT_ITALICS: |
case STYLE_FONT_ITALICS: |
ustrcpy (buffer, TEXT("font-style: italic")); |
strcpy (buffer, "font-style: italic"); |
break; |
break; |
case STYLE_FONT_OBLIQUE: |
case STYLE_FONT_OBLIQUE: |
ustrcpy (buffer, TEXT("font-style: oblique")); |
strcpy (buffer, "font-style: oblique"); |
break; |
break; |
} |
} |
break; |
break; |
Line 3471 int len
|
Line 3470 int len
|
switch (settings->value.typed_data.value) |
switch (settings->value.typed_data.value) |
{ |
{ |
case STYLE_WEIGHT_BOLD: |
case STYLE_WEIGHT_BOLD: |
ustrcpy (buffer, TEXT("font-weight: bold")); |
strcpy (buffer, "font-weight: bold"); |
break; |
break; |
case STYLE_WEIGHT_NORMAL: |
case STYLE_WEIGHT_NORMAL: |
ustrcpy (buffer, TEXT("font-weight: normal")); |
strcpy (buffer, "font-weight: normal"); |
break; |
break; |
} |
} |
break; |
break; |
Line 3483 int len
|
Line 3482 int len
|
{ |
{ |
if (real) |
if (real) |
{ |
{ |
usprintf (buffer, TEXT("font-size: %g"), fval); |
sprintf (buffer, "font-size: %g", fval); |
add_unit = 1; |
add_unit = 1; |
} |
} |
else |
else |
switch (settings->value.typed_data.value) |
switch (settings->value.typed_data.value) |
{ |
{ |
case 1: |
case 1: |
ustrcpy (buffer, TEXT("font-size: xx-small")); |
strcpy (buffer, "font-size: xx-small"); |
break; |
break; |
case 2: |
case 2: |
ustrcpy (buffer, TEXT("font-size: x-small")); |
strcpy (buffer, "font-size: x-small"); |
break; |
break; |
case 3: |
case 3: |
ustrcpy (buffer, TEXT("font-size: small")); |
strcpy (buffer, "font-size: small"); |
break; |
break; |
case 4: |
case 4: |
ustrcpy (buffer, TEXT("font-size: medium")); |
strcpy (buffer, "font-size: medium"); |
break; |
break; |
case 5: |
case 5: |
ustrcpy (buffer, TEXT("font-size: large")); |
strcpy (buffer, "font-size: large"); |
break; |
break; |
case 6: |
case 6: |
ustrcpy (buffer, TEXT("font-size: x-large")); |
strcpy (buffer, "font-size: x-large"); |
break; |
break; |
case 7: |
case 7: |
case 8: |
case 8: |
Line 3513 int len
|
Line 3512 int len
|
case 10: |
case 10: |
case 11: |
case 11: |
case 12: |
case 12: |
ustrcpy (buffer, TEXT("font-size: xx-large")); |
strcpy (buffer, "font-size: xx-large"); |
break; |
break; |
} |
} |
} |
} |
else |
else |
{ |
{ |
if (real) |
if (real) |
usprintf (buffer, TEXT("font-size: %g"), fval); |
sprintf (buffer, "font-size: %g", fval); |
else |
else |
usprintf (buffer, TEXT("font-size: %d"), settings->value.typed_data.value); |
sprintf (buffer, "font-size: %d", settings->value.typed_data.value); |
add_unit = 1; |
add_unit = 1; |
} |
} |
break; |
break; |
Line 3530 int len
|
Line 3529 int len
|
switch (settings->value.typed_data.value) |
switch (settings->value.typed_data.value) |
{ |
{ |
case STYLE_UNDERLINE: |
case STYLE_UNDERLINE: |
ustrcpy (buffer, TEXT("text-decoration: underline")); |
strcpy (buffer, "text-decoration: underline"); |
break; |
break; |
case STYLE_OVERLINE: |
case STYLE_OVERLINE: |
ustrcpy (buffer, TEXT("text-decoration: overline")); |
strcpy (buffer, "text-decoration: overline"); |
break; |
break; |
case STYLE_CROSSOUT: |
case STYLE_CROSSOUT: |
ustrcpy (buffer, TEXT("text-decoration: line-through")); |
strcpy (buffer, "text-decoration: line-through"); |
break; |
break; |
} |
} |
break; |
break; |
case PRIndent: |
case PRIndent: |
if (real) |
if (real) |
usprintf (buffer, TEXT("text-indent: %g"), fval); |
sprintf (buffer, "text-indent: %g", fval); |
else |
else |
usprintf (buffer, TEXT("text-indent: %d"), settings->value.typed_data.value); |
sprintf (buffer, "text-indent: %d", settings->value.typed_data.value); |
add_unit = 1; |
add_unit = 1; |
break; |
break; |
case PRLineSpacing: |
case PRLineSpacing: |
if (real) |
if (real) |
usprintf (buffer, TEXT("line-height: %g"), fval); |
sprintf (buffer, "line-height: %g", fval); |
else |
else |
usprintf (buffer, TEXT("line-height: %d"), settings->value.typed_data.value); |
sprintf (buffer, "line-height: %d", settings->value.typed_data.value); |
add_unit = 1; |
add_unit = 1; |
break; |
break; |
case PRJustify: |
case PRJustify: |
if (settings->value.typed_data.value == STYLE_JUSTIFIED) |
if (settings->value.typed_data.value == STYLE_JUSTIFIED) |
usprintf (buffer, TEXT("text-align: justify")); |
sprintf (buffer, "text-align: justify"); |
break; |
break; |
case PRAdjust: |
case PRAdjust: |
switch (settings->value.typed_data.value) |
switch (settings->value.typed_data.value) |
{ |
{ |
case STYLE_ADJUSTLEFT: |
case STYLE_ADJUSTLEFT: |
ustrcpy (buffer, TEXT("text-align: left")); |
strcpy (buffer, "text-align: left"); |
break; |
break; |
case STYLE_ADJUSTRIGHT: |
case STYLE_ADJUSTRIGHT: |
ustrcpy (buffer, TEXT("text-align: right")); |
strcpy (buffer, "text-align: right"); |
break; |
break; |
case STYLE_ADJUSTCENTERED: |
case STYLE_ADJUSTCENTERED: |
ustrcpy (buffer, TEXT("text-align: center")); |
strcpy (buffer, "text-align: center"); |
break; |
break; |
case STYLE_ADJUSTLEFTWITHDOTS: |
case STYLE_ADJUSTLEFTWITHDOTS: |
ustrcpy (buffer, TEXT("text-align: left")); |
strcpy (buffer, "text-align: left"); |
break; |
break; |
} |
} |
break; |
break; |
Line 3581 int len
|
Line 3580 int len
|
break; |
break; |
case PRBackground: |
case PRBackground: |
TtaGiveThotRGB (settings->value.typed_data.value, &red, &green, &blue); |
TtaGiveThotRGB (settings->value.typed_data.value, &red, &green, &blue); |
usprintf (buffer, TEXT("background-color: #%02X%02X%02X"), red, green, blue); |
sprintf (buffer, "background-color: #%02X%02X%02X", red, green, blue); |
break; |
break; |
case PRForeground: |
case PRForeground: |
TtaGiveThotRGB (settings->value.typed_data.value, &red, &green, &blue); |
TtaGiveThotRGB (settings->value.typed_data.value, &red, &green, &blue); |
usprintf (buffer, TEXT("color: #%02X%02X%02X"), red, green, blue); |
sprintf (buffer, "color: #%02X%02X%02X", red, green, blue); |
break; |
break; |
case PRMarginTop: |
case PRMarginTop: |
if (real) |
if (real) |
usprintf (buffer, TEXT("marging-top: %g"), fval); |
sprintf (buffer, "marging-top: %g", fval); |
else |
else |
usprintf (buffer, TEXT("marging-top: %d"), settings->value.typed_data.value); |
sprintf (buffer, "marging-top: %d", settings->value.typed_data.value); |
add_unit = 1; |
add_unit = 1; |
break; |
break; |
case PRMarginLeft: |
case PRMarginLeft: |
if (real) |
if (real) |
usprintf (buffer, TEXT("margin-left: %g"), fval); |
sprintf (buffer, "margin-left: %g", fval); |
else |
else |
usprintf (buffer, TEXT("margin-left: %d"), settings->value.typed_data.value); |
sprintf (buffer, "margin-left: %d", settings->value.typed_data.value); |
add_unit = 1; |
add_unit = 1; |
break; |
break; |
case PRHeight: |
case PRHeight: |
if (real) |
if (real) |
usprintf (buffer, TEXT("height: %g"), fval); |
sprintf (buffer, "height: %g", fval); |
else |
else |
usprintf (buffer, TEXT("height: %d"), settings->value.typed_data.value); |
sprintf (buffer, "height: %d", settings->value.typed_data.value); |
add_unit = 1; |
add_unit = 1; |
break; |
break; |
case PRWidth: |
case PRWidth: |
if (real) |
if (real) |
usprintf (buffer, TEXT("width: %g"), fval); |
sprintf (buffer, "width: %g", fval); |
else |
else |
usprintf (buffer, TEXT("width: %d"), settings->value.typed_data.value); |
sprintf (buffer, "width: %d", settings->value.typed_data.value); |
add_unit = 1; |
add_unit = 1; |
break; |
break; |
case PRLine: |
case PRLine: |
if (settings->value.typed_data.value == STYLE_INLINE) |
if (settings->value.typed_data.value == STYLE_INLINE) |
ustrcpy (buffer, TEXT("display: inline")); |
strcpy (buffer, "display: inline"); |
else if (settings->value.typed_data.value == STYLE_NOTINLINE) |
else if (settings->value.typed_data.value == STYLE_NOTINLINE) |
ustrcpy (buffer, TEXT("display: block")); |
strcpy (buffer, "display: block"); |
break; |
break; |
case PRBackgroundPicture: |
case PRBackgroundPicture: |
if (settings->value.pointer != NULL) |
if (settings->value.pointer != NULL) |
usprintf (buffer, TEXT("background-image: url(%s)"), (STRING)(settings->value.pointer)); |
sprintf (buffer, "background-image: url(%s)", (char*)(settings->value.pointer)); |
else |
else |
usprintf (buffer, TEXT("background-image: none")); |
sprintf (buffer, "background-image: none"); |
break; |
break; |
case PRPictureMode: |
case PRPictureMode: |
switch (settings->value.typed_data.value) |
switch (settings->value.typed_data.value) |
{ |
{ |
case STYLE_REALSIZE: |
case STYLE_REALSIZE: |
usprintf (buffer, TEXT("background-repeat: no-repeat")); |
sprintf (buffer, "background-repeat: no-repeat"); |
break; |
break; |
case STYLE_REPEAT: |
case STYLE_REPEAT: |
usprintf (buffer, TEXT("background-repeat: repeat")); |
sprintf (buffer, "background-repeat: repeat"); |
break; |
break; |
case STYLE_VREPEAT: |
case STYLE_VREPEAT: |
usprintf (buffer, TEXT("background-repeat: repeat-y")); |
sprintf (buffer, "background-repeat: repeat-y"); |
break; |
break; |
case STYLE_HREPEAT: |
case STYLE_HREPEAT: |
usprintf (buffer, TEXT("background-repeat: repeat-x")); |
sprintf (buffer, "background-repeat: repeat-x"); |
break; |
break; |
} |
} |
break; |
break; |
Line 3655 int len
|
Line 3654 int len
|
{ |
{ |
if (CSSUnitNames[i].unit == unit) |
if (CSSUnitNames[i].unit == unit) |
{ |
{ |
ustrcat (buffer, CSSUnitNames[i].sign); |
strcat (buffer, CSSUnitNames[i].sign); |
break; |
break; |
} |
} |
} |
} |
Line 3668 int len
|
Line 3667 int len
|
element. |
element. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
void ParseHTMLSpecificStyle (Element el, STRING cssRule, Document doc, ThotBool destroy) |
void ParseHTMLSpecificStyle (Element el, char* cssRule, Document doc, ThotBool destroy) |
#else |
#else |
void ParseHTMLSpecificStyle (el, cssRule, doc, destroy) |
void ParseHTMLSpecificStyle (el, cssRule, doc, destroy) |
Element elem; |
Element elem; |
STRING cssRule; |
char* cssRule; |
Document doc; |
Document doc; |
ThotBool destroy; |
ThotBool destroy; |
#endif |
#endif |
Line 3683 ThotBool destroy;
|
Line 3682 ThotBool destroy;
|
|
|
/* A rule applying to BODY is really meant to address HTML */ |
/* A rule applying to BODY is really meant to address HTML */ |
elType = TtaGetElementType (el); |
elType = TtaGetElementType (el); |
isHTML = (ustrcmp(TtaGetSSchemaName (elType.ElSSchema), TEXT("HTML")) == 0); |
isHTML = (strcmp (TtaGetSSchemaName (elType.ElSSchema), "HTML") == 0); |
/* create the context of the Specific presentation driver */ |
/* create the context of the Specific presentation driver */ |
context = TtaGetSpecificStyleContext (doc); |
context = TtaGetSpecificStyleContext (doc); |
if (context == NULL) |
if (context == NULL) |
Line 3703 ThotBool destroy;
|
Line 3702 ThotBool destroy;
|
return the end of the selector string to be handled or NULL |
return the end of the selector string to be handled or NULL |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static STRING ParseGenericSelector (STRING selector, STRING cssRule, |
static char* ParseGenericSelector (char* selector, char* cssRule, |
GenericContext ctxt, Document doc, CSSInfoPtr css) |
GenericContext ctxt, Document doc, CSSInfoPtr css) |
#else |
#else |
static STRING ParseGenericSelector (selector, cssRule, ctxt, doc, css) |
static char* ParseGenericSelector (selector, cssRule, ctxt, doc, css) |
STRING selector; |
char* selector; |
STRING cssRule; |
char* cssRule; |
GenericContext ctxt; |
GenericContext ctxt; |
Document doc; |
Document doc; |
CSSInfoPtr css; |
CSSInfoPtr css; |
Line 3717 CSSInfoPtr css;
|
Line 3716 CSSInfoPtr css;
|
ElementType elType; |
ElementType elType; |
PSchema tsch; |
PSchema tsch; |
AttributeType attrType; |
AttributeType attrType; |
CHAR_T sel[MAX_ANCESTORS * 50]; |
char sel[MAX_ANCESTORS * 50]; |
STRING deb, cur; |
char *deb, *cur; |
STRING structName; |
char* structName; |
STRING names[MAX_ANCESTORS]; |
char* names[MAX_ANCESTORS]; |
STRING ids[MAX_ANCESTORS]; |
char* ids[MAX_ANCESTORS]; |
STRING classes[MAX_ANCESTORS]; |
char* classes[MAX_ANCESTORS]; |
STRING pseudoclasses[MAX_ANCESTORS]; |
char* pseudoclasses[MAX_ANCESTORS]; |
STRING attrs[MAX_ANCESTORS]; |
char* attrs[MAX_ANCESTORS]; |
STRING attrvals[MAX_ANCESTORS]; |
char* attrvals[MAX_ANCESTORS]; |
int i, j, k, max, maxAttr; |
int i, j, k, max, maxAttr; |
ThotBool isHTML; |
ThotBool isHTML; |
|
|
Line 3980 CSSInfoPtr css;
|
Line 3979 CSSInfoPtr css;
|
/* Get the schema name of the main element */ |
/* Get the schema name of the main element */ |
if (ctxt->schema == NULL) |
if (ctxt->schema == NULL) |
ctxt->schema = TtaGetDocumentSSchema (doc); |
ctxt->schema = TtaGetDocumentSSchema (doc); |
isHTML = (ustrcmp(TtaGetSSchemaName (ctxt->schema), TEXT("HTML")) == 0); |
isHTML = (strcmp(TtaGetSSchemaName (ctxt->schema), "HTML") == 0); |
tsch = GetPExtension (doc, ctxt->schema, css); |
tsch = GetPExtension (doc, ctxt->schema, css); |
structName = TtaGetSSchemaName (ctxt->schema); |
structName = TtaGetSSchemaName (ctxt->schema); |
if (cssRule) |
if (cssRule) |
Line 3996 CSSInfoPtr css;
|
Line 3995 CSSInfoPtr css;
|
e.g: pinky, awful { color: pink, font-family: helvetica } |
e.g: pinky, awful { color: pink, font-family: helvetica } |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static void ParseStyleDeclaration (Element el, STRING cssRule, Document doc, CSSInfoPtr css, ThotBool destroy) |
static void ParseStyleDeclaration (Element el, char* cssRule, Document doc, CSSInfoPtr css, ThotBool destroy) |
#else |
#else |
static void ParseStyleDeclaration (el, cssRule, doc, css, destroy) |
static void ParseStyleDeclaration (el, cssRule, doc, css, destroy) |
Element el; |
Element el; |
Line 4007 ThotBool destroy;
|
Line 4006 ThotBool destroy;
|
#endif |
#endif |
{ |
{ |
GenericContext ctxt; |
GenericContext ctxt; |
STRING decl_end; |
char* decl_end; |
STRING sel_end; |
char* sel_end; |
STRING selector; |
char* selector; |
CHAR_T saved1; |
char saved1; |
CHAR_T saved2; |
char saved2; |
|
|
/* separate the selectors string */ |
/* separate the selectors string */ |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
Line 4073 ThotBool destroy;
|
Line 4072 ThotBool destroy;
|
or an HTML context name. |
or an HTML context name. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
int IsImplicitClassName (STRING class, Document doc) |
int IsImplicitClassName (char* class, Document doc) |
#else |
#else |
int IsImplicitClassName (class, doc) |
int IsImplicitClassName (class, doc) |
STRING class; |
char* class; |
Document doc; |
Document doc; |
#endif |
#endif |
{ |
{ |
CHAR_T name[200]; |
char name[200]; |
STRING cur = name, first; |
char* cur = name; |
CHAR_T save; |
char* first; |
SSchema schema; |
char save; |
|
SSchema schema; |
|
|
/* make a local copy */ |
/* make a local copy */ |
ustrncpy (name, class, 199); |
strncpy (name, class, 199); |
name[199] = 0; |
name[199] = 0; |
|
|
/* loop looking if each word is a GI */ |
/* loop looking if each word is a GI */ |
Line 4117 Document doc;
|
Line 4117 Document doc;
|
HTMLSetBackgroundColor : |
HTMLSetBackgroundColor : |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
void HTMLSetBackgroundColor (Document doc, Element el, STRING color) |
void HTMLSetBackgroundColor (Document doc, Element el, char* color) |
#else |
#else |
void HTMLSetBackgroundColor (doc, el, color) |
void HTMLSetBackgroundColor (doc, el, color) |
Document doc; |
Document doc; |
Element el; |
Element el; |
STRING color; |
char* color; |
#endif |
#endif |
{ |
{ |
CHAR_T css_command[100]; |
char css_command[100]; |
|
|
usprintf (css_command, TEXT("background-color: %s"), color); |
sprintf (css_command, "background-color: %s", color); |
ParseHTMLSpecificStyle (el, css_command, doc, FALSE); |
ParseHTMLSpecificStyle (el, css_command, doc, FALSE); |
} |
} |
|
|
Line 4137 STRING color;
|
Line 4137 STRING color;
|
image = url of background image |
image = url of background image |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
void HTMLSetBackgroundImage (Document doc, Element el, int repeat, STRING image) |
void HTMLSetBackgroundImage (Document doc, Element el, int repeat, char* image) |
#else |
#else |
void HTMLSetBackgroundImage (doc, el, repeat, image) |
void HTMLSetBackgroundImage (doc, el, repeat, image) |
Document doc; |
Document doc; |
Element el; |
Element el; |
int repeat; |
int repeat; |
STRING image; |
char* image; |
#endif |
#endif |
{ |
{ |
CHAR_T css_command[400]; |
char css_command[400]; |
|
|
/******* check buffer overflow ********/ |
/******* check buffer overflow ********/ |
usprintf (css_command, TEXT("background-image: url(%s); background-repeat: "), image); |
sprintf (css_command, "background-image: url(%s); background-repeat: ", image); |
if (repeat == STYLE_REPEAT) |
if (repeat == STYLE_REPEAT) |
ustrcat (css_command, TEXT("repeat")); |
strcat (css_command, "repeat"); |
else if (repeat == STYLE_HREPEAT) |
else if (repeat == STYLE_HREPEAT) |
ustrcat (css_command, TEXT("repeat-x")); |
strcat (css_command, "repeat-x"); |
else if (repeat == STYLE_VREPEAT) |
else if (repeat == STYLE_VREPEAT) |
ustrcat (css_command, TEXT("repeat-y")); |
strcat (css_command, "repeat-y"); |
else |
else |
ustrcat (css_command, TEXT("no-repeat")); |
strcat (css_command, "no-repeat"); |
ParseHTMLSpecificStyle (el, css_command, doc, FALSE); |
ParseHTMLSpecificStyle (el, css_command, doc, FALSE); |
} |
} |
|
|
Line 4165 STRING image;
|
Line 4165 STRING image;
|
HTMLSetForegroundColor : |
HTMLSetForegroundColor : |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
void HTMLSetForegroundColor (Document doc, Element el, STRING color) |
void HTMLSetForegroundColor (Document doc, Element el, char* color) |
#else |
#else |
void HTMLSetForegroundColor (doc, el, color) |
void HTMLSetForegroundColor (doc, el, color) |
Document doc; |
Document doc; |
Element el; |
Element el; |
STRING color; |
char* color; |
#endif |
#endif |
{ |
{ |
CHAR_T css_command[100]; |
char css_command[100]; |
|
|
usprintf (css_command, TEXT("color: %s"), color); |
sprintf (css_command, "color: %s", color); |
ParseHTMLSpecificStyle (el, css_command, doc, FALSE); |
ParseHTMLSpecificStyle (el, css_command, doc, FALSE); |
} |
} |
|
|
Line 4190 Document doc;
|
Line 4190 Document doc;
|
Element el; |
Element el; |
#endif |
#endif |
{ |
{ |
CHAR_T css_command[100]; |
char css_command[100]; |
|
|
usprintf (css_command, TEXT("background: red")); |
sprintf (css_command, "background: red"); |
ParseHTMLSpecificStyle (el, css_command, doc, TRUE); |
ParseHTMLSpecificStyle (el, css_command, doc, TRUE); |
} |
} |
|
|
Line 4207 Document doc;
|
Line 4207 Document doc;
|
Element el; |
Element el; |
#endif |
#endif |
{ |
{ |
CHAR_T css_command[1000]; |
char css_command[1000]; |
|
|
usprintf (css_command, TEXT("background-image: url(xx); background-repeat: repeat")); |
sprintf (css_command, "background-image: url(xx); background-repeat: repeat"); |
ParseHTMLSpecificStyle (el, css_command, doc, TRUE); |
ParseHTMLSpecificStyle (el, css_command, doc, TRUE); |
} |
} |
|
|
Line 4224 Document doc;
|
Line 4224 Document doc;
|
Element el; |
Element el; |
#endif |
#endif |
{ |
{ |
CHAR_T css_command[100]; |
char css_command[100]; |
|
|
/* it's not necessary to well know the current color but it must be valid */ |
/* it's not necessary to well know the current color but it must be valid */ |
usprintf (css_command, TEXT("color: red")); |
sprintf (css_command, "color: red"); |
ParseHTMLSpecificStyle (el, css_command, doc, TRUE); |
ParseHTMLSpecificStyle (el, css_command, doc, TRUE); |
} |
} |
|
|
Line 4235 Element el;
|
Line 4235 Element el;
|
HTMLSetAlinkColor : |
HTMLSetAlinkColor : |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
void HTMLSetAlinkColor (Document doc, STRING color) |
void HTMLSetAlinkColor (Document doc, char* color) |
#else |
#else |
void HTMLSetAlinkColor (doc, color) |
void HTMLSetAlinkColor (doc, color) |
Document doc; |
Document doc; |
STRING color; |
char* color; |
#endif |
#endif |
{ |
{ |
CHAR_T css_command[100]; |
char css_command[100]; |
|
|
usprintf (css_command, TEXT("a:link { color : %s }"), color); |
sprintf (css_command, "a:link { color : %s }", color); |
ApplyCSSRules (NULL, css_command, doc, FALSE); |
ApplyCSSRules (NULL, css_command, doc, FALSE); |
} |
} |
|
|
Line 4252 STRING color;
|
Line 4252 STRING color;
|
HTMLSetAactiveColor : |
HTMLSetAactiveColor : |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
void HTMLSetAactiveColor (Document doc, STRING color) |
void HTMLSetAactiveColor (Document doc, char* color) |
#else |
#else |
void HTMLSetAactiveColor (doc, color) |
void HTMLSetAactiveColor (doc, color) |
Document doc; |
Document doc; |
STRING color; |
char* color; |
#endif |
#endif |
{ |
{ |
CHAR_T css_command[100]; |
char css_command[100]; |
|
|
usprintf (css_command, TEXT("a:active { color : %s }"), color); |
sprintf (css_command, "a:active { color : %s }", color); |
ApplyCSSRules (NULL, css_command, doc, FALSE); |
ApplyCSSRules (NULL, css_command, doc, FALSE); |
} |
} |
|
|
Line 4269 STRING color;
|
Line 4269 STRING color;
|
HTMLSetAvisitedColor : |
HTMLSetAvisitedColor : |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
void HTMLSetAvisitedColor (Document doc, STRING color) |
void HTMLSetAvisitedColor (Document doc, char* color) |
#else |
#else |
void HTMLSetAvisitedColor (doc, color) |
void HTMLSetAvisitedColor (doc, color) |
Document doc; |
Document doc; |
STRING color; |
char* color; |
#endif |
#endif |
{ |
{ |
CHAR_T css_command[100]; |
char css_command[100]; |
|
|
usprintf (css_command, TEXT("a:visited { color : %s }"), color); |
sprintf (css_command, "a:visited { color : %s }", color); |
ApplyCSSRules (NULL, css_command, doc, FALSE); |
ApplyCSSRules (NULL, css_command, doc, FALSE); |
} |
} |
|
|
Line 4292 void HTMLResetAlinkColor
|
Line 4292 void HTMLResetAlinkColor
|
Document doc; |
Document doc; |
#endif |
#endif |
{ |
{ |
CHAR_T css_command[100]; |
char css_command[100]; |
|
|
usprintf (css_command, TEXT("a:link { color : red }")); |
sprintf (css_command, "a:link { color : red }"); |
ApplyCSSRules (NULL, css_command, doc, TRUE); |
ApplyCSSRules (NULL, css_command, doc, TRUE); |
} |
} |
|
|
Line 4308 void HTMLResetAactiveColo
|
Line 4308 void HTMLResetAactiveColo
|
Document doc; |
Document doc; |
#endif |
#endif |
{ |
{ |
CHAR_T css_command[100]; |
char css_command[100]; |
|
|
usprintf (css_command, TEXT("a:active { color : red }")); |
sprintf (css_command, "a:active { color : red }"); |
ApplyCSSRules (NULL, css_command, doc, TRUE); |
ApplyCSSRules (NULL, css_command, doc, TRUE); |
} |
} |
|
|
Line 4324 void HTMLResetAvisitedCol
|
Line 4324 void HTMLResetAvisitedCol
|
Document doc; |
Document doc; |
#endif |
#endif |
{ |
{ |
CHAR_T css_command[100]; |
char css_command[100]; |
|
|
usprintf (css_command, TEXT("a:visited { color : red }")); |
sprintf (css_command, "a:visited { color : red }"); |
ApplyCSSRules (NULL, css_command, doc, TRUE); |
ApplyCSSRules (NULL, css_command, doc, TRUE); |
} |
} |
|
|
Line 4335 Document doc;
|
Line 4335 Document doc;
|
header of a HTML document. |
header of a HTML document. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
void ApplyCSSRules (Element el, STRING cssRule, Document doc, ThotBool destroy) |
void ApplyCSSRules (Element el, char* cssRule, Document doc, ThotBool destroy) |
#else |
#else |
void ApplyCSSRules (el, cssRule, doc, destroy) |
void ApplyCSSRules (el, cssRule, doc, destroy) |
Element el; |
Element el; |
STRING cssRule; |
char* cssRule; |
Document doc; |
Document doc; |
ThotBool destroy; |
ThotBool destroy; |
#endif |
#endif |
Line 4373 ThotBool destroy;
|
Line 4373 ThotBool destroy;
|
structure and content have to be registered in the Undo queue or not |
structure and content have to be registered in the Undo queue or not |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
CHAR_T ReadCSSRules (Document docRef, CSSInfoPtr css, STRING buffer, ThotBool withUndo) |
char ReadCSSRules (Document docRef, CSSInfoPtr css, char* buffer, ThotBool withUndo) |
#else |
#else |
CHAR_T ReadCSSRules (docRef, css, buffer, withUndo) |
char ReadCSSRules (docRef, css, buffer, withUndo) |
Document docRef; |
Document docRef; |
CSSInfoPtr css; |
CSSInfoPtr css; |
STRING buffer; |
char* buffer; |
ThotBool withUndo; |
ThotBool withUndo; |
#endif |
#endif |
{ |
{ |
CHAR_T c; |
char c; |
STRING cssRule, base; |
char *cssRule, *base; |
DisplayMode dispMode; |
DisplayMode dispMode; |
int index; |
int index; |
int CSSindex; |
int CSSindex; |
Line 4435 ThotBool withUndo;
|
Line 4435 ThotBool withUndo;
|
case ';': |
case ';': |
if (import != MAX_CSS_LENGTH && !media) |
if (import != MAX_CSS_LENGTH && !media) |
{ |
{ |
if (ustrncasecmp (&CSSbuffer[import+1], TEXT("import"), 6)) |
if (strncasecmp (&CSSbuffer[import+1], "import", 6)) |
/* it's not an import */ |
/* it's not an import */ |
import = MAX_CSS_LENGTH; |
import = MAX_CSS_LENGTH; |
/* save the text */ |
/* save the text */ |
Line 4494 ThotBool withUndo;
|
Line 4494 ThotBool withUndo;
|
break; |
break; |
case ' ': |
case ' ': |
if (import != MAX_CSS_LENGTH && openRule == 0) |
if (import != MAX_CSS_LENGTH && openRule == 0) |
media = !ustrncmp (&CSSbuffer[import+1], TEXT("media"), 5); |
media = !strncmp (&CSSbuffer[import+1], "media", 5); |
break; |
break; |
case '{': |
case '{': |
openRule++; |
openRule++; |
Line 4503 ThotBool withUndo;
|
Line 4503 ThotBool withUndo;
|
/* is it the screen concerned? */ |
/* is it the screen concerned? */ |
CSSbuffer[CSSindex+1] = EOS; |
CSSbuffer[CSSindex+1] = EOS; |
if (TtaIsPrinting ()) |
if (TtaIsPrinting ()) |
base = ustrstr (&CSSbuffer[import], TEXT("print")); |
base = strstr (&CSSbuffer[import], "print"); |
else |
else |
base = ustrstr (&CSSbuffer[import], TEXT("screen")); |
base = strstr (&CSSbuffer[import], "screen"); |
if (base == NULL) |
if (base == NULL) |
ignoreMedia = TRUE; |
ignoreMedia = TRUE; |
noRule = TRUE; |
noRule = TRUE; |
Line 4544 ThotBool withUndo;
|
Line 4544 ThotBool withUndo;
|
if (!noRule && !ignoreMedia) |
if (!noRule && !ignoreMedia) |
ParseStyleDeclaration (NULL, CSSbuffer, docRef, css, FALSE); |
ParseStyleDeclaration (NULL, CSSbuffer, docRef, css, FALSE); |
else if (import != MAX_CSS_LENGTH && |
else if (import != MAX_CSS_LENGTH && |
!ustrncasecmp (&CSSbuffer[import+1], TEXT("import"), 6)) |
!strncasecmp (&CSSbuffer[import+1], "import", 6)) |
{ |
{ |
/* import section */ |
/* import section */ |
cssRule = &CSSbuffer[import+7]; |
cssRule = &CSSbuffer[import+7]; |
cssRule = TtaSkipBlanks (cssRule); |
cssRule = TtaSkipBlanks (cssRule); |
if (!ustrncasecmp (cssRule, TEXT("url"), 3)) |
if (!strncasecmp (cssRule, "url", 3)) |
{ |
{ |
cssRule = &cssRule[3]; |
cssRule = &cssRule[3]; |
cssRule = TtaSkipBlanks (cssRule); |
cssRule = TtaSkipBlanks (cssRule); |