version 1.230, 2003/09/17 07:39:19
|
version 1.231, 2003/09/24 15:20:33
|
Line 64 typedef struct CSSProperty
|
Line 64 typedef struct CSSProperty
|
} |
} |
CSSProperty; |
CSSProperty; |
|
|
struct unit_def |
|
{ |
|
char *sign; |
|
unsigned int unit; |
|
}; |
|
|
|
static struct unit_def CSSUnitNames[] = |
|
{ |
|
{"pt", UNIT_PT}, |
|
{"pc", UNIT_PC}, |
|
{"in", UNIT_IN}, |
|
{"cm", UNIT_CM}, |
|
{"mm", UNIT_MM}, |
|
{"em", UNIT_EM}, |
|
{"px", UNIT_PX}, |
|
{"ex", UNIT_XHEIGHT}, |
|
{"%", UNIT_PERCENT} |
|
}; |
|
|
|
#define NB_UNITS (sizeof(CSSUnitNames) / sizeof(struct unit_def)) |
|
static char *DocURL = NULL; /* The parsed CSS file */ |
static char *DocURL = NULL; /* The parsed CSS file */ |
static Document ParsedDoc; /* The document to which CSS are to be applied */ |
static Document ParsedDoc; /* The document to which CSS are to be applied */ |
static int LineNumber = -1; /* The line where the error occurs */ |
static int LineNumber = -1; /* The line where the error occurs */ |
Line 432 char *ParseCSSUnit (char *cssRule, Prese
|
Line 412 char *ParseCSSUnit (char *cssRule, Prese
|
else |
else |
{ |
{ |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
for (uni = 0; uni < NB_UNITS; uni++) |
uni = 0; |
|
while (CSSUnitNames[uni].sign) |
{ |
{ |
if (!strncasecmp (CSSUnitNames[uni].sign, cssRule, |
if (!strncasecmp (CSSUnitNames[uni].sign, cssRule, |
strlen (CSSUnitNames[uni].sign))) |
strlen (CSSUnitNames[uni].sign))) |
Line 440 char *ParseCSSUnit (char *cssRule, Prese
|
Line 421 char *ParseCSSUnit (char *cssRule, Prese
|
pval->typed_data.unit = CSSUnitNames[uni].unit; |
pval->typed_data.unit = CSSUnitNames[uni].unit; |
return (cssRule + strlen (CSSUnitNames[uni].sign)); |
return (cssRule + strlen (CSSUnitNames[uni].sign)); |
} |
} |
|
else |
|
uni++; |
} |
} |
/* not in the list of predefined units */ |
/* not in the list of predefined units */ |
pval->typed_data.unit = UNIT_BOX; |
pval->typed_data.unit = UNIT_BOX; |
Line 577 static char *ParseCSSColor (char *cssRul
|
Line 560 static char *ParseCSSColor (char *cssRul
|
} |
} |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
CheckImportantRule updates the field important of the context. |
CheckImportantRule updates the field important of the context and |
|
the line number. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
static char *CheckImportantRule (char *cssRule, PresentationContext context) |
static char *CheckImportantRule (char *cssRule, PresentationContext context) |
{ |
{ |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipBlanksAndComments (cssRule); |
|
/* update the line number */ |
|
context->cssLine = LineNumber + NewLineSkipped; |
if (*cssRule != '!') |
if (*cssRule != '!') |
context->important = FALSE; |
context->important = FALSE; |
else |
else |
Line 4120 static void ParseCSSRule (Element eleme
|
Line 4106 static void ParseCSSRule (Element eleme
|
} |
} |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
AddBorderStyleValue |
|
-----------------------------------------------------------------------*/ |
|
static void AddBorderStyleValue (char *buffer, int value) |
|
{ |
|
switch (value) |
|
{ |
|
case BorderStyleNone: |
|
strcat (buffer, "none"); |
|
break; |
|
case BorderStyleHidden: |
|
strcat (buffer, "hidden"); |
|
break; |
|
case BorderStyleDotted: |
|
strcat (buffer, "dotted"); |
|
break; |
|
case BorderStyleDashed: |
|
strcat (buffer, "dashed"); |
|
break; |
|
case BorderStyleSolid: |
|
strcat (buffer, "solid"); |
|
break; |
|
case BorderStyleDouble: |
|
strcat (buffer, "double"); |
|
break; |
|
case BorderStyleGroove: |
|
strcat (buffer, "groove"); |
|
break; |
|
case BorderStyleRidge: |
|
strcat (buffer, "ridge"); |
|
break; |
|
case BorderStyleInset: |
|
strcat (buffer, "inset"); |
|
break; |
|
case BorderStyleOutset: |
|
strcat (buffer, "outset"); |
|
break; |
|
} |
|
} |
|
|
|
/*---------------------------------------------------------------------- |
|
PToCss: translate a PresentationSetting to the |
|
equivalent CSS string, and add it to the buffer given as the |
|
argument. It is used when extracting the CSS string from actual |
|
presentation. |
|
el is the element for which the style rule is generated |
|
|
|
All the possible values returned by the presentation drivers are |
|
described in thotlib/include/presentation.h |
|
-----------------------------------------------------------------------*/ |
|
void PToCss (PresentationSetting settings, char *buffer, int len, Element el) |
|
{ |
|
ElementType elType; |
|
float fval = 0; |
|
unsigned short red, green, blue; |
|
int add_unit = 0; |
|
unsigned int unit, i; |
|
ThotBool real = FALSE; |
|
|
|
buffer[0] = EOS; |
|
if (len < 40) |
|
return; |
|
|
|
unit = settings->value.typed_data.unit; |
|
if (settings->value.typed_data.real) |
|
{ |
|
real = TRUE; |
|
fval = (float) settings->value.typed_data.value; |
|
fval /= 1000.; |
|
} |
|
|
|
switch (settings->type) |
|
{ |
|
case PRVisibility: |
|
break; |
|
case PRHeight: |
|
if (real) |
|
sprintf (buffer, "height: %g", fval); |
|
else |
|
sprintf (buffer, "height: %d", settings->value.typed_data.value); |
|
add_unit = 1; |
|
break; |
|
case PRWidth: |
|
if (real) |
|
sprintf (buffer, "width: %g", fval); |
|
else |
|
sprintf (buffer, "width: %d", settings->value.typed_data.value); |
|
add_unit = 1; |
|
break; |
|
case PRMarginTop: |
|
if (real) |
|
sprintf (buffer, "margin-top: %g", fval); |
|
else |
|
sprintf (buffer, "margin-top: %d",settings->value.typed_data.value); |
|
add_unit = 1; |
|
break; |
|
case PRMarginBottom: |
|
if (real) |
|
sprintf (buffer, "margin-bottom: %g", fval); |
|
else |
|
sprintf (buffer, "margin-bottom: %d", |
|
settings->value.typed_data.value); |
|
add_unit = 1; |
|
break; |
|
case PRMarginLeft: |
|
if (real) |
|
sprintf (buffer, "margin-left: %g", fval); |
|
else |
|
sprintf (buffer, "margin-left: %d", settings->value.typed_data.value); |
|
add_unit = 1; |
|
break; |
|
case PRMarginRight: |
|
if (real) |
|
sprintf (buffer, "margin-right: %g", fval); |
|
else |
|
sprintf (buffer, "margin-right: %d", settings->value.typed_data.value); |
|
add_unit = 1; |
|
break; |
|
case PRPaddingTop: |
|
if (real) |
|
sprintf (buffer, "padding-top: %g", fval); |
|
else |
|
sprintf (buffer, "padding-top: %d", settings->value.typed_data.value); |
|
add_unit = 1; |
|
break; |
|
case PRPaddingBottom: |
|
if (real) |
|
sprintf (buffer, "padding-bottom: %g", fval); |
|
else |
|
sprintf (buffer, "padding-bottom: %d", |
|
settings->value.typed_data.value); |
|
add_unit = 1; |
|
break; |
|
case PRPaddingLeft: |
|
if (real) |
|
sprintf (buffer, "padding-left: %g", fval); |
|
else |
|
sprintf (buffer, "padding-left: %d", settings->value.typed_data.value); |
|
add_unit = 1; |
|
break; |
|
case PRPaddingRight: |
|
if (real) |
|
sprintf (buffer, "padding-right: %g", fval); |
|
else |
|
sprintf (buffer, "padding-right: %d", |
|
settings->value.typed_data.value); |
|
add_unit = 1; |
|
break; |
|
case PRBorderTopWidth: |
|
if (real) |
|
sprintf (buffer, "border-top-width: %g", fval); |
|
else |
|
sprintf (buffer, "border-top-width: %d", |
|
settings->value.typed_data.value); |
|
add_unit = 1; |
|
break; |
|
case PRBorderBottomWidth: |
|
if (real) |
|
sprintf (buffer, "border-bottom-width: %g", fval); |
|
else |
|
sprintf (buffer, "border-bottom-width: %d", |
|
settings->value.typed_data.value); |
|
add_unit = 1; |
|
break; |
|
case PRBorderLeftWidth: |
|
if (real) |
|
sprintf (buffer, "border-left-width: %g", fval); |
|
else |
|
sprintf (buffer, "border-left-width: %d", |
|
settings->value.typed_data.value); |
|
add_unit = 1; |
|
break; |
|
case PRBorderRightWidth: |
|
if (real) |
|
sprintf (buffer, "border-right-width: %g", fval); |
|
else |
|
sprintf (buffer, "border-right-width: %d", |
|
settings->value.typed_data.value); |
|
add_unit = 1; |
|
break; |
|
case PRBorderTopColor: |
|
TtaGiveThotRGB (settings->value.typed_data.value, &red, &green, &blue); |
|
elType = TtaGetElementType(el); |
|
sprintf (buffer, "border-top-color: #%02X%02X%02X", red, green, blue); |
|
break; |
|
case PRBorderRightColor: |
|
TtaGiveThotRGB (settings->value.typed_data.value, &red, &green, &blue); |
|
elType = TtaGetElementType(el); |
|
sprintf (buffer, "border-right-color: #%02X%02X%02X", red, green, blue); |
|
break; |
|
case PRBorderBottomColor: |
|
TtaGiveThotRGB (settings->value.typed_data.value, &red, &green, &blue); |
|
elType = TtaGetElementType(el); |
|
sprintf (buffer, "border-bottom-color: #%02X%02X%02X", red, green, blue); |
|
break; |
|
case PRBorderLeftColor: |
|
TtaGiveThotRGB (settings->value.typed_data.value, &red, &green, &blue); |
|
elType = TtaGetElementType(el); |
|
sprintf (buffer, "border-left-color: #%02X%02X%02X", red, green, blue); |
|
break; |
|
case PRBorderTopStyle: |
|
strcpy (buffer, "border-top-style: "); |
|
AddBorderStyleValue (buffer, settings->value.typed_data.value); |
|
break; |
|
case PRBorderRightStyle: |
|
strcpy (buffer, "border-right-style: "); |
|
AddBorderStyleValue (buffer, settings->value.typed_data.value); |
|
break; |
|
case PRBorderBottomStyle: |
|
strcpy (buffer, "border-bottom-style: "); |
|
AddBorderStyleValue (buffer, settings->value.typed_data.value); |
|
break; |
|
case PRBorderLeftStyle: |
|
strcpy (buffer, "border-left-style: "); |
|
AddBorderStyleValue (buffer, settings->value.typed_data.value); |
|
break; |
|
case PRSize: |
|
if (unit == UNIT_REL) |
|
{ |
|
if (real) |
|
{ |
|
sprintf (buffer, "font-size: %g", fval); |
|
add_unit = 1; |
|
} |
|
else |
|
switch (settings->value.typed_data.value) |
|
{ |
|
case 1: |
|
strcpy (buffer, "font-size: xx-small"); |
|
break; |
|
case 2: |
|
strcpy (buffer, "font-size: x-small"); |
|
break; |
|
case 3: |
|
strcpy (buffer, "font-size: small"); |
|
break; |
|
case 4: |
|
strcpy (buffer, "font-size: medium"); |
|
break; |
|
case 5: |
|
strcpy (buffer, "font-size: large"); |
|
break; |
|
case 6: |
|
strcpy (buffer, "font-size: x-large"); |
|
break; |
|
case 7: |
|
case 8: |
|
case 9: |
|
case 10: |
|
case 11: |
|
case 12: |
|
strcpy (buffer, "font-size: xx-large"); |
|
break; |
|
} |
|
} |
|
else |
|
{ |
|
if (real) |
|
sprintf (buffer, "font-size: %g", fval); |
|
else |
|
sprintf (buffer, "font-size: %d", |
|
settings->value.typed_data.value); |
|
add_unit = 1; |
|
} |
|
break; |
|
case PRStyle: |
|
switch (settings->value.typed_data.value) |
|
{ |
|
case StyleRoman: |
|
strcpy (buffer, "font-style: normal"); |
|
break; |
|
case StyleItalics: |
|
strcpy (buffer, "font-style: italic"); |
|
break; |
|
case StyleOblique: |
|
strcpy (buffer, "font-style: oblique"); |
|
break; |
|
} |
|
break; |
|
case PRWeight: |
|
switch (settings->value.typed_data.value) |
|
{ |
|
case WeightBold: |
|
strcpy (buffer, "font-weight: bold"); |
|
break; |
|
case WeightNormal: |
|
strcpy (buffer, "font-weight: normal"); |
|
break; |
|
} |
|
break; |
|
case PRFont: |
|
switch (settings->value.typed_data.value) |
|
{ |
|
case FontHelvetica: |
|
strcpy (buffer, "font-family: helvetica"); |
|
break; |
|
case FontTimes: |
|
strcpy (buffer, "font-family: times"); |
|
break; |
|
case FontCourier: |
|
strcpy (buffer, "font-family: courier"); |
|
break; |
|
} |
|
break; |
|
case PRUnderline: |
|
switch (settings->value.typed_data.value) |
|
{ |
|
case Underline: |
|
strcpy (buffer, "text-decoration: underline"); |
|
break; |
|
case Overline: |
|
strcpy (buffer, "text-decoration: overline"); |
|
break; |
|
case CrossOut: |
|
strcpy (buffer, "text-decoration: line-through"); |
|
break; |
|
} |
|
break; |
|
case PRThickness: |
|
break; |
|
case PRIndent: |
|
if (real) |
|
sprintf (buffer, "text-indent: %g", fval); |
|
else |
|
sprintf (buffer, "text-indent: %d", |
|
settings->value.typed_data.value); |
|
add_unit = 1; |
|
break; |
|
case PRLineSpacing: |
|
if (real) |
|
sprintf (buffer, "line-height: %g", fval); |
|
else |
|
sprintf (buffer, "line-height: %d", |
|
settings->value.typed_data.value); |
|
add_unit = 1; |
|
break; |
|
case PRDepth: |
|
break; |
|
case PRAdjust: |
|
switch (settings->value.typed_data.value) |
|
{ |
|
case AdjustLeft: |
|
strcpy (buffer, "text-align: left"); |
|
break; |
|
case AdjustRight: |
|
strcpy (buffer, "text-align: right"); |
|
break; |
|
case Centered: |
|
strcpy (buffer, "text-align: center"); |
|
break; |
|
case LeftWithDots: |
|
strcpy (buffer, "text-align: left"); |
|
break; |
|
case Justify: |
|
strcpy (buffer, "text-align: justify"); |
|
break; |
|
} |
|
break; |
|
case PRDirection: |
|
switch (settings->value.typed_data.value) |
|
{ |
|
case LeftToRight: |
|
strcpy (buffer, "direction: ltr"); |
|
break; |
|
case RightToLeft: |
|
strcpy (buffer, "direction: rtl"); |
|
break; |
|
} |
|
break; |
|
case PRUnicodeBidi: |
|
switch (settings->value.typed_data.value) |
|
{ |
|
case Normal: |
|
strcpy (buffer, "unicode-bidi: normal"); |
|
break; |
|
case Embed: |
|
strcpy (buffer, "unicode-bidi: embed"); |
|
break; |
|
case Override: |
|
strcpy (buffer, "unicode-bidi: bidi-override"); |
|
break; |
|
} |
|
break; |
|
case PRLineStyle: |
|
break; |
|
case PRDisplay: |
|
switch (settings->value.typed_data.value) |
|
{ |
|
case Inline: |
|
strcpy (buffer, "display: inline"); |
|
break; |
|
case Block: |
|
strcpy (buffer, "display: block"); |
|
break; |
|
case ListItem: |
|
strcpy (buffer, "display: list-item"); |
|
break; |
|
case RunIn: |
|
strcpy (buffer, "display: runin"); |
|
break; |
|
case Compact: |
|
strcpy (buffer, "display: compact"); |
|
break; |
|
case Marker: |
|
strcpy (buffer, "display: marker"); |
|
break; |
|
default: |
|
break; |
|
} |
|
break; |
|
case PRFloat: |
|
switch (settings->value.typed_data.value) |
|
{ |
|
case FloatNone: |
|
strcpy (buffer, "float: none"); |
|
break; |
|
case FloatLeft: |
|
strcpy (buffer, "float: left"); |
|
break; |
|
case FloatRight: |
|
strcpy (buffer, "float: right"); |
|
break; |
|
default: |
|
break; |
|
} |
|
break; |
|
case PRClear: |
|
switch (settings->value.typed_data.value) |
|
{ |
|
case ClearNone: |
|
strcpy (buffer, "clear: none"); |
|
break; |
|
case ClearLeft: |
|
strcpy (buffer, "clear: left"); |
|
break; |
|
case ClearRight: |
|
strcpy (buffer, "clear: right"); |
|
break; |
|
case ClearBoth: |
|
strcpy (buffer, "clear: both"); |
|
break; |
|
default: |
|
break; |
|
} |
|
break; |
|
case PRLineWeight: |
|
elType = TtaGetElementType(el); |
|
#ifdef _SVG |
|
if (!strcmp(TtaGetSSchemaName (elType.ElSSchema), "SVG")) |
|
#endif /* _SVG */ |
|
{ |
|
if (real) |
|
sprintf (buffer, "stroke-width: %g", fval); |
|
else |
|
sprintf (buffer, "stroke-width: %d", |
|
settings->value.typed_data.value); |
|
} |
|
add_unit = 1; |
|
break; |
|
case PRFillPattern: |
|
break; |
|
case PRBackground: |
|
TtaGiveThotRGB (settings->value.typed_data.value, &red, &green, &blue); |
|
elType = TtaGetElementType(el); |
|
#ifdef _SVG |
|
if (strcmp(TtaGetSSchemaName (elType.ElSSchema), "SVG") == 0) |
|
sprintf (buffer, "fill: #%02X%02X%02X", red, green, blue); |
|
else |
|
#endif /* _SVG */ |
|
sprintf (buffer, "background-color: #%02X%02X%02X", red, green, |
|
blue); |
|
break; |
|
case PRForeground: |
|
TtaGiveThotRGB (settings->value.typed_data.value, &red, &green, &blue); |
|
elType = TtaGetElementType(el); |
|
#ifdef _SVG |
|
if (strcmp(TtaGetSSchemaName (elType.ElSSchema), "SVG") == 0) |
|
sprintf (buffer, "stroke: #%02X%02X%02X", red, green, blue); |
|
else |
|
#endif /* _SVG */ |
|
sprintf (buffer, "color: #%02X%02X%02X", red, green, blue); |
|
break; |
|
case PRHyphenate: |
|
case PRVertOverflow: |
|
case PRHorizOverflow: |
|
break; |
|
case PROpacity: |
|
sprintf (buffer, "opacity: %g", fval); |
|
break; |
|
case PRStrokeOpacity: |
|
sprintf (buffer, "stroke-opacity: %g", fval); |
|
break; |
|
case PRFillOpacity: |
|
sprintf (buffer, "fill-opacity: %g", fval); |
|
break; |
|
case PRBackgroundPicture: |
|
if (settings->value.pointer != NULL) |
|
sprintf (buffer, "background-image: url(%s)", |
|
(char*)(settings->value.pointer)); |
|
else |
|
sprintf (buffer, "background-image: none"); |
|
break; |
|
case PRPictureMode: |
|
switch (settings->value.typed_data.value) |
|
{ |
|
case REALSIZE: |
|
sprintf (buffer, "background-repeat: no-repeat"); |
|
break; |
|
case REPEAT: |
|
sprintf (buffer, "background-repeat: repeat"); |
|
break; |
|
case VREPEAT: |
|
sprintf (buffer, "background-repeat: repeat-y"); |
|
break; |
|
case HREPEAT: |
|
sprintf (buffer, "background-repeat: repeat-x"); |
|
break; |
|
} |
|
break; |
|
default: |
|
break; |
|
} |
|
|
|
if (add_unit) |
|
{ |
|
/* add the unit string to the CSS string */ |
|
for (i = 0; i < NB_UNITS; i++) |
|
{ |
|
if (CSSUnitNames[i].unit == unit) |
|
{ |
|
strcat (buffer, CSSUnitNames[i].sign); |
|
break; |
|
} |
|
} |
|
} |
|
} |
|
|
|
/*---------------------------------------------------------------------- |
|
ParseHTMLSpecificStyle: parse and apply a CSS Style string. |
ParseHTMLSpecificStyle: parse and apply a CSS Style string. |
This function must be called when a specific style is applied to an |
This function must be called when a specific style is applied to an |
element. |
element. |
Line 4709 void ParseHTMLSpecificStyle (Element el
|
Line 4158 void ParseHTMLSpecificStyle (Element el
|
string. |
string. |
If the selector is made of multiple comma, it parses them one at a time |
If the selector is made of multiple comma, it parses them one at a time |
and return the end of the selector string to be handled or NULL. |
and return the end of the selector string to be handled or NULL. |
|
The parameter ctxt gives the current style context which will be passed |
|
to Thotlib. |
|
The parameter css points to the current CSS context. |
|
The parameter link points to the link element. |
|
The parameter url gives the URL of the parsed style sheet. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
static char *ParseGenericSelector (char *selector, char *cssRule, |
static char *ParseGenericSelector (char *selector, char *cssRule, |
GenericContext ctxt, Document doc, |
GenericContext ctxt, Document doc, |
CSSInfoPtr css, Element link) |
CSSInfoPtr css, Element link, char *url) |
{ |
{ |
ElementType elType; |
ElementType elType; |
PSchema tsch; |
PSchema tsch; |
Line 4756 static char *ParseGenericSelector (char
|
Line 4210 static char *ParseGenericSelector (char
|
ctxt->type = 0; |
ctxt->type = 0; |
/* the specificity of the rule depends on the selector */ |
/* the specificity of the rule depends on the selector */ |
ctxt->cssSpecificity = 0; |
ctxt->cssSpecificity = 0; |
|
/* localisation of the CSS rule */ |
|
ctxt->cssLine = LineNumber + NewLineSkipped; |
|
ctxt->cssURL = url; |
|
|
selector = SkipBlanksAndComments (selector); |
selector = SkipBlanksAndComments (selector); |
cur = &sel[0]; |
cur = &sel[0]; |
Line 5402 static char *ParseGenericSelector (char
|
Line 4859 static char *ParseGenericSelector (char
|
element of a document |
element of a document |
We expect the style string to be of the form: |
We expect the style string to be of the form: |
.pinky, .awful { color: pink; font-family: helvetica } |
.pinky, .awful { color: pink; font-family: helvetica } |
|
The parameter css points to the current CSS context. |
|
The parameter link points to the link element. |
|
The parameter url gives the URL of the parsed style sheet. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
static void ParseStyleDeclaration (Element el, char *cssRule, Document doc, |
static void ParseStyleDeclaration (Element el, char *cssRule, Document doc, |
CSSInfoPtr css, Element link, ThotBool destroy) |
CSSInfoPtr css, Element link, char *url, |
|
ThotBool destroy) |
{ |
{ |
GenericContext ctxt; |
GenericContext ctxt; |
char *decl_end; |
char *decl_end; |
Line 5447 static void ParseStyleDeclaration (Eleme
|
Line 4908 static void ParseStyleDeclaration (Eleme
|
/* first use of the context */ |
/* first use of the context */ |
ctxt->uses = 1; |
ctxt->uses = 1; |
while (selector && *selector != EOS) |
while (selector && *selector != EOS) |
selector = ParseGenericSelector (selector, cssRule, ctxt, doc, css, link); |
selector = ParseGenericSelector (selector, cssRule, ctxt, doc, css, |
|
link, url); |
/* check if the context can be freed */ |
/* check if the context can be freed */ |
ctxt->uses -= 1; |
ctxt->uses -= 1; |
if (ctxt->uses == 0) |
if (ctxt->uses == 0) |
Line 5650 void ApplyCSSRules (Element el, char *cs
|
Line 5112 void ApplyCSSRules (Element el, char *cs
|
/* create the entry into the css context */ |
/* create the entry into the css context */ |
pInfo = AddInfoCSS (doc, css, CSS_DOCUMENT_STYLE, CSS_ALL, el); |
pInfo = AddInfoCSS (doc, css, CSS_DOCUMENT_STYLE, CSS_ALL, el); |
if (pInfo->PiEnabled) |
if (pInfo->PiEnabled) |
ParseStyleDeclaration (el, cssRule, doc, css, el, destroy); |
ParseStyleDeclaration (el, cssRule, doc, css, el, NULL, destroy); |
} |
} |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
Line 5668 void ApplyCSSRules (Element el, char *cs
|
Line 5130 void ApplyCSSRules (Element el, char *cs
|
This function uses the current css context or creates it. It's able |
This function uses the current css context or creates it. It's able |
to work on the given buffer or call GetNextChar to read the parsed |
to work on the given buffer or call GetNextChar to read the parsed |
file. |
file. |
The parameter url gives the URL of the style shheet parsed. |
The parameter url gives the URL of the parsed style sheet. |
Parameter numberOfLinesRead indicates the number of lines already |
The parameter numberOfLinesRead gives the number of lines already |
read in the file. |
read in the file. |
Parameter withUndo indicates whether the changes made in the document |
The parameter withUndo indicates whether the changes made in the document |
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. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
char ReadCSSRules (Document docRef, CSSInfoPtr css, char *buffer, char *url, |
char ReadCSSRules (Document docRef, CSSInfoPtr css, char *buffer, char *url, |
Line 5936 char ReadCSSRules (Document docRef, CSSI
|
Line 5398 char ReadCSSRules (Document docRef, CSSI
|
ignoreImport = TRUE; |
ignoreImport = TRUE; |
NewLineSkipped = 0; |
NewLineSkipped = 0; |
ParseStyleDeclaration (NULL, CSSbuffer, docRef, refcss, |
ParseStyleDeclaration (NULL, CSSbuffer, docRef, refcss, |
pInfo->PiLink, FALSE); |
pInfo->PiLink, url, FALSE); |
LineNumber += newlines; |
LineNumber += newlines; |
newlines = 0; |
newlines = 0; |
} |
} |