~ubuntu-branches/ubuntu/lucid/w3m/lucid-updates

« back to all changes in this revision

Viewing changes to table.h

  • Committer: Bazaar Package Importer
  • Author(s): Fumitoshi UKAI
  • Date: 2004-04-29 03:28:41 UTC
  • Revision ID: james.westby@ubuntu.com-20040429032841-uo4mu7a813aqrua8
Tags: upstream-0.5.1
ImportĀ upstreamĀ versionĀ 0.5.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: table.h,v 1.12 2003/09/22 21:02:21 ukai Exp $ */
 
2
#if (defined(MESCHACH) && !defined(MATRIX))
 
3
#define MATRIX
 
4
#endif                          /* (defined(MESCHACH) && !defined(MATRIX)) */
 
5
 
 
6
#ifdef MATRIX
 
7
#ifdef MESCHACH
 
8
#include <matrix2.h>
 
9
#else                           /* not MESCHACH */
 
10
#include "matrix.h"
 
11
#endif                          /* not MESCHACH */
 
12
#endif                          /* MATRIX */
 
13
 
 
14
#include "Str.h"
 
15
 
 
16
#define MAX_TABLE 20            /* maximum nest level of table */
 
17
#define MAX_TABLE_N 20          /* maximum number of table in same level */
 
18
 
 
19
#define MAXROW 50
 
20
#define MAXCOL 50
 
21
 
 
22
#define MAX_WIDTH 80
 
23
 
 
24
#define BORDER_NONE 0
 
25
#define BORDER_THIN 1
 
26
#define BORDER_THICK 2
 
27
#define BORDER_NOWIN 3
 
28
 
 
29
typedef unsigned short table_attr;
 
30
 
 
31
/* flag */
 
32
#define TBL_IN_ROW     1
 
33
#define TBL_EXPAND_OK  2
 
34
#define TBL_IN_COL     4
 
35
 
 
36
#define MAXCELL 20
 
37
#define MAXROWCELL 1000
 
38
struct table_cell {
 
39
    short col[MAXCELL];
 
40
    short colspan[MAXCELL];
 
41
    short index[MAXCELL];
 
42
    short maxcell;
 
43
    short icell;
 
44
#ifdef MATRIX
 
45
    short eindex[MAXCELL];
 
46
    short necell;
 
47
#endif                          /* MATRIX */
 
48
    short width[MAXCELL];
 
49
    short minimum_width[MAXCELL];
 
50
    short fixed_width[MAXCELL];
 
51
};
 
52
 
 
53
struct table_in {
 
54
    struct table *ptr;
 
55
    short col;
 
56
    short row;
 
57
    short cell;
 
58
    short indent;
 
59
    TextLineList *buf;
 
60
};
 
61
 
 
62
struct table_linfo {
 
63
    Lineprop prev_ctype;
 
64
    signed char prev_spaces;
 
65
    Str prevchar;
 
66
    short length;
 
67
};
 
68
 
 
69
struct table {
 
70
    int row;
 
71
    int col;
 
72
    int maxrow;
 
73
    int maxcol;
 
74
    int max_rowsize;
 
75
    int border_mode;
 
76
    int total_width;
 
77
    int total_height;
 
78
    int tabcontentssize;
 
79
    int indent;
 
80
    int cellspacing;
 
81
    int cellpadding;
 
82
    int vcellpadding;
 
83
    int vspace;
 
84
    int flag;
 
85
#ifdef TABLE_EXPAND
 
86
    int real_width;
 
87
#endif                          /* TABLE_EXPAND */
 
88
    Str caption;
 
89
#ifdef ID_EXT
 
90
    Str id;
 
91
#endif
 
92
    GeneralList ***tabdata;
 
93
    table_attr **tabattr;
 
94
    table_attr trattr;
 
95
#ifdef ID_EXT
 
96
    Str **tabidvalue;
 
97
    Str *tridvalue;
 
98
#endif
 
99
    short tabwidth[MAXCOL];
 
100
    short minimum_width[MAXCOL];
 
101
    short fixed_width[MAXCOL];
 
102
    struct table_cell cell;
 
103
    short *tabheight;
 
104
    struct table_in *tables;
 
105
    short ntable;
 
106
    short tables_size;
 
107
    TextList *suspended_data;
 
108
    /* use for counting skipped spaces */
 
109
    struct table_linfo linfo;
 
110
#ifdef MATRIX
 
111
    MAT *matrix;
 
112
    VEC *vector;
 
113
#endif                          /* MATRIX */
 
114
    int sloppy_width;
 
115
};
 
116
 
 
117
#define TBLM_PRE        RB_PRE
 
118
#define TBLM_SCRIPT     RB_SCRIPT
 
119
#define TBLM_STYLE      RB_STYLE
 
120
#define TBLM_PLAIN      RB_PLAIN
 
121
#define TBLM_NOBR       RB_NOBR
 
122
#define TBLM_PRE_INT    RB_PRE_INT
 
123
#define TBLM_INTXTA     RB_INTXTA
 
124
#define TBLM_INSELECT   RB_INSELECT
 
125
#define TBLM_PREMODE    (TBLM_PRE | TBLM_PRE_INT | TBLM_SCRIPT | TBLM_STYLE | TBLM_PLAIN | TBLM_INTXTA)
 
126
#define TBLM_SPECIAL    (TBLM_PRE | TBLM_PRE_INT | TBLM_SCRIPT | TBLM_STYLE | TBLM_PLAIN | TBLM_NOBR)
 
127
#define TBLM_DEL        RB_DEL
 
128
#define TBLM_S          RB_S
 
129
#define TBLM_ANCHOR     0x1000000
 
130
 
 
131
struct table_mode {
 
132
    unsigned int pre_mode;
 
133
    char indent_level;
 
134
    char caption;
 
135
    short nobr_offset;
 
136
    char nobr_level;
 
137
    short anchor_offset;
 
138
    unsigned char end_tag;
 
139
};
 
140
 
 
141
/* Local Variables:    */
 
142
/* c-basic-offset: 4   */
 
143
/* tab-width: 8        */
 
144
/* End:                */