version 1.48, 2000/02/08 17:25:20
|
version 1.49, 2000/02/10 09:42:43
|
Line 148 char* ptr;
|
Line 148 char* ptr;
|
} |
} |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
|
SkipWCBlanksAndComments: |
|
----------------------------------------------------------------------*/ |
|
#ifdef __STDC__ |
|
CHAR_T* SkipWCBlanksAndComments (CHAR_T* ptr) |
|
#else |
|
CHAR_T* SkipWCBlanksAndComments (ptr) |
|
CHAR_T* ptr; |
|
#endif |
|
{ |
|
ptr = TtaSkipWCBlanks (ptr); |
|
while (ptr[0] == TEXT('/') && ptr[1] == TEXT('*')) |
|
{ |
|
/* look for the end of the comment */ |
|
ptr = &ptr[2]; |
|
while (ptr[0] != WC_EOS && (ptr[0] != TEXT('*') || ptr[1] != TEXT('/'))) |
|
ptr++; |
|
if (ptr[0] != WC_EOS) |
|
ptr = &ptr[2]; |
|
ptr = TtaSkipWCBlanks (ptr); |
|
} |
|
return (ptr); |
|
} |
|
|
|
/*---------------------------------------------------------------------- |
SkipQuotedString: |
SkipQuotedString: |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
Line 2864 char* styleString;
|
Line 2888 char* styleString;
|
attribute string. |
attribute string. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static char* ParseCSSBackgroundImage (Element element, PSchema tsch, |
static CHAR_T* ParseCSSBackgroundImage (Element element, PSchema tsch, |
PresentationContext context, char* cssRule, CSSInfoPtr css, ThotBool isHTML) |
PresentationContext context, CHAR_T* cssRule, CSSInfoPtr css, ThotBool isHTML) |
#else |
#else |
static char* ParseCSSBackgroundImage (element, tsch, context, cssRule, css, isHTML) |
static CHAR_T* ParseCSSBackgroundImage (element, tsch, context, cssRule, css, isHTML) |
Element element; |
Element element; |
PSchema tsch; |
PSchema tsch; |
PresentationContext context; |
PresentationContext context; |
STRING cssRule; |
CHAR_T* cssRule; |
CSSInfoPtr css; |
CSSInfoPtr css; |
ThotBool isHTML; |
ThotBool isHTML; |
#endif |
#endif |
{ |
{ |
Element el; |
Element el; |
GenericContext gblock; |
GenericContext gblock; |
PresentationContextBlock *sblock; |
PresentationContextBlock* sblock; |
BackgroundImageCallbackPtr callblock; |
BackgroundImageCallbackPtr callblock; |
PresentationValue image, value; |
PresentationValue image, value; |
char* url; |
CHAR_T* url; |
STRING bg_image; |
STRING bg_image; |
char saved; |
CHAR_T saved; |
char* base; |
CHAR_T* 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; |
ThotBool moved; |
ThotBool moved; |
|
|
/* default element for FetchImage */ |
/* default element for FetchImage */ |
el = TtaGetMainRoot (context->doc); |
el = TtaGetMainRoot (context->doc); |
Line 2908 ThotBool isHTML;
|
Line 2932 ThotBool isHTML;
|
el = element; |
el = element; |
|
|
url = NULL; |
url = NULL; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipWCBlanksAndComments (cssRule); |
if (!strncasecmp (cssRule, "url", 3)) |
if (!ustrncasecmp (cssRule, TEXT("url"), 3)) |
{ |
{ |
cssRule += 3; |
cssRule += 3; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipWCBlanksAndComments (cssRule); |
if (*cssRule == '(') |
if (*cssRule == '(') |
{ |
{ |
cssRule++; |
cssRule++; |
cssRule = SkipBlanksAndComments (cssRule); |
cssRule = SkipWCBlanksAndComments (cssRule); |
/*** Caution: Strings can either be written with double quotes or |
/*** Caution: Strings can either be written with double quotes or |
with single quotes. Only double quotes are handled here. |
with single quotes. Only double quotes are handled here. |
Escaped quotes are not handled. See function SkipQuotedString */ |
Escaped quotes are not handled. See function SkipQuotedString */ |
Line 2924 ThotBool isHTML;
|
Line 2948 ThotBool isHTML;
|
{ |
{ |
cssRule++; |
cssRule++; |
base = cssRule; |
base = cssRule; |
while (*cssRule != EOS && *cssRule != '"') |
while (*cssRule != WC_EOS && *cssRule != TEXT('"')) |
cssRule++; |
cssRule++; |
} |
} |
else |
else |
Line 2934 ThotBool isHTML;
|
Line 2958 ThotBool isHTML;
|
cssRule++; |
cssRule++; |
} |
} |
saved = *cssRule; |
saved = *cssRule; |
*cssRule = EOS; |
*cssRule = WC_EOS; |
url = TtaStrdup (base); |
url = TtaWCSdup (base); |
*cssRule = saved; |
*cssRule = saved; |
if (saved == '"') |
if (saved == '"') |
/* we need to skip two characters */ |
/* we need to skip two characters */ |
Line 2985 ThotBool isHTML;
|
Line 3009 ThotBool isHTML;
|
{ |
{ |
NormalizeURL (url, 0, tempname, imgname, css->url); |
NormalizeURL (url, 0, tempname, imgname, css->url); |
/* fetch and display background image of element */ |
/* fetch and display background image of element */ |
FetchImage (context->doc, el, tempname, AMAYA_LOAD_IMAGE, |
FetchImage (context->doc, el, tempname, AMAYA_LOAD_IMAGE, ParseCSSBackgroundImageCallback, callblock); |
ParseCSSBackgroundImageCallback, callblock); |
|
} |
} |
else |
else |
FetchImage (context->doc, el, url, AMAYA_LOAD_IMAGE, |
FetchImage (context->doc, el, url, AMAYA_LOAD_IMAGE, ParseCSSBackgroundImageCallback, callblock); |
ParseCSSBackgroundImageCallback, callblock); |
|
} |
} |
} |
} |
|
|
Line 3682 ThotBool destroy;
|
Line 3704 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 = (strcmp (TtaGetSSchemaName (elType.ElSSchema), "HTML") == 0); |
isHTML = (ustrcmp (TtaGetSSchemaName (elType.ElSSchema), TEXT("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 3716 CSSInfoPtr css;
|
Line 3738 CSSInfoPtr css;
|
ElementType elType; |
ElementType elType; |
PSchema tsch; |
PSchema tsch; |
AttributeType attrType; |
AttributeType attrType; |
char sel[MAX_ANCESTORS * 50]; |
CHAR_T sel[MAX_ANCESTORS * 50]; |
char *deb, *cur; |
CHAR_T *deb, *cur; |
char* structName; |
CHAR_T* structName; |
char* names[MAX_ANCESTORS]; |
CHAR_T* names[MAX_ANCESTORS]; |
char* ids[MAX_ANCESTORS]; |
CHAR_T* ids[MAX_ANCESTORS]; |
char* classes[MAX_ANCESTORS]; |
CHAR_T* classes[MAX_ANCESTORS]; |
char* pseudoclasses[MAX_ANCESTORS]; |
CHAR_T* pseudoclasses[MAX_ANCESTORS]; |
char* attrs[MAX_ANCESTORS]; |
CHAR_T* attrs[MAX_ANCESTORS]; |
char* attrvals[MAX_ANCESTORS]; |
CHAR_T* attrvals[MAX_ANCESTORS]; |
int i, j, k, max, maxAttr; |
int i, j, k, max, maxAttr; |
ThotBool isHTML; |
ThotBool isHTML; |
|
|
Line 3979 CSSInfoPtr css;
|
Line 4001 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 = (strcmp(TtaGetSSchemaName (ctxt->schema), "HTML") == 0); |
isHTML = (ustrcmp (TtaGetSSchemaName (ctxt->schema), TEXT("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) |