1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU 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, see <http://www.gnu.org/licenses/>. */
20 /* Structured Output Manager.
22 som considers the output stream to be a series of tables. Each
23 table is made up of a rectangular grid of cells. Cells can be
24 joined to form larger cells. Rows and columns can be separated by
25 rules of various types. Tables too large to fit on a single page
26 will be divided into sections. Rows and columns can be designated
27 as headers, which causes them to be repeated in each section.
29 Every table is an instance of a particular table class. A table
30 class is responsible for keeping track of cell data, for handling
31 requests from the som, and finally for rendering cell data to the
32 output drivers. Tables may implement these operations in any way
33 desired, and in fact almost every operation performed by som may be
34 overridden in a table class. */
44 /* Entity (Table or Chart) . */
47 const struct som_table_class *class; /* Table class. */
48 enum som_type type; /* Table or Chart */
49 void *ext; /* Owned by */
55 SOM_COL_NONE, /* No columns. */
56 SOM_COL_DOWN /* Columns down first. */
59 /* Cumulation types. */
62 SOM_ROWS, SOM_ROW = SOM_ROWS, /* Rows. */
63 SOM_COLUMNS, SOM_COLUMN = SOM_COLUMNS /* Columns. */
70 SOMF_NO_SPACING = 01, /* No spacing before the table. */
71 SOMF_NO_TITLE = 02 /* No title. */
76 struct som_table_class
78 /* Set table, driver. */
79 void (*table) (struct som_entity *);
80 void (*driver) (struct outp_driver *);
82 /* Query columns and rows. */
83 void (*count) (int *n_columns, int *n_rows);
84 void (*area) (int *horiz, int *vert);
85 void (*width) (int *columns);
86 void (*height) (int *rows);
87 void (*columns) (int *style);
88 int (*breakable) (int row); /* ? */
89 void (*headers) (int *l, int *r, int *t, int *b);
90 void (*join) (int *(column[2]), int *(row[2])); /* ? */
91 void (*cumulate) (int cumtype, int start, int *end, int max, int *actual);
92 void (*flags) (unsigned *);
93 bool (*fits_width) (int width);
94 bool (*fits_length) (int length);
96 /* Set columns and rows. */
97 void (*set_width) (int column, int width); /* ? */
98 void (*set_height) (int row, int height); /* ? */
99 void (*set_headers) (int l, int r, int t, int b);
102 void (*title) (int x, int y);
103 void (*render) (int x1, int y1, int x2, int y2);
107 extern int table_num;
108 extern int subtable_num;
111 void som_new_series (void);
112 void som_submit (struct som_entity *t);
115 void som_eject_page (void);
116 void som_blank_line (void);
117 void som_flush (void);