const struct area_style *style;
};
-static const struct table_class tab_table_class;
-
/* Creates and returns a new table with NC columns and NR rows and initially no
header rows or columns. The table's cells are initially empty. */
struct tab_table *
struct tab_table *t;
t = pool_create_container (struct tab_table, container);
- table_init (&t->table, &tab_table_class, nc, nr);
+ t->table.n[TABLE_HORZ] = nc;
+ t->table.n[TABLE_VERT] = nr;
+ t->table.h[TABLE_HORZ][0] = t->table.h[TABLE_HORZ][1] = 0;
+ t->table.h[TABLE_VERT][0] = t->table.h[TABLE_VERT][1] = 0;
+ t->table.ref_cnt = 1;
t->cc = pool_calloc (t->container, nr * nc, sizeof *t->cc);
t->ct = pool_calloc (t->container, nr * nc, sizeof *t->ct);
\f
/* Table class implementation. */
-static void
+void
tab_destroy (struct table *table)
{
struct tab_table *t = tab_cast (table);
pool_destroy (t->container);
}
-static void
+void
tab_get_cell (const struct table *table, int x, int y,
struct table_cell *cell)
{
}
}
-static int
+int
tab_get_rule (const struct table *table, enum table_axis axis, int x, int y,
struct cell_color *color)
{
return (raw & TAB_RULE_TYPE_MASK) >> TAB_RULE_TYPE_SHIFT;
}
-static const struct table_class tab_table_class = {
- tab_destroy,
- tab_get_cell,
- tab_get_rule,
-};
-
struct tab_table *
tab_cast (const struct table *table)
{
- assert (table->klass == &tab_table_class);
return UP_CAST (table, struct tab_table, table);
}