LIST: Remove WEIGHT subcommand.
[pspp-builds.git] / src / output / manager.h
index 7c0a0dc8161af674ceee4557c8ffef9ea5092312..e7276982fc5c5a064b89cc8e0af364d43283a38f 100644 (file)
@@ -1,21 +1,18 @@
-/* PSPP - computes sample statistics.
-   Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
-   Written by Ben Pfaff <blp@gnu.org>.
+/* PSPP - a program for statistical analysis.
+   Copyright (C) 1997-9, 2000, 2009 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 the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   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
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
 
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
    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., 51 Franklin Street, Fifth Floor, Boston, MA
-   02110-1301, USA. */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
 #if !som_h
 #define som_h 1
 
 enum som_type
   {
-    SOM_TABLE,
-    SOM_CHART
+    SOM_TABLE
   } ;
 
 /* Entity (Table or Chart) . */
 struct som_entity
   {
     const struct som_table_class *class;       /* Table class. */
-    enum som_type type;                 /* Table or Chart */ 
-    void *ext;                         /* Owned by */
+    enum som_type type;                 /* Table or Chart */
+    void *ext;                         /* Owned by table or chart class. */
+    int table_num;                      /* Table number. */
+    int subtable_num;                   /* Sub-table number. */
+    char *command_name;                 /* Command that yielded this output. */
   };
 
+struct som_entity *som_entity_clone (struct som_entity *);
+void som_entity_destroy (struct som_entity *);
+
 /* Group styles. */
 enum
   {
@@ -62,8 +64,8 @@ enum
 /* Cumulation types. */
 enum
   {
-    SOM_ROWS, SOM_ROW = SOM_ROWS,      /* Rows. */
-    SOM_COLUMNS, SOM_COLUMN = SOM_COLUMNS      /* Columns. */
+    SOM_ROWS,                   /* Rows. */
+    SOM_COLUMNS                 /* Columns. */
   };
 
 /* Flags. */
@@ -78,44 +80,34 @@ enum
 struct outp_driver;
 struct som_table_class
   {
-    /* Set table, driver. */
-    void (*table) (struct som_entity *);
-    void (*driver) (struct outp_driver *);
-
-    /* Query columns and rows. */
-    void (*count) (int *n_columns, int *n_rows);
-    void (*area) (int *horiz, int *vert);
-    void (*width) (int *columns);
-    void (*height) (int *rows);
-    void (*columns) (int *style);
-    int (*breakable) (int row);                                /* ? */
-    void (*headers) (int *l, int *r, int *t, int *b);
-    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);
-    void (*render) (int x1, int y1, int x2, int y2);
+    /* Operations on tables. */
+    void (*count) (struct som_entity *, int *n_columns, int *n_rows);
+    void (*columns) (struct som_entity *, int *style);
+    void (*headers) (struct som_entity *, int *l, int *r, int *t, int *b);
+    void (*flags) (struct som_entity *, unsigned *);
+
+    /* Creating and freeing driver-specific table rendering data. */
+    void *(*render_init) (struct som_entity *, struct outp_driver *,
+                          int l, int r, int t, int b);
+    void (*render_free) (void *);
+
+    /* Rendering operations. */
+    void (*area) (void *, int *horiz, int *vert);
+    void (*cumulate) (void *, int cumtype, int start, int *end,
+                      int max, int *actual);
+    void (*title) (void *, int x, int y, int table_num, int subtable_num,
+                   const char *command_name);
+    void (*render) (void *, int x1, int y1, int x2, int y2);
   };
 
-/* Table indexes. */
-extern int table_num;
-extern int subtable_num;
-
 /* Submission. */
 void som_new_series (void);
+void som_set_command_name (const char *);
 void som_submit (struct som_entity *t);
 
 /* Miscellaneous. */
 void som_eject_page (void);
 void som_blank_line (void);
+void som_flush (void);
 
 #endif /* som_h */