1 /* PSPP - computes sample statistics.
2 Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 /* Structured Output Manager.
24 som considers the output stream to be a series of tables. Each
25 table is made up of a rectangular grid of cells. Cells can be
26 joined to form larger cells. Rows and columns can be separated by
27 rules of various types. Tables too large to fit on a single page
28 will be divided into sections. Rows and columns can be designated
29 as headers, which causes them to be repeated in each section.
31 Every table is an instance of a particular table class. A table
32 class is responsible for keeping track of cell data, for handling
33 requests from the som, and finally for rendering cell data to the
34 output drivers. Tables may implement these operations in any way
35 desired, and in fact almost every operation performed by som may be
36 overridden in a table class. */
46 /* Entity (Table or Chart) . */
49 const struct som_table_class *class; /* Table class. */
50 enum som_type type; /* Table or Chart */
51 void *ext; /* Owned by */
57 SOM_COL_NONE, /* No columns. */
58 SOM_COL_DOWN /* Columns down first. */
61 /* Cumulation types. */
64 SOM_ROWS, SOM_ROW = SOM_ROWS, /* Rows. */
65 SOM_COLUMNS, SOM_COLUMN = SOM_COLUMNS /* Columns. */
72 SOMF_NO_SPACING = 01, /* No spacing before the table. */
73 SOMF_NO_TITLE = 02 /* No title. */
78 struct som_table_class
80 /* Set table, driver. */
81 void (*table) (struct som_entity *);
82 void (*driver) (struct outp_driver *);
84 /* Query columns and rows. */
85 void (*count) (int *n_columns, int *n_rows);
86 void (*area) (int *horiz, int *vert);
87 void (*width) (int *columns);
88 void (*height) (int *rows);
89 void (*columns) (int *style);
90 int (*breakable) (int row); /* ? */
91 void (*headers) (int *l, int *r, int *t, int *b);
92 void (*join) (int *(column[2]), int *(row[2])); /* ? */
93 void (*cumulate) (int cumtype, int start, int *end, int max, int *actual);
94 void (*flags) (unsigned *);
95 bool (*fits_width) (int width);
96 bool (*fits_length) (int length);
98 /* Set columns and rows. */
99 void (*set_width) (int column, int width); /* ? */
100 void (*set_height) (int row, int height); /* ? */
101 void (*set_headers) (int l, int r, int t, int b);
104 void (*title) (int x, int y);
105 void (*render) (int x1, int y1, int x2, int y2);
109 extern int table_num;
110 extern int subtable_num;
113 void som_new_series (void);
114 void som_submit (struct som_entity *t);
117 void som_eject_page (void);
118 void som_blank_line (void);