output: Add support for dashed, thick, and thin rules.
[pspp] / src / output / table.h
index 06427ac32b75bac0d91670840c3a10c4307b8484..8b1d68f654f68aeb70950117e84475002cee523b 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 1997, 1998, 1999, 2000, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999, 2000, 2009, 2013, 2014 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -40,6 +40,7 @@
 
 struct casereader;
 struct fmt_spec;
+struct table_item;
 struct variable;
 
 /* Properties of a table cell. */
@@ -47,29 +48,40 @@ enum
   {
     TAB_NONE = 0,
 
-    /* Alignment of cell contents. */
-    TAB_RIGHT      = 0 << 0,    /* Right justify. */
-    TAB_LEFT       = 1 << 0,    /* Left justify. */
-    TAB_CENTER     = 2 << 0,    /* Centered. */
-    TAB_ALIGNMENT  = 3 << 0,   /* Alignment mask. */
+    /* Horizontal alignment of cell contents. */
+    TAB_RIGHT      = 0 << 0,
+    TAB_LEFT       = 1 << 0,
+    TAB_CENTER     = 2 << 0,
+    TAB_HALIGN     = 3 << 0,   /* Alignment mask. */
+
+    /* Vertical alignment of cell contents. */
+    TAB_TOP        = 0 << 2,
+    TAB_MIDDLE     = 1 << 2,
+    TAB_BOTTOM     = 2 << 2,
+    TAB_VALIGN     = 3 << 2,   /* Alignment mask. */
 
     /* These flags may be combined with any alignment. */
-    TAB_EMPH       = 1 << 2,    /* Emphasize cell contents. */
-    TAB_FIX        = 1 << 3,    /* Use fixed font. */
+    TAB_EMPH       = 1 << 4,    /* Emphasize cell contents. */
+    TAB_FIX        = 1 << 5,    /* Use fixed font. */
 
     /* Bits with values (1 << TAB_FIRST_AVAILABLE) and higher are
        not used, so they are available for subclasses to use as
        they wish. */
-    TAB_FIRST_AVAILABLE = 4
+    TAB_FIRST_AVAILABLE = 6
   };
 
 /* Styles for the rules around table cells. */
 enum
   {
-    TAL_0,                     /* No line. */
-    TAL_GAP,                    /* Spacing but no line. */
-    TAL_1,                     /* Single line. */
-    TAL_2,                     /* Double line. */
+    TAL_NONE,                  /* No spacing. */
+#define TAL_0 TAL_NONE
+    TAL_SOLID,
+#define TAL_1 TAL_SOLID
+    TAL_DASHED,
+    TAL_THICK,
+    TAL_THIN,
+    TAL_DOUBLE,
+#define TAL_2 TAL_DOUBLE
     N_LINES
   };
 
@@ -102,7 +114,7 @@ enum table_axis
 /* A table. */
 struct table
   {
-    const struct table_class *class;
+    const struct table_class *klass;
 
     /* Table size.
 
@@ -162,6 +174,8 @@ void table_set_hb (struct table *, int hb);
 
 /* Simple kinds of tables. */
 struct table *table_from_string (unsigned int options, const char *);
+struct table *table_from_string_span (unsigned int options, const char *,
+                                      int colspan, int rowspan);
 struct table *table_from_variables (unsigned int options,
                                     struct variable **, size_t);
 struct table *table_from_casereader (const struct casereader *,
@@ -174,6 +188,7 @@ struct table *table_paste (struct table *, struct table *,
                            enum table_axis orientation);
 struct table *table_hpaste (struct table *left, struct table *right);
 struct table *table_vpaste (struct table *top, struct table *bottom);
+struct table *table_stomp (struct table *);
 
 /* Taking subsets of tables. */
 struct table *table_select (struct table *, int rect[TABLE_N_AXES][2]);