diff options
author | Ali Abdin <aliabdin@aucegypt.edu> | 2000-12-25 14:32:47 +0000 |
---|---|---|
committer | Ali Abdin <rakholh@src.gnome.org> | 2000-12-25 14:32:47 +0000 |
commit | ac5bcd46419c90fb99afced8c6fec2f8c3a99c78 (patch) | |
tree | dd36948fe6396295a85b22774a9014701b955945 | |
parent | a57481aa2fa57e34e0f71220ea1aa4f3affd83b4 (diff) | |
download | nautilus-ac5bcd46419c90fb99afced8c6fec2f8c3a99c78.tar.gz |
Handle the <address> tag properly (including <street>, <city>, <country>,
2000-12-25 Ali Abdin <aliabdin@aucegypt.edu>
Handle the <address> tag properly (including <street>, <city>,
<country>, <postcode>, and <state>) - Fixes bug #2176
Support the <literallayout> tag - Fixes bug #5341
These patches contributed by John Fleck <jfleck@inkstain.net>
Happy Eid and Merry Christmas!
* components/help/converters/gnome-db2html2/gdb3html.h:
* components/help/converters/gnome-db2html2/sect-elements.[ch]:
* components/help/converters/gnome-db2html2/sect-preparse.c:
* components/help/converters/gnome-db2html2/toc-elements.c:
(sect_literallayout_start_element),
(sect_literallayout_end_element):
New functions to for LITERALLAYOUT tag support.
(sect_country_start_element),
(sect_city_start_element),
(sect_street_start_element),
(sect_address_end_element),
(sect_address_start_element),
(sect_address_characters):
New functions to handle the ADDRESS/STREET/CITY/COUNTRY tags properly
* components/help/converters/gnome-db2html2/ASSUMPTIONS:
Removed an erroneous entry
* components/help/converters/gnome-db2html2/TODO:
Updated
* components/help/converters/gnome-db2html2/AUTHORS:
Added John Fleck (jfleck@inkstain.net)
-rw-r--r-- | ChangeLog | 35 | ||||
-rw-r--r-- | components/help/converters/gnome-db2html2/ASSUMPTIONS | 3 | ||||
-rw-r--r-- | components/help/converters/gnome-db2html2/AUTHORS | 3 | ||||
-rw-r--r-- | components/help/converters/gnome-db2html2/TODO | 13 | ||||
-rw-r--r-- | components/help/converters/gnome-db2html2/gdb3html.h | 9 | ||||
-rw-r--r-- | components/help/converters/gnome-db2html2/sect-elements.c | 94 | ||||
-rw-r--r-- | components/help/converters/gnome-db2html2/sect-elements.h | 8 | ||||
-rw-r--r-- | components/help/converters/gnome-db2html2/sect-preparse.c | 8 | ||||
-rw-r--r-- | components/help/converters/gnome-db2html2/toc-elements.c | 6 |
9 files changed, 161 insertions, 18 deletions
@@ -1,3 +1,38 @@ +2000-12-25 Ali Abdin <aliabdin@aucegypt.edu> + + Handle the <address> tag properly (including <street>, <city>, + <country>, <postcode>, and <state>) - Fixes bug #2176 + + Support the <literallayout> tag - Fixes bug #5341 + + These patches contributed by John Fleck <jfleck@inkstain.net> + + Happy Eid and Merry Christmas! + + * components/help/converters/gnome-db2html2/gdb3html.h: + * components/help/converters/gnome-db2html2/sect-elements.[ch]: + * components/help/converters/gnome-db2html2/sect-preparse.c: + * components/help/converters/gnome-db2html2/toc-elements.c: + (sect_literallayout_start_element), + (sect_literallayout_end_element): + New functions to for LITERALLAYOUT tag support. + (sect_country_start_element), + (sect_city_start_element), + (sect_street_start_element), + (sect_address_end_element), + (sect_address_start_element), + (sect_address_characters): + New functions to handle the ADDRESS/STREET/CITY/COUNTRY tags properly + + * components/help/converters/gnome-db2html2/ASSUMPTIONS: + Removed an erroneous entry + + * components/help/converters/gnome-db2html2/TODO: + Updated + + * components/help/converters/gnome-db2html2/AUTHORS: + Added John Fleck (jfleck@inkstain.net) + 2000-12-25 Gene Z. Ragan <gzr@eazel.com> * src/file-manager/fm-desktop-icon-view.c: diff --git a/components/help/converters/gnome-db2html2/ASSUMPTIONS b/components/help/converters/gnome-db2html2/ASSUMPTIONS index 65d682abf..92e4bb6f1 100644 --- a/components/help/converters/gnome-db2html2/ASSUMPTIONS +++ b/components/help/converters/gnome-db2html2/ASSUMPTIONS @@ -44,6 +44,3 @@ each listitem has one para --------------------------------------------- each formalpara has one para --------------------------------------------- -Do not do <entry></entry> - do <entry> </entry> this makes it look much -better ---------------------------------------------- diff --git a/components/help/converters/gnome-db2html2/AUTHORS b/components/help/converters/gnome-db2html2/AUTHORS index 259669c1f..eb2fb58ee 100644 --- a/components/help/converters/gnome-db2html2/AUTHORS +++ b/components/help/converters/gnome-db2html2/AUTHORS @@ -1,3 +1,6 @@ Original author is: Jonathon Blandford (jrb@redhat.com) Current maintainer is: Ali Abdin (aliabdin@aucegypt.edu) + +Contributors: +John Fleck (jfleck@inkstain.net) diff --git a/components/help/converters/gnome-db2html2/TODO b/components/help/converters/gnome-db2html2/TODO index f8ae15b6a..755f2d7e8 100644 --- a/components/help/converters/gnome-db2html2/TODO +++ b/components/help/converters/gnome-db2html2/TODO @@ -2,14 +2,7 @@ List of things I know I need to do: ----------------------------------- Store the id of the sect with the title of the graphic so that I can get -xref correctly - (Ali: I looked at this item and there seems no point in doing -this. We can only examine graphics in the /CURRENT/ sect-id (the one specified -on the command-line) using the pre-parser. This means we cannot properly xref -figure's outside the current sect) +xref correctly. -Store sect level so we can do <H2>/<H3> correctly for section headers - This -appears to be done (if this is meant for the table of contents) - -Implement variablelist - -Switch to a DOM based parser. +Switch to a DOM based parser (not possible until we switch to a DOM based +parser and/or we switch to libxml 2.2.x) diff --git a/components/help/converters/gnome-db2html2/gdb3html.h b/components/help/converters/gnome-db2html2/gdb3html.h index 5458af2cd..0800e07b5 100644 --- a/components/help/converters/gnome-db2html2/gdb3html.h +++ b/components/help/converters/gnome-db2html2/gdb3html.h @@ -128,7 +128,13 @@ typedef enum ElementIndex { GLOSSSEEALSO, /* 115 */ EXAMPLE, VARLISTENTRY, - UNDEFINED /* 118 */ + STREET, + CITY, + COUNTRY, /* 120 */ + STATE, + POSTCODE, + LITERALLAYOUT, + UNDEFINED /* 124 */ } ElementIndex; typedef struct _ElementInfo ElementInfo; @@ -181,6 +187,7 @@ struct _Context { gboolean empty_element; /* This is to determine if the element is empty or not */ gboolean in_glossterm; + gboolean start_address_character; DocType doctype; GSList *footnotes; xmlParserCtxtPtr ParserCtxt; diff --git a/components/help/converters/gnome-db2html2/sect-elements.c b/components/help/converters/gnome-db2html2/sect-elements.c index c0cd1c484..d481c7148 100644 --- a/components/help/converters/gnome-db2html2/sect-elements.c +++ b/components/help/converters/gnome-db2html2/sect-elements.c @@ -26,7 +26,7 @@ ElementInfo sect_elements[] = { { AFFILIATION, "affiliation", NULL, NULL, NULL}, { EMAIL, "email", NULL, NULL, (charactersSAXFunc) sect_email_characters }, { ORGNAME, "orgname", NULL, NULL, (charactersSAXFunc) sect_author_characters }, - { ADDRESS, "address", NULL, NULL, (charactersSAXFunc) sect_write_characters}, + { ADDRESS, "address", (startElementSAXFunc) sect_address_start_element, (endElementSAXFunc) sect_address_end_element, (charactersSAXFunc) sect_address_characters}, { COPYRIGHT, "copyright", NULL, NULL, NULL}, { YEAR, "year", NULL, NULL, (charactersSAXFunc) sect_copyright_characters}, { HOLDER, "holder", NULL, NULL, (charactersSAXFunc) sect_copyright_characters}, @@ -123,6 +123,12 @@ ElementInfo sect_elements[] = { { GLOSSSEEALSO, "glossseealso", (startElementSAXFunc) sect_glossseealso_start_element, NULL, NULL }, { EXAMPLE, "example", NULL, NULL, NULL }, { VARLISTENTRY, "varlistentry", (startElementSAXFunc) sect_varlistentry_start_element, (endElementSAXFunc) sect_varlistentry_end_element, NULL }, + { STREET, "street", (startElementSAXFunc) sect_street_start_element, NULL, (charactersSAXFunc) sect_write_characters }, + { CITY, "city", (startElementSAXFunc) sect_city_start_element, NULL, (charactersSAXFunc) sect_write_characters }, + { COUNTRY, "country", (startElementSAXFunc) sect_country_start_element, NULL, (charactersSAXFunc) sect_write_characters }, + { STATE, "state", NULL, NULL, (charactersSAXFunc) sect_write_characters }, + { POSTCODE, "postcode", NULL, NULL, (charactersSAXFunc) sect_write_characters }, + { LITERALLAYOUT, "literallayout", (startElementSAXFunc) sect_literallayout_start_element, (endElementSAXFunc) sect_literallayout_end_element, (charactersSAXFunc) sect_write_characters }, { UNDEFINED, NULL, NULL, NULL, NULL} }; @@ -2160,8 +2166,8 @@ sect_glossseealso_start_element (Context *context, const gchar *name, const xmlC void sect_varlistentry_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) + const gchar *name, + const xmlChar **atrs) { if (!IS_IN_SECT (context)) return; @@ -2171,10 +2177,90 @@ sect_varlistentry_start_element (Context *context, void sect_varlistentry_end_element (Context *context, - const gchar *name) + const gchar *name) { if (!IS_IN_SECT (context)) return; sect_print (context, "</LI>"); } + +void +sect_address_characters (Context *context, + const char *chars, + int len) +{ + gchar *temp; + + if (!IS_IN_SECT (context)) + return; + + if (context->start_address_character == TRUE) { + g_print ("<BR> "); + context->start_address_character = FALSE; + } + + temp = g_strndup (chars, len); + sect_print (context, temp); + g_free (temp); +} +void +sect_address_start_element (Context *context, + const gchar *name, + const xmlChar **atrs) +{ + context->start_address_character = TRUE; +} + +void +sect_address_end_element (Context *context, + const gchar *name) +{ + context->start_address_character = FALSE; +} + +void +sect_street_start_element (Context *context, + const gchar *name, + const xmlChar **atrs) +{ + sect_print (context, "<BR> "); +} + +void +sect_city_start_element (Context *context, + const gchar *name, + const xmlChar **atrs) +{ + sect_print (context, "<BR> "); +} + +void +sect_country_start_element (Context *context, + const gchar *name, + const xmlChar **atrs) +{ + sect_print (context, "<BR> "); +} + +void +sect_literallayout_start_element (Context *context, + const gchar *name, + const xmlChar **atrs) +{ + if (!IS_IN_SECT (context)) + return; + + sect_print (context, "<PRE>"); +} + +void +sect_literallayout_end_element (Context *context, + const gchar *name) +{ + if (!IS_IN_SECT (context)) + return; + + sect_print (context, "</PRE>"); +} + diff --git a/components/help/converters/gnome-db2html2/sect-elements.h b/components/help/converters/gnome-db2html2/sect-elements.h index 85aa83981..a49355a73 100644 --- a/components/help/converters/gnome-db2html2/sect-elements.h +++ b/components/help/converters/gnome-db2html2/sect-elements.h @@ -133,4 +133,12 @@ void sect_glossseealso_start_element (Context *context, const gchar *name, const void sect_glossee_end_element (Context *context, const gchar *name); void sect_varlistentry_start_element (Context *context, const gchar *name, const xmlChar **atrs); void sect_varlistentry_end_element (Context *context, const gchar *name); +void sect_address_characters (Context *context, const char *chars, int len); +void sect_address_start_element (Context *context, const gchar *name, const xmlChar **atrs); +void sect_address_end_element (Context *context, const gchar *name); +void sect_street_start_element (Context *context, const gchar *name, const xmlChar **atrs); +void sect_city_start_element (Context *context, const gchar *name, const xmlChar **atrs); +void sect_country_start_element (Context *context, const gchar *name, const xmlChar **atrs); +void sect_literallayout_start_element (Context *context, const gchar *name, const xmlChar **atrs); +void sect_literallayout_end_element (Context *context, const gchar *name); #endif diff --git a/components/help/converters/gnome-db2html2/sect-preparse.c b/components/help/converters/gnome-db2html2/sect-preparse.c index e51817298..c2aeb6fe1 100644 --- a/components/help/converters/gnome-db2html2/sect-preparse.c +++ b/components/help/converters/gnome-db2html2/sect-preparse.c @@ -135,6 +135,14 @@ ElementInfo sect_preparse[] = { { GLOSSSEE, "glosssee", NULL, NULL, NULL}, { GLOSSSEEALSO, "glossseealso", NULL, NULL, NULL}, { EXAMPLE, "example", NULL, NULL, NULL}, + { VARLISTENTRY, "varlistentry", NULL, NULL, NULL}, + { STREET, "street", NULL, NULL, NULL}, + { CITY, "city", NULL, NULL, NULL}, + { COUNTRY, "country", NULL, NULL, NULL}, + { STATE, "state", NULL, NULL, NULL}, + { POSTCODE, "postcode", NULL, NULL, NULL}, + { LITERALLAYOUT, "literallayout", NULL, NULL, NULL}, + { UNDEFINED, NULL, NULL, NULL, NULL} }; diff --git a/components/help/converters/gnome-db2html2/toc-elements.c b/components/help/converters/gnome-db2html2/toc-elements.c index 56302cd23..4079a75a2 100644 --- a/components/help/converters/gnome-db2html2/toc-elements.c +++ b/components/help/converters/gnome-db2html2/toc-elements.c @@ -147,6 +147,12 @@ ElementInfo toc_elements[] = { { GLOSSSEEALSO, "glossseealso", NULL, NULL, NULL}, { EXAMPLE, "example", NULL, NULL, NULL}, { VARLISTENTRY, "varlistentry", NULL, NULL, NULL}, + { STREET, "street", NULL, NULL, NULL}, + { CITY, "city", NULL, NULL, NULL}, + { COUNTRY, "country", NULL, NULL, NULL}, + { STATE, "state", NULL, NULL, NULL}, + { POSTCODE, "postcode", NULL, NULL, NULL}, + { LITERALLAYOUT, "literallayout", NULL, NULL, NULL}, { UNDEFINED, NULL, NULL, NULL, NULL} }; |