00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020
00021 #ifndef TABLE_H
00022 #define TABLE_H
00023
00024 #define FIXED_FLAG 1
00025 #define HALIGN_RIGHT (1 << 1)
00026 #define HALIGN_LEFT (1 << 2)
00027 #define HALIGN_MASK (HALIGN_RIGHT | HALIGN_LEFT)
00028 #define HALIGN_TEXT HALIGN_MASK
00029 #define VALIGN_TOP (1 << 3)
00030 #define VALIGN_BOTTOM (1 << 4)
00031 #define VALIGN_MASK (VALIGN_TOP | VALIGN_BOTTOM)
00032 #define BORDER_SET (1 << 5)
00033 #define PAD_SET (1 << 6)
00034 #define SPACE_SET (1 << 7)
00035 #define BALIGN_RIGHT (1 << 8)
00036 #define BALIGN_LEFT (1 << 9)
00037 #define BALIGN_MASK (BALIGN_RIGHT | BALIGN_LEFT)
00038
00039 #define UNSET_ALIGN 0
00040
00041
00042
00043
00044
00045 typedef struct {
00046 char* name;
00047 char* color;
00048 double size;
00049 int cnt;
00050 } htmlfont_t;
00051
00052
00053
00054
00055
00056 #ifdef OLD
00057 typedef struct {
00058 textpara_t *para;
00059 short nparas;
00060 box box;
00061 htmlfont_t *font;
00062 } htmltxt_t;
00063 #endif
00064
00065 typedef struct {
00066 char *str;
00067 char *xshow;
00068 PostscriptAlias *postscript_alias;
00069 void *layout;
00070 void (*free_layout) (void *layout);
00071 htmlfont_t *font;
00072 double size, yoffset_layout, yoffset_centerline;
00073 } textitem_t;
00074
00075 typedef struct {
00076 textitem_t *items;
00077 short nitems;
00078 char just;
00079 double size;
00080 double lfsize;
00081 } htextpara_t;
00082
00083 typedef struct {
00084 htextpara_t *paras;
00085 short nparas;
00086 box box;
00087 } htmltxt_t;
00088
00089 typedef struct {
00090 box box;
00091 char *src;
00092 char *scale;
00093 } htmlimg_t;
00094
00095 typedef struct {
00096 char *href;
00097 char *port;
00098 char *target;
00099 char *title;
00100 char *bgcolor;
00101 char *pencolor;
00102 signed char space;
00103 unsigned char border;
00104 unsigned char pad;
00105 unsigned char sides;
00106 unsigned short flags;
00107 unsigned short width;
00108 unsigned short height;
00109 box box;
00110 } htmldata_t;
00111
00112 #define HTML_UNSET 0
00113 #define HTML_TBL 1
00114 #define HTML_TEXT 2
00115 #define HTML_IMAGE 3
00116
00117 typedef struct htmlcell_t htmlcell_t;
00118 typedef struct htmltbl_t htmltbl_t;
00119
00120 struct htmltbl_t {
00121 htmldata_t data;
00122 union {
00123 struct {
00124 htmlcell_t *parent;
00125 htmlcell_t **cells;
00126 } n;
00127 struct {
00128 htmltbl_t *prev;
00129 Dt_t *rows;
00130 } p;
00131 } u;
00132 signed char cb;
00133 int *heights;
00134 int *widths;
00135 int rc;
00136 int cc;
00137 htmlfont_t *font;
00138 };
00139
00140 struct htmllabel_t {
00141 union {
00142 htmltbl_t *tbl;
00143 htmltxt_t *txt;
00144 htmlimg_t *img;
00145 } u;
00146 char kind;
00147 };
00148
00149 struct htmlcell_t {
00150 htmldata_t data;
00151 unsigned short cspan;
00152 unsigned short rspan;
00153 unsigned short col;
00154 unsigned short row;
00155 htmllabel_t child;
00156 htmltbl_t *parent;
00157 };
00158
00159
00160
00161
00162
00163
00164 typedef struct {
00165 Dtlink_t link;
00166 union {
00167 Dt_t *rp;
00168 htmlcell_t *cp;
00169 } u;
00170 } pitem;
00171
00172 extern htmllabel_t *parseHTML(char *, int *, int);
00173
00174 extern int make_html_label(graph_t *g, textlabel_t * lp, void *obj);
00175 extern void emit_html_label(GVJ_t * job, htmllabel_t * lp, textlabel_t *);
00176
00177 extern void free_html_label(htmllabel_t *, int);
00178 extern void free_html_data(htmldata_t *);
00179 extern void free_html_text(htmltxt_t *);
00180 extern void free_html_font(htmlfont_t*);
00181
00182 extern box *html_port(node_t * n, char *pname, int* sides);
00183 extern int html_path(node_t * n, port* p, int side, box * rv, int *k);
00184 extern int html_inside(node_t * n, pointf p, edge_t * e);
00185
00186 #endif
00187
00188 #ifdef __cplusplus
00189 }
00190 #endif