summaryrefslogtreecommitdiff
path: root/render/box.h
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2004-05-27 22:13:20 +0000
committerJames Bursa <james@netsurf-browser.org>2004-05-27 22:13:20 +0000
commit4f31db54f76fa046675954581d9a908a7d6f5382 (patch)
tree5fd45d8803db51f1c180e9f81271b9d56a8e06db /render/box.h
parent2af77b03e50b5fc70c7df56fda6c4a54ec04453d (diff)
downloadnetsurf-4f31db54f76fa046675954581d9a908a7d6f5382.tar.gz
netsurf-4f31db54f76fa046675954581d9a908a7d6f5382.tar.bz2
[project @ 2004-05-27 22:13:20 by bursa]
Fix some table layout bugs related to the recent changes to calculate_table_widths(). svn path=/import/netsurf/; revision=898
Diffstat (limited to 'render/box.h')
-rw-r--r--render/box.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/render/box.h b/render/box.h
index 6e94247c4..b4ecfa631 100644
--- a/render/box.h
+++ b/render/box.h
@@ -82,6 +82,11 @@
#include "netsurf/utils/pool.h"
+struct box;
+struct column;
+
+
+/** Type of a struct box. */
typedef enum {
BOX_BLOCK, BOX_INLINE_CONTAINER, BOX_INLINE,
BOX_TABLE, BOX_TABLE_ROW, BOX_TABLE_CELL,
@@ -90,15 +95,6 @@ typedef enum {
BOX_INLINE_BLOCK, BOX_BR
} box_type;
-struct column {
- enum { COLUMN_WIDTH_UNKNOWN = 0, COLUMN_WIDTH_FIXED,
- COLUMN_WIDTH_AUTO, COLUMN_WIDTH_PERCENT,
- COLUMN_WIDTH_RELATIVE } type;
- int min, max, width;
-};
-
-struct box;
-
/* parameters for <object> and related elements */
struct object_params {
char* data;
@@ -184,7 +180,7 @@ struct box {
/** Next sibling float box. */
struct box *next_float;
- struct column *col; /**< Table column data for TABLE only. */
+ struct column *col; /**< Array of table column data for TABLE only. */
struct font_data *font; /**< Font, or 0 if no text. */
@@ -201,6 +197,21 @@ struct box {
void *object_state;
};
+/** Table column data. */
+struct column {
+ /** Type of column. */
+ enum { COLUMN_WIDTH_UNKNOWN, COLUMN_WIDTH_FIXED,
+ COLUMN_WIDTH_AUTO, COLUMN_WIDTH_PERCENT,
+ COLUMN_WIDTH_RELATIVE } type;
+ /** Preferred width of column. Pixels for FIXED, percentage for PERCENT,
+ * relative units for RELATIVE, unused for AUTO. */
+ int width;
+ /** Minimum width of content. */
+ int min;
+ /** Maximum width of content. */
+ int max;
+};
+
#define UNKNOWN_WIDTH INT_MAX
#define UNKNOWN_MAX_WIDTH INT_MAX