Adopt use of gnulib for portability.
[pspp-builds.git] / src / som.h
index 9ac69c86b9f5ccee2c41e0a449154ab0ca84d5ef..1568dca30613af29ec5a198a5a3abcc55e90e835 100644 (file)
--- a/src/som.h
+++ b/src/som.h
@@ -14,8 +14,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA. */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA. */
 
 #if !som_h
 #define som_h 1
    desired, and in fact almost every operation performed by som may be
    overridden in a table class.  */
 
-/* Table. */
-struct som_table
+#include <stdbool.h>
+
+enum som_type
+  {
+    SOM_TABLE,
+    SOM_CHART
+  } ;
+
+/* Entity (Table or Chart) . */
+struct som_entity
   {
     struct som_table_class *class;     /* Table class. */
-    void *ext;                         /* Owned by table class. */
+    enum som_type type;                 /* Table or Chart */ 
+    void *ext;                         /* Owned by */
   };
 
 /* Group styles. */
@@ -70,7 +79,7 @@ struct outp_driver;
 struct som_table_class
   {
     /* Set table, driver. */
-    void (*table) (struct som_table *);
+    void (*table) (struct som_entity *);
     void (*driver) (struct outp_driver *);
 
     /* Query columns and rows. */
@@ -84,10 +93,13 @@ struct som_table_class
     void (*join) (int *(column[2]), int *(row[2]));    /* ? */
     void (*cumulate) (int cumtype, int start, int *end, int max, int *actual);
     void (*flags) (unsigned *);
+    bool (*fits_width) (int width);
+    bool (*fits_length) (int length);
 
     /* Set columns and rows. */
     void (*set_width) (int column, int width);         /* ? */
     void (*set_height) (int row, int height);          /* ? */
+    void (*set_headers) (int l, int r, int t, int b);
 
     /* Rendering. */
     void (*title) (int x, int y);
@@ -100,7 +112,7 @@ extern int subtable_num;
 
 /* Submission. */
 void som_new_series (void);
-void som_submit (struct som_table *t);
+void som_submit (struct som_entity *t);
 
 /* Miscellaneous. */
 void som_eject_page (void);