1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 1997-9, 2000, 2009 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 table or chart class. */
50 int table_num; /* Table number. */
51 int subtable_num; /* Sub-table number. */
57 SOM_COL_NONE, /* No columns. */
58 SOM_COL_DOWN /* Columns down first. */
61 /* Cumulation types. */
65 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 /* Operations on tables. */
81 void (*count) (struct som_entity *, int *n_columns, int *n_rows);
82 void (*columns) (struct som_entity *, int *style);
83 void (*headers) (struct som_entity *, int *l, int *r, int *t, int *b);
84 void (*flags) (struct som_entity *, unsigned *);
86 /* Creating and freeing driver-specific table rendering data. */
87 void *(*render_init) (struct som_entity *, struct outp_driver *,
88 int l, int r, int t, int b);
89 void (*render_free) (void *);
91 /* Rendering operations. */
92 void (*area) (void *, int *horiz, int *vert);
93 void (*cumulate) (void *, int cumtype, int start, int *end,
94 int max, int *actual);
95 void (*title) (void *, int x, int y, int table_num, int subtable_num);
96 void (*render) (void *, int x1, int y1, int x2, int y2);
100 void som_new_series (void);
101 void som_submit (struct som_entity *t);
104 void som_eject_page (void);
105 void som_blank_line (void);
106 void som_flush (void);