diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 1997-01-29 21:25:58 -0500 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 1997-01-29 21:25:58 -0500 |
commit | c3ec4181d988501e4d7116f32c669d5ca69e7060 (patch) | |
tree | 3a19fc17f13ca34edf02b209e19464f8041984cd /WWW/Library/Implementation/HTML.h | |
parent | 6bd78b38830217fa268e678d9637116ec516bf0e (diff) | |
download | lynx-snapshots-c3ec4181d988501e4d7116f32c669d5ca69e7060.tar.gz |
snapshot of project "lynx", label v2_6fm_970129
Diffstat (limited to 'WWW/Library/Implementation/HTML.h')
-rw-r--r-- | WWW/Library/Implementation/HTML.h | 178 |
1 files changed, 152 insertions, 26 deletions
diff --git a/WWW/Library/Implementation/HTML.h b/WWW/Library/Implementation/HTML.h index aada006f..23d89e17 100644 --- a/WWW/Library/Implementation/HTML.h +++ b/WWW/Library/Implementation/HTML.h @@ -1,9 +1,9 @@ -/* HTML to rich text converter for libwww - THE HTML TO RTF OBJECT CONVERTER - - This interprets the HTML semantics. - - */ +/* HTML to rich text converter for libwww +** +** THE HTML TO RTF OBJECT CONVERTER +** +** This interprets the HTML semantics. +*/ #ifndef HTML_H #define HTML_H @@ -20,22 +20,150 @@ extern CONST HTStructuredClass HTMLPresentation; +#ifdef Lynx_HTML_Handler /* +** This section is semi-private to HTML.c and it's helper modules. - FM +** -------------------------------------------------------------------- +*/ -HTConverter to present HTML +typedef struct _stack_element { + HTStyle * style; + int tag_number; +} stack_element; + +/* HTML Object +** ----------- +*/ +#define MAX_NESTING 800 /* Should be checked by parser */ + +struct _HTStructured { + CONST HTStructuredClass * isa; + HTParentAnchor * node_anchor; + HText * text; + + HTStream* target; /* Output stream */ + HTStreamClass targetClass; /* Output routines */ + + HTChildAnchor * CurrentA; /* current HTML_A anchor */ + char * base_href; /* current HTML_BASE href */ + char * map_address; /* current HTML_MAP address */ + + HTChunk title; /* Grow by 128 */ + HTChunk object; /* Grow by 128 */ + BOOL object_started; + BOOL object_declare; + BOOL object_shapes; + BOOL object_ismap; + char * object_usemap; + char * object_id; + char * object_title; + char * object_data; + char * object_type; + char * object_classid; + char * object_codebase; + char * object_codetype; + char * object_name; + HTChunk option; /* Grow by 128 */ + char * LastOptionValue; + BOOL LastOptionChecked; + BOOL select_disabled; + HTChunk textarea; /* Grow by 128 */ + char * textarea_name; + char * textarea_cols; + int textarea_rows; + int textarea_disabled; + char * textarea_id; + HTChunk math; /* Grow by 128 */ + HTChunk style_block; /* Grow by 128 */ + HTChunk script; /* Grow by 128 */ + + /* + * Used for nested lists. - FM + */ + int List_Nesting_Level; /* counter for list nesting level */ + int OL_Counter[7]; /* counter for ordered lists */ + char OL_Type[7]; /* types for ordered lists */ + int Last_OL_Count; /* last count in ordered lists */ + char Last_OL_Type; /* last type in ordered lists */ + + int Division_Level; + short DivisionAlignments[MAX_NESTING]; + int Underline_Level; + int Quote_Level; + + BOOL UsePlainSpace; + BOOL HiddenValue; + int lastraw; + + char * comment_start; /* for literate programming */ + char * comment_end; + + HTTag * current_tag; + BOOL style_change; + HTStyle * new_style; + HTStyle * old_style; + int current_default_alignment; + BOOL in_word; /* Have just had a non-white char */ + stack_element stack[MAX_NESTING]; + stack_element *sp; /* Style stack pointer */ + + /* + ** Track if we are in an anchor, paragraph, address, base, etc. + */ + BOOL inA; + BOOL inAPPLET; + BOOL inAPPLETwithP; + BOOL inBadHTML; + BOOL inBASE; + BOOL inBoldA; + BOOL inBoldH; + BOOL inCAPTION; + BOOL inCREDIT; + BOOL inFIG; + BOOL inFIGwithP; + BOOL inFORM; + BOOL inLABEL; + BOOL inP; + BOOL inPRE; + BOOL inSELECT; + BOOL inTABLE; + BOOL inTEXTAREA; + BOOL inUnderline; + + BOOL needBoldH; +}; + +struct _HTStream { + CONST HTStreamClass * isa; + /* .... */ +}; +/* + * Semi-Private functions. - FM */ -PUBLIC HTStream* HTMLToPlain PARAMS(( +extern void HTML_put_character PARAMS((HTStructured *me, char c)); +extern void HTML_put_string PARAMS((HTStructured *me, CONST char *s)); +extern void HTML_write PARAMS((HTStructured *me, CONST char *s, int l)); +extern void HTML_put_entity PARAMS((HTStructured *me, int entity_number)); +#endif /* Lynx_HTML_Handler */ + +/* P U B L I C +*/ + +/* +** HTConverter to present HTML +*/ +extern HTStream* HTMLToPlain PARAMS(( HTPresentation * pres, HTParentAnchor * anchor, HTStream * sink)); -PUBLIC HTStream* HTMLToC PARAMS(( +extern HTStream* HTMLToC PARAMS(( HTPresentation * pres, HTParentAnchor * anchor, HTStream * sink)); -PUBLIC HTStream* HTMLPresent PARAMS(( +extern HTStream* HTMLPresent PARAMS(( HTPresentation * pres, HTParentAnchor * anchor, HTStream * sink)); @@ -45,7 +173,8 @@ extern HTStructured* HTML_new PARAMS(( HTFormat format_out, HTStream * target)); -/* Names for selected internal representations: +/* +** Names for selected internal representations. */ typedef enum _HTMLCharacterSet { HTML_ISO_LATIN1, @@ -53,27 +182,24 @@ typedef enum _HTMLCharacterSet { HTML_PC_CP950 } HTMLCharacterSet; - /* - -Record error message as a hypertext object - - The error message should be marked as an error so that it can be reloaded later. This - implementation just throws up an error message and leaves the document unloaded. - - */ -/* On entry, +** Record error message as a hypertext object. +** +** The error message should be marked as an error so that it can be +** reloaded later. This implementation just throws up an error message +** and leaves the document unloaded. +** +** On entry, ** sink is a stream to the output device if any ** number is the HTTP error number ** message is the human readable message. -** On exit, +** On exit, ** a retrun code like HT_LOADED if object exists else 60; 0 */ - -PUBLIC int HTLoadError PARAMS(( - HTStream * sink, - int number, - CONST char * message)); +extern int HTLoadError PARAMS(( + HTStream * sink, + int number, + CONST char * message)); #endif /* HTML_H */ |