These were the same as TABLE_STROKE_* so get rid of the extras.
{
switch (border)
{
- case TAL_NONE:
+ case TABLE_STROKE_NONE:
return NULL;
- case TAL_SOLID:
+ case TABLE_STROKE_SOLID:
return "solid";
- case TAL_DASHED:
+ case TABLE_STROKE_DASHED:
return "dashed";
- case TAL_THICK:
+ case TABLE_STROKE_THICK:
return "thick solid";
- case TAL_THIN:
+ case TABLE_STROKE_THIN:
return "thin solid";
- case TAL_DOUBLE:
+ case TABLE_STROKE_DOUBLE:
return "double";
default:
{
switch (type)
{
- case TAL_NONE:
+ case TABLE_STROKE_NONE:
return RENDER_LINE_NONE;
- case TAL_SOLID:
+ case TABLE_STROKE_SOLID:
return RENDER_LINE_SINGLE;
- case TAL_DASHED:
+ case TABLE_STROKE_DASHED:
return RENDER_LINE_DASHED;
- case TAL_THICK:
+ case TABLE_STROKE_THICK:
return RENDER_LINE_THICK;
- case TAL_THIN:
+ case TABLE_STROKE_THIN:
return RENDER_LINE_THIN;
- case TAL_DOUBLE:
+ case TABLE_STROKE_DOUBLE:
return RENDER_LINE_DOUBLE;
default:
NOT_REACHED ();
for (d[b] = 0; d[b] < table->n[b]; d[b]++)
rules |= 1u << table_get_rule (table, a, d[H], d[V], &color);
- /* Turn off TAL_NONE because it has width 0 and we needn't bother. However,
- if the device doesn't support margins, make sure that there is at least a
- small gap between cells (but we don't need any at the left or right edge
- of the table). */
- if (rules & (1u << TAL_NONE))
+ /* Turn off TABLE_STROKE_NONE because it has width 0 and we needn't bother.
+ However, if the device doesn't support margins, make sure that there is at
+ least a small gap between cells (but we don't need any at the left or
+ right edge of the table). */
+ if (rules & (1u << TABLE_STROKE_NONE))
{
- rules &= ~(1u << TAL_NONE);
+ rules &= ~(1u << TABLE_STROKE_NONE);
if (z > 0 && z < table->n[a] && !params->supports_margins && a == H)
- rules |= 1u << TAL_SOLID;
+ rules |= 1u << TABLE_STROKE_SOLID;
}
/* Calculate maximum width of the rules that are present. */
{
d[a] = d2;
int r2 = table_get_rule (page->table, axis, d[H], d[V], color);
- r = table_rule_combine (r, r2);
+ r = table_stroke_combine (r, r2);
}
return rule_to_render_type (r);
}
t->ct = pool_calloc (t->container, nr * nc, sizeof *t->ct);
t->rh = pool_nmalloc (t->container, nc, nr + 1);
- memset (t->rh, TAL_0, nc * (nr + 1));
+ memset (t->rh, TABLE_STROKE_NONE, nc * (nr + 1));
t->rv = pool_nmalloc (t->container, nr, nc + 1);
- memset (t->rv, TAL_0, nr * (nc + 1));
+ memset (t->rv, TABLE_STROKE_NONE, nr * (nc + 1));
memset (t->styles, 0, sizeof t->styles);
memset (t->rule_colors, 0, sizeof t->rule_colors);
}
}
- table_box (table, -1, -1, TAL_0, TAL_0, x1, y1, x2, y2);
+ table_box (table, -1, -1, TABLE_STROKE_NONE, TABLE_STROKE_NONE,
+ x1, y1, x2, y2);
j = pool_alloc (table->container, sizeof *j);
j->d[TABLE_HORZ][0] = x1;
const char *table_stroke_to_string (enum table_stroke);
+/* Given strokes A and B, returns a stroke that "combines" them, that is, that
+ gives a reasonable stroke choice for a rule for different reasons should
+ have both styles A and B. */
+static inline int
+table_stroke_combine (enum table_stroke a, enum table_stroke b)
+{
+ return a > b ? a : b;
+}
+
struct table_border_style
{
enum table_stroke stroke;
TAB_JOIN = 1 << 14,
};
-/* Styles for the rules around table cells. */
-enum
- {
- TAL_NONE = TABLE_STROKE_NONE,
-#define TAL_0 TAL_NONE
- TAL_SOLID = TABLE_STROKE_SOLID,
-#define TAL_1 TAL_SOLID
- TAL_DASHED = TABLE_STROKE_DASHED,
- TAL_THICK = TABLE_STROKE_THICK,
- TAL_THIN = TABLE_STROKE_THIN,
- TAL_DOUBLE = TABLE_STROKE_DOUBLE,
-#define TAL_2 TAL_DOUBLE
- };
-
-/* Given line styles A and B (each one of the TAL_* enumeration constants
- above), returns a line style that "combines" them, that is, that gives a
- reasonable line style choice for a rule for different reasons should have
- both styles A and B. */
-static inline int table_rule_combine (int a, int b)
-{
- return a > b ? a : b;
-}
-
/* A table. */
struct table
{
switch (*text++)
{
case '<':
- table_vline (tab, TAL_1, c, r, r + rs - 1);
+ table_vline (tab, TABLE_STROKE_SOLID, c, r, r + rs - 1);
break;
case '>':
- table_vline (tab, TAL_1, c + cs, r, r + rs - 1);
+ table_vline (tab, TABLE_STROKE_SOLID, c + cs, r, r + rs - 1);
break;
case '^':
- table_hline (tab, TAL_1, c, c + cs - 1, r);
+ table_hline (tab, TABLE_STROKE_SOLID, c, c + cs - 1, r);
break;
case ',':
- table_hline (tab, TAL_1, c, c + cs - 1, r + rs);
+ table_hline (tab, TABLE_STROKE_SOLID, c, c + cs - 1, r + rs);
break;
case '@':
- table_box (tab, TAL_1, TAL_1, -1, -1, c, r,
- c + cs - 1, r + rs - 1);
+ table_box (tab, TABLE_STROKE_SOLID, TABLE_STROKE_SOLID,
+ -1, -1, c, r, c + cs - 1, r + rs - 1);
break;
case '(':