version 1.90, 2001/06/12 13:10:03
|
version 1.91, 2001/06/12 13:51:09
|
Line 17
|
Line 17
|
#define THOT_EXPORT extern |
#define THOT_EXPORT extern |
#include "amaya.h" |
#include "amaya.h" |
#include "css.h" |
#include "css.h" |
#include "undo.h" |
|
#include "registry.h" |
|
#include "fetchHTMLname.h" |
#include "fetchHTMLname.h" |
#include "GraphML.h" |
#include "GraphML.h" |
|
|
Line 40 BackgroundImageCallbackBlock, *Backgroun
|
Line 38 BackgroundImageCallbackBlock, *Backgroun
|
#include "UIcss_f.h" |
#include "UIcss_f.h" |
#include "css_f.h" |
#include "css_f.h" |
#include "fetchHTMLname_f.h" |
#include "fetchHTMLname_f.h" |
|
#include "fetchXMLname_f.h" |
#include "html2thot_f.h" |
#include "html2thot_f.h" |
|
#include "init_f.h" |
#include "styleparser_f.h" |
#include "styleparser_f.h" |
|
|
#define MAX_BUFFER_LENGTH 200 |
#define MAX_BUFFER_LENGTH 200 |
Line 171 static char *SkipQuotedString (char *ptr
|
Line 171 static char *SkipQuotedString (char *ptr
|
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
static void CSSParseError (char *msg, char *value) |
static void CSSParseError (char *msg, char *value) |
{ |
{ |
char fileName [100]; |
|
|
|
if (!TtaIsPrinting () && ParsedDoc > 0) |
if (!TtaIsPrinting () && ParsedDoc > 0) |
{ |
{ |
if (!ErrFile) |
if (!ErrFile) |
Line 3326 static char *ParseGenericSelector (char
|
Line 3324 static char *ParseGenericSelector (char
|
{ |
{ |
ElementType elType; |
ElementType elType; |
PSchema tsch; |
PSchema tsch; |
AttributeType attrType; |
/*AttributeType attrType;*/ |
char sel[MAX_ANCESTORS * 50]; |
char sel[MAX_ANCESTORS * 50]; |
char *deb, *cur; |
char *deb, *cur; |
char *structName; |
char *structName; |
Line 3336 static char *ParseGenericSelector (char
|
Line 3334 static char *ParseGenericSelector (char
|
char *pseudoclasses[MAX_ANCESTORS]; |
char *pseudoclasses[MAX_ANCESTORS]; |
char *attrs[MAX_ANCESTORS]; |
char *attrs[MAX_ANCESTORS]; |
char *attrvals[MAX_ANCESTORS]; |
char *attrvals[MAX_ANCESTORS]; |
int i, j, k, max, maxAttr; |
char *ptr; |
|
int i, j, k, max; |
|
int att, maxAttr; |
ThotBool isHTML; |
ThotBool isHTML; |
ThotBool level; |
ThotBool level; |
|
|
Line 3505 static char *ParseGenericSelector (char
|
Line 3505 static char *ParseGenericSelector (char
|
k = 0; |
k = 0; |
j = 0; |
j = 0; |
maxAttr = 0; |
maxAttr = 0; |
|
/* default schema name */ |
|
ptr = "HTML"; |
while (i <= max) |
while (i <= max) |
{ |
{ |
if (names[i]) |
if (names[i]) |
Line 3518 static char *ParseGenericSelector (char
|
Line 3520 static char *ParseGenericSelector (char
|
ctxt->name[0] = elType.ElTypeNum; |
ctxt->name[0] = elType.ElTypeNum; |
ctxt->names_nb[0] = 0; |
ctxt->names_nb[0] = 0; |
ctxt->schema = elType.ElSSchema; |
ctxt->schema = elType.ElSSchema; |
|
ptr = TtaGetSSchemaName (elType.ElSSchema); |
k++; |
k++; |
} |
} |
else if (elType.ElTypeNum != 0) |
else if (elType.ElTypeNum != 0) |
Line 3551 static char *ParseGenericSelector (char
|
Line 3554 static char *ParseGenericSelector (char
|
if (classes[i]) |
if (classes[i]) |
{ |
{ |
ctxt->attrText[j] = classes[i]; |
ctxt->attrText[j] = classes[i]; |
ctxt->attrType[j] = HTML_ATTR_Class; |
if (!strcmp (ptr, "GraphML")) |
|
ctxt->attrType[j] = GraphML_ATTR_class; |
|
else if (!strcmp (ptr, "MathML")) |
|
ctxt->attrType[j] = MathML_ATTR_class; |
|
else |
|
ctxt->attrType[j] = HTML_ATTR_Class; |
/* add a new entry */ |
/* add a new entry */ |
maxAttr = i + 1; |
maxAttr = i + 1; |
} |
} |
if (pseudoclasses[i]) |
if (pseudoclasses[i]) |
{ |
{ |
ctxt->attrText[j] = pseudoclasses[i]; |
ctxt->attrText[j] = pseudoclasses[i]; |
ctxt->attrType[j] = HTML_ATTR_PseudoClass; |
if (!strcmp (ptr, "GraphML")) |
|
ctxt->attrType[j] = GraphML_ATTR_PseudoClass; |
|
else if (!strcmp (ptr, "MathML")) |
|
ctxt->attrType[j] = MathML_ATTR_PseudoClass; |
|
else |
|
ctxt->attrType[j] = HTML_ATTR_PseudoClass; |
/* add a new entry */ |
/* add a new entry */ |
maxAttr = i + 1; |
maxAttr = i + 1; |
} |
} |
if (ids[i]) |
if (ids[i]) |
{ |
{ |
ctxt->attrText[j] = ids[i]; |
ctxt->attrText[j] = ids[i]; |
ctxt->attrType[j] = HTML_ATTR_ID; |
if (!strcmp (ptr, "GraphML")) |
|
ctxt->attrType[j] = GraphML_ATTR_id; |
|
else if (!strcmp (ptr, "MathML")) |
|
ctxt->attrType[j] = MathML_ATTR_id; |
|
else |
|
ctxt->attrType[j] = HTML_ATTR_ID; |
/* add a new entry */ |
/* add a new entry */ |
maxAttr = i + 1; |
maxAttr = i + 1; |
} |
} |
if (attrs[i]) |
if (attrs[i]) |
{ |
{ |
MapHTMLAttribute (attrs[i], &attrType, names[i], &level, doc); |
if (!strcmp (ptr, "GraphML")) |
|
MapXMLAttribute (GRAPH_TYPE, attrs[i], names[i], &level, doc, &att); |
|
else if (!strcmp (ptr, "MathML")) |
|
MapXMLAttribute (MATH_TYPE, attrs[i], names[i], &level, doc, &att); |
|
else |
|
MapXMLAttribute (XHTML_TYPE, attrs[i], names[i], &level, doc, &att); |
ctxt->attrText[j] = attrvals[i]; |
ctxt->attrText[j] = attrvals[i]; |
ctxt->attrType[j] = attrType.AttrTypeNum; |
/* we should pass also the attribute schema in the context */ |
|
ctxt->attrType[j] = att; |
maxAttr = i + 1; |
maxAttr = i + 1; |
} |
} |
i++; |
i++; |