tab: Support cell-specific styles.
[pspp] / src / output / tab.h
index 4bf7816fadd668563c2d18d533c59c062d5f8711..f45e1f605589f66729ed872f6cc9bbed44256d15 100644 (file)
@@ -51,6 +51,15 @@ enum result_class
     n_RC
   };
 
+#define TAB_STYLE_MASK (7u << (TAB_FIRST_AVAILABLE + 3))
+#define TAB_STYLE_SHIFT (TAB_FIRST_AVAILABLE + 3)
+
+/* Rule masks. */
+#define TAB_RULE_TYPE_MASK   7
+#define TAB_RULE_TYPE_SHIFT  0
+#define TAB_RULE_STYLE_MASK  (31 << TAB_RULE_STYLE_SHIFT)
+#define TAB_RULE_STYLE_SHIFT 3
+
 /* A table. */
 struct tab_table
   {
@@ -69,10 +78,12 @@ struct tab_table
        points to a struct tab_joined_cell. */
     void **cc;                  /* Cell contents; void *[nr][nc]. */
     unsigned short *ct;                /* Cell types; unsigned short[nr][nc]. */
+    struct cell_style *styles[8];
 
     /* Rules. */
     unsigned char *rh;         /* Horiz rules; unsigned char[nr+1][nc]. */
     unsigned char *rv;         /* Vert rules; unsigned char[nr][nc+1]. */
+    struct cell_color *rule_colors[32];
 
     /* X and Y offsets. */
     int col_ofs, row_ofs;
@@ -148,6 +159,9 @@ struct footnote *tab_create_footnote (struct tab_table *, size_t idx,
 void tab_add_footnote (struct tab_table *, int x, int y,
                        const struct footnote *);
 
+void tab_add_style (struct tab_table *, int x, int y,
+                    const struct cell_style *);
+
 bool tab_cell_is_empty (const struct tab_table *, int c, int r);
 
 /* Editing. */