#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#include "ut_locale.h"#include "ut_assert.h"#include "ut_debugmsg.h"#include "ut_types.h"#include "ut_base64.h"#include "ut_bytebuf.h"#include "ut_path.h"#include "ut_misc.h"#include "ut_string.h"#include "ut_std_string.h"#include "fg_GraphicRaster.h"#include "ie_imp_PasteListener.h"#include "pd_Document.h"#include "ie_types.h"#include "ie_impGraphic.h"#include "ie_Table.h"#include "ie_impexp_HTML.h"#include "ie_imp_XHTML.h"#include "ut_html.h"Defines | |
| #define | CSS_MASK_INLINE (1<<0) |
| #define | CSS_MASK_BLOCK (1<<1) |
| #define | CSS_MASK_IMAGE (1<<2) |
| #define | CSS_MASK_BODY (1<<3) |
| #define | TokenTableSize ((sizeof(s_Tokens)/sizeof(s_Tokens[0]))) |
| #define | X_TestParseState(ps) ((m_parseState==(ps))) |
| #define | X_VerifyParseState(ps) |
| #define | X_CheckDocument(b) |
| #define | X_CheckError(v) |
| #define | X_EatIfAlreadyError() do { if (m_error) { failLine = __LINE__; goto X_Fail; } } while (0) |
Typedefs | |
| typedef enum section_class | SectionClass |
Enumerations | |
| enum | section_class { sc_section = 0, sc_other } |
Functions | |
| static UT_UTF8String | s_parseCSStyle (const UT_UTF8String &style, UT_uint32 css_mask) |
| static SectionClass | s_class_query (const char *class_value) |
| static void | s_append_font_family (UT_UTF8String &style, const char *face) |
| static void | s_append_font_size (UT_UTF8String &style, const char *size) |
| static void | s_append_color (UT_UTF8String &style, const char *color, const char *property) |
| static bool | recognizeXHTML (const char *szBuf, UT_uint32 iNumbytes) |
| static void | s_pass_whitespace (const char *&csstr) |
| static const char * | s_pass_name (const char *&csstr) |
| static const char * | s_pass_value (const char *&csstr) |
| static bool | s_pass_number (char *&ptr, bool &bIsPercent) |
| static unsigned char | s_rgb_number (float f, bool bIsPercent) |
| static void | s_props_append (UT_UTF8String &props, UT_uint32 css_mask, const char *name, char *value) |
Variables | |
| static const char * | s_section_classes [sc_other] |
| static IE_SuffixConfidence | IE_Imp_XHTML_Sniffer__SuffixConfidence [] |
| static IE_MimeConfidence | IE_Imp_XHTML_Sniffer__MimeConfidence [] |
| static const gchar * | ol_atts [] |
| static const gchar * | ol_p_atts [] |
| static const gchar * | ul_atts [] |
| static const gchar * | ul_p_atts [] |
| static struct xmlToIdMapping | s_Tokens [] |
| static const char * | s_font_size [7] |
| #define CSS_MASK_BLOCK (1<<1) |
Referenced by IE_Imp_XHTML::newBlock(), and s_props_append().
| #define CSS_MASK_BODY (1<<3) |
Referenced by s_props_append().
| #define CSS_MASK_IMAGE (1<<2) |
Referenced by s_props_append(), and IE_Imp_XHTML::startElement().
| #define CSS_MASK_INLINE (1<<0) |
Referenced by IE_Imp_XHTML::newBlock(), s_props_append(), and IE_Imp_XHTML::startElement().
Referenced by IE_Imp_XHTML::endElement(), and IE_Imp_XHTML::startElement().
| #define X_CheckDocument | ( | b | ) |
do { if (!(b)) \ { m_error = UT_IE_BOGUSDOCUMENT; \ failLine = __LINE__; goto X_Fail; } } while (0)
Referenced by IE_Imp_XHTML::endElement().
| #define X_CheckError | ( | v | ) |
do { if (!(v)) \ { m_error = UT_ERROR; \ UT_DEBUGMSG(("JOHN: X_CheckError\n")); \ failLine = __LINE__; goto X_Fail; } } while (0)
Referenced by IE_Imp_XHTML::charData(), IE_Imp_XHTML::endElement(), and IE_Imp_XHTML::startElement().
| #define X_EatIfAlreadyError | ( | ) | do { if (m_error) { failLine = __LINE__; goto X_Fail; } } while (0) |
Referenced by IE_Imp_XHTML::endElement(), and IE_Imp_XHTML::startElement().
| #define X_TestParseState | ( | ps | ) | ((m_parseState==(ps))) |
| #define X_VerifyParseState | ( | ps | ) |
do { if (!(X_TestParseState(ps))) \ { m_error = UT_IE_BOGUSDOCUMENT; \ UT_DEBUGMSG(("DOM: unhandled tag: %d (ps: %d)\n", tokenIndex, ps)); \ failLine = __LINE__; goto X_Fail; } } while (0)
Referenced by IE_Imp_XHTML::endElement(), and IE_Imp_XHTML::startElement().
| typedef enum section_class SectionClass |
| enum section_class |
| static bool recognizeXHTML | ( | const char * | szBuf, | |
| UT_uint32 | iNumbytes | |||
| ) | [static] |
Referenced by IE_Imp_XHTML::_loadFile(), and IE_Imp_XHTML::pasteFromBuffer().
| static void s_append_color | ( | UT_UTF8String & | style, | |
| const char * | color, | |||
| const char * | property | |||
| ) | [static] |
References UT_UTF8String::byteLength(), UT_HashColor::lookupNamedColor(), and UT_HashColor::setColor().
Referenced by IE_Imp_XHTML::startElement().
| static void s_append_font_family | ( | UT_UTF8String & | style, | |
| const char * | face | |||
| ) | [static] |
References UT_UTF8String::byteLength().
Referenced by IE_Imp_XHTML::startElement().
| static void s_append_font_size | ( | UT_UTF8String & | style, | |
| const char * | size | |||
| ) | [static] |
References UT_UTF8String::byteLength(), and UT_std_string_sprintf().
Referenced by IE_Imp_XHTML::startElement().
| static SectionClass s_class_query | ( | const char * | class_value | ) | [static] |
References s_section_classes.
Referenced by IE_Imp_XHTML::startElement().
| static UT_UTF8String s_parseCSStyle | ( | const UT_UTF8String & | style, | |
| UT_uint32 | css_mask | |||
| ) | [static] |
References FREEP, s_pass_name(), s_pass_value(), s_pass_whitespace(), s_props_append(), and UT_UTF8String::utf8_str().
Referenced by IE_Imp_XHTML::newBlock(), and IE_Imp_XHTML::startElement().
| static const char* s_pass_name | ( | const char *& | csstr | ) | [static] |
References UT_UTF8Stringbuf::charCode(), and UT_UCS4_isspace().
Referenced by s_parseCSStyle().
| static bool s_pass_number | ( | char *& | ptr, | |
| bool & | bIsPercent | |||
| ) | [static] |
Referenced by s_props_append().
| static const char* s_pass_value | ( | const char *& | csstr | ) | [static] |
References UT_UTF8Stringbuf::charCode(), and UT_UCS4_isspace().
Referenced by s_parseCSStyle().
| static void s_pass_whitespace | ( | const char *& | csstr | ) | [static] |
References UT_UTF8Stringbuf::charCode(), and UT_UCS4_isspace().
Referenced by s_parseCSStyle().
| static void s_props_append | ( | UT_UTF8String & | props, | |
| UT_uint32 | css_mask, | |||
| const char * | name, | |||
| char * | value | |||
| ) | [static] |
References UT_UTF8String::byteLength(), CSS_MASK_BLOCK, CSS_MASK_BODY, CSS_MASK_IMAGE, CSS_MASK_INLINE, d, dim, DIM_IN, DIM_none, DIM_PERCENT, DIM_PT, DIM_PX, UT_HashColor::lookupNamedColor(), s_pass_number(), s_rgb_number(), UT_HashColor::setColor(), UT_convertDimensionless(), UT_convertDimensions(), UT_convertToPoints(), UT_determineDimension(), UT_formatDimensionedValue(), UT_std_string_sprintf(), UT_UTF8String_sprintf(), and UT_UTF8String::utf8_str().
Referenced by s_parseCSStyle().
| static unsigned char s_rgb_number | ( | float | f, | |
| bool | bIsPercent | |||
| ) | [static] |
Referenced by s_props_append().
{
{ IE_MIME_MATCH_FULL, IE_MIMETYPE_XHTML, UT_CONFIDENCE_PERFECT },
{ IE_MIME_MATCH_FULL, "application/xhtml", UT_CONFIDENCE_PERFECT },
{ IE_MIME_MATCH_FULL, "text/html", UT_CONFIDENCE_PERFECT },
{ IE_MIME_MATCH_BOGUS, "", UT_CONFIDENCE_ZILCH }
}
{
{ "xhtml", UT_CONFIDENCE_PERFECT },
{ "html", UT_CONFIDENCE_PERFECT },
{ "htm", UT_CONFIDENCE_PERFECT },
{ "", UT_CONFIDENCE_ZILCH }
}
const gchar* ol_atts[] [static] |
{
"id", "1",
"parentid", "0",
"type", "0",
"start-value", "1",
"list-delim", "%L.",
"list-decimal", ".",
NULL, NULL
}
const gchar* ol_p_atts[] [static] |
{
"level", "1",
"listid", "1",
"parentid", "0",
"props", "list-style:Numbered List; start-value:1; text-indent:-0.3in; field-font: NULL;",
"style", "Normal",
NULL, NULL
}
const char* s_font_size[7] [static] |
{
"8pt",
"10pt",
"11pt",
"12pt",
"16pt",
"24pt",
"32pt"
}
const char* s_section_classes[sc_other] [static] |
{
"Section"
}
Referenced by s_class_query(), and IE_Imp_XHTML::startElement().
struct xmlToIdMapping s_Tokens[] [static] |
const gchar* ul_atts[] [static] |
{
"id", "2",
"parentid", "0",
"type", "5",
"start-value", "0",
"list-delim", "%L",
"list-decimal", "NULL",
NULL, NULL
}
const gchar* ul_p_atts[] [static] |
{
"level", "1",
"listid", "2",
"parentid", "0",
"props", "list-style:Bullet List; start-value:0; text-indent:-0.3in; field-font: NULL;",
"style", "Normal",
NULL, NULL
}
1.7.1