1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#include <glib.h>
#include <libxml/tree.h>
#include <libgda/libgda.h>
typedef struct {
gchar *name;
xmlDocPtr doc;
xmlNodePtr body;
xmlNodePtr toc;
} HtmlFile;
typedef struct {
HtmlFile *index;
GHashTable *nodes; /* key=node name, value=xmlNodePtr */
gchar *dir;
GSList *all_files;
} HtmlConfig;
#define HTML_CONFIG(x) ((HtmlConfig*)(x))
/*
* HTML output files manipulation
* Files are built as XML files and then printed at the end
*/
void html_init_config (HtmlConfig *config);
HtmlFile *html_file_new (HtmlConfig *config,
const gchar *name, const gchar *title);
gboolean html_file_write (HtmlFile *file, HtmlConfig *config);
void html_file_free (HtmlFile *file);
void html_declare_node (HtmlConfig *config, const gchar *path, xmlNodePtr node);
void html_declare_node_own (HtmlConfig *config, gchar *path, xmlNodePtr node);
void html_add_link_to_node (HtmlConfig *config, const gchar *nodepath,
const gchar *text, const gchar *link_to);
void html_add_to_toc (HtmlConfig *config, HtmlFile *file, const gchar *text, const gchar *link_to);
xmlNodePtr html_add_header (HtmlConfig *config, HtmlFile *file, const gchar *text);
void html_mark_path_error (HtmlConfig *config, const gchar *nodepath);
void html_mark_node_error (HtmlConfig *config, xmlNodePtr node);
void html_mark_node_warning (HtmlConfig *config, xmlNodePtr node);
void html_mark_node_notice (HtmlConfig *config, xmlNodePtr node);
xmlNodePtr html_render_attribute_str (xmlNodePtr parent, const gchar *node_type,
const gchar *att_name, const gchar *att_val);
xmlNodePtr html_render_attribute_bool (xmlNodePtr parent, const gchar *node_type,
const gchar *att_name, gboolean att_val);
xmlNodePtr html_render_data_model (xmlNodePtr parent, GdaDataModel *model);
|